diff --git a/.ahoy/docker.ahoy.yml b/.ahoy/docker.ahoy.yml index b599cc3..a5bedb3 100644 --- a/.ahoy/docker.ahoy.yml +++ b/.ahoy/docker.ahoy.yml @@ -158,6 +158,11 @@ commands: fi echo "Lighthouse has been started. It's running on port 8080" + backstop: + usage: Run backstop. + cmd: | + docker run --rm -v $(pwd):/src backstopjs/backstopjs $1 + hostfile: usage: Write entries in host file. cmd: | diff --git a/backstop.json b/backstop.json new file mode 100644 index 0000000..26d89bb --- /dev/null +++ b/backstop.json @@ -0,0 +1,59 @@ +{ + "id": "backstop_default", + "viewports": [ + { + "label": "phone", + "width": 320, + "height": 480 + }, + { + "label": "tablet", + "width": 1024, + "height": 768 + }, + { + "label": "laptop", + "width": 1920, + "height": 1080 + } + ], + "onBeforeScript": "puppet/onBefore.js", + "onReadyScript": "puppet/onReady.js", + "scenarios": [ + { + "label": "Google Homepage", + "cookiePath": "backstop_data/engine_scripts/cookies.json", + "url": "https://garris.github.io/BackstopJS/", + "referenceUrl": "https://garris.github.io/BackstopJS/", + "readyEvent": "", + "readySelector": "", + "delay": 0, + "hideSelectors": [], + "removeSelectors": [], + "hoverSelector": "", + "clickSelector": "", + "postInteractionWait": 0, + "selectors": [], + "selectorExpansion": true, + "expect": 0, + "misMatchThreshold" : 0.1, + "requireSameDimensions": true + } + ], + "paths": { + "bitmaps_reference": "backstop_data/bitmaps_reference", + "bitmaps_test": "backstop_data/bitmaps_test", + "engine_scripts": "backstop_data/engine_scripts", + "html_report": "backstop_data/html_report", + "ci_report": "backstop_data/ci_report" + }, + "report": ["browser"], + "engine": "puppeteer", + "engineOptions": { + "args": ["--no-sandbox"] + }, + "asyncCaptureLimit": 5, + "asyncCompareLimit": 50, + "debug": false, + "debugWindow": false +} diff --git a/backstop_data/bitmaps_reference/.gitkeep b/backstop_data/bitmaps_reference/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/backstop_data/bitmaps_test/.gitkeep b/backstop_data/bitmaps_test/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/backstop_data/engine_scripts/casper/clickAndHoverHelper.js b/backstop_data/engine_scripts/casper/clickAndHoverHelper.js new file mode 100644 index 0000000..27406ec --- /dev/null +++ b/backstop_data/engine_scripts/casper/clickAndHoverHelper.js @@ -0,0 +1,25 @@ +var WAIT_TIMEOUT = 5000; + +module.exports = function (casper, scenario) { + var waitFor = require('./waitForHelperHelper')(casper, WAIT_TIMEOUT); + var hoverSelector = scenario.hoverSelector; + var clickSelector = scenario.clickSelector; + var postInteractionWait = scenario.postInteractionWait; + + if (hoverSelector) { + waitFor(hoverSelector); + casper.then(function () { + casper.mouse.move(hoverSelector); + }); + } + + if (clickSelector) { + waitFor(clickSelector); + casper.then(function () { + casper.click(clickSelector); + }); + } + + // TODO: if postInteractionWait === integer then do ==> wait(postInteractionWait) || elsevvv + waitFor(postInteractionWait); +}; diff --git a/backstop_data/engine_scripts/casper/loadCookies.js b/backstop_data/engine_scripts/casper/loadCookies.js new file mode 100644 index 0000000..3c1ad0e --- /dev/null +++ b/backstop_data/engine_scripts/casper/loadCookies.js @@ -0,0 +1,15 @@ +var fs = require('fs'); + +module.exports = function (casper, scenario) { + var cookies = []; + var cookiePath = scenario.cookiePath; + + // READ COOKIES FROM FILE IF EXISTS + if (fs.exists(cookiePath)) { + cookies = JSON.parse(fs.read(cookiePath)); + } + + casper.page.cookies = cookies; + console.log('Cookie state restored with cookies:', JSON.stringify(cookies, null, 2)); + casper.userAgent('Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.116 Safari/537.36'); +}; diff --git a/backstop_data/engine_scripts/casper/onBefore.js b/backstop_data/engine_scripts/casper/onBefore.js new file mode 100644 index 0000000..785c4ec --- /dev/null +++ b/backstop_data/engine_scripts/casper/onBefore.js @@ -0,0 +1,4 @@ +module.exports = function (casper, scenario, vp) { + require('./loadCookies')(casper, scenario); + casper.userAgent('Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.116 Safari/537.36'); +}; diff --git a/backstop_data/engine_scripts/casper/onReady.js b/backstop_data/engine_scripts/casper/onReady.js new file mode 100644 index 0000000..959a443 --- /dev/null +++ b/backstop_data/engine_scripts/casper/onReady.js @@ -0,0 +1,5 @@ +module.exports = function (casper, scenario, vp) { + console.log('SCENARIO> ' + scenario.label); + require('./clickAndHoverHelper')(casper, scenario); + // add more helpers here... +}; diff --git a/backstop_data/engine_scripts/casper/waitForHelperHelper.js b/backstop_data/engine_scripts/casper/waitForHelperHelper.js new file mode 100644 index 0000000..682eb3b --- /dev/null +++ b/backstop_data/engine_scripts/casper/waitForHelperHelper.js @@ -0,0 +1,18 @@ +var TIMEOUT_DEFAULT = 2000; + +module.exports = function (casper, timeout) { + var TIMEOUT = timeout || TIMEOUT_DEFAULT; + + return function waitFor (selector) { + if (selector) { + casper.waitForSelector( + selector, + function () {}, + function () { + console.error('NOT FOUND > ' + selector); + }, + TIMEOUT + ); + } + }; +}; diff --git a/backstop_data/engine_scripts/chromy/clickAndHoverHelper.js b/backstop_data/engine_scripts/chromy/clickAndHoverHelper.js new file mode 100644 index 0000000..7966103 --- /dev/null +++ b/backstop_data/engine_scripts/chromy/clickAndHoverHelper.js @@ -0,0 +1,34 @@ +module.exports = function (chromy, scenario) { + var hoverSelector = scenario.hoverSelectors || scenario.hoverSelector; + var clickSelector = scenario.clickSelectors || scenario.clickSelector; + var scrollToSelector = scenario.scrollToSelectors || scenario.scrollToSelector; + var postInteractionWait = scenario.postInteractionWait; // selector [str] | ms [int] + + if (hoverSelector) { + chromy + .wait(hoverSelector) + .rect(hoverSelector) + .result(function (rect) { + chromy.mouseMoved(rect.left, rect.top); + }); + } + + if (clickSelector) { + chromy + .wait(clickSelector) + .click(clickSelector); + } + + if (postInteractionWait) { + chromy.wait(postInteractionWait); + } + + if (scrollToSelector) { + chromy + .wait(scrollToSelector) + .evaluate(`window._scrollToSelector = '${scrollToSelector}'`) + .evaluate(function () { + document.querySelector(window._scrollToSelector).scrollIntoView(); + }); + } +}; diff --git a/backstop_data/engine_scripts/chromy/loadCookies.js b/backstop_data/engine_scripts/chromy/loadCookies.js new file mode 100644 index 0000000..7d5a165 --- /dev/null +++ b/backstop_data/engine_scripts/chromy/loadCookies.js @@ -0,0 +1,22 @@ +var fs = require('fs'); + +module.exports = function (chromy, scenario) { + var cookies = []; + var cookiePath = scenario.cookiePath; + + // READ COOKIES FROM FILE IF EXISTS + if (fs.existsSync(cookiePath)) { + cookies = JSON.parse(fs.readFileSync(cookiePath)); + } + + // MUNGE COOKIE DOMAIN FOR CHROMY USAGE + cookies = cookies.map(cookie => { + cookie.url = 'https://' + cookie.domain; + delete cookie.domain; + return cookie; + }); + + // SET COOKIES VIA CHROMY + chromy.setCookie(cookies); + console.log('Cookie state restored with:', JSON.stringify(cookies, null, 2)); +}; diff --git a/backstop_data/engine_scripts/chromy/onBefore.js b/backstop_data/engine_scripts/chromy/onBefore.js new file mode 100644 index 0000000..e174ef8 --- /dev/null +++ b/backstop_data/engine_scripts/chromy/onBefore.js @@ -0,0 +1,6 @@ +module.exports = function (chromy, scenario, vp) { + require('./loadCookies')(chromy, scenario); + + // IGNORE ANY CERT WARNINGS + chromy.ignoreCertificateErrors(); +}; diff --git a/backstop_data/engine_scripts/chromy/onReady.js b/backstop_data/engine_scripts/chromy/onReady.js new file mode 100644 index 0000000..6238af8 --- /dev/null +++ b/backstop_data/engine_scripts/chromy/onReady.js @@ -0,0 +1,5 @@ +module.exports = function (chromy, scenario, vp) { + console.log('SCENARIO > ' + scenario.label); + require('./clickAndHoverHelper')(chromy, scenario); + // add more ready handlers here... +}; diff --git a/backstop_data/engine_scripts/cookies.json b/backstop_data/engine_scripts/cookies.json new file mode 100644 index 0000000..b59400d --- /dev/null +++ b/backstop_data/engine_scripts/cookies.json @@ -0,0 +1,14 @@ +[ + { + "domain": ".www.yourdomain.com", + "path": "/", + "name": "yourCookieName", + "value": "yourCookieValue", + "expirationDate": 1798790400, + "hostOnly": false, + "httpOnly": false, + "secure": false, + "session": false, + "sameSite": "no_restriction" + } +] diff --git a/backstop_data/engine_scripts/imageStub.jpg b/backstop_data/engine_scripts/imageStub.jpg new file mode 100644 index 0000000..3e526b4 Binary files /dev/null and b/backstop_data/engine_scripts/imageStub.jpg differ diff --git a/backstop_data/engine_scripts/puppet/clickAndHoverHelper.js b/backstop_data/engine_scripts/puppet/clickAndHoverHelper.js new file mode 100644 index 0000000..81e0c9b --- /dev/null +++ b/backstop_data/engine_scripts/puppet/clickAndHoverHelper.js @@ -0,0 +1,31 @@ +module.exports = async (page, scenario) => { + var hoverSelector = scenario.hoverSelectors || scenario.hoverSelector; + var clickSelector = scenario.clickSelectors || scenario.clickSelector; + var scrollToSelector = scenario.scrollToSelector; + var postInteractionWait = scenario.postInteractionWait; // selector [str] | ms [int] + + if (hoverSelector) { + for (const hoverSelectorIndex of [].concat(hoverSelector)) { + await page.waitFor(hoverSelectorIndex); + await page.hover(hoverSelectorIndex); + } + } + + if (clickSelector) { + for (const clickSelectorIndex of [].concat(clickSelector)) { + await page.waitFor(clickSelectorIndex); + await page.click(clickSelectorIndex); + } + } + + if (postInteractionWait) { + await page.waitFor(postInteractionWait); + } + + if (scrollToSelector) { + await page.waitFor(scrollToSelector); + await page.evaluate(scrollToSelector => { + document.querySelector(scrollToSelector).scrollIntoView(); + }, scrollToSelector); + } +}; diff --git a/backstop_data/engine_scripts/puppet/ignoreCSP.js b/backstop_data/engine_scripts/puppet/ignoreCSP.js new file mode 100644 index 0000000..5e4f141 --- /dev/null +++ b/backstop_data/engine_scripts/puppet/ignoreCSP.js @@ -0,0 +1,65 @@ +/** + * IGNORE CSP HEADERS + * Listen to all requests. If a request matches scenario.url + * then fetch the request again manually, strip out CSP headers + * and respond to the original request without CSP headers. + * Allows `ignoreHTTPSErrors: true` BUT... requires `debugWindow: true` + * + * see https://github.com/GoogleChrome/puppeteer/issues/1229#issuecomment-380133332 + * this is the workaround until Page.setBypassCSP lands... https://github.com/GoogleChrome/puppeteer/pull/2324 + * + * @param {REQUEST} request + * @return {VOID} + * + * Use this in an onBefore script E.G. + ``` + module.exports = async function(page, scenario) { + require('./removeCSP')(page, scenario); + } + ``` + * + */ + +const fetch = require('node-fetch'); +const https = require('https'); +const agent = new https.Agent({ + rejectUnauthorized: false +}); + +module.exports = async function (page, scenario) { + const intercept = async (request, targetUrl) => { + const requestUrl = request.url(); + + // FIND TARGET URL REQUEST + if (requestUrl === targetUrl) { + const cookiesList = await page.cookies(requestUrl); + const cookies = cookiesList.map(cookie => `${cookie.name}=${cookie.value}`).join('; '); + const headers = Object.assign(request.headers(), {cookie: cookies}); + const options = { + headers: headers, + body: request.postData(), + method: request.method(), + follow: 20, + agent + }; + + const result = await fetch(requestUrl, options); + + const buffer = await result.buffer(); + let cleanedHeaders = result.headers._headers || {}; + cleanedHeaders['content-security-policy'] = ''; + await request.respond({ + body: buffer, + headers: cleanedHeaders, + status: result.status + }); + } else { + request.continue(); + } + }; + + await page.setRequestInterception(true); + page.on('request', req => { + intercept(req, scenario.url); + }); +}; diff --git a/backstop_data/engine_scripts/puppet/interceptImages.js b/backstop_data/engine_scripts/puppet/interceptImages.js new file mode 100644 index 0000000..c6c5ed3 --- /dev/null +++ b/backstop_data/engine_scripts/puppet/interceptImages.js @@ -0,0 +1,37 @@ +/** + * INTERCEPT IMAGES + * Listen to all requests. If a request matches IMAGE_URL_RE + * then stub the image with data from IMAGE_STUB_URL + * + * Use this in an onBefore script E.G. + ``` + module.exports = async function(page, scenario) { + require('./interceptImages')(page, scenario); + } + ``` + * + */ + +const fs = require('fs'); +const path = require('path'); + +const IMAGE_URL_RE = /\.gif|\.jpg|\.png/i; +const IMAGE_STUB_URL = path.resolve(__dirname, '../../imageStub.jpg'); +const IMAGE_DATA_BUFFER = fs.readFileSync(IMAGE_STUB_URL); +const HEADERS_STUB = {}; + +module.exports = async function (page, scenario) { + const intercept = async (request, targetUrl) => { + if (IMAGE_URL_RE.test(request.url())) { + await request.respond({ + body: IMAGE_DATA_BUFFER, + headers: HEADERS_STUB, + status: 200 + }); + } else { + request.continue(); + } + }; + await page.setRequestInterception(true); + page.on('request', intercept); +}; diff --git a/backstop_data/engine_scripts/puppet/loadCookies.js b/backstop_data/engine_scripts/puppet/loadCookies.js new file mode 100644 index 0000000..db848a7 --- /dev/null +++ b/backstop_data/engine_scripts/puppet/loadCookies.js @@ -0,0 +1,29 @@ +var fs = require('fs'); + +module.exports = async (page, scenario) => { + var cookies = []; + var cookiePath = scenario.cookiePath; + + // READ COOKIES FROM FILE IF EXISTS + if (fs.existsSync(cookiePath)) { + cookies = JSON.parse(fs.readFileSync(cookiePath)); + } + + // MUNGE COOKIE DOMAIN + cookies = cookies.map(cookie => { + cookie.url = 'https://' + cookie.domain; + delete cookie.domain; + return cookie; + }); + + // SET COOKIES + const setCookies = async () => { + return Promise.all( + cookies.map(async (cookie) => { + await page.setCookie(cookie); + }) + ); + }; + await setCookies(); + console.log('Cookie state restored with:', JSON.stringify(cookies, null, 2)); +}; diff --git a/backstop_data/engine_scripts/puppet/onBefore.js b/backstop_data/engine_scripts/puppet/onBefore.js new file mode 100644 index 0000000..a1c374c --- /dev/null +++ b/backstop_data/engine_scripts/puppet/onBefore.js @@ -0,0 +1,3 @@ +module.exports = async (page, scenario, vp) => { + await require('./loadCookies')(page, scenario); +}; diff --git a/backstop_data/engine_scripts/puppet/onReady.js b/backstop_data/engine_scripts/puppet/onReady.js new file mode 100644 index 0000000..517c0e4 --- /dev/null +++ b/backstop_data/engine_scripts/puppet/onReady.js @@ -0,0 +1,6 @@ +module.exports = async (page, scenario, vp) => { + console.log('SCENARIO > ' + scenario.label); + await require('./clickAndHoverHelper')(page, scenario); + + // add more ready handlers here... +}; diff --git a/backstop_data/html_report/.gitkeep b/backstop_data/html_report/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/backstop_data/html_report/assets/fonts/Lato-Bold.ttf b/backstop_data/html_report/assets/fonts/Lato-Bold.ttf new file mode 100755 index 0000000..7434369 Binary files /dev/null and b/backstop_data/html_report/assets/fonts/Lato-Bold.ttf differ diff --git a/backstop_data/html_report/assets/fonts/Lato-Regular.ttf b/backstop_data/html_report/assets/fonts/Lato-Regular.ttf new file mode 100755 index 0000000..04ea8ef Binary files /dev/null and b/backstop_data/html_report/assets/fonts/Lato-Regular.ttf differ diff --git a/backstop_data/html_report/assets/fonts/lato-bold-webfont.woff b/backstop_data/html_report/assets/fonts/lato-bold-webfont.woff new file mode 100755 index 0000000..d02221d Binary files /dev/null and b/backstop_data/html_report/assets/fonts/lato-bold-webfont.woff differ diff --git a/backstop_data/html_report/assets/fonts/lato-bold-webfont.woff2 b/backstop_data/html_report/assets/fonts/lato-bold-webfont.woff2 new file mode 100755 index 0000000..d330650 Binary files /dev/null and b/backstop_data/html_report/assets/fonts/lato-bold-webfont.woff2 differ diff --git a/backstop_data/html_report/assets/fonts/lato-regular-webfont.woff b/backstop_data/html_report/assets/fonts/lato-regular-webfont.woff new file mode 100755 index 0000000..af2064a Binary files /dev/null and b/backstop_data/html_report/assets/fonts/lato-regular-webfont.woff differ diff --git a/backstop_data/html_report/assets/fonts/lato-regular-webfont.woff2 b/backstop_data/html_report/assets/fonts/lato-regular-webfont.woff2 new file mode 100755 index 0000000..0e58138 Binary files /dev/null and b/backstop_data/html_report/assets/fonts/lato-regular-webfont.woff2 differ diff --git a/backstop_data/html_report/b815e28b1e230cff6e9d7b749edcd562.png b/backstop_data/html_report/b815e28b1e230cff6e9d7b749edcd562.png new file mode 100644 index 0000000..f3e4785 Binary files /dev/null and b/backstop_data/html_report/b815e28b1e230cff6e9d7b749edcd562.png differ diff --git a/backstop_data/html_report/config.js b/backstop_data/html_report/config.js new file mode 100644 index 0000000..7e8e0a8 --- /dev/null +++ b/backstop_data/html_report/config.js @@ -0,0 +1,80 @@ +report({ + "testSuite": "BackstopJS", + "tests": [ + { + "pair": { + "reference": "../bitmaps_reference/backstop_default_Google_Homepage_0_document_0_phone.png", + "test": "../bitmaps_test/20181002-234418/backstop_default_Google_Homepage_0_document_0_phone.png", + "selector": "document", + "fileName": "backstop_default_Google_Homepage_0_document_0_phone.png", + "label": "Google Homepage", + "requireSameDimensions": true, + "misMatchThreshold": 0.1, + "url": "https://www.google.com/?hl=en", + "referenceUrl": "https://www.google.de/?hl=en", + "expect": 0, + "viewportLabel": "phone", + "diff": { + "isSameDimensions": true, + "dimensionDifference": { + "width": 0, + "height": 0 + }, + "misMatchPercentage": "0.00", + "analysisTime": 121 + } + }, + "status": "pass" + }, + { + "pair": { + "reference": "../bitmaps_reference/backstop_default_Google_Homepage_0_document_1_tablet.png", + "test": "../bitmaps_test/20181002-234418/backstop_default_Google_Homepage_0_document_1_tablet.png", + "selector": "document", + "fileName": "backstop_default_Google_Homepage_0_document_1_tablet.png", + "label": "Google Homepage", + "requireSameDimensions": true, + "misMatchThreshold": 0.1, + "url": "https://www.google.com/?hl=en", + "referenceUrl": "https://www.google.de/?hl=en", + "expect": 0, + "viewportLabel": "tablet", + "diff": { + "isSameDimensions": true, + "dimensionDifference": { + "width": 0, + "height": 0 + }, + "misMatchPercentage": "0.00", + "analysisTime": 76 + } + }, + "status": "pass" + }, + { + "pair": { + "reference": "../bitmaps_reference/backstop_default_Google_Homepage_0_document_2_laptop.png", + "test": "../bitmaps_test/20181002-234418/backstop_default_Google_Homepage_0_document_2_laptop.png", + "selector": "document", + "fileName": "backstop_default_Google_Homepage_0_document_2_laptop.png", + "label": "Google Homepage", + "requireSameDimensions": true, + "misMatchThreshold": 0.1, + "url": "https://www.google.com/?hl=en", + "referenceUrl": "https://www.google.de/?hl=en", + "expect": 0, + "viewportLabel": "laptop", + "diff": { + "isSameDimensions": true, + "dimensionDifference": { + "width": 0, + "height": 0 + }, + "misMatchPercentage": "0.00" + } + }, + "status": "pass" + } + ], + "id": "backstop_default" +}); \ No newline at end of file diff --git a/backstop_data/html_report/index_bundle.js b/backstop_data/html_report/index_bundle.js new file mode 100644 index 0000000..bcd3bd1 --- /dev/null +++ b/backstop_data/html_report/index_bundle.js @@ -0,0 +1,36322 @@ +/******/ (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 = 111); +/******/ }) +/************************************************************************/ +/******/ ([ +/* 0 */ +/***/ (function(module, exports) { + +// shim for using process in browser +var process = module.exports = {}; + +// cached from whatever global is present so that test runners that stub it +// don't break things. But we need to wrap it in a try catch in case it is +// wrapped in strict mode code which doesn't define any globals. It's inside a +// function because try/catches deoptimize in certain engines. + +var cachedSetTimeout; +var cachedClearTimeout; + +function defaultSetTimout() { + throw new Error('setTimeout has not been defined'); +} +function defaultClearTimeout () { + throw new Error('clearTimeout has not been defined'); +} +(function () { + try { + if (typeof setTimeout === 'function') { + cachedSetTimeout = setTimeout; + } else { + cachedSetTimeout = defaultSetTimout; + } + } catch (e) { + cachedSetTimeout = defaultSetTimout; + } + try { + if (typeof clearTimeout === 'function') { + cachedClearTimeout = clearTimeout; + } else { + cachedClearTimeout = defaultClearTimeout; + } + } catch (e) { + cachedClearTimeout = defaultClearTimeout; + } +} ()) +function runTimeout(fun) { + if (cachedSetTimeout === setTimeout) { + //normal enviroments in sane situations + return setTimeout(fun, 0); + } + // if setTimeout wasn't available but was latter defined + if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) { + cachedSetTimeout = setTimeout; + return setTimeout(fun, 0); + } + try { + // when when somebody has screwed with setTimeout but no I.E. maddness + return cachedSetTimeout(fun, 0); + } catch(e){ + try { + // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally + return cachedSetTimeout.call(null, fun, 0); + } catch(e){ + // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error + return cachedSetTimeout.call(this, fun, 0); + } + } + + +} +function runClearTimeout(marker) { + if (cachedClearTimeout === clearTimeout) { + //normal enviroments in sane situations + return clearTimeout(marker); + } + // if clearTimeout wasn't available but was latter defined + if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) { + cachedClearTimeout = clearTimeout; + return clearTimeout(marker); + } + try { + // when when somebody has screwed with setTimeout but no I.E. maddness + return cachedClearTimeout(marker); + } catch (e){ + try { + // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally + return cachedClearTimeout.call(null, marker); + } catch (e){ + // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error. + // Some versions of I.E. have different rules for clearTimeout vs setTimeout + return cachedClearTimeout.call(this, marker); + } + } + + + +} +var queue = []; +var draining = false; +var currentQueue; +var queueIndex = -1; + +function cleanUpNextTick() { + if (!draining || !currentQueue) { + return; + } + draining = false; + if (currentQueue.length) { + queue = currentQueue.concat(queue); + } else { + queueIndex = -1; + } + if (queue.length) { + drainQueue(); + } +} + +function drainQueue() { + if (draining) { + return; + } + var timeout = runTimeout(cleanUpNextTick); + draining = true; + + var len = queue.length; + while(len) { + currentQueue = queue; + queue = []; + while (++queueIndex < len) { + if (currentQueue) { + currentQueue[queueIndex].run(); + } + } + queueIndex = -1; + len = queue.length; + } + currentQueue = null; + draining = false; + runClearTimeout(timeout); +} + +process.nextTick = function (fun) { + var args = new Array(arguments.length - 1); + if (arguments.length > 1) { + for (var i = 1; i < arguments.length; i++) { + args[i - 1] = arguments[i]; + } + } + queue.push(new Item(fun, args)); + if (queue.length === 1 && !draining) { + runTimeout(drainQueue); + } +}; + +// v8 likes predictible objects +function Item(fun, array) { + this.fun = fun; + this.array = array; +} +Item.prototype.run = function () { + this.fun.apply(null, this.array); +}; +process.title = 'browser'; +process.browser = true; +process.env = {}; +process.argv = []; +process.version = ''; // empty string to avoid regexp issues +process.versions = {}; + +function noop() {} + +process.on = noop; +process.addListener = noop; +process.once = noop; +process.off = noop; +process.removeListener = noop; +process.removeAllListeners = noop; +process.emit = noop; +process.prependListener = noop; +process.prependOnceListener = noop; + +process.listeners = function (name) { return [] } + +process.binding = function (name) { + throw new Error('process.binding is not supported'); +}; + +process.cwd = function () { return '/' }; +process.chdir = function (dir) { + throw new Error('process.chdir is not supported'); +}; +process.umask = function() { return 0; }; + + +/***/ }), +/* 1 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(process) {/** + * 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; +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) + +/***/ }), +/* 2 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +module.exports = __webpack_require__(21); + + +/***/ }), +/* 3 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(process) {/** + * 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__(12); + +/** + * 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; +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) + +/***/ }), +/* 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. + * + * + */ + + +/** + * 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; + +/***/ }), +/* 5 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); +/* WEBPACK VAR INJECTION */(function(process, module) {/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "css", function() { return css; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "keyframes", function() { return keyframes; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "injectGlobal", function() { return injectGlobal; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ThemeProvider", function() { return ThemeProvider; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "withTheme", function() { return wrapWithTheme; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ServerStyleSheet", function() { return ServerStyleSheet; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "StyleSheetManager", function() { return StyleSheetManager; }); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_is_plain_object__ = __webpack_require__(245); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_is_plain_object___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_is_plain_object__); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_stylis__ = __webpack_require__(247); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_stylis___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_stylis__); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_react__ = __webpack_require__(2); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_react__); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_prop_types__ = __webpack_require__(18); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_prop_types__); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_hoist_non_react_statics__ = __webpack_require__(248); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_hoist_non_react_statics___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4_hoist_non_react_statics__); + + + + + + +/** + * Copyright (c) 2013-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @typechecks + */ + +var _uppercasePattern = /([A-Z])/g; + +/** + * Hyphenates a camelcased string, for example: + * + * > hyphenate('backgroundColor') + * < "background-color" + * + * For CSS style names, use `hyphenateStyleName` instead which works properly + * with all vendor prefixes, including `ms`. + * + * @param {string} string + * @return {string} + */ +function hyphenate$2(string) { + return string.replace(_uppercasePattern, '-$1').toLowerCase(); +} + +var hyphenate_1 = hyphenate$2; + +var hyphenate = hyphenate_1; + +var msPattern = /^ms-/; + +/** + * Hyphenates a camelcased CSS property name, for example: + * + * > hyphenateStyleName('backgroundColor') + * < "background-color" + * > hyphenateStyleName('MozTransition') + * < "-moz-transition" + * > hyphenateStyleName('msTransition') + * < "-ms-transition" + * + * As Modernizr suggests (http://modernizr.com/docs/#prefixed), an `ms` prefix + * is converted to `-ms-`. + * + * @param {string} string + * @return {string} + */ +function hyphenateStyleName(string) { + return hyphenate(string).replace(msPattern, '-ms-'); +} + +var hyphenateStyleName_1 = hyphenateStyleName; + +// +var objToCss = function objToCss(obj, prevKey) { + var css = Object.keys(obj).filter(function (key) { + var chunk = obj[key]; + return chunk !== undefined && chunk !== null && chunk !== false && chunk !== ''; + }).map(function (key) { + if (__WEBPACK_IMPORTED_MODULE_0_is_plain_object___default()(obj[key])) return objToCss(obj[key], key); + return hyphenateStyleName_1(key) + ': ' + obj[key] + ';'; + }).join(' '); + return prevKey ? prevKey + ' {\n ' + css + '\n}' : css; +}; + +var flatten = function flatten(chunks, executionContext) { + return chunks.reduce(function (ruleSet, chunk) { + /* Remove falsey values */ + if (chunk === undefined || chunk === null || chunk === false || chunk === '') { + return ruleSet; + } + /* Flatten ruleSet */ + if (Array.isArray(chunk)) { + return [].concat(ruleSet, flatten(chunk, executionContext)); + } + + /* Handle other components */ + if (chunk.hasOwnProperty('styledComponentId')) { + // $FlowFixMe not sure how to make this pass + return [].concat(ruleSet, ['.' + chunk.styledComponentId]); + } + + /* Either execute or defer the function */ + if (typeof chunk === 'function') { + return executionContext ? ruleSet.concat.apply(ruleSet, flatten([chunk(executionContext)], executionContext)) : ruleSet.concat(chunk); + } + + /* Handle objects */ + return ruleSet.concat( + // $FlowFixMe have to add %checks somehow to isPlainObject + __WEBPACK_IMPORTED_MODULE_0_is_plain_object___default()(chunk) ? objToCss(chunk) : chunk.toString()); + }, []); +}; + +// +var stylis = new __WEBPACK_IMPORTED_MODULE_1_stylis___default.a({ + global: false, + cascade: true, + keyframe: false, + prefix: true, + compress: false, + semicolon: true +}); + +var stringifyRules = function stringifyRules(rules, selector, prefix) { + var flatCSS = rules.join('').replace(/^\s*\/\/.*$/gm, ''); // replace JS comments + + var cssStr = selector && prefix ? prefix + ' ' + selector + ' { ' + flatCSS + ' }' : flatCSS; + + return stylis(prefix || !selector ? '' : selector, cssStr); +}; + +// +var chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'.split(''); +var charsLength = chars.length; + +/* Some high number, usually 9-digit base-10. Map it to base-😎 */ +var generateAlphabeticName = function generateAlphabeticName(code) { + var name = ''; + var x = void 0; + + for (x = code; x > charsLength; x = Math.floor(x / charsLength)) { + name = chars[x % charsLength] + name; + } + + return chars[x % charsLength] + name; +}; + +// + + +var interleave = (function (strings, interpolations) { + return interpolations.reduce(function (array, interp, i) { + return array.concat(interp, strings[i + 1]); + }, [strings[0]]); +}); + +// +var css = (function (strings) { + for (var _len = arguments.length, interpolations = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + interpolations[_key - 1] = arguments[_key]; + } + + return flatten(interleave(strings, interpolations)); +}); + +// +var SC_COMPONENT_ID = /^[^\S\n]*?\/\* sc-component-id:\s+(\S+)\s+\*\//gm; + +var extractCompsFromCSS = (function (maybeCSS) { + var css = '' + (maybeCSS || ''); // Definitely a string, and a clone + var existingComponents = []; + css.replace(SC_COMPONENT_ID, function (match, componentId, matchIndex) { + existingComponents.push({ componentId: componentId, matchIndex: matchIndex }); + return match; + }); + return existingComponents.map(function (_ref, i) { + var componentId = _ref.componentId, + matchIndex = _ref.matchIndex; + + var nextComp = existingComponents[i + 1]; + var cssFromDOM = nextComp ? css.slice(matchIndex, nextComp.matchIndex) : css.slice(matchIndex); + return { componentId: componentId, cssFromDOM: cssFromDOM }; + }); +}); + +// +/* eslint-disable camelcase, no-undef */ + +var getNonce = (function () { + return true ? __webpack_require__.nc : null; +}); + +var classCallCheck = function (instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } +}; + +var createClass = function () { + function defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ("value" in descriptor) descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + + return function (Constructor, protoProps, staticProps) { + if (protoProps) defineProperties(Constructor.prototype, protoProps); + if (staticProps) defineProperties(Constructor, staticProps); + return Constructor; + }; +}(); + + + + + + + +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 inherits = function (subClass, superClass) { + if (typeof superClass !== "function" && superClass !== null) { + throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); + } + + subClass.prototype = Object.create(superClass && superClass.prototype, { + constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + } + }); + if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; +}; + + + + + + + + + +var objectWithoutProperties = function (obj, keys) { + var target = {}; + + for (var i in obj) { + if (keys.indexOf(i) >= 0) continue; + if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; + target[i] = obj[i]; + } + + return target; +}; + +var possibleConstructorReturn = function (self, call) { + if (!self) { + throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); + } + + return call && (typeof call === "object" || typeof call === "function") ? call : self; +}; + +// +/* eslint-disable no-underscore-dangle */ +/* + * Browser Style Sheet with Rehydration + * + * + * + * Note: replace · with * in the above snippet. + * */ +var COMPONENTS_PER_TAG = 40; + +var BrowserTag = function () { + function BrowserTag(el, isLocal) { + var existingSource = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : ''; + classCallCheck(this, BrowserTag); + + this.el = el; + this.isLocal = isLocal; + this.ready = false; + + var extractedComps = extractCompsFromCSS(existingSource); + + this.size = extractedComps.length; + this.components = extractedComps.reduce(function (acc, obj) { + acc[obj.componentId] = obj; // eslint-disable-line no-param-reassign + return acc; + }, {}); + } + + BrowserTag.prototype.isFull = function isFull() { + return this.size >= COMPONENTS_PER_TAG; + }; + + BrowserTag.prototype.addComponent = function addComponent(componentId) { + if (!this.ready) this.replaceElement(); + if (process.env.NODE_ENV !== 'production' && this.components[componentId]) { + throw new Error('Trying to add Component \'' + componentId + '\' twice!'); + } + + var comp = { componentId: componentId, textNode: document.createTextNode('') }; + this.el.appendChild(comp.textNode); + + this.size += 1; + this.components[componentId] = comp; + }; + + BrowserTag.prototype.inject = function inject(componentId, css, name) { + if (!this.ready) this.replaceElement(); + var comp = this.components[componentId]; + + if (process.env.NODE_ENV !== 'production' && !comp) { + throw new Error('Must add a new component before you can inject css into it'); + } + if (comp.textNode.data === '') { + comp.textNode.appendData('\n/* sc-component-id: ' + componentId + ' */\n'); + } + + comp.textNode.appendData(css); + if (name) { + var existingNames = this.el.getAttribute(SC_ATTR); + this.el.setAttribute(SC_ATTR, existingNames ? existingNames + ' ' + name : name); + } + + var nonce = getNonce(); + + if (nonce) { + this.el.setAttribute('nonce', nonce); + } + }; + + BrowserTag.prototype.toHTML = function toHTML() { + return this.el.outerHTML; + }; + + BrowserTag.prototype.toReactElement = function toReactElement() { + throw new Error("BrowserTag doesn't implement toReactElement!"); + }; + + BrowserTag.prototype.clone = function clone() { + throw new Error('BrowserTag cannot be cloned!'); + }; + + /* Because we care about source order, before we can inject anything we need to + * create a text node for each component and replace the existing CSS. */ + + + BrowserTag.prototype.replaceElement = function replaceElement() { + var _this = this; + + this.ready = true; + // We have nothing to inject. Use the current el. + if (this.size === 0) return; + + // Build up our replacement style tag + var newEl = this.el.cloneNode(); + newEl.appendChild(document.createTextNode('\n')); + + Object.keys(this.components).forEach(function (key) { + var comp = _this.components[key]; + + // eslint-disable-next-line no-param-reassign + comp.textNode = document.createTextNode(comp.cssFromDOM); + newEl.appendChild(comp.textNode); + }); + + if (!this.el.parentNode) { + throw new Error("Trying to replace an element that wasn't mounted!"); + } + + // The ol' switcheroo + this.el.parentNode.replaceChild(newEl, this.el); + this.el = newEl; + }; + + return BrowserTag; +}(); + +/* Factory function to separate DOM operations from logical ones*/ + + +var BrowserStyleSheet = { + create: function create() { + var tags = []; + var names = {}; + + /* Construct existing state from DOM */ + var nodes = document.querySelectorAll('[' + SC_ATTR + ']'); + var nodesLength = nodes.length; + + for (var i = 0; i < nodesLength; i += 1) { + var el = nodes[i]; + + tags.push(new BrowserTag(el, el.getAttribute(LOCAL_ATTR) === 'true', el.innerHTML)); + + var attr = el.getAttribute(SC_ATTR); + if (attr) { + attr.trim().split(/\s+/).forEach(function (name) { + names[name] = true; + }); + } + } + + /* Factory for making more tags */ + var tagConstructor = function tagConstructor(isLocal) { + var el = document.createElement('style'); + el.type = 'text/css'; + el.setAttribute(SC_ATTR, ''); + el.setAttribute(LOCAL_ATTR, isLocal ? 'true' : 'false'); + if (!document.head) throw new Error('Missing document '); + document.head.appendChild(el); + return new BrowserTag(el, isLocal); + }; + + return new StyleSheet(tagConstructor, tags, names); + } +}; + +// +var SC_ATTR = 'data-styled-components'; +var LOCAL_ATTR = 'data-styled-components-is-local'; +var CONTEXT_KEY = '__styled-components-stylesheet__'; + +/* eslint-disable flowtype/object-type-delimiter */ + +/* eslint-enable flowtype/object-type-delimiter */ + +var instance = null; +// eslint-disable-next-line no-use-before-define +var clones = []; + +var StyleSheet = function () { + function StyleSheet(tagConstructor) { + var tags = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : []; + var names = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; + classCallCheck(this, StyleSheet); + this.hashes = {}; + this.deferredInjections = {}; + this.stylesCacheable = typeof document !== 'undefined'; + + this.tagConstructor = tagConstructor; + this.tags = tags; + this.names = names; + this.constructComponentTagMap(); + } + + // helper for `ComponentStyle` to know when it cache static styles. + // staticly styled-component can not safely cache styles on the server + // without all `ComponentStyle` instances saving a reference to the + // the styleSheet instance they last rendered with, + // or listening to creation / reset events. otherwise you might create + // a component with one stylesheet and render it another api response + // with another, losing styles on from your server-side render. + + + StyleSheet.prototype.constructComponentTagMap = function constructComponentTagMap() { + var _this = this; + + this.componentTags = {}; + + this.tags.forEach(function (tag) { + Object.keys(tag.components).forEach(function (componentId) { + _this.componentTags[componentId] = tag; + }); + }); + }; + + /* Best level of caching—get the name from the hash straight away. */ + + + StyleSheet.prototype.getName = function getName(hash) { + return this.hashes[hash.toString()]; + }; + + /* Second level of caching—if the name is already in the dom, don't + * inject anything and record the hash for getName next time. */ + + + StyleSheet.prototype.alreadyInjected = function alreadyInjected(hash, name) { + if (!this.names[name]) return false; + + this.hashes[hash.toString()] = name; + return true; + }; + + /* Third type of caching—don't inject components' componentId twice. */ + + + StyleSheet.prototype.hasInjectedComponent = function hasInjectedComponent(componentId) { + return !!this.componentTags[componentId]; + }; + + StyleSheet.prototype.deferredInject = function deferredInject(componentId, isLocal, css) { + if (this === instance) { + clones.forEach(function (clone) { + clone.deferredInject(componentId, isLocal, css); + }); + } + + this.getOrCreateTag(componentId, isLocal); + this.deferredInjections[componentId] = css; + }; + + StyleSheet.prototype.inject = function inject(componentId, isLocal, css, hash, name) { + if (this === instance) { + clones.forEach(function (clone) { + clone.inject(componentId, isLocal, css); + }); + } + + var tag = this.getOrCreateTag(componentId, isLocal); + + var deferredInjection = this.deferredInjections[componentId]; + if (deferredInjection) { + tag.inject(componentId, deferredInjection); + delete this.deferredInjections[componentId]; + } + + tag.inject(componentId, css, name); + + if (hash && name) { + this.hashes[hash.toString()] = name; + } + }; + + StyleSheet.prototype.toHTML = function toHTML() { + return this.tags.map(function (tag) { + return tag.toHTML(); + }).join(''); + }; + + StyleSheet.prototype.toReactElements = function toReactElements() { + return this.tags.map(function (tag, i) { + return tag.toReactElement('sc-' + i); + }); + }; + + StyleSheet.prototype.getOrCreateTag = function getOrCreateTag(componentId, isLocal) { + var existingTag = this.componentTags[componentId]; + if (existingTag) { + return existingTag; + } + + var lastTag = this.tags[this.tags.length - 1]; + var componentTag = !lastTag || lastTag.isFull() || lastTag.isLocal !== isLocal ? this.createNewTag(isLocal) : lastTag; + this.componentTags[componentId] = componentTag; + componentTag.addComponent(componentId); + return componentTag; + }; + + StyleSheet.prototype.createNewTag = function createNewTag(isLocal) { + var newTag = this.tagConstructor(isLocal); + this.tags.push(newTag); + return newTag; + }; + + StyleSheet.reset = function reset(isServer) { + instance = StyleSheet.create(isServer); + }; + + /* We can make isServer totally implicit once Jest 20 drops and we + * can change environment on a per-test basis. */ + + + StyleSheet.create = function create() { + var isServer = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : typeof document === 'undefined'; + + return (isServer ? ServerStyleSheet : BrowserStyleSheet).create(); + }; + + StyleSheet.clone = function clone(oldSheet) { + var newSheet = new StyleSheet(oldSheet.tagConstructor, oldSheet.tags.map(function (tag) { + return tag.clone(); + }), _extends({}, oldSheet.names)); + + newSheet.hashes = _extends({}, oldSheet.hashes); + newSheet.deferredInjections = _extends({}, oldSheet.deferredInjections); + clones.push(newSheet); + + return newSheet; + }; + + createClass(StyleSheet, null, [{ + key: 'instance', + get: function get$$1() { + return instance || (instance = StyleSheet.create()); + } + }]); + return StyleSheet; +}(); + +var _StyleSheetManager$ch; + +// +var StyleSheetManager = function (_Component) { + inherits(StyleSheetManager, _Component); + + function StyleSheetManager() { + classCallCheck(this, StyleSheetManager); + return possibleConstructorReturn(this, _Component.apply(this, arguments)); + } + + StyleSheetManager.prototype.getChildContext = function getChildContext() { + var _ref; + + return _ref = {}, _ref[CONTEXT_KEY] = this.props.sheet, _ref; + }; + + StyleSheetManager.prototype.render = function render() { + /* eslint-disable react/prop-types */ + // Flow v0.43.1 will report an error accessing the `children` property, + // but v0.47.0 will not. It is necessary to use a type cast instead of + // a "fixme" comment to satisfy both Flow versions. + return __WEBPACK_IMPORTED_MODULE_2_react___default.a.Children.only(this.props.children); + }; + + return StyleSheetManager; +}(__WEBPACK_IMPORTED_MODULE_2_react__["Component"]); + +StyleSheetManager.childContextTypes = (_StyleSheetManager$ch = {}, _StyleSheetManager$ch[CONTEXT_KEY] = __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.instanceOf(StyleSheet), __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.instanceOf(ServerStyleSheet)]).isRequired, _StyleSheetManager$ch); + +StyleSheetManager.propTypes = { + sheet: __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.instanceOf(StyleSheet), __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.instanceOf(ServerStyleSheet)]).isRequired +}; + +// +/* eslint-disable no-underscore-dangle */ +var ServerTag = function () { + function ServerTag(isLocal) { + classCallCheck(this, ServerTag); + + this.isLocal = isLocal; + this.components = {}; + this.size = 0; + this.names = []; + } + + ServerTag.prototype.isFull = function isFull() { + return false; + }; + + ServerTag.prototype.addComponent = function addComponent(componentId) { + if (process.env.NODE_ENV !== 'production' && this.components[componentId]) { + throw new Error('Trying to add Component \'' + componentId + '\' twice!'); + } + this.components[componentId] = { componentId: componentId, css: '' }; + this.size += 1; + }; + + ServerTag.prototype.concatenateCSS = function concatenateCSS() { + var _this = this; + + return Object.keys(this.components).reduce(function (styles, k) { + return styles + _this.components[k].css; + }, ''); + }; + + ServerTag.prototype.inject = function inject(componentId, css, name) { + var comp = this.components[componentId]; + + if (process.env.NODE_ENV !== 'production' && !comp) { + throw new Error('Must add a new component before you can inject css into it'); + } + if (comp.css === '') comp.css = '/* sc-component-id: ' + componentId + ' */\n'; + + comp.css += css.replace(/\n*$/, '\n'); + + if (name) this.names.push(name); + }; + + ServerTag.prototype.toHTML = function toHTML() { + var attrs = ['type="text/css"', SC_ATTR + '="' + this.names.join(' ') + '"', LOCAL_ATTR + '="' + (this.isLocal ? 'true' : 'false') + '"']; + + var nonce = getNonce(); + + if (nonce) { + attrs.push('nonce="' + nonce + '"'); + } + + return ''; + }; + + ServerTag.prototype.toReactElement = function toReactElement(key) { + var _attrs; + + var attrs = (_attrs = {}, _attrs[SC_ATTR] = this.names.join(' '), _attrs[LOCAL_ATTR] = this.isLocal.toString(), _attrs); + + var nonce = getNonce(); + + if (nonce) { + attrs.nonce = nonce; + } + + return __WEBPACK_IMPORTED_MODULE_2_react___default.a.createElement('style', _extends({ + key: key, + type: 'text/css' + }, attrs, { + dangerouslySetInnerHTML: { __html: this.concatenateCSS() } + })); + }; + + ServerTag.prototype.clone = function clone() { + var _this2 = this; + + var copy = new ServerTag(this.isLocal); + copy.names = [].concat(this.names); + copy.size = this.size; + copy.components = Object.keys(this.components).reduce(function (acc, key) { + acc[key] = _extends({}, _this2.components[key]); // eslint-disable-line no-param-reassign + return acc; + }, {}); + + return copy; + }; + + return ServerTag; +}(); + +var ServerStyleSheet = function () { + function ServerStyleSheet() { + classCallCheck(this, ServerStyleSheet); + + this.instance = StyleSheet.clone(StyleSheet.instance); + } + + ServerStyleSheet.prototype.collectStyles = function collectStyles(children) { + if (this.closed) { + throw new Error("Can't collect styles once you've called getStyleTags!"); + } + return __WEBPACK_IMPORTED_MODULE_2_react___default.a.createElement( + StyleSheetManager, + { sheet: this.instance }, + children + ); + }; + + ServerStyleSheet.prototype.getStyleTags = function getStyleTags() { + if (!this.closed) { + clones.splice(clones.indexOf(this.instance), 1); + this.closed = true; + } + + return this.instance.toHTML(); + }; + + ServerStyleSheet.prototype.getStyleElement = function getStyleElement() { + if (!this.closed) { + clones.splice(clones.indexOf(this.instance), 1); + this.closed = true; + } + + return this.instance.toReactElements(); + }; + + ServerStyleSheet.create = function create() { + return new StyleSheet(function (isLocal) { + return new ServerTag(isLocal); + }); + }; + + return ServerStyleSheet; +}(); + +// + +var LIMIT = 200; + +var createWarnTooManyClasses = (function (displayName) { + var generatedClasses = {}; + var warningSeen = false; + + return function (className) { + if (!warningSeen) { + generatedClasses[className] = true; + if (Object.keys(generatedClasses).length >= LIMIT) { + // Unable to find latestRule in test environment. + /* eslint-disable no-console, prefer-template */ + console.warn('Over ' + LIMIT + ' classes were generated for component ' + displayName + '. \n' + 'Consider using the attrs method, together with a style object for frequently changed styles.\n' + 'Example:\n' + ' const Component = styled.div.attrs({\n' + ' style: ({ background }) => ({\n' + ' background,\n' + ' }),\n' + ' })`width: 100%;`\n\n' + ' '); + warningSeen = true; + generatedClasses = {}; + } + } + }; +}); + +// +/* eslint-disable max-len */ +/** + * Trying to avoid the unknown-prop errors on styled components by filtering by + * React's attribute whitelist. + * + * To regenerate this regex: + * + * 1. `npm i -g regexgen` (https://github.com/devongovett/regexgen) + * 2. Run `regexgen` with the list of space-separated words below as input + * 3. Surround the emitted regex with this: `/^(GENERATED_REGEX)$/` -- this will ensure a full string match + * and no false positives from partials + **/ +/* +children dangerouslySetInnerHTML key ref autoFocus defaultValue valueLink defaultChecked checkedLink innerHTML suppressContentEditableWarning onFocusIn onFocusOut className onCopy onCut onPaste onCompositionEnd onCompositionStart onCompositionUpdate onKeyDown onKeyPress onKeyUp onFocus onBlur onChange onInput onSubmit onReset onClick onContextMenu onDoubleClick onDrag onDragEnd onDragEnter onDragExit onDragLeave onDragOver onDragStart onDrop onMouseDown onMouseEnter onMouseLeave onMouseMove onMouseOut onMouseOver onMouseUp onSelect onTouchCancel onTouchEnd onTouchMove onTouchStart onScroll onWheel onAbort onCanPlay onCanPlayThrough onDurationChange onEmptied onEncrypted onEnded onError onLoadedData onLoadedMetadata onLoadStart onPause onPlay onPlaying onProgress onRateChange onSeeked onSeeking onStalled onSuspend onTimeUpdate onVolumeChange onWaiting onLoad onAnimationStart onAnimationEnd onAnimationIteration onTransitionEnd onCopyCapture onCutCapture onPasteCapture onCompositionEndCapture onCompositionStartCapture onCompositionUpdateCapture onKeyDownCapture onKeyPressCapture onKeyUpCapture onFocusCapture onBlurCapture onChangeCapture onInputCapture onSubmitCapture onResetCapture onClickCapture onContextMenuCapture onDoubleClickCapture onDragCapture onDragEndCapture onDragEnterCapture onDragExitCapture onDragLeaveCapture onDragOverCapture onDragStartCapture onDropCapture onMouseDownCapture onMouseEnterCapture onMouseLeaveCapture onMouseMoveCapture onMouseOutCapture onMouseOverCapture onMouseUpCapture onSelectCapture onTouchCancelCapture onTouchEndCapture onTouchMoveCapture onTouchStartCapture onScrollCapture onWheelCapture onAbortCapture onCanPlayCapture onCanPlayThroughCapture onDurationChangeCapture onEmptiedCapture onEncryptedCapture onEndedCapture onErrorCapture onLoadedDataCapture onLoadedMetadataCapture onLoadStartCapture onPauseCapture onPlayCapture onPlayingCapture onProgressCapture onRateChangeCapture onSeekedCapture onSeekingCapture onStalledCapture onSuspendCapture onTimeUpdateCapture onVolumeChangeCapture onWaitingCapture onLoadCapture onAnimationStartCapture onAnimationEndCapture onAnimationIterationCapture onTransitionEndCapture accept acceptCharset accessKey action allowFullScreen allowTransparency alt as async autoComplete autoPlay capture cellPadding cellSpacing charSet challenge checked cite classID className cols colSpan content contentEditable contextMenu controls coords crossOrigin data dateTime default defer dir disabled download draggable encType form formAction formEncType formMethod formNoValidate formTarget frameBorder headers height hidden high href hrefLang htmlFor httpEquiv icon id inputMode integrity is keyParams keyType kind label lang list loop low manifest marginHeight marginWidth max maxLength media mediaGroup method min minLength multiple muted name nonce noValidate open optimum pattern placeholder playsInline poster preload profile radioGroup readOnly referrerPolicy rel required reversed role rows rowSpan sandbox scope scoped scrolling seamless selected shape size sizes span spellCheck src srcDoc srcLang srcSet start step style summary tabIndex target title type useMap value width wmode wrap about datatype inlist prefix property resource typeof vocab autoCapitalize autoCorrect autoSave color itemProp itemScope itemType itemID itemRef results security unselectable accentHeight accumulate additive alignmentBaseline allowReorder alphabetic amplitude arabicForm ascent attributeName attributeType autoReverse azimuth baseFrequency baseProfile baselineShift bbox begin bias by calcMode capHeight clip clipPath clipRule clipPathUnits colorInterpolation colorInterpolationFilters colorProfile colorRendering contentScriptType contentStyleType cursor cx cy d decelerate descent diffuseConstant direction display divisor dominantBaseline dur dx dy edgeMode elevation enableBackground end exponent externalResourcesRequired fill fillOpacity fillRule filter filterRes filterUnits floodColor floodOpacity focusable fontFamily fontSize fontSizeAdjust fontStretch fontStyle fontVariant fontWeight format from fx fy g1 g2 glyphName glyphOrientationHorizontal glyphOrientationVertical glyphRef gradientTransform gradientUnits hanging horizAdvX horizOriginX ideographic imageRendering in in2 intercept k k1 k2 k3 k4 kernelMatrix kernelUnitLength kerning keyPoints keySplines keyTimes lengthAdjust letterSpacing lightingColor limitingConeAngle local markerEnd markerMid markerStart markerHeight markerUnits markerWidth mask maskContentUnits maskUnits mathematical mode numOctaves offset opacity operator order orient orientation origin overflow overlinePosition overlineThickness paintOrder panose1 pathLength patternContentUnits patternTransform patternUnits pointerEvents points pointsAtX pointsAtY pointsAtZ preserveAlpha preserveAspectRatio primitiveUnits r radius refX refY renderingIntent repeatCount repeatDur requiredExtensions requiredFeatures restart result rotate rx ry scale seed shapeRendering slope spacing specularConstant specularExponent speed spreadMethod startOffset stdDeviation stemh stemv stitchTiles stopColor stopOpacity strikethroughPosition strikethroughThickness string stroke strokeDasharray strokeDashoffset strokeLinecap strokeLinejoin strokeMiterlimit strokeOpacity strokeWidth surfaceScale systemLanguage tableValues targetX targetY textAnchor textDecoration textRendering textLength to transform u1 u2 underlinePosition underlineThickness unicode unicodeBidi unicodeRange unitsPerEm vAlphabetic vHanging vIdeographic vMathematical values vectorEffect version vertAdvY vertOriginX vertOriginY viewBox viewTarget visibility widths wordSpacing writingMode x xHeight x1 x2 xChannelSelector xlinkActuate xlinkArcrole xlinkHref xlinkRole xlinkShow xlinkTitle xlinkType xmlBase xmlns xmlnsXlink xmlLang xmlSpace y y1 y2 yChannelSelector z zoomAndPan +*/ +/* eslint-enable max-len */ + +var ATTRIBUTE_REGEX = /^((?:s(?:uppressContentEditableWarn|croll|pac)|(?:shape|image|text)Render|(?:letter|word)Spac|vHang|hang)ing|(?:on(?:AnimationIteration|C(?:o(?:mposition(?:Update|Start|End)|ntextMenu|py)|anPlayThrough|anPlay|hange|lick|ut)|(?:(?:Duration|Volume|Rate)Chang|(?:MouseLea|(?:Touch|Mouse)Mo|DragLea)v|Paus)e|Loaded(?:Metad|D)ata|(?:Animation|Touch|Load|Drag)Start|(?:(?:T(?:ransition|ouch)|Animation)E|Suspe)nd|DoubleClick|(?:TouchCanc|Whe)el|(?:Mouse(?:Ent|Ov)e|Drag(?:Ent|Ov)e|Erro)r|TimeUpdate|(?:E(?:n(?:crypt|d)|mpti)|S(?:tall|eek))ed|MouseDown|P(?:rogress|laying)|(?:MouseOu|DragExi|S(?:elec|ubmi)|Rese|Inpu)t|KeyPress|DragEnd|Key(?:Down|Up)|(?:Wait|Seek)ing|(?:MouseU|Dro)p|Scroll|Paste|Focus|Abort|Drag|Play|Load|Blur)Captur|alignmentBaselin|(?:limitingConeAng|xlink(?:(?:Arcr|R)o|Tit)|s(?:urfaceSca|ty|ca)|unselectab|baseProfi|fontSty|(?:focus|dragg)ab|multip|profi|tit)l|d(?:ominantBaselin|efaultValu)|a(?:uto(?:Capitaliz|Revers|Sav)|dditiv)|(?:(?:formNoValid|xlinkActu|noValid|accumul|rot)a|autoComple|decelera)t|(?:(?:attribute|item)T|datat)yp|(?:attribute|glyph)Nam|playsInlin|(?:formE|e)ncTyp|(?:writing|input|edge)Mod|(?:xlinkTy|itemSco|keyTy|slo)p|(?:amplitu|mo)d|(?:xmlSpa|non)c|fillRul|(?:dateTi|na)m|r(?:esourc|ol)|xmlBas|wmod)e|(?:glyphOrientationHorizont|loc)al|(?:externalResourcesRequir|select|revers|mut)ed|c(?:o(?:lorInterpolationFilter|ntrol|ord)s|o(?:lor(?:Interpolation)?|ntent)|(?:ontentS(?:cript|tyle)Typ|o(?:ntentEditab|lorProfi)l|l(?:assNam|ipRul)|a(?:lcMod|ptur)|it)e|olorRendering|l(?:ipPathUnits|assID)|o(?:ntextMenu|ls)|h(?:eckedLink|a(?:llenge|rSet)|ildren|ecked)|ell(?:Spac|Padd)ing|(?:rossOrigi|olSpa)n|apHeight|lip(?:Path)?|ursor|[xy])|glyphOrientationVertical|d(?:angerouslySetInnerHTML|efaultChecked|ownload|isabled|isplay|[xy])|(?:s(?:trikethroughThickn|eaml)es|(?:und|ov)erlineThicknes|r(?:equiredExtension|adiu)|(?:requiredFeatur|tableValu|stitchTil|numOctav|filterR)e|key(?:(?:Splin|Tim)e|Param)|autoFocu|header|bia)s|(?:(?:st(?:rikethroughPosi|dDevia)|(?:und|ov)erlinePosi|(?:textDecor|elev)a|orienta)tio|(?:strokeLinejo|orig)i|formActio|zoomAndPa|onFocusI|directio|(?:vers|act)io|rowSpa|begi|ico)n|o(?:n(?:AnimationIteration|C(?:o(?:mposition(?:Update|Start|End)|ntextMenu|py)|anPlayThrough|anPlay|hange|lick|ut)|(?:(?:Duration|Volume|Rate)Chang|(?:MouseLea|(?:Touch|Mouse)Mo|DragLea)v|Paus)e|Loaded(?:Metad|D)ata|(?:Animation|Touch|Load|Drag)Start|(?:(?:T(?:ransition|ouch)|Animation)E|Suspe)nd|DoubleClick|(?:TouchCanc|Whe)el|(?:Mouse(?:Ent|Ov)e|Drag(?:Ent|Ov)e|Erro)r|TimeUpdate|(?:E(?:n(?:crypt|d)|mpti)|S(?:tall|eek))ed|MouseDown|P(?:rogress|laying)|(?:MouseOu|DragExi|S(?:elec|ubmi)|Rese|Inpu)t|KeyPress|DragEnd|Key(?:Down|Up)|(?:Wait|Seek)ing|(?:MouseU|Dro)p|Scroll|Paste|Focus|Abort|Drag|Play|Load|Blur)|rient)|p(?:reserveA(?:spectRatio|lpha)|ointsAt[X-Z]|anose1)|(?:patternContent|ma(?:sk(?:Content)?|rker)|primitive|gradient|pattern|filter)Units|(?:gradientT|patternT|t)ransform|(?:(?:allowTranspar|baseFrequ)enc|re(?:ferrerPolic|adOnl)|(?:(?:st(?:roke|op)O|floodO|fillO|o)pac|integr|secur)it|visibilit|fontFamil|accessKe|propert|summar)y|(?:strokeMiterlimi|(?:specularConsta|repeatCou|fontVaria)n|(?:(?:specularE|e)xpon|renderingInt|asc)en|d(?:iffuseConsta|esce)n|(?:fontSizeAdju|lengthAdju|manife)s|baselineShif|vectorEffec|(?:(?:mar(?:ker|gin)|x)H|accentH|fontW)eigh|a(?:utoCorrec|bou)|markerStar|onFocusOu|in(?:tercep|lis)|restar|forma|heigh|lis)t|(?:(?:st(?:rokeDasho|artO)|o)ffs|acceptChars|formTarg|viewTarg|srcS)et|(?:(?:enableBackgrou|markerE)n|s(?:p(?:readMetho|ee)|ee)|formMetho|m(?:arkerMi|etho)|preloa|kin)d|k(?:ernel(?:UnitLength|Matrix)|[1-4])|(?:[xy]ChannelSelect|lightingCol|textAnch|floodCol|stopCol|operat|htmlF)or|(?:allowFullScre|hidd)en|strokeDasharray|systemLanguage|(?:strokeLineca|itemPro|useMa|wra|loo)p|v(?:Mathematical|ert(?:Origin[XY]|AdvY)|alues|ocab)|(?:pointerEve|keyPoi)nts|unicodeRange|(?:(?:allowReord|placehold|frameBord|paintOrd|post|ord)e|repeatDu|d(?:efe|u))r|mathematical|(?:vI|i)deographic|h(?:oriz(?:Origin|Adv)X|ttpEquiv)|u(?:nicodeBidi|[12])|(?:fontStretc|hig)h|(?:(?:mar(?:ker|gin)W|strokeW)id|azimu)th|vAlphabetic|mediaGroup|spellCheck|(?:unitsPerE|optimu|fro)m|r(?:adioGroup|e(?:sults|f[XY]|l)|ows|[xy])|(?:xmlnsXl|valueL)ink|a(?:rabicForm|l(?:phabetic|t)|sync)|pathLength|(?:text|m(?:in|ax))Length|innerHTML|xlinkShow|(?:xlinkHr|glyphR)ef|r(?:e(?:quired|sult|f))?|o(?:verflow|pen)|(?:tabInde|(?:sand|b)bo|viewBo)x|(?:(?:href|xml|src)La|kerni)ng|f(?:o(?:ntSize|rm)|il(?:ter|l))|autoPlay|unicode|p(?:attern|oints)|t(?:arget[XY]|o)|i(?:temRef|n2|s)|divisor|d(?:efault|ata|ir)?|srcDoc|s(?:coped|te(?:m[hv]|p)|pan)|(?:width|size)s|(?:stri|la)ng|prefix|itemID|s(?:t(?:roke|art)|hape|cope|rc)|a(?:ccept|s)|t(?:arget|ype)|typeof|width|value|x(?:mlns)?|label|m(?:edia|a(?:sk|x)|in)|size|href|k(?:ey)?|end|low|x[12]|i[dn]|y[12]|g[12]|by|f[xy]|[yz])$/; + +/* From DOMProperty */ +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'; +var ATTRIBUTE_NAME_CHAR = ATTRIBUTE_NAME_START_CHAR + '\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040'; +var isCustomAttribute = RegExp.prototype.test.bind(new RegExp('^(data|aria)-[' + ATTRIBUTE_NAME_CHAR + ']*$')); + +var validAttr = (function (name) { + return ATTRIBUTE_REGEX.test(name) || isCustomAttribute(name.toLowerCase()); +}); + +// + + +function isTag(target) /* : %checks */{ + return typeof target === 'string'; +} + +// + + +function isStyledComponent(target) /* : %checks */{ + return typeof target === 'function' && typeof target.styledComponentId === 'string'; +} + +// + +/* eslint-disable no-undef */ +function getComponentName(target) { + return target.displayName || target.name || 'Component'; +} + +// + + +var determineTheme = (function (props, fallbackTheme, defaultProps) { + // Props should take precedence over ThemeProvider, which should take precedence over + // defaultProps, but React automatically puts defaultProps on props. + + /* eslint-disable react/prop-types */ + var isDefaultTheme = defaultProps && props.theme === defaultProps.theme; + var theme = props.theme && !isDefaultTheme ? props.theme : fallbackTheme; + /* eslint-enable */ + + return theme; +}); + +// +var escapeRegex = /[[\].#*$><+~=|^:(),"'`-]+/g; +var dashesAtEnds = /(^-|-$)/g; + +/** + * TODO: Explore using CSS.escape when it becomes more available + * in evergreen browsers. + */ +function escape(str) { + return str + // Replace all possible CSS selectors + .replace(escapeRegex, '-') + + // Remove extraneous hyphens at the start and end + .replace(dashesAtEnds, ''); +} + +// +/** + * Creates a broadcast that can be listened to, i.e. simple event emitter + * + * @see https://github.com/ReactTraining/react-broadcast + */ + +var createBroadcast = function createBroadcast(initialState) { + var listeners = {}; + var id = 0; + var state = initialState; + + function publish(nextState) { + state = nextState; + + // eslint-disable-next-line guard-for-in, no-restricted-syntax + for (var key in listeners) { + var listener = listeners[key]; + if (listener === undefined) { + // eslint-disable-next-line no-continue + continue; + } + + listener(state); + } + } + + function subscribe(listener) { + var currentId = id; + listeners[currentId] = listener; + id += 1; + listener(state); + return currentId; + } + + function unsubscribe(unsubID) { + listeners[unsubID] = undefined; + } + + return { publish: publish, subscribe: subscribe, unsubscribe: unsubscribe }; +}; + +// +// Helper to call a given function, only once +var once = (function (cb) { + var called = false; + + return function () { + if (!called) { + called = true; + cb(); + } + }; +}); + +var _ThemeProvider$childC; +var _ThemeProvider$contex; + +// +/* globals React$Element */ +// NOTE: DO NOT CHANGE, changing this is a semver major change! +var CHANNEL = '__styled-components__'; +var CHANNEL_NEXT = CHANNEL + 'next__'; + +var CONTEXT_CHANNEL_SHAPE = __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.shape({ + getTheme: __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.func, + subscribe: __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.func, + unsubscribe: __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.func +}); + +var warnChannelDeprecated = void 0; +if (process.env.NODE_ENV !== 'production') { + warnChannelDeprecated = once(function () { + // eslint-disable-next-line no-console + console.error('Warning: Usage of `context.' + CHANNEL + '` as a function is deprecated. It will be replaced with the object on `.context.' + CHANNEL_NEXT + '` in a future version.'); + }); +} + +var isFunction = function isFunction(test) { + return typeof test === 'function'; +}; + +/** + * Provide a theme to an entire react component tree via context and event listeners (have to do + * both context and event emitter as pure components block context updates) + */ + +var ThemeProvider = function (_Component) { + inherits(ThemeProvider, _Component); + + function ThemeProvider() { + classCallCheck(this, ThemeProvider); + + var _this = possibleConstructorReturn(this, _Component.call(this)); + + _this.unsubscribeToOuterId = -1; + + _this.getTheme = _this.getTheme.bind(_this); + return _this; + } + + ThemeProvider.prototype.componentWillMount = function componentWillMount() { + var _this2 = this; + + // If there is a ThemeProvider wrapper anywhere around this theme provider, merge this theme + // with the outer theme + var outerContext = this.context[CHANNEL_NEXT]; + if (outerContext !== undefined) { + this.unsubscribeToOuterId = outerContext.subscribe(function (theme) { + _this2.outerTheme = theme; + }); + } + this.broadcast = createBroadcast(this.getTheme()); + }; + + ThemeProvider.prototype.getChildContext = function getChildContext() { + var _this3 = this, + _babelHelpers$extends; + + return _extends({}, this.context, (_babelHelpers$extends = {}, _babelHelpers$extends[CHANNEL_NEXT] = { + getTheme: this.getTheme, + subscribe: this.broadcast.subscribe, + unsubscribe: this.broadcast.unsubscribe + }, _babelHelpers$extends[CHANNEL] = function (subscriber) { + if (process.env.NODE_ENV !== 'production') { + warnChannelDeprecated(); + } + + // Patch the old `subscribe` provide via `CHANNEL` for older clients. + var unsubscribeId = _this3.broadcast.subscribe(subscriber); + return function () { + return _this3.broadcast.unsubscribe(unsubscribeId); + }; + }, _babelHelpers$extends)); + }; + + ThemeProvider.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) { + if (this.props.theme !== nextProps.theme) { + this.broadcast.publish(this.getTheme(nextProps.theme)); + } + }; + + ThemeProvider.prototype.componentWillUnmount = function componentWillUnmount() { + if (this.unsubscribeToOuterId !== -1) { + this.context[CHANNEL_NEXT].unsubscribe(this.unsubscribeToOuterId); + } + }; + + // Get the theme from the props, supporting both (outerTheme) => {} as well as object notation + + + ThemeProvider.prototype.getTheme = function getTheme(passedTheme) { + var theme = passedTheme || this.props.theme; + if (isFunction(theme)) { + var mergedTheme = theme(this.outerTheme); + if (process.env.NODE_ENV !== 'production' && !__WEBPACK_IMPORTED_MODULE_0_is_plain_object___default()(mergedTheme)) { + throw new Error('[ThemeProvider] Please return an object from your theme function, i.e. theme={() => ({})}!'); + } + return mergedTheme; + } + if (!__WEBPACK_IMPORTED_MODULE_0_is_plain_object___default()(theme)) { + throw new Error('[ThemeProvider] Please make your theme prop a plain object'); + } + return _extends({}, this.outerTheme, theme); + }; + + ThemeProvider.prototype.render = function render() { + if (!this.props.children) { + return null; + } + return __WEBPACK_IMPORTED_MODULE_2_react___default.a.Children.only(this.props.children); + }; + + return ThemeProvider; +}(__WEBPACK_IMPORTED_MODULE_2_react__["Component"]); + +ThemeProvider.childContextTypes = (_ThemeProvider$childC = {}, _ThemeProvider$childC[CHANNEL] = __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.func, _ThemeProvider$childC[CHANNEL_NEXT] = CONTEXT_CHANNEL_SHAPE, _ThemeProvider$childC); +ThemeProvider.contextTypes = (_ThemeProvider$contex = {}, _ThemeProvider$contex[CHANNEL_NEXT] = CONTEXT_CHANNEL_SHAPE, _ThemeProvider$contex); + +// + +// HACK for generating all static styles without needing to allocate +// an empty execution context every single time... +var STATIC_EXECUTION_CONTEXT = {}; + +var _StyledComponent = (function (ComponentStyle, constructWithOptions) { + var identifiers = {}; + + /* We depend on components having unique IDs */ + var generateId = function generateId(_displayName, parentComponentId) { + var displayName = typeof _displayName !== 'string' ? 'sc' : escape(_displayName); + + var componentId = void 0; + + /** + * only fall back to hashing the component injection order if + * a proper displayName isn't provided by the babel plugin + */ + if (!_displayName) { + var nr = (identifiers[displayName] || 0) + 1; + identifiers[displayName] = nr; + + componentId = displayName + '-' + ComponentStyle.generateName(displayName + nr); + } else { + componentId = displayName + '-' + ComponentStyle.generateName(displayName); + } + + return parentComponentId !== undefined ? parentComponentId + '-' + componentId : componentId; + }; + + var BaseStyledComponent = function (_Component) { + inherits(BaseStyledComponent, _Component); + + function BaseStyledComponent() { + var _temp, _this, _ret; + + classCallCheck(this, BaseStyledComponent); + + for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + return _ret = (_temp = (_this = possibleConstructorReturn(this, _Component.call.apply(_Component, [this].concat(args))), _this), _this.attrs = {}, _this.state = { + theme: null, + generatedClassName: '' + }, _this.unsubscribeId = -1, _temp), possibleConstructorReturn(_this, _ret); + } + + BaseStyledComponent.prototype.unsubscribeFromContext = function unsubscribeFromContext() { + if (this.unsubscribeId !== -1) { + this.context[CHANNEL_NEXT].unsubscribe(this.unsubscribeId); + } + }; + + BaseStyledComponent.prototype.buildExecutionContext = function buildExecutionContext(theme, props) { + var attrs = this.constructor.attrs; + + var context = _extends({}, props, { theme: theme }); + if (attrs === undefined) { + return context; + } + + this.attrs = Object.keys(attrs).reduce(function (acc, key) { + var attr = attrs[key]; + // eslint-disable-next-line no-param-reassign + acc[key] = typeof attr === 'function' ? attr(context) : attr; + return acc; + }, {}); + + return _extends({}, context, this.attrs); + }; + + BaseStyledComponent.prototype.generateAndInjectStyles = function generateAndInjectStyles(theme, props) { + var _constructor = this.constructor, + attrs = _constructor.attrs, + componentStyle = _constructor.componentStyle, + warnTooManyClasses = _constructor.warnTooManyClasses; + + var styleSheet = this.context[CONTEXT_KEY] || StyleSheet.instance; + + // staticaly styled-components don't need to build an execution context object, + // and shouldn't be increasing the number of class names + if (componentStyle.isStatic && attrs === undefined) { + return componentStyle.generateAndInjectStyles(STATIC_EXECUTION_CONTEXT, styleSheet); + } else { + var executionContext = this.buildExecutionContext(theme, props); + var className = componentStyle.generateAndInjectStyles(executionContext, styleSheet); + + if (process.env.NODE_ENV !== 'production' && warnTooManyClasses !== undefined) { + warnTooManyClasses(className); + } + + return className; + } + }; + + BaseStyledComponent.prototype.componentWillMount = function componentWillMount() { + var _this2 = this; + + var componentStyle = this.constructor.componentStyle; + + var styledContext = this.context[CHANNEL_NEXT]; + + // If this is a staticaly-styled component, we don't need to the theme + // to generate or build styles. + if (componentStyle.isStatic) { + var generatedClassName = this.generateAndInjectStyles(STATIC_EXECUTION_CONTEXT, this.props); + this.setState({ generatedClassName: generatedClassName }); + // If there is a theme in the context, subscribe to the event emitter. This + // is necessary due to pure components blocking context updates, this circumvents + // that by updating when an event is emitted + } else if (styledContext !== undefined) { + var subscribe = styledContext.subscribe; + + this.unsubscribeId = subscribe(function (nextTheme) { + // This will be called once immediately + var theme = determineTheme(_this2.props, nextTheme, _this2.constructor.defaultProps); + var generatedClassName = _this2.generateAndInjectStyles(theme, _this2.props); + + _this2.setState({ theme: theme, generatedClassName: generatedClassName }); + }); + } else { + // eslint-disable-next-line react/prop-types + var theme = this.props.theme || {}; + var _generatedClassName = this.generateAndInjectStyles(theme, this.props); + this.setState({ theme: theme, generatedClassName: _generatedClassName }); + } + }; + + BaseStyledComponent.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) { + var _this3 = this; + + // If this is a staticaly-styled component, we don't need to listen to + // props changes to update styles + var componentStyle = this.constructor.componentStyle; + + if (componentStyle.isStatic) { + return; + } + + this.setState(function (oldState) { + var theme = determineTheme(nextProps, oldState.theme, _this3.constructor.defaultProps); + var generatedClassName = _this3.generateAndInjectStyles(theme, nextProps); + + return { theme: theme, generatedClassName: generatedClassName }; + }); + }; + + BaseStyledComponent.prototype.componentWillUnmount = function componentWillUnmount() { + this.unsubscribeFromContext(); + }; + + BaseStyledComponent.prototype.render = function render() { + var _this4 = this; + + // eslint-disable-next-line react/prop-types + var innerRef = this.props.innerRef; + var generatedClassName = this.state.generatedClassName; + var _constructor2 = this.constructor, + styledComponentId = _constructor2.styledComponentId, + target = _constructor2.target; + + + var isTargetTag = isTag(target); + + var className = [ + // eslint-disable-next-line react/prop-types + this.props.className, styledComponentId, this.attrs.className, generatedClassName].filter(Boolean).join(' '); + + var baseProps = _extends({}, this.attrs, { + className: className + }); + + if (isStyledComponent(target)) { + baseProps.innerRef = innerRef; + } else { + baseProps.ref = innerRef; + } + + var propsForElement = Object.keys(this.props).reduce(function (acc, propName) { + // Don't pass through non HTML tags through to HTML elements + // always omit innerRef + if (propName !== 'innerRef' && propName !== 'className' && (!isTargetTag || validAttr(propName))) { + // eslint-disable-next-line no-param-reassign + acc[propName] = _this4.props[propName]; + } + + return acc; + }, baseProps); + + return Object(__WEBPACK_IMPORTED_MODULE_2_react__["createElement"])(target, propsForElement); + }; + + return BaseStyledComponent; + }(__WEBPACK_IMPORTED_MODULE_2_react__["Component"]); + + var createStyledComponent = function createStyledComponent(target, options, rules) { + var _StyledComponent$cont; + + var _options$displayName = options.displayName, + displayName = _options$displayName === undefined ? isTag(target) ? 'styled.' + target : 'Styled(' + getComponentName(target) + ')' : _options$displayName, + _options$componentId = options.componentId, + componentId = _options$componentId === undefined ? generateId(options.displayName, options.parentComponentId) : _options$componentId, + _options$ParentCompon = options.ParentComponent, + ParentComponent = _options$ParentCompon === undefined ? BaseStyledComponent : _options$ParentCompon, + extendingRules = options.rules, + attrs = options.attrs; + + + var styledComponentId = options.displayName && options.componentId ? escape(options.displayName) + '-' + options.componentId : componentId; + + var componentStyle = new ComponentStyle(extendingRules === undefined ? rules : extendingRules.concat(rules), attrs, styledComponentId); + + var StyledComponent = function (_ParentComponent) { + inherits(StyledComponent, _ParentComponent); + + function StyledComponent() { + classCallCheck(this, StyledComponent); + return possibleConstructorReturn(this, _ParentComponent.apply(this, arguments)); + } + + StyledComponent.withComponent = function withComponent(tag) { + var previousComponentId = options.componentId, + optionsToCopy = objectWithoutProperties(options, ['componentId']); + + + var newComponentId = previousComponentId && previousComponentId + '-' + (isTag(tag) ? tag : escape(getComponentName(tag))); + + var newOptions = _extends({}, optionsToCopy, { + componentId: newComponentId, + ParentComponent: StyledComponent + }); + + return createStyledComponent(tag, newOptions, rules); + }; + + createClass(StyledComponent, null, [{ + key: 'extend', + get: function get$$1() { + var rulesFromOptions = options.rules, + parentComponentId = options.componentId, + optionsToCopy = objectWithoutProperties(options, ['rules', 'componentId']); + + + var newRules = rulesFromOptions === undefined ? rules : rulesFromOptions.concat(rules); + + var newOptions = _extends({}, optionsToCopy, { + rules: newRules, + parentComponentId: parentComponentId, + ParentComponent: StyledComponent + }); + + return constructWithOptions(createStyledComponent, target, newOptions); + } + }]); + return StyledComponent; + }(ParentComponent); + + StyledComponent.contextTypes = (_StyledComponent$cont = {}, _StyledComponent$cont[CHANNEL] = __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.func, _StyledComponent$cont[CHANNEL_NEXT] = CONTEXT_CHANNEL_SHAPE, _StyledComponent$cont[CONTEXT_KEY] = __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.instanceOf(StyleSheet), __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.instanceOf(ServerStyleSheet)]), _StyledComponent$cont); + StyledComponent.displayName = displayName; + StyledComponent.styledComponentId = styledComponentId; + StyledComponent.attrs = attrs; + StyledComponent.componentStyle = componentStyle; + StyledComponent.target = target; + + + if (process.env.NODE_ENV !== 'production') { + StyledComponent.warnTooManyClasses = createWarnTooManyClasses(displayName); + } + + return StyledComponent; + }; + + return createStyledComponent; +}); + +// murmurhash2 via https://gist.github.com/raycmorgan/588423 + +function doHash(str, seed) { + var m = 0x5bd1e995; + var r = 24; + var h = seed ^ str.length; + var length = str.length; + var currentIndex = 0; + + while (length >= 4) { + var k = UInt32(str, currentIndex); + + k = Umul32(k, m); + k ^= k >>> r; + k = Umul32(k, m); + + h = Umul32(h, m); + h ^= k; + + currentIndex += 4; + length -= 4; + } + + switch (length) { + case 3: + h ^= UInt16(str, currentIndex); + h ^= str.charCodeAt(currentIndex + 2) << 16; + h = Umul32(h, m); + break; + + case 2: + h ^= UInt16(str, currentIndex); + h = Umul32(h, m); + break; + + case 1: + h ^= str.charCodeAt(currentIndex); + h = Umul32(h, m); + break; + } + + h ^= h >>> 13; + h = Umul32(h, m); + h ^= h >>> 15; + + return h >>> 0; +} + +function UInt32(str, pos) { + return str.charCodeAt(pos++) + (str.charCodeAt(pos++) << 8) + (str.charCodeAt(pos++) << 16) + (str.charCodeAt(pos) << 24); +} + +function UInt16(str, pos) { + return str.charCodeAt(pos++) + (str.charCodeAt(pos++) << 8); +} + +function Umul32(n, m) { + n = n | 0; + m = m | 0; + var nlo = n & 0xffff; + var nhi = n >>> 16; + var res = nlo * m + ((nhi * m & 0xffff) << 16) | 0; + return res; +} + +// +var isStaticRules = function isStaticRules(rules, attrs) { + for (var i = 0; i < rules.length; i += 1) { + var rule = rules[i]; + + // recursive case + if (Array.isArray(rule) && !isStaticRules(rule)) { + return false; + } else if (typeof rule === 'function' && !isStyledComponent(rule)) { + // functions are allowed to be static if they're just being + // used to get the classname of a nested styled copmonent + return false; + } + } + + if (attrs !== undefined) { + // eslint-disable-next-line guard-for-in, no-restricted-syntax + for (var key in attrs) { + var value = attrs[key]; + if (typeof value === 'function') { + return false; + } + } + } + + return true; +}; + +var isHRMEnabled = typeof module !== 'undefined' && module.hot && process.env.NODE_ENV !== 'production'; + +/* + ComponentStyle is all the CSS-specific stuff, not + the React-specific stuff. + */ +var _ComponentStyle = (function (nameGenerator, flatten, stringifyRules) { + var ComponentStyle = function () { + function ComponentStyle(rules, attrs, componentId) { + classCallCheck(this, ComponentStyle); + + this.rules = rules; + this.isStatic = !isHRMEnabled && isStaticRules(rules, attrs); + this.componentId = componentId; + if (!StyleSheet.instance.hasInjectedComponent(this.componentId)) { + var placeholder = process.env.NODE_ENV !== 'production' ? '.' + componentId + ' {}' : ''; + StyleSheet.instance.deferredInject(componentId, true, placeholder); + } + } + + /* + * Flattens a rule set into valid CSS + * Hashes it, wraps the whole chunk in a .hash1234 {} + * Returns the hash to be injected on render() + * */ + + + ComponentStyle.prototype.generateAndInjectStyles = function generateAndInjectStyles(executionContext, styleSheet) { + var isStatic = this.isStatic, + lastClassName = this.lastClassName; + + if (isStatic && lastClassName !== undefined) { + return lastClassName; + } + + var flatCSS = flatten(this.rules, executionContext); + var hash = doHash(this.componentId + flatCSS.join('')); + + var existingName = styleSheet.getName(hash); + if (existingName !== undefined) { + if (styleSheet.stylesCacheable) { + this.lastClassName = existingName; + } + return existingName; + } + + var name = nameGenerator(hash); + if (styleSheet.stylesCacheable) { + this.lastClassName = existingName; + } + if (styleSheet.alreadyInjected(hash, name)) { + return name; + } + + var css = '\n' + stringifyRules(flatCSS, '.' + name); + // NOTE: this can only be set when we inject the class-name. + // For some reason, presumably due to how css is stringifyRules behaves in + // differently between client and server, styles break. + styleSheet.inject(this.componentId, true, css, hash, name); + return name; + }; + + ComponentStyle.generateName = function generateName(str) { + return nameGenerator(doHash(str)); + }; + + return ComponentStyle; + }(); + + return ComponentStyle; +}); + +// +// Thanks to ReactDOMFactories for this handy list! + +var domElements = ['a', 'abbr', 'address', 'area', 'article', 'aside', 'audio', 'b', 'base', 'bdi', 'bdo', 'big', 'blockquote', 'body', 'br', 'button', 'canvas', 'caption', 'cite', 'code', 'col', 'colgroup', 'data', 'datalist', 'dd', 'del', 'details', 'dfn', 'dialog', 'div', 'dl', 'dt', 'em', 'embed', 'fieldset', 'figcaption', 'figure', 'footer', 'form', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'header', 'hgroup', 'hr', 'html', 'i', 'iframe', 'img', 'input', 'ins', 'kbd', 'keygen', 'label', 'legend', 'li', 'link', 'main', 'map', 'mark', 'marquee', 'menu', 'menuitem', 'meta', 'meter', 'nav', 'noscript', 'object', 'ol', 'optgroup', 'option', 'output', 'p', 'param', 'picture', 'pre', 'progress', 'q', 'rp', 'rt', 'ruby', 's', 'samp', 'script', 'section', 'select', 'small', 'source', 'span', 'strong', 'style', 'sub', 'summary', 'sup', 'table', 'tbody', 'td', 'textarea', 'tfoot', 'th', 'thead', 'time', 'title', 'tr', 'track', 'u', 'ul', 'var', 'video', 'wbr', + +// SVG +'circle', 'clipPath', 'defs', 'ellipse', 'g', 'image', 'line', 'linearGradient', 'mask', 'path', 'pattern', 'polygon', 'polyline', 'radialGradient', 'rect', 'stop', 'svg', 'text', 'tspan']; + +// + +var _styled = (function (styledComponent, constructWithOptions) { + var styled = function styled(tag) { + return constructWithOptions(styledComponent, tag); + }; + + // Shorthands for all valid HTML Elements + domElements.forEach(function (domElement) { + styled[domElement] = styled(domElement); + }); + + return styled; +}); + +// +var replaceWhitespace = function replaceWhitespace(str) { + return str.replace(/\s|\\n/g, ''); +}; + +var _keyframes = (function (nameGenerator, stringifyRules, css) { + return function (strings) { + for (var _len = arguments.length, interpolations = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + interpolations[_key - 1] = arguments[_key]; + } + + var rules = css.apply(undefined, [strings].concat(interpolations)); + var hash = doHash(replaceWhitespace(JSON.stringify(rules))); + + var existingName = StyleSheet.instance.getName(hash); + if (existingName) return existingName; + + var name = nameGenerator(hash); + if (StyleSheet.instance.alreadyInjected(hash, name)) return name; + + var generatedCSS = stringifyRules(rules, name, '@keyframes'); + StyleSheet.instance.inject('sc-keyframes-' + name, true, generatedCSS, hash, name); + return name; + }; +}); + +// +var _injectGlobal = (function (stringifyRules, css) { + var injectGlobal = function injectGlobal(strings) { + for (var _len = arguments.length, interpolations = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + interpolations[_key - 1] = arguments[_key]; + } + + var rules = css.apply(undefined, [strings].concat(interpolations)); + var hash = doHash(JSON.stringify(rules)); + + var componentId = 'sc-global-' + hash; + if (StyleSheet.instance.hasInjectedComponent(componentId)) return; + + StyleSheet.instance.inject(componentId, false, stringifyRules(rules)); + }; + + return injectGlobal; +}); + +// + + +var _constructWithOptions = (function (css) { + var constructWithOptions = function constructWithOptions(componentConstructor, tag) { + var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; + + if (process.env.NODE_ENV !== 'production' && typeof tag !== 'string' && typeof tag !== 'function') { + // $FlowInvalidInputTest + throw new Error('Cannot create styled-component for component: ' + tag); + } + + /* This is callable directly as a template function */ + var templateFunction = function templateFunction(strings) { + for (var _len = arguments.length, interpolations = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + interpolations[_key - 1] = arguments[_key]; + } + + return componentConstructor(tag, options, css.apply(undefined, [strings].concat(interpolations))); + }; + + /* If config methods are called, wrap up a new template function and merge options */ + templateFunction.withConfig = function (config) { + return constructWithOptions(componentConstructor, tag, _extends({}, options, config)); + }; + templateFunction.attrs = function (attrs) { + return constructWithOptions(componentConstructor, tag, _extends({}, options, { + attrs: _extends({}, options.attrs || {}, attrs) + })); + }; + + return templateFunction; + }; + + return constructWithOptions; +}); + +// +/* globals ReactClass */ + +var wrapWithTheme = function wrapWithTheme(Component$$1) { + var _WithTheme$contextTyp; + + var componentName = Component$$1.displayName || Component$$1.name || 'Component'; + + var shouldSetInnerRef = isStyledComponent(Component$$1) || + // NOTE: We can't pass a ref to a stateless functional component + typeof Component$$1 === 'function' && !(Component$$1.prototype && 'isReactComponent' in Component$$1.prototype); + + var WithTheme = function (_React$Component) { + inherits(WithTheme, _React$Component); + + function WithTheme() { + var _temp, _this, _ret; + + classCallCheck(this, WithTheme); + + for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + return _ret = (_temp = (_this = possibleConstructorReturn(this, _React$Component.call.apply(_React$Component, [this].concat(args))), _this), _this.state = {}, _this.unsubscribeId = -1, _temp), possibleConstructorReturn(_this, _ret); + } + + // NOTE: This is so that isStyledComponent passes for the innerRef unwrapping + + + WithTheme.prototype.componentWillMount = function componentWillMount() { + var _this2 = this; + + var defaultProps = this.constructor.defaultProps; + + var styledContext = this.context[CHANNEL_NEXT]; + var themeProp = determineTheme(this.props, undefined, defaultProps); + if (styledContext === undefined && themeProp === undefined && process.env.NODE_ENV !== 'production') { + // eslint-disable-next-line no-console + console.warn('[withTheme] You are not using a ThemeProvider nor passing a theme prop or a theme in defaultProps'); + } else if (styledContext === undefined && themeProp !== undefined) { + this.setState({ theme: themeProp }); + } else { + var subscribe = styledContext.subscribe; + + this.unsubscribeId = subscribe(function (nextTheme) { + var theme = determineTheme(_this2.props, nextTheme, defaultProps); + _this2.setState({ theme: theme }); + }); + } + }; + + WithTheme.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) { + var defaultProps = this.constructor.defaultProps; + + this.setState(function (oldState) { + var theme = determineTheme(nextProps, oldState.theme, defaultProps); + + return { theme: theme }; + }); + }; + + WithTheme.prototype.componentWillUnmount = function componentWillUnmount() { + if (this.unsubscribeId !== -1) { + this.context[CHANNEL_NEXT].unsubscribe(this.unsubscribeId); + } + }; + + WithTheme.prototype.render = function render() { + // eslint-disable-next-line react/prop-types + var innerRef = this.props.innerRef; + var theme = this.state.theme; + + + return __WEBPACK_IMPORTED_MODULE_2_react___default.a.createElement(Component$$1, _extends({ + theme: theme + }, this.props, { + innerRef: shouldSetInnerRef ? innerRef : undefined, + ref: shouldSetInnerRef ? undefined : innerRef + })); + }; + + return WithTheme; + }(__WEBPACK_IMPORTED_MODULE_2_react___default.a.Component); + + WithTheme.displayName = 'WithTheme(' + componentName + ')'; + WithTheme.styledComponentId = 'withTheme'; + WithTheme.contextTypes = (_WithTheme$contextTyp = {}, _WithTheme$contextTyp[CHANNEL] = __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.func, _WithTheme$contextTyp[CHANNEL_NEXT] = CONTEXT_CHANNEL_SHAPE, _WithTheme$contextTyp); + + + return __WEBPACK_IMPORTED_MODULE_4_hoist_non_react_statics___default()(WithTheme, Component$$1); +}; + +// + +/* Import singletons */ +/* Import singleton constructors */ +/* Import components */ +/* Import Higher Order Components */ +/* Instantiate singletons */ +var ComponentStyle = _ComponentStyle(generateAlphabeticName, flatten, stringifyRules); +var constructWithOptions = _constructWithOptions(css); +var StyledComponent = _StyledComponent(ComponentStyle, constructWithOptions); + +/* Instantiate exported singletons */ +var keyframes = _keyframes(generateAlphabeticName, stringifyRules, css); +var injectGlobal = _injectGlobal(stringifyRules, css); +var styled = _styled(StyledComponent, constructWithOptions); + +/* harmony default export */ __webpack_exports__["default"] = (styled); + +/* WEBPACK VAR INJECTION */}.call(__webpack_exports__, __webpack_require__(0), __webpack_require__(99)(module))) + +/***/ }), +/* 6 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +var colors = exports.colors = { + primaryText: '#4A4A4A', + bodyColor: '#E2E7EA', + secondaryText: '#787878', + borderGray: '#D1D9DD', + green: '#8BC34A', + red: '#F44336', + white: '#FFFFFF', + cardWhite: '#FAFAFA', + lightGray: '#EEEEEE' +}; + +var fonts = exports.fonts = { + latoRegular: 'latoregular', + latoBold: 'latobold', + arial: 'Arial' +}; + +var shadows = exports.shadows = { + shadow01: '0 3px 6px 0 rgba(0,0,0,0.16)', + shadow02: '0 4px 5px 0 rgba(0,0,0,0.14), 0 1px 10px 0 rgba(0,0,0,0.12), 0 2px 4px -1px rgba(0,0,0,0.3)' +}; + +/***/ }), +/* 7 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(process) {/** + * 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__(4); + +var DOMProperty = __webpack_require__(17); +var ReactDOMComponentFlags = __webpack_require__(70); + +var invariant = __webpack_require__(1); + +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; +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) + +/***/ }), +/* 8 */ +/***/ (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; +}; + + +/***/ }), +/* 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. + * + */ + + + +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; + +/***/ }), +/* 10 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__components_Provider__ = __webpack_require__(212); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__components_connectAdvanced__ = __webpack_require__(96); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__connect_connect__ = __webpack_require__(217); +/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "Provider", function() { return __WEBPACK_IMPORTED_MODULE_0__components_Provider__["b"]; }); +/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "createProvider", function() { return __WEBPACK_IMPORTED_MODULE_0__components_Provider__["a"]; }); +/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "connectAdvanced", function() { return __WEBPACK_IMPORTED_MODULE_1__components_connectAdvanced__["a"]; }); +/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "connect", function() { return __WEBPACK_IMPORTED_MODULE_2__connect_connect__["a"]; }); + + + + + + +/***/ }), +/* 11 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(process) {/** + * 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__(22); + +var ReactCurrentOwner = __webpack_require__(14); + +var invariant = __webpack_require__(1); +var warning = __webpack_require__(3); + +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; +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(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. + * + * + */ + +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; + +/***/ }), +/* 13 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(process) {/** + * 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__(137); + debugTool = ReactDebugTool; +} + +module.exports = { debugTool: debugTool }; +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) + +/***/ }), +/* 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. + * + * + */ + + + +/** + * 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; + +/***/ }), +/* 15 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(process) {/** + * 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__(4), + _assign = __webpack_require__(8); + +var CallbackQueue = __webpack_require__(74); +var PooledClass = __webpack_require__(20); +var ReactFeatureFlags = __webpack_require__(75); +var ReactReconciler = __webpack_require__(23); +var Transaction = __webpack_require__(34); + +var invariant = __webpack_require__(1); + +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; +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) + +/***/ }), +/* 16 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(process) {/** + * 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__(8); + +var PooledClass = __webpack_require__(20); + +var emptyFunction = __webpack_require__(12); +var warning = __webpack_require__(3); + +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; + } +} +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) + +/***/ }), +/* 17 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(process) {/** + * 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__(4); + +var invariant = __webpack_require__(1); + +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; +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) + +/***/ }), +/* 18 */ +/***/ (function(module, exports, __webpack_require__) { + +/* WEBPACK VAR INJECTION */(function(process) {/** + * 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. + */ + +if (process.env.NODE_ENV !== 'production') { + var REACT_ELEMENT_TYPE = (typeof Symbol === 'function' && + Symbol.for && + Symbol.for('react.element')) || + 0xeac7; + + var isValidElement = function(object) { + return typeof object === 'object' && + object !== null && + object.$$typeof === REACT_ELEMENT_TYPE; + }; + + // By explicitly using `prop-types` you are opting into new development behavior. + // http://fb.me/prop-types-in-prod + var throwOnDirectAccess = true; + module.exports = __webpack_require__(68)(isValidElement, throwOnDirectAccess); +} else { + // By explicitly using `prop-types` you are opting into new production behavior. + // http://fb.me/prop-types-in-prod + module.exports = __webpack_require__(213)(); +} + +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) + +/***/ }), +/* 19 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(process) {/** + * 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__(39); + +var ReactCurrentOwner = __webpack_require__(14); + +var warning = __webpack_require__(3); +var canDefineProperty = __webpack_require__(30); +var hasOwnProperty = Object.prototype.hasOwnProperty; + +var REACT_ELEMENT_TYPE = __webpack_require__(64); + +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; +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) + +/***/ }), +/* 20 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(process) {/** + * 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__(4); + +var invariant = __webpack_require__(1); + +/** + * 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; +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) + +/***/ }), +/* 21 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(process) {/** + * 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__(39); + +var ReactBaseClasses = __webpack_require__(62); +var ReactChildren = __webpack_require__(112); +var ReactDOMFactories = __webpack_require__(116); +var ReactElement = __webpack_require__(19); +var ReactPropTypes = __webpack_require__(120); +var ReactVersion = __webpack_require__(123); + +var createReactClass = __webpack_require__(124); +var onlyChild = __webpack_require__(126); + +var createElement = ReactElement.createElement; +var createFactory = ReactElement.createFactory; +var cloneElement = ReactElement.cloneElement; + +if (process.env.NODE_ENV !== 'production') { + var lowPriorityWarning = __webpack_require__(40); + var canDefineProperty = __webpack_require__(30); + var ReactElementValidator = __webpack_require__(66); + 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; +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) + +/***/ }), +/* 22 */ +/***/ (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; + +/***/ }), +/* 23 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(process) {/** + * 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__(135); +var ReactInstrumentation = __webpack_require__(13); + +var warning = __webpack_require__(3); + +/** + * 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; +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) + +/***/ }), +/* 24 */ +/***/ (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__(48); +var setInnerHTML = __webpack_require__(36); + +var createMicrosoftUnsafeLocalFunction = __webpack_require__(49); +var setTextContent = __webpack_require__(79); + +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 plugins (like Flash Player) will read + // nodes immediately upon insertion into the DOM, so + // must also be populated prior to insertion into the DOM. + if (tree.node.nodeType === DOCUMENT_FRAGMENT_NODE_TYPE || tree.node.nodeType === ELEMENT_NODE_TYPE && tree.node.nodeName.toLowerCase() === 'object' && (tree.node.namespaceURI == null || tree.node.namespaceURI === DOMNamespaces.html)) { + insertTreeChildren(tree); + parentNode.insertBefore(tree.node, referenceNode); + } else { + parentNode.insertBefore(tree.node, referenceNode); + insertTreeChildren(tree); + } +}); + +function replaceChildWithTree(oldNode, newTree) { + oldNode.parentNode.replaceChild(newTree.node, oldNode); + insertTreeChildren(newTree); +} + +function queueChild(parentTree, childTree) { + if (enableLazy) { + parentTree.children.push(childTree); + } else { + parentTree.node.appendChild(childTree.node); + } +} + +function queueHTML(tree, html) { + if (enableLazy) { + tree.html = html; + } else { + setInnerHTML(tree.node, html); + } +} + +function queueText(tree, text) { + if (enableLazy) { + tree.text = text; + } else { + setTextContent(tree.node, text); + } +} + +function toString() { + return this.node.nodeName; +} + +function DOMLazyTree(node) { + return { + node: node, + children: [], + html: null, + text: null, + toString: toString + }; +} + +DOMLazyTree.insertTreeBefore = insertTreeBefore; +DOMLazyTree.replaceChildWithTree = replaceChildWithTree; +DOMLazyTree.queueChild = queueChild; +DOMLazyTree.queueHTML = queueHTML; +DOMLazyTree.queueText = queueText; + +module.exports = DOMLazyTree; + +/***/ }), +/* 25 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +var filterTests = exports.filterTests = function filterTests(status) { + return { + type: 'FILTER_TESTS', + status: status + }; +}; + +var findTests = exports.findTests = function findTests(value) { + return { + type: 'SEARCH_TESTS', + value: value + }; +}; + +var updateSettings = exports.updateSettings = function updateSettings(id) { + return { + type: 'UPDATE_SETTINGS', + id: id + }; +}; + +var toggleAllImages = exports.toggleAllImages = function toggleAllImages(value) { + return { + type: 'TOGGLE_ALL_IMAGES', + value: value + }; +}; + +var openModal = exports.openModal = function openModal(value) { + return { + type: 'OPEN_SCRUBBER_MODAL', + value: value + }; +}; + +var closeModal = exports.closeModal = function closeModal(value) { + return { + type: 'CLOSE_SCRUBBER_MODAL', + value: value + }; +}; + +var showScrubberTestImage = exports.showScrubberTestImage = function showScrubberTestImage(value) { + return { + type: 'SHOW_SCRUBBER_TEST_IMAGE', + value: value + }; +}; + +var showScrubberRefImage = exports.showScrubberRefImage = function showScrubberRefImage(value) { + return { + type: 'SHOW_SCRUBBER_REF_IMAGE', + value: value + }; +}; + +var showScrubberDiffImage = exports.showScrubberDiffImage = function showScrubberDiffImage(value) { + return { + type: 'SHOW_SCRUBBER_DIFF_IMAGE', + value: value + }; +}; + +var showScrubberDivergedImage = exports.showScrubberDivergedImage = function showScrubberDivergedImage(value) { + return { + type: 'SHOW_SCRUBBER_DIVERGED_IMAGE', + value: value + }; +}; + +var showScrubber = exports.showScrubber = function showScrubber(value) { + return { + type: 'SHOW_SCRUBBER', + value: value + }; +}; + +/***/ }), +/* 26 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(process) {/** + * 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 EventPluginHub = __webpack_require__(27); +var EventPluginUtils = __webpack_require__(42); + +var accumulateInto = __webpack_require__(71); +var forEachAccumulated = __webpack_require__(72); +var warning = __webpack_require__(3); + +var getListener = EventPluginHub.getListener; + +/** + * Some event types have a notion of different registration names for different + * "phases" of propagation. This finds listeners by a given phase. + */ +function listenerAtPhase(inst, event, propagationPhase) { + var registrationName = event.dispatchConfig.phasedRegistrationNames[propagationPhase]; + return getListener(inst, registrationName); +} + +/** + * Tags a `SyntheticEvent` with dispatched listeners. Creating this function + * here, allows us to not have to bind or create functions for each event. + * Mutating the event's members allows us to not have to create a wrapping + * "dispatch" object that pairs the event with the listener. + */ +function accumulateDirectionalDispatches(inst, phase, event) { + if (process.env.NODE_ENV !== 'production') { + process.env.NODE_ENV !== 'production' ? warning(inst, 'Dispatching inst must not be null') : void 0; + } + var listener = listenerAtPhase(inst, event, phase); + if (listener) { + event._dispatchListeners = accumulateInto(event._dispatchListeners, listener); + event._dispatchInstances = accumulateInto(event._dispatchInstances, inst); + } +} + +/** + * Collect dispatches (must be entirely collected before dispatching - see unit + * tests). Lazily allocate the array to conserve memory. We must loop through + * each event and perform the traversal for each one. We cannot perform a + * single traversal for the entire collection of events because each event may + * have a different target. + */ +function accumulateTwoPhaseDispatchesSingle(event) { + if (event && event.dispatchConfig.phasedRegistrationNames) { + EventPluginUtils.traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event); + } +} + +/** + * Same as `accumulateTwoPhaseDispatchesSingle`, but skips over the targetID. + */ +function accumulateTwoPhaseDispatchesSingleSkipTarget(event) { + if (event && event.dispatchConfig.phasedRegistrationNames) { + var targetInst = event._targetInst; + var parentInst = targetInst ? EventPluginUtils.getParentInstance(targetInst) : null; + EventPluginUtils.traverseTwoPhase(parentInst, accumulateDirectionalDispatches, event); + } +} + +/** + * Accumulates without regard to direction, does not look for phased + * registration names. Same as `accumulateDirectDispatchesSingle` but without + * requiring that the `dispatchMarker` be the same as the dispatched ID. + */ +function accumulateDispatches(inst, ignoredDirection, event) { + if (event && event.dispatchConfig.registrationName) { + var registrationName = event.dispatchConfig.registrationName; + var listener = getListener(inst, registrationName); + if (listener) { + event._dispatchListeners = accumulateInto(event._dispatchListeners, listener); + event._dispatchInstances = accumulateInto(event._dispatchInstances, inst); + } + } +} + +/** + * Accumulates dispatches on an `SyntheticEvent`, but only for the + * `dispatchMarker`. + * @param {SyntheticEvent} event + */ +function accumulateDirectDispatchesSingle(event) { + if (event && event.dispatchConfig.registrationName) { + accumulateDispatches(event._targetInst, null, event); + } +} + +function accumulateTwoPhaseDispatches(events) { + forEachAccumulated(events, accumulateTwoPhaseDispatchesSingle); +} + +function accumulateTwoPhaseDispatchesSkipTarget(events) { + forEachAccumulated(events, accumulateTwoPhaseDispatchesSingleSkipTarget); +} + +function accumulateEnterLeaveDispatches(leave, enter, from, to) { + EventPluginUtils.traverseEnterLeave(from, to, accumulateDispatches, leave, enter); +} + +function accumulateDirectDispatches(events) { + forEachAccumulated(events, accumulateDirectDispatchesSingle); +} + +/** + * A small set of propagation patterns, each of which will accept a small amount + * of information, and generate a set of "dispatch ready event objects" - which + * are sets of events that have already been annotated with a set of dispatched + * listener functions/ids. The API is designed this way to discourage these + * propagation strategies from actually executing the dispatches, since we + * always want to collect the entire set of dispatches before executing event a + * single one. + * + * @constructor EventPropagators + */ +var EventPropagators = { + accumulateTwoPhaseDispatches: accumulateTwoPhaseDispatches, + accumulateTwoPhaseDispatchesSkipTarget: accumulateTwoPhaseDispatchesSkipTarget, + accumulateDirectDispatches: accumulateDirectDispatches, + accumulateEnterLeaveDispatches: accumulateEnterLeaveDispatches +}; + +module.exports = EventPropagators; +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) + +/***/ }), +/* 27 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(process) {/** + * 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__(4); + +var EventPluginRegistry = __webpack_require__(33); +var EventPluginUtils = __webpack_require__(42); +var ReactErrorUtils = __webpack_require__(43); + +var accumulateInto = __webpack_require__(71); +var forEachAccumulated = __webpack_require__(72); +var invariant = __webpack_require__(1); + +/** + * Internal store for event listeners + */ +var listenerBank = {}; + +/** + * Internal queue of events that have accumulated their dispatches and are + * waiting to have their dispatches executed. + */ +var eventQueue = null; + +/** + * Dispatches an event and releases it back into the pool, unless persistent. + * + * @param {?object} event Synthetic event to be dispatched. + * @param {boolean} simulated If the event is simulated (changes exn behavior) + * @private + */ +var executeDispatchesAndRelease = function (event, simulated) { + if (event) { + EventPluginUtils.executeDispatchesInOrder(event, simulated); + + if (!event.isPersistent()) { + event.constructor.release(event); + } + } +}; +var executeDispatchesAndReleaseSimulated = function (e) { + return executeDispatchesAndRelease(e, true); +}; +var executeDispatchesAndReleaseTopLevel = function (e) { + return executeDispatchesAndRelease(e, false); +}; + +var getDictionaryKey = function (inst) { + // Prevents V8 performance issue: + // https://github.com/facebook/react/pull/7232 + return '.' + inst._rootNodeID; +}; + +function isInteractive(tag) { + return tag === 'button' || tag === 'input' || tag === 'select' || tag === 'textarea'; +} + +function shouldPreventMouseEvent(name, type, props) { + switch (name) { + case 'onClick': + case 'onClickCapture': + case 'onDoubleClick': + case 'onDoubleClickCapture': + case 'onMouseDown': + case 'onMouseDownCapture': + case 'onMouseMove': + case 'onMouseMoveCapture': + case 'onMouseUp': + case 'onMouseUpCapture': + return !!(props.disabled && isInteractive(type)); + default: + return false; + } +} + +/** + * This is a unified interface for event plugins to be installed and configured. + * + * Event plugins can implement the following properties: + * + * `extractEvents` {function(string, DOMEventTarget, string, object): *} + * Required. When a top-level event is fired, this method is expected to + * extract synthetic events that will in turn be queued and dispatched. + * + * `eventTypes` {object} + * Optional, plugins that fire events must publish a mapping of registration + * names that are used to register listeners. Values of this mapping must + * be objects that contain `registrationName` or `phasedRegistrationNames`. + * + * `executeDispatch` {function(object, function, string)} + * Optional, allows plugins to override how an event gets dispatched. By + * default, the listener is simply invoked. + * + * Each plugin that is injected into `EventsPluginHub` is immediately operable. + * + * @public + */ +var EventPluginHub = { + /** + * Methods for injecting dependencies. + */ + injection: { + /** + * @param {array} InjectedEventPluginOrder + * @public + */ + injectEventPluginOrder: EventPluginRegistry.injectEventPluginOrder, + + /** + * @param {object} injectedNamesToPlugins Map from names to plugin modules. + */ + injectEventPluginsByName: EventPluginRegistry.injectEventPluginsByName + }, + + /** + * Stores `listener` at `listenerBank[registrationName][key]`. Is idempotent. + * + * @param {object} inst The instance, which is the source of events. + * @param {string} registrationName Name of listener (e.g. `onClick`). + * @param {function} listener The callback to store. + */ + putListener: function (inst, registrationName, listener) { + !(typeof listener === 'function') ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Expected %s listener to be a function, instead got type %s', registrationName, typeof listener) : _prodInvariant('94', registrationName, typeof listener) : void 0; + + var key = getDictionaryKey(inst); + var bankForRegistrationName = listenerBank[registrationName] || (listenerBank[registrationName] = {}); + bankForRegistrationName[key] = listener; + + var PluginModule = EventPluginRegistry.registrationNameModules[registrationName]; + if (PluginModule && PluginModule.didPutListener) { + PluginModule.didPutListener(inst, registrationName, listener); + } + }, + + /** + * @param {object} inst The instance, which is the source of events. + * @param {string} registrationName Name of listener (e.g. `onClick`). + * @return {?function} The stored callback. + */ + getListener: function (inst, registrationName) { + // TODO: shouldPreventMouseEvent is DOM-specific and definitely should not + // live here; needs to be moved to a better place soon + var bankForRegistrationName = listenerBank[registrationName]; + if (shouldPreventMouseEvent(registrationName, inst._currentElement.type, inst._currentElement.props)) { + return null; + } + var key = getDictionaryKey(inst); + return bankForRegistrationName && bankForRegistrationName[key]; + }, + + /** + * Deletes a listener from the registration bank. + * + * @param {object} inst The instance, which is the source of events. + * @param {string} registrationName Name of listener (e.g. `onClick`). + */ + deleteListener: function (inst, registrationName) { + var PluginModule = EventPluginRegistry.registrationNameModules[registrationName]; + if (PluginModule && PluginModule.willDeleteListener) { + PluginModule.willDeleteListener(inst, registrationName); + } + + var bankForRegistrationName = listenerBank[registrationName]; + // TODO: This should never be null -- when is it? + if (bankForRegistrationName) { + var key = getDictionaryKey(inst); + delete bankForRegistrationName[key]; + } + }, + + /** + * Deletes all listeners for the DOM element with the supplied ID. + * + * @param {object} inst The instance, which is the source of events. + */ + deleteAllListeners: function (inst) { + var key = getDictionaryKey(inst); + for (var registrationName in listenerBank) { + if (!listenerBank.hasOwnProperty(registrationName)) { + continue; + } + + if (!listenerBank[registrationName][key]) { + continue; + } + + var PluginModule = EventPluginRegistry.registrationNameModules[registrationName]; + if (PluginModule && PluginModule.willDeleteListener) { + PluginModule.willDeleteListener(inst, registrationName); + } + + delete listenerBank[registrationName][key]; + } + }, + + /** + * Allows registered plugins an opportunity to extract events from top-level + * native browser events. + * + * @return {*} An accumulation of synthetic events. + * @internal + */ + extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget) { + var events; + var plugins = EventPluginRegistry.plugins; + for (var i = 0; i < plugins.length; i++) { + // Not every plugin in the ordering may be loaded at runtime. + var possiblePlugin = plugins[i]; + if (possiblePlugin) { + var extractedEvents = possiblePlugin.extractEvents(topLevelType, targetInst, nativeEvent, nativeEventTarget); + if (extractedEvents) { + events = accumulateInto(events, extractedEvents); + } + } + } + return events; + }, + + /** + * Enqueues a synthetic event that should be dispatched when + * `processEventQueue` is invoked. + * + * @param {*} events An accumulation of synthetic events. + * @internal + */ + enqueueEvents: function (events) { + if (events) { + eventQueue = accumulateInto(eventQueue, events); + } + }, + + /** + * Dispatches all synthetic events on the event queue. + * + * @internal + */ + processEventQueue: function (simulated) { + // Set `eventQueue` to null before processing it so that we can tell if more + // events get enqueued while processing. + var processingEventQueue = eventQueue; + eventQueue = null; + if (simulated) { + forEachAccumulated(processingEventQueue, executeDispatchesAndReleaseSimulated); + } else { + forEachAccumulated(processingEventQueue, executeDispatchesAndReleaseTopLevel); + } + !!eventQueue ? process.env.NODE_ENV !== 'production' ? invariant(false, 'processEventQueue(): Additional events were enqueued while processing an event queue. Support for this has not yet been implemented.') : _prodInvariant('95') : void 0; + // This would be a good time to rethrow if any of the event handlers threw. + ReactErrorUtils.rethrowCaughtError(); + }, + + /** + * These are needed for tests only. Do not use! + */ + __purge: function () { + listenerBank = {}; + }, + + __getListenerBank: function () { + return listenerBank; + } +}; + +module.exports = EventPluginHub; +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) + +/***/ }), +/* 28 */ +/***/ (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 SyntheticEvent = __webpack_require__(16); + +var getEventTarget = __webpack_require__(44); + +/** + * @interface UIEvent + * @see http://www.w3.org/TR/DOM-Level-3-Events/ + */ +var UIEventInterface = { + view: function (event) { + if (event.view) { + return event.view; + } + + var target = getEventTarget(event); + if (target.window === target) { + // target is a window object + return target; + } + + var doc = target.ownerDocument; + // TODO: Figure out why `ownerDocument` is sometimes undefined in IE8. + if (doc) { + return doc.defaultView || doc.parentWindow; + } else { + return window; + } + }, + detail: function (event) { + return event.detail || 0; + } +}; + +/** + * @param {object} dispatchConfig Configuration used to dispatch this event. + * @param {string} dispatchMarker Marker identifying the event target. + * @param {object} nativeEvent Native browser event. + * @extends {SyntheticEvent} + */ +function SyntheticUIEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) { + return SyntheticEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget); +} + +SyntheticEvent.augmentClass(SyntheticUIEvent, UIEventInterface); + +module.exports = SyntheticUIEvent; + +/***/ }), +/* 29 */ +/***/ (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. + * + */ + + + +/** + * `ReactInstanceMap` maintains a mapping from a public facing stateful + * instance (key) and the internal representation (value). This allows public + * methods to accept the user facing instance as an argument and map them back + * to internal methods. + */ + +// TODO: Replace this with ES6: var ReactInstanceMap = new Map(); + +var ReactInstanceMap = { + /** + * This API should be called `delete` but we'd have to make sure to always + * transform these to strings for IE support. When this transform is fully + * supported we can rename it. + */ + remove: function (key) { + key._reactInternalInstance = undefined; + }, + + get: function (key) { + return key._reactInternalInstance; + }, + + has: function (key) { + return key._reactInternalInstance !== undefined; + }, + + set: function (key, value) { + key._reactInternalInstance = value; + } +}; + +module.exports = ReactInstanceMap; + +/***/ }), +/* 30 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(process) {/** + * 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 canDefineProperty = false; +if (process.env.NODE_ENV !== 'production') { + try { + // $FlowFixMe https://github.com/facebook/flow/issues/285 + Object.defineProperty({}, 'x', { get: function () {} }); + canDefineProperty = true; + } catch (x) { + // IE will fail on defineProperty + } +} + +module.exports = canDefineProperty; +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) + +/***/ }), +/* 31 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(process) {/** + * 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 emptyObject = {}; + +if (process.env.NODE_ENV !== 'production') { + Object.freeze(emptyObject); +} + +module.exports = emptyObject; +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) + +/***/ }), +/* 32 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +module.exports = __webpack_require__(127); + + +/***/ }), +/* 33 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(process) {/** + * 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__(4); + +var invariant = __webpack_require__(1); + +/** + * Injectable ordering of event plugins. + */ +var eventPluginOrder = null; + +/** + * Injectable mapping from names to event plugin modules. + */ +var namesToPlugins = {}; + +/** + * Recomputes the plugin list using the injected plugins and plugin ordering. + * + * @private + */ +function recomputePluginOrdering() { + if (!eventPluginOrder) { + // Wait until an `eventPluginOrder` is injected. + return; + } + for (var pluginName in namesToPlugins) { + var pluginModule = namesToPlugins[pluginName]; + var pluginIndex = eventPluginOrder.indexOf(pluginName); + !(pluginIndex > -1) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `%s`.', pluginName) : _prodInvariant('96', pluginName) : void 0; + if (EventPluginRegistry.plugins[pluginIndex]) { + continue; + } + !pluginModule.extractEvents ? process.env.NODE_ENV !== 'production' ? invariant(false, 'EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.', pluginName) : _prodInvariant('97', pluginName) : void 0; + EventPluginRegistry.plugins[pluginIndex] = pluginModule; + var publishedEvents = pluginModule.eventTypes; + for (var eventName in publishedEvents) { + !publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.', eventName, pluginName) : _prodInvariant('98', eventName, pluginName) : void 0; + } + } +} + +/** + * Publishes an event so that it can be dispatched by the supplied plugin. + * + * @param {object} dispatchConfig Dispatch configuration for the event. + * @param {object} PluginModule Plugin publishing the event. + * @return {boolean} True if the event was successfully published. + * @private + */ +function publishEventForPlugin(dispatchConfig, pluginModule, eventName) { + !!EventPluginRegistry.eventNameDispatchConfigs.hasOwnProperty(eventName) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'EventPluginHub: More than one plugin attempted to publish the same event name, `%s`.', eventName) : _prodInvariant('99', eventName) : void 0; + EventPluginRegistry.eventNameDispatchConfigs[eventName] = dispatchConfig; + + var phasedRegistrationNames = dispatchConfig.phasedRegistrationNames; + if (phasedRegistrationNames) { + for (var phaseName in phasedRegistrationNames) { + if (phasedRegistrationNames.hasOwnProperty(phaseName)) { + var phasedRegistrationName = phasedRegistrationNames[phaseName]; + publishRegistrationName(phasedRegistrationName, pluginModule, eventName); + } + } + return true; + } else if (dispatchConfig.registrationName) { + publishRegistrationName(dispatchConfig.registrationName, pluginModule, eventName); + return true; + } + return false; +} + +/** + * Publishes a registration name that is used to identify dispatched events and + * can be used with `EventPluginHub.putListener` to register listeners. + * + * @param {string} registrationName Registration name to add. + * @param {object} PluginModule Plugin publishing the event. + * @private + */ +function publishRegistrationName(registrationName, pluginModule, eventName) { + !!EventPluginRegistry.registrationNameModules[registrationName] ? process.env.NODE_ENV !== 'production' ? invariant(false, 'EventPluginHub: More than one plugin attempted to publish the same registration name, `%s`.', registrationName) : _prodInvariant('100', registrationName) : void 0; + EventPluginRegistry.registrationNameModules[registrationName] = pluginModule; + EventPluginRegistry.registrationNameDependencies[registrationName] = pluginModule.eventTypes[eventName].dependencies; + + if (process.env.NODE_ENV !== 'production') { + var lowerCasedName = registrationName.toLowerCase(); + EventPluginRegistry.possibleRegistrationNames[lowerCasedName] = registrationName; + + if (registrationName === 'onDoubleClick') { + EventPluginRegistry.possibleRegistrationNames.ondblclick = registrationName; + } + } +} + +/** + * Registers plugins so that they can extract and dispatch events. + * + * @see {EventPluginHub} + */ +var EventPluginRegistry = { + /** + * Ordered list of injected plugins. + */ + plugins: [], + + /** + * Mapping from event name to dispatch config + */ + eventNameDispatchConfigs: {}, + + /** + * Mapping from registration name to plugin module + */ + registrationNameModules: {}, + + /** + * Mapping from registration name to event name + */ + registrationNameDependencies: {}, + + /** + * Mapping from lowercase registration names to the properly cased version, + * used to warn in the case of missing event handlers. Available + * only in __DEV__. + * @type {Object} + */ + possibleRegistrationNames: process.env.NODE_ENV !== 'production' ? {} : null, + // Trust the developer to only use possibleRegistrationNames in __DEV__ + + /** + * Injects an ordering of plugins (by plugin name). This allows the ordering + * to be decoupled from injection of the actual plugins so that ordering is + * always deterministic regardless of packaging, on-the-fly injection, etc. + * + * @param {array} InjectedEventPluginOrder + * @internal + * @see {EventPluginHub.injection.injectEventPluginOrder} + */ + injectEventPluginOrder: function (injectedEventPluginOrder) { + !!eventPluginOrder ? process.env.NODE_ENV !== 'production' ? invariant(false, 'EventPluginRegistry: Cannot inject event plugin ordering more than once. You are likely trying to load more than one copy of React.') : _prodInvariant('101') : void 0; + // Clone the ordering so it cannot be dynamically mutated. + eventPluginOrder = Array.prototype.slice.call(injectedEventPluginOrder); + recomputePluginOrdering(); + }, + + /** + * Injects plugins to be used by `EventPluginHub`. The plugin names must be + * in the ordering injected by `injectEventPluginOrder`. + * + * Plugins can be injected as part of page initialization or on-the-fly. + * + * @param {object} injectedNamesToPlugins Map from names to plugin modules. + * @internal + * @see {EventPluginHub.injection.injectEventPluginsByName} + */ + injectEventPluginsByName: function (injectedNamesToPlugins) { + var isOrderingDirty = false; + for (var pluginName in injectedNamesToPlugins) { + if (!injectedNamesToPlugins.hasOwnProperty(pluginName)) { + continue; + } + var pluginModule = injectedNamesToPlugins[pluginName]; + if (!namesToPlugins.hasOwnProperty(pluginName) || namesToPlugins[pluginName] !== pluginModule) { + !!namesToPlugins[pluginName] ? process.env.NODE_ENV !== 'production' ? invariant(false, 'EventPluginRegistry: Cannot inject two different event plugins using the same name, `%s`.', pluginName) : _prodInvariant('102', pluginName) : void 0; + namesToPlugins[pluginName] = pluginModule; + isOrderingDirty = true; + } + } + if (isOrderingDirty) { + recomputePluginOrdering(); + } + }, + + /** + * Looks up the plugin for the supplied event. + * + * @param {object} event A synthetic event. + * @return {?object} The plugin that created the supplied event. + * @internal + */ + getPluginModuleForEvent: function (event) { + var dispatchConfig = event.dispatchConfig; + if (dispatchConfig.registrationName) { + return EventPluginRegistry.registrationNameModules[dispatchConfig.registrationName] || null; + } + if (dispatchConfig.phasedRegistrationNames !== undefined) { + // pulling phasedRegistrationNames out of dispatchConfig helps Flow see + // that it is not undefined. + var phasedRegistrationNames = dispatchConfig.phasedRegistrationNames; + + for (var phase in phasedRegistrationNames) { + if (!phasedRegistrationNames.hasOwnProperty(phase)) { + continue; + } + var pluginModule = EventPluginRegistry.registrationNameModules[phasedRegistrationNames[phase]]; + if (pluginModule) { + return pluginModule; + } + } + } + return null; + }, + + /** + * Exposed for unit testing. + * @private + */ + _resetEventPlugins: function () { + eventPluginOrder = null; + for (var pluginName in namesToPlugins) { + if (namesToPlugins.hasOwnProperty(pluginName)) { + delete namesToPlugins[pluginName]; + } + } + EventPluginRegistry.plugins.length = 0; + + var eventNameDispatchConfigs = EventPluginRegistry.eventNameDispatchConfigs; + for (var eventName in eventNameDispatchConfigs) { + if (eventNameDispatchConfigs.hasOwnProperty(eventName)) { + delete eventNameDispatchConfigs[eventName]; + } + } + + var registrationNameModules = EventPluginRegistry.registrationNameModules; + for (var registrationName in registrationNameModules) { + if (registrationNameModules.hasOwnProperty(registrationName)) { + delete registrationNameModules[registrationName]; + } + } + + if (process.env.NODE_ENV !== 'production') { + var possibleRegistrationNames = EventPluginRegistry.possibleRegistrationNames; + for (var lowerCasedName in possibleRegistrationNames) { + if (possibleRegistrationNames.hasOwnProperty(lowerCasedName)) { + delete possibleRegistrationNames[lowerCasedName]; + } + } + } + } +}; + +module.exports = EventPluginRegistry; +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) + +/***/ }), +/* 34 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(process) {/** + * 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__(4); + +var invariant = __webpack_require__(1); + +var OBSERVED_ERROR = {}; + +/** + * `Transaction` creates a black box that is able to wrap any method such that + * certain invariants are maintained before and after the method is invoked + * (Even if an exception is thrown while invoking the wrapped method). Whoever + * instantiates a transaction can provide enforcers of the invariants at + * creation time. The `Transaction` class itself will supply one additional + * automatic invariant for you - the invariant that any transaction instance + * should not be run while it is already being run. You would typically create a + * single instance of a `Transaction` for reuse multiple times, that potentially + * is used to wrap several different methods. Wrappers are extremely simple - + * they only require implementing two methods. + * + *
+ *                       wrappers (injected at creation time)
+ *                                      +        +
+ *                                      |        |
+ *                    +-----------------|--------|--------------+
+ *                    |                 v        |              |
+ *                    |      +---------------+   |              |
+ *                    |   +--|    wrapper1   |---|----+         |
+ *                    |   |  +---------------+   v    |         |
+ *                    |   |          +-------------+  |         |
+ *                    |   |     +----|   wrapper2  |--------+   |
+ *                    |   |     |    +-------------+  |     |   |
+ *                    |   |     |                     |     |   |
+ *                    |   v     v                     v     v   | wrapper
+ *                    | +---+ +---+   +---------+   +---+ +---+ | invariants
+ * perform(anyMethod) | |   | |   |   |         |   |   | |   | | maintained
+ * +----------------->|-|---|-|---|-->|anyMethod|---|---|-|---|-|-------->
+ *                    | |   | |   |   |         |   |   | |   | |
+ *                    | |   | |   |   |         |   |   | |   | |
+ *                    | |   | |   |   |         |   |   | |   | |
+ *                    | +---+ +---+   +---------+   +---+ +---+ |
+ *                    |  initialize                    close    |
+ *                    +-----------------------------------------+
+ * 
+ * + * Use cases: + * - Preserving the input selection ranges before/after reconciliation. + * Restoring selection even in the event of an unexpected error. + * - Deactivating events while rearranging the DOM, preventing blurs/focuses, + * while guaranteeing that afterwards, the event system is reactivated. + * - Flushing a queue of collected DOM mutations to the main UI thread after a + * reconciliation takes place in a worker thread. + * - Invoking any collected `componentDidUpdate` callbacks after rendering new + * content. + * - (Future use case): Wrapping particular flushes of the `ReactWorker` queue + * to preserve the `scrollTop` (an automatic scroll aware DOM). + * - (Future use case): Layout calculations before and after DOM updates. + * + * Transactional plugin API: + * - A module that has an `initialize` method that returns any precomputation. + * - and a `close` method that accepts the precomputation. `close` is invoked + * when the wrapped process is completed, or has failed. + * + * @param {Array} transactionWrapper Wrapper modules + * that implement `initialize` and `close`. + * @return {Transaction} Single transaction for reuse in thread. + * + * @class Transaction + */ +var TransactionImpl = { + /** + * Sets up this instance so that it is prepared for collecting metrics. Does + * so such that this setup method may be used on an instance that is already + * initialized, in a way that does not consume additional memory upon reuse. + * That can be useful if you decide to make your subclass of this mixin a + * "PooledClass". + */ + reinitializeTransaction: function () { + this.transactionWrappers = this.getTransactionWrappers(); + if (this.wrapperInitData) { + this.wrapperInitData.length = 0; + } else { + this.wrapperInitData = []; + } + this._isInTransaction = false; + }, + + _isInTransaction: false, + + /** + * @abstract + * @return {Array} Array of transaction wrappers. + */ + getTransactionWrappers: null, + + isInTransaction: function () { + return !!this._isInTransaction; + }, + + /* eslint-disable space-before-function-paren */ + + /** + * Executes the function within a safety window. Use this for the top level + * methods that result in large amounts of computation/mutations that would + * need to be safety checked. The optional arguments helps prevent the need + * to bind in many cases. + * + * @param {function} method Member of scope to call. + * @param {Object} scope Scope to invoke from. + * @param {Object?=} a Argument to pass to the method. + * @param {Object?=} b Argument to pass to the method. + * @param {Object?=} c Argument to pass to the method. + * @param {Object?=} d Argument to pass to the method. + * @param {Object?=} e Argument to pass to the method. + * @param {Object?=} f Argument to pass to the method. + * + * @return {*} Return value from `method`. + */ + perform: function (method, scope, a, b, c, d, e, f) { + /* eslint-enable space-before-function-paren */ + !!this.isInTransaction() ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Transaction.perform(...): Cannot initialize a transaction when there is already an outstanding transaction.') : _prodInvariant('27') : void 0; + var errorThrown; + var ret; + try { + this._isInTransaction = true; + // Catching errors makes debugging more difficult, so we start with + // errorThrown set to true before setting it to false after calling + // close -- if it's still set to true in the finally block, it means + // one of these calls threw. + errorThrown = true; + this.initializeAll(0); + ret = method.call(scope, a, b, c, d, e, f); + errorThrown = false; + } finally { + try { + if (errorThrown) { + // If `method` throws, prefer to show that stack trace over any thrown + // by invoking `closeAll`. + try { + this.closeAll(0); + } catch (err) {} + } else { + // Since `method` didn't throw, we don't want to silence the exception + // here. + this.closeAll(0); + } + } finally { + this._isInTransaction = false; + } + } + return ret; + }, + + initializeAll: function (startIndex) { + var transactionWrappers = this.transactionWrappers; + for (var i = startIndex; i < transactionWrappers.length; i++) { + var wrapper = transactionWrappers[i]; + try { + // Catching errors makes debugging more difficult, so we start with the + // OBSERVED_ERROR state before overwriting it with the real return value + // of initialize -- if it's still set to OBSERVED_ERROR in the finally + // block, it means wrapper.initialize threw. + this.wrapperInitData[i] = OBSERVED_ERROR; + this.wrapperInitData[i] = wrapper.initialize ? wrapper.initialize.call(this) : null; + } finally { + if (this.wrapperInitData[i] === OBSERVED_ERROR) { + // The initializer for wrapper i threw an error; initialize the + // remaining wrappers but silence any exceptions from them to ensure + // that the first error is the one to bubble up. + try { + this.initializeAll(i + 1); + } catch (err) {} + } + } + } + }, + + /** + * Invokes each of `this.transactionWrappers.close[i]` functions, passing into + * them the respective return values of `this.transactionWrappers.init[i]` + * (`close`rs that correspond to initializers that failed will not be + * invoked). + */ + closeAll: function (startIndex) { + !this.isInTransaction() ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Transaction.closeAll(): Cannot close transaction when none are open.') : _prodInvariant('28') : void 0; + var transactionWrappers = this.transactionWrappers; + for (var i = startIndex; i < transactionWrappers.length; i++) { + var wrapper = transactionWrappers[i]; + var initData = this.wrapperInitData[i]; + var errorThrown; + try { + // Catching errors makes debugging more difficult, so we start with + // errorThrown set to true before setting it to false after calling + // close -- if it's still set to true in the finally block, it means + // wrapper.close threw. + errorThrown = true; + if (initData !== OBSERVED_ERROR && wrapper.close) { + wrapper.close.call(this, initData); + } + errorThrown = false; + } finally { + if (errorThrown) { + // The closer for wrapper i threw an error; close the remaining + // wrappers but silence any exceptions from them to ensure that the + // first error is the one to bubble up. + try { + this.closeAll(i + 1); + } catch (e) {} + } + } + } + this.wrapperInitData.length = 0; + } +}; + +module.exports = TransactionImpl; +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) + +/***/ }), +/* 35 */ +/***/ (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 SyntheticUIEvent = __webpack_require__(28); +var ViewportMetrics = __webpack_require__(78); + +var getEventModifierState = __webpack_require__(46); + +/** + * @interface MouseEvent + * @see http://www.w3.org/TR/DOM-Level-3-Events/ + */ +var MouseEventInterface = { + screenX: null, + screenY: null, + clientX: null, + clientY: null, + ctrlKey: null, + shiftKey: null, + altKey: null, + metaKey: null, + getModifierState: getEventModifierState, + button: function (event) { + // Webkit, Firefox, IE9+ + // which: 1 2 3 + // button: 0 1 2 (standard) + var button = event.button; + if ('which' in event) { + return button; + } + // IE<9 + // which: undefined + // button: 0 0 0 + // button: 1 4 2 (onmouseup) + return button === 2 ? 2 : button === 4 ? 1 : 0; + }, + buttons: null, + relatedTarget: function (event) { + return event.relatedTarget || (event.fromElement === event.srcElement ? event.toElement : event.fromElement); + }, + // "Proprietary" Interface. + pageX: function (event) { + return 'pageX' in event ? event.pageX : event.clientX + ViewportMetrics.currentScrollLeft; + }, + pageY: function (event) { + return 'pageY' in event ? event.pageY : event.clientY + ViewportMetrics.currentScrollTop; + } +}; + +/** + * @param {object} dispatchConfig Configuration used to dispatch this event. + * @param {string} dispatchMarker Marker identifying the event target. + * @param {object} nativeEvent Native browser event. + * @extends {SyntheticUIEvent} + */ +function SyntheticMouseEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) { + return SyntheticUIEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget); +} + +SyntheticUIEvent.augmentClass(SyntheticMouseEvent, MouseEventInterface); + +module.exports = SyntheticMouseEvent; + +/***/ }), +/* 36 */ +/***/ (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 ExecutionEnvironment = __webpack_require__(9); +var DOMNamespaces = __webpack_require__(48); + +var WHITESPACE_TEST = /^[ \r\n\t\f]/; +var NONVISIBLE_TEST = /<(!--|link|noscript|meta|script|style)[ \r\n\t\f\/>]/; + +var createMicrosoftUnsafeLocalFunction = __webpack_require__(49); + +// SVG temp container for IE lacking innerHTML +var reusableSVGContainer; + +/** + * Set the innerHTML property of a node, ensuring that whitespace is preserved + * even in IE8. + * + * @param {DOMElement} node + * @param {string} html + * @internal + */ +var setInnerHTML = createMicrosoftUnsafeLocalFunction(function (node, html) { + // IE does not have innerHTML for SVG nodes, so instead we inject the + // new markup in a temp node and then move the child nodes across into + // the target node + if (node.namespaceURI === DOMNamespaces.svg && !('innerHTML' in node)) { + reusableSVGContainer = reusableSVGContainer || document.createElement('div'); + reusableSVGContainer.innerHTML = '' + html + ''; + var svgNode = reusableSVGContainer.firstChild; + while (svgNode.firstChild) { + node.appendChild(svgNode.firstChild); + } + } else { + node.innerHTML = html; + } +}); + +if (ExecutionEnvironment.canUseDOM) { + // IE8: When updating a just created node with innerHTML only leading + // whitespace is removed. When updating an existing node with innerHTML + // whitespace in root TextNodes is also collapsed. + // @see quirksmode.org/bugreports/archives/2004/11/innerhtml_and_t.html + + // Feature detection; only IE8 is known to behave improperly like this. + var testElement = document.createElement('div'); + testElement.innerHTML = ' '; + if (testElement.innerHTML === '') { + setInnerHTML = function (node, html) { + // Magic theory: IE8 supposedly differentiates between added and updated + // nodes when processing innerHTML, innerHTML on updated nodes suffers + // from worse whitespace behavior. Re-adding a node like this triggers + // the initial and more favorable whitespace behavior. + // TODO: What to do on a detached node? + if (node.parentNode) { + node.parentNode.replaceChild(node, node); + } + + // We also implement a workaround for non-visible tags disappearing into + // thin air on IE8, this only happens if there is no visible text + // in-front of the non-visible tags. Piggyback on the whitespace fix + // and simply check if any non-visible tags appear in the source. + if (WHITESPACE_TEST.test(html) || html[0] === '<' && NONVISIBLE_TEST.test(html)) { + // Recover leading whitespace by temporarily prepending any character. + // \uFEFF has the potential advantage of being zero-width/invisible. + // UglifyJS drops U+FEFF chars when parsing, so use String.fromCharCode + // in hopes that this is preserved even if "\uFEFF" is transformed to + // the actual Unicode character (by Babel, for example). + // https://github.com/mishoo/UglifyJS2/blob/v2.4.20/lib/parse.js#L216 + node.innerHTML = String.fromCharCode(0xfeff) + html; + + // deleteData leaves an empty `TextNode` which offsets the index of all + // children. Definitely want to avoid this. + var textNode = node.firstChild; + if (textNode.data.length === 1) { + node.removeChild(textNode); + } else { + textNode.deleteData(0, 1); + } + } else { + node.innerHTML = html; + } + }; + } + testElement = null; +} + +module.exports = setInnerHTML; + +/***/ }), +/* 37 */ +/***/ (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. + * + * Based on the escape-html library, which is used under the MIT License below: + * + * Copyright (c) 2012-2013 TJ Holowaychuk + * Copyright (c) 2015 Andreas Lubbe + * Copyright (c) 2015 Tiancheng "Timothy" Gu + * + * Permission is hereby granted, free of charge, to any person obtaining + * a copy of this software and associated documentation files (the + * 'Software'), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sublicense, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY + * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + */ + + + +// code copied and modified from escape-html +/** + * Module variables. + * @private + */ + +var matchHtmlRegExp = /["'&<>]/; + +/** + * Escape special characters in the given string of html. + * + * @param {string} string The string to escape for inserting into HTML + * @return {string} + * @public + */ + +function escapeHtml(string) { + var str = '' + string; + var match = matchHtmlRegExp.exec(str); + + if (!match) { + return str; + } + + var escape; + var html = ''; + var index = 0; + var lastIndex = 0; + + for (index = match.index; index < str.length; index++) { + switch (str.charCodeAt(index)) { + case 34: + // " + escape = '"'; + break; + case 38: + // & + escape = '&'; + break; + case 39: + // ' + escape = '''; // modified from escape-html; used to be ''' + break; + case 60: + // < + escape = '<'; + break; + case 62: + // > + escape = '>'; + break; + default: + continue; + } + + if (lastIndex !== index) { + html += str.substring(lastIndex, index); + } + + lastIndex = index + 1; + html += escape; + } + + return lastIndex !== index ? html + str.substring(lastIndex, index) : html; +} +// end code copied and modified from escape-html + +/** + * Escapes text to prevent scripting attacks. + * + * @param {*} text Text value to escape. + * @return {string} An escaped string. + */ +function escapeTextContentForBrowser(text) { + if (typeof text === 'boolean' || typeof text === 'number') { + // this shortcircuit helps perf for types that we know will never have + // special characters, especially given that this function is used often + // for numeric dom ids. + return '' + text; + } + return escapeHtml(text); +} + +module.exports = escapeTextContentForBrowser; + +/***/ }), +/* 38 */ +/***/ (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__(8); + +var EventPluginRegistry = __webpack_require__(33); +var ReactEventEmitterMixin = __webpack_require__(161); +var ViewportMetrics = __webpack_require__(78); + +var getVendorPrefixedEventName = __webpack_require__(162); +var isEventSupported = __webpack_require__(45); + +/** + * Summary of `ReactBrowserEventEmitter` event handling: + * + * - Top-level delegation is used to trap most native browser events. This + * may only occur in the main thread and is the responsibility of + * ReactEventListener, which is injected and can therefore support pluggable + * event sources. This is the only work that occurs in the main thread. + * + * - We normalize and de-duplicate events to account for browser quirks. This + * may be done in the worker thread. + * + * - Forward these native events (with the associated top-level type used to + * trap it) to `EventPluginHub`, which in turn will ask plugins if they want + * to extract any synthetic events. + * + * - The `EventPluginHub` will then process each event by annotating them with + * "dispatches", a sequence of listeners and IDs that care about that event. + * + * - The `EventPluginHub` then dispatches the events. + * + * Overview of React and the event system: + * + * +------------+ . + * | DOM | . + * +------------+ . + * | . + * v . + * +------------+ . + * | ReactEvent | . + * | Listener | . + * +------------+ . +-----------+ + * | . +--------+|SimpleEvent| + * | . | |Plugin | + * +-----|------+ . v +-----------+ + * | | | . +--------------+ +------------+ + * | +-----------.--->|EventPluginHub| | Event | + * | | . | | +-----------+ | Propagators| + * | ReactEvent | . | | |TapEvent | |------------| + * | Emitter | . | |<---+|Plugin | |other plugin| + * | | . | | +-----------+ | utilities | + * | +-----------.--->| | +------------+ + * | | | . +--------------+ + * +-----|------+ . ^ +-----------+ + * | . | |Enter/Leave| + * + . +-------+|Plugin | + * +-------------+ . +-----------+ + * | application | . + * |-------------| . + * | | . + * | | . + * +-------------+ . + * . + * React Core . General Purpose Event Plugin System + */ + +var hasEventPageXY; +var alreadyListeningTo = {}; +var isMonitoringScrollValue = false; +var reactTopListenersCounter = 0; + +// For events like 'submit' which don't consistently bubble (which we trap at a +// lower node than `document`), binding at `document` would cause duplicate +// events so we don't include them here +var topEventMapping = { + topAbort: 'abort', + topAnimationEnd: getVendorPrefixedEventName('animationend') || 'animationend', + topAnimationIteration: getVendorPrefixedEventName('animationiteration') || 'animationiteration', + topAnimationStart: getVendorPrefixedEventName('animationstart') || 'animationstart', + topBlur: 'blur', + topCanPlay: 'canplay', + topCanPlayThrough: 'canplaythrough', + topChange: 'change', + topClick: 'click', + topCompositionEnd: 'compositionend', + topCompositionStart: 'compositionstart', + topCompositionUpdate: 'compositionupdate', + topContextMenu: 'contextmenu', + topCopy: 'copy', + topCut: 'cut', + topDoubleClick: 'dblclick', + topDrag: 'drag', + topDragEnd: 'dragend', + topDragEnter: 'dragenter', + topDragExit: 'dragexit', + topDragLeave: 'dragleave', + topDragOver: 'dragover', + topDragStart: 'dragstart', + topDrop: 'drop', + topDurationChange: 'durationchange', + topEmptied: 'emptied', + topEncrypted: 'encrypted', + topEnded: 'ended', + topError: 'error', + topFocus: 'focus', + topInput: 'input', + topKeyDown: 'keydown', + topKeyPress: 'keypress', + topKeyUp: 'keyup', + topLoadedData: 'loadeddata', + topLoadedMetadata: 'loadedmetadata', + topLoadStart: 'loadstart', + topMouseDown: 'mousedown', + topMouseMove: 'mousemove', + topMouseOut: 'mouseout', + topMouseOver: 'mouseover', + topMouseUp: 'mouseup', + topPaste: 'paste', + topPause: 'pause', + topPlay: 'play', + topPlaying: 'playing', + topProgress: 'progress', + topRateChange: 'ratechange', + topScroll: 'scroll', + topSeeked: 'seeked', + topSeeking: 'seeking', + topSelectionChange: 'selectionchange', + topStalled: 'stalled', + topSuspend: 'suspend', + topTextInput: 'textInput', + topTimeUpdate: 'timeupdate', + topTouchCancel: 'touchcancel', + topTouchEnd: 'touchend', + topTouchMove: 'touchmove', + topTouchStart: 'touchstart', + topTransitionEnd: getVendorPrefixedEventName('transitionend') || 'transitionend', + topVolumeChange: 'volumechange', + topWaiting: 'waiting', + topWheel: 'wheel' +}; + +/** + * To ensure no conflicts with other potential React instances on the page + */ +var topListenersIDKey = '_reactListenersID' + String(Math.random()).slice(2); + +function getListeningForDocument(mountAt) { + // In IE8, `mountAt` is a host object and doesn't have `hasOwnProperty` + // directly. + if (!Object.prototype.hasOwnProperty.call(mountAt, topListenersIDKey)) { + mountAt[topListenersIDKey] = reactTopListenersCounter++; + alreadyListeningTo[mountAt[topListenersIDKey]] = {}; + } + return alreadyListeningTo[mountAt[topListenersIDKey]]; +} + +/** + * `ReactBrowserEventEmitter` is used to attach top-level event listeners. For + * example: + * + * EventPluginHub.putListener('myID', 'onClick', myFunction); + * + * This would allocate a "registration" of `('onClick', myFunction)` on 'myID'. + * + * @internal + */ +var ReactBrowserEventEmitter = _assign({}, ReactEventEmitterMixin, { + /** + * Injectable event backend + */ + ReactEventListener: null, + + injection: { + /** + * @param {object} ReactEventListener + */ + injectReactEventListener: function (ReactEventListener) { + ReactEventListener.setHandleTopLevel(ReactBrowserEventEmitter.handleTopLevel); + ReactBrowserEventEmitter.ReactEventListener = ReactEventListener; + } + }, + + /** + * Sets whether or not any created callbacks should be enabled. + * + * @param {boolean} enabled True if callbacks should be enabled. + */ + setEnabled: function (enabled) { + if (ReactBrowserEventEmitter.ReactEventListener) { + ReactBrowserEventEmitter.ReactEventListener.setEnabled(enabled); + } + }, + + /** + * @return {boolean} True if callbacks are enabled. + */ + isEnabled: function () { + return !!(ReactBrowserEventEmitter.ReactEventListener && ReactBrowserEventEmitter.ReactEventListener.isEnabled()); + }, + + /** + * We listen for bubbled touch events on the document object. + * + * Firefox v8.01 (and possibly others) exhibited strange behavior when + * mounting `onmousemove` events at some node that was not the document + * element. The symptoms were that if your mouse is not moving over something + * contained within that mount point (for example on the background) the + * top-level listeners for `onmousemove` won't be called. However, if you + * register the `mousemove` on the document object, then it will of course + * catch all `mousemove`s. This along with iOS quirks, justifies restricting + * top-level listeners to the document object only, at least for these + * movement types of events and possibly all events. + * + * @see http://www.quirksmode.org/blog/archives/2010/09/click_event_del.html + * + * Also, `keyup`/`keypress`/`keydown` do not bubble to the window on IE, but + * they bubble to document. + * + * @param {string} registrationName Name of listener (e.g. `onClick`). + * @param {object} contentDocumentHandle Document which owns the container + */ + listenTo: function (registrationName, contentDocumentHandle) { + var mountAt = contentDocumentHandle; + var isListening = getListeningForDocument(mountAt); + var dependencies = EventPluginRegistry.registrationNameDependencies[registrationName]; + + for (var i = 0; i < dependencies.length; i++) { + var dependency = dependencies[i]; + if (!(isListening.hasOwnProperty(dependency) && isListening[dependency])) { + if (dependency === 'topWheel') { + if (isEventSupported('wheel')) { + ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent('topWheel', 'wheel', mountAt); + } else if (isEventSupported('mousewheel')) { + ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent('topWheel', 'mousewheel', mountAt); + } else { + // Firefox needs to capture a different mouse scroll event. + // @see http://www.quirksmode.org/dom/events/tests/scroll.html + ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent('topWheel', 'DOMMouseScroll', mountAt); + } + } else if (dependency === 'topScroll') { + if (isEventSupported('scroll', true)) { + ReactBrowserEventEmitter.ReactEventListener.trapCapturedEvent('topScroll', 'scroll', mountAt); + } else { + ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent('topScroll', 'scroll', ReactBrowserEventEmitter.ReactEventListener.WINDOW_HANDLE); + } + } else if (dependency === 'topFocus' || dependency === 'topBlur') { + if (isEventSupported('focus', true)) { + ReactBrowserEventEmitter.ReactEventListener.trapCapturedEvent('topFocus', 'focus', mountAt); + ReactBrowserEventEmitter.ReactEventListener.trapCapturedEvent('topBlur', 'blur', mountAt); + } else if (isEventSupported('focusin')) { + // IE has `focusin` and `focusout` events which bubble. + // @see http://www.quirksmode.org/blog/archives/2008/04/delegating_the.html + ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent('topFocus', 'focusin', mountAt); + ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent('topBlur', 'focusout', mountAt); + } + + // to make sure blur and focus event listeners are only attached once + isListening.topBlur = true; + isListening.topFocus = true; + } else if (topEventMapping.hasOwnProperty(dependency)) { + ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent(dependency, topEventMapping[dependency], mountAt); + } + + isListening[dependency] = true; + } + } + }, + + trapBubbledEvent: function (topLevelType, handlerBaseName, handle) { + return ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent(topLevelType, handlerBaseName, handle); + }, + + trapCapturedEvent: function (topLevelType, handlerBaseName, handle) { + return ReactBrowserEventEmitter.ReactEventListener.trapCapturedEvent(topLevelType, handlerBaseName, handle); + }, + + /** + * Protect against document.createEvent() returning null + * Some popup blocker extensions appear to do this: + * https://github.com/facebook/react/issues/6887 + */ + supportsEventPageXY: function () { + if (!document.createEvent) { + return false; + } + var ev = document.createEvent('MouseEvent'); + return ev != null && 'pageX' in ev; + }, + + /** + * Listens to window scroll and resize events. We cache scroll values so that + * application code can access them without triggering reflows. + * + * ViewportMetrics is only used by SyntheticMouse/TouchEvent and only when + * pageX/pageY isn't supported (legacy browsers). + * + * NOTE: Scroll events do not bubble. + * + * @see http://www.quirksmode.org/dom/events/scroll.html + */ + ensureScrollValueMonitoring: function () { + if (hasEventPageXY === undefined) { + hasEventPageXY = ReactBrowserEventEmitter.supportsEventPageXY(); + } + if (!hasEventPageXY && !isMonitoringScrollValue) { + var refresh = ViewportMetrics.refreshScrollValues; + ReactBrowserEventEmitter.ReactEventListener.monitorScrollValue(refresh); + isMonitoringScrollValue = true; + } + } +}); + +module.exports = ReactBrowserEventEmitter; + +/***/ }), +/* 39 */ +/***/ (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; +}; + + +/***/ }), +/* 40 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(process) {/** + * 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. + * + */ + + + +/** + * Forked from fbjs/warning: + * https://github.com/facebook/fbjs/blob/e66ba20ad5be433eb54423f2b097d829324d9de6/packages/fbjs/src/__forks__/warning.js + * + * Only change is we use console.warn instead of console.error, + * and do nothing when 'console' is not supported. + * This really simplifies the code. + * --- + * 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 lowPriorityWarning = function () {}; + +if (process.env.NODE_ENV !== 'production') { + var printWarning = function (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.warn(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) {} + }; + + lowPriorityWarning = function (condition, format) { + if (format === undefined) { + throw new Error('`warning(condition, format, ...args)` requires a warning ' + 'message argument'); + } + 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 = lowPriorityWarning; +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) + +/***/ }), +/* 41 */ +/***/ (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 ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED'; + +module.exports = ReactPropTypesSecret; + + +/***/ }), +/* 42 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(process) {/** + * 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__(4); + +var ReactErrorUtils = __webpack_require__(43); + +var invariant = __webpack_require__(1); +var warning = __webpack_require__(3); + +/** + * Injected dependencies: + */ + +/** + * - `ComponentTree`: [required] Module that can convert between React instances + * and actual node references. + */ +var ComponentTree; +var TreeTraversal; +var injection = { + injectComponentTree: function (Injected) { + ComponentTree = Injected; + if (process.env.NODE_ENV !== 'production') { + process.env.NODE_ENV !== 'production' ? warning(Injected && Injected.getNodeFromInstance && Injected.getInstanceFromNode, 'EventPluginUtils.injection.injectComponentTree(...): Injected ' + 'module is missing getNodeFromInstance or getInstanceFromNode.') : void 0; + } + }, + injectTreeTraversal: function (Injected) { + TreeTraversal = Injected; + if (process.env.NODE_ENV !== 'production') { + process.env.NODE_ENV !== 'production' ? warning(Injected && Injected.isAncestor && Injected.getLowestCommonAncestor, 'EventPluginUtils.injection.injectTreeTraversal(...): Injected ' + 'module is missing isAncestor or getLowestCommonAncestor.') : void 0; + } + } +}; + +function isEndish(topLevelType) { + return topLevelType === 'topMouseUp' || topLevelType === 'topTouchEnd' || topLevelType === 'topTouchCancel'; +} + +function isMoveish(topLevelType) { + return topLevelType === 'topMouseMove' || topLevelType === 'topTouchMove'; +} +function isStartish(topLevelType) { + return topLevelType === 'topMouseDown' || topLevelType === 'topTouchStart'; +} + +var validateEventDispatches; +if (process.env.NODE_ENV !== 'production') { + validateEventDispatches = function (event) { + var dispatchListeners = event._dispatchListeners; + var dispatchInstances = event._dispatchInstances; + + var listenersIsArr = Array.isArray(dispatchListeners); + var listenersLen = listenersIsArr ? dispatchListeners.length : dispatchListeners ? 1 : 0; + + var instancesIsArr = Array.isArray(dispatchInstances); + var instancesLen = instancesIsArr ? dispatchInstances.length : dispatchInstances ? 1 : 0; + + process.env.NODE_ENV !== 'production' ? warning(instancesIsArr === listenersIsArr && instancesLen === listenersLen, 'EventPluginUtils: Invalid `event`.') : void 0; + }; +} + +/** + * Dispatch the event to the listener. + * @param {SyntheticEvent} event SyntheticEvent to handle + * @param {boolean} simulated If the event is simulated (changes exn behavior) + * @param {function} listener Application-level callback + * @param {*} inst Internal component instance + */ +function executeDispatch(event, simulated, listener, inst) { + var type = event.type || 'unknown-event'; + event.currentTarget = EventPluginUtils.getNodeFromInstance(inst); + if (simulated) { + ReactErrorUtils.invokeGuardedCallbackWithCatch(type, listener, event); + } else { + ReactErrorUtils.invokeGuardedCallback(type, listener, event); + } + event.currentTarget = null; +} + +/** + * Standard/simple iteration through an event's collected dispatches. + */ +function executeDispatchesInOrder(event, simulated) { + var dispatchListeners = event._dispatchListeners; + var dispatchInstances = event._dispatchInstances; + if (process.env.NODE_ENV !== 'production') { + validateEventDispatches(event); + } + if (Array.isArray(dispatchListeners)) { + for (var i = 0; i < dispatchListeners.length; i++) { + if (event.isPropagationStopped()) { + break; + } + // Listeners and Instances are two parallel arrays that are always in sync. + executeDispatch(event, simulated, dispatchListeners[i], dispatchInstances[i]); + } + } else if (dispatchListeners) { + executeDispatch(event, simulated, dispatchListeners, dispatchInstances); + } + event._dispatchListeners = null; + event._dispatchInstances = null; +} + +/** + * Standard/simple iteration through an event's collected dispatches, but stops + * at the first dispatch execution returning true, and returns that id. + * + * @return {?string} id of the first dispatch execution who's listener returns + * true, or null if no listener returned true. + */ +function executeDispatchesInOrderStopAtTrueImpl(event) { + var dispatchListeners = event._dispatchListeners; + var dispatchInstances = event._dispatchInstances; + if (process.env.NODE_ENV !== 'production') { + validateEventDispatches(event); + } + if (Array.isArray(dispatchListeners)) { + for (var i = 0; i < dispatchListeners.length; i++) { + if (event.isPropagationStopped()) { + break; + } + // Listeners and Instances are two parallel arrays that are always in sync. + if (dispatchListeners[i](event, dispatchInstances[i])) { + return dispatchInstances[i]; + } + } + } else if (dispatchListeners) { + if (dispatchListeners(event, dispatchInstances)) { + return dispatchInstances; + } + } + return null; +} + +/** + * @see executeDispatchesInOrderStopAtTrueImpl + */ +function executeDispatchesInOrderStopAtTrue(event) { + var ret = executeDispatchesInOrderStopAtTrueImpl(event); + event._dispatchInstances = null; + event._dispatchListeners = null; + return ret; +} + +/** + * Execution of a "direct" dispatch - there must be at most one dispatch + * accumulated on the event or it is considered an error. It doesn't really make + * sense for an event with multiple dispatches (bubbled) to keep track of the + * return values at each dispatch execution, but it does tend to make sense when + * dealing with "direct" dispatches. + * + * @return {*} The return value of executing the single dispatch. + */ +function executeDirectDispatch(event) { + if (process.env.NODE_ENV !== 'production') { + validateEventDispatches(event); + } + var dispatchListener = event._dispatchListeners; + var dispatchInstance = event._dispatchInstances; + !!Array.isArray(dispatchListener) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'executeDirectDispatch(...): Invalid `event`.') : _prodInvariant('103') : void 0; + event.currentTarget = dispatchListener ? EventPluginUtils.getNodeFromInstance(dispatchInstance) : null; + var res = dispatchListener ? dispatchListener(event) : null; + event.currentTarget = null; + event._dispatchListeners = null; + event._dispatchInstances = null; + return res; +} + +/** + * @param {SyntheticEvent} event + * @return {boolean} True iff number of dispatches accumulated is greater than 0. + */ +function hasDispatches(event) { + return !!event._dispatchListeners; +} + +/** + * General utilities that are useful in creating custom Event Plugins. + */ +var EventPluginUtils = { + isEndish: isEndish, + isMoveish: isMoveish, + isStartish: isStartish, + + executeDirectDispatch: executeDirectDispatch, + executeDispatchesInOrder: executeDispatchesInOrder, + executeDispatchesInOrderStopAtTrue: executeDispatchesInOrderStopAtTrue, + hasDispatches: hasDispatches, + + getInstanceFromNode: function (node) { + return ComponentTree.getInstanceFromNode(node); + }, + getNodeFromInstance: function (node) { + return ComponentTree.getNodeFromInstance(node); + }, + isAncestor: function (a, b) { + return TreeTraversal.isAncestor(a, b); + }, + getLowestCommonAncestor: function (a, b) { + return TreeTraversal.getLowestCommonAncestor(a, b); + }, + getParentInstance: function (inst) { + return TreeTraversal.getParentInstance(inst); + }, + traverseTwoPhase: function (target, fn, arg) { + return TreeTraversal.traverseTwoPhase(target, fn, arg); + }, + traverseEnterLeave: function (from, to, fn, argFrom, argTo) { + return TreeTraversal.traverseEnterLeave(from, to, fn, argFrom, argTo); + }, + + injection: injection +}; + +module.exports = EventPluginUtils; +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) + +/***/ }), +/* 43 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(process) {/** + * 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 caughtError = null; + +/** + * Call a function while guarding against errors that happens within it. + * + * @param {String} name of the guard to use for logging or debugging + * @param {Function} func The function to invoke + * @param {*} a First argument + * @param {*} b Second argument + */ +function invokeGuardedCallback(name, func, a) { + try { + func(a); + } catch (x) { + if (caughtError === null) { + caughtError = x; + } + } +} + +var ReactErrorUtils = { + invokeGuardedCallback: invokeGuardedCallback, + + /** + * Invoked by ReactTestUtils.Simulate so that any errors thrown by the event + * handler are sure to be rethrown by rethrowCaughtError. + */ + invokeGuardedCallbackWithCatch: invokeGuardedCallback, + + /** + * During execution of guarded functions we will capture the first error which + * we will rethrow to be handled by the top level error handler. + */ + rethrowCaughtError: function () { + if (caughtError) { + var error = caughtError; + caughtError = null; + throw error; + } + } +}; + +if (process.env.NODE_ENV !== 'production') { + /** + * To help development we can get better devtools integration by simulating a + * real browser event. + */ + if (typeof window !== 'undefined' && typeof window.dispatchEvent === 'function' && typeof document !== 'undefined' && typeof document.createEvent === 'function') { + var fakeNode = document.createElement('react'); + ReactErrorUtils.invokeGuardedCallback = function (name, func, a) { + var boundFunc = function () { + func(a); + }; + var evtType = 'react-' + name; + fakeNode.addEventListener(evtType, boundFunc, false); + var evt = document.createEvent('Event'); + evt.initEvent(evtType, false, false); + fakeNode.dispatchEvent(evt); + fakeNode.removeEventListener(evtType, boundFunc, false); + }; + } +} + +module.exports = ReactErrorUtils; +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) + +/***/ }), +/* 44 */ +/***/ (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. + * + */ + + + +/** + * Gets the target node from a native browser event by accounting for + * inconsistencies in browser DOM APIs. + * + * @param {object} nativeEvent Native browser event. + * @return {DOMEventTarget} Target node. + */ + +function getEventTarget(nativeEvent) { + var target = nativeEvent.target || nativeEvent.srcElement || window; + + // Normalize SVG element events #4963 + if (target.correspondingUseElement) { + target = target.correspondingUseElement; + } + + // Safari may fire events on text nodes (Node.TEXT_NODE is 3). + // @see http://www.quirksmode.org/js/events_properties.html + return target.nodeType === 3 ? target.parentNode : target; +} + +module.exports = getEventTarget; + +/***/ }), +/* 45 */ +/***/ (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 ExecutionEnvironment = __webpack_require__(9); + +var useHasFeature; +if (ExecutionEnvironment.canUseDOM) { + useHasFeature = document.implementation && document.implementation.hasFeature && + // always returns true in newer browsers as per the standard. + // @see http://dom.spec.whatwg.org/#dom-domimplementation-hasfeature + document.implementation.hasFeature('', '') !== true; +} + +/** + * Checks if an event is supported in the current execution environment. + * + * NOTE: This will not work correctly for non-generic events such as `change`, + * `reset`, `load`, `error`, and `select`. + * + * Borrows from Modernizr. + * + * @param {string} eventNameSuffix Event name, e.g. "click". + * @param {?boolean} capture Check if the capture phase is supported. + * @return {boolean} True if the event is supported. + * @internal + * @license Modernizr 3.0.0pre (Custom Build) | MIT + */ +function isEventSupported(eventNameSuffix, capture) { + if (!ExecutionEnvironment.canUseDOM || capture && !('addEventListener' in document)) { + return false; + } + + var eventName = 'on' + eventNameSuffix; + var isSupported = eventName in document; + + if (!isSupported) { + var element = document.createElement('div'); + element.setAttribute(eventName, 'return;'); + isSupported = typeof element[eventName] === 'function'; + } + + if (!isSupported && useHasFeature && eventNameSuffix === 'wheel') { + // This is the only way to test support for the `wheel` event in IE9+. + isSupported = document.implementation.hasFeature('Events.wheel', '3.0'); + } + + return isSupported; +} + +module.exports = isEventSupported; + +/***/ }), +/* 46 */ +/***/ (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. + * + */ + + + +/** + * Translation from modifier key to the associated property in the event. + * @see http://www.w3.org/TR/DOM-Level-3-Events/#keys-Modifiers + */ + +var modifierKeyToProp = { + Alt: 'altKey', + Control: 'ctrlKey', + Meta: 'metaKey', + Shift: 'shiftKey' +}; + +// IE8 does not implement getModifierState so we simply map it to the only +// modifier keys exposed by the event itself, does not support Lock-keys. +// Currently, all major browsers except Chrome seems to support Lock-keys. +function modifierStateGetter(keyArg) { + var syntheticEvent = this; + var nativeEvent = syntheticEvent.nativeEvent; + if (nativeEvent.getModifierState) { + return nativeEvent.getModifierState(keyArg); + } + var keyProp = modifierKeyToProp[keyArg]; + return keyProp ? !!nativeEvent[keyProp] : false; +} + +function getEventModifierState(nativeEvent) { + return modifierStateGetter; +} + +module.exports = getEventModifierState; + +/***/ }), +/* 47 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(process) {/** + * 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 DOMLazyTree = __webpack_require__(24); +var Danger = __webpack_require__(146); +var ReactDOMComponentTree = __webpack_require__(7); +var ReactInstrumentation = __webpack_require__(13); + +var createMicrosoftUnsafeLocalFunction = __webpack_require__(49); +var setInnerHTML = __webpack_require__(36); +var setTextContent = __webpack_require__(79); + +function getNodeAfter(parentNode, node) { + // Special case for text components, which return [open, close] comments + // from getHostNode. + if (Array.isArray(node)) { + node = node[1]; + } + return node ? node.nextSibling : parentNode.firstChild; +} + +/** + * Inserts `childNode` as a child of `parentNode` at the `index`. + * + * @param {DOMElement} parentNode Parent node in which to insert. + * @param {DOMElement} childNode Child node to insert. + * @param {number} index Index at which to insert the child. + * @internal + */ +var insertChildAt = createMicrosoftUnsafeLocalFunction(function (parentNode, childNode, referenceNode) { + // We rely exclusively on `insertBefore(node, null)` instead of also using + // `appendChild(node)`. (Using `undefined` is not allowed by all browsers so + // we are careful to use `null`.) + parentNode.insertBefore(childNode, referenceNode); +}); + +function insertLazyTreeChildAt(parentNode, childTree, referenceNode) { + DOMLazyTree.insertTreeBefore(parentNode, childTree, referenceNode); +} + +function moveChild(parentNode, childNode, referenceNode) { + if (Array.isArray(childNode)) { + moveDelimitedText(parentNode, childNode[0], childNode[1], referenceNode); + } else { + insertChildAt(parentNode, childNode, referenceNode); + } +} + +function removeChild(parentNode, childNode) { + if (Array.isArray(childNode)) { + var closingComment = childNode[1]; + childNode = childNode[0]; + removeDelimitedText(parentNode, childNode, closingComment); + parentNode.removeChild(closingComment); + } + parentNode.removeChild(childNode); +} + +function moveDelimitedText(parentNode, openingComment, closingComment, referenceNode) { + var node = openingComment; + while (true) { + var nextNode = node.nextSibling; + insertChildAt(parentNode, node, referenceNode); + if (node === closingComment) { + break; + } + node = nextNode; + } +} + +function removeDelimitedText(parentNode, startNode, closingComment) { + while (true) { + var node = startNode.nextSibling; + if (node === closingComment) { + // The closing comment is removed by ReactMultiChild. + break; + } else { + parentNode.removeChild(node); + } + } +} + +function replaceDelimitedText(openingComment, closingComment, stringText) { + var parentNode = openingComment.parentNode; + var nodeAfterComment = openingComment.nextSibling; + if (nodeAfterComment === closingComment) { + // There are no text nodes between the opening and closing comments; insert + // a new one if stringText isn't empty. + if (stringText) { + insertChildAt(parentNode, document.createTextNode(stringText), nodeAfterComment); + } + } else { + if (stringText) { + // Set the text content of the first node after the opening comment, and + // remove all following nodes up until the closing comment. + setTextContent(nodeAfterComment, stringText); + removeDelimitedText(parentNode, nodeAfterComment, closingComment); + } else { + removeDelimitedText(parentNode, openingComment, closingComment); + } + } + + if (process.env.NODE_ENV !== 'production') { + ReactInstrumentation.debugTool.onHostOperation({ + instanceID: ReactDOMComponentTree.getInstanceFromNode(openingComment)._debugID, + type: 'replace text', + payload: stringText + }); + } +} + +var dangerouslyReplaceNodeWithMarkup = Danger.dangerouslyReplaceNodeWithMarkup; +if (process.env.NODE_ENV !== 'production') { + dangerouslyReplaceNodeWithMarkup = function (oldChild, markup, prevInstance) { + Danger.dangerouslyReplaceNodeWithMarkup(oldChild, markup); + if (prevInstance._debugID !== 0) { + ReactInstrumentation.debugTool.onHostOperation({ + instanceID: prevInstance._debugID, + type: 'replace with', + payload: markup.toString() + }); + } else { + var nextInstance = ReactDOMComponentTree.getInstanceFromNode(markup.node); + if (nextInstance._debugID !== 0) { + ReactInstrumentation.debugTool.onHostOperation({ + instanceID: nextInstance._debugID, + type: 'mount', + payload: markup.toString() + }); + } + } + }; +} + +/** + * Operations for updating with DOM children. + */ +var DOMChildrenOperations = { + dangerouslyReplaceNodeWithMarkup: dangerouslyReplaceNodeWithMarkup, + + replaceDelimitedText: replaceDelimitedText, + + /** + * Updates a component's children by processing a series of updates. The + * update configurations are each expected to have a `parentNode` property. + * + * @param {array} updates List of update configurations. + * @internal + */ + processUpdates: function (parentNode, updates) { + if (process.env.NODE_ENV !== 'production') { + var parentNodeDebugID = ReactDOMComponentTree.getInstanceFromNode(parentNode)._debugID; + } + + for (var k = 0; k < updates.length; k++) { + var update = updates[k]; + switch (update.type) { + case 'INSERT_MARKUP': + insertLazyTreeChildAt(parentNode, update.content, getNodeAfter(parentNode, update.afterNode)); + if (process.env.NODE_ENV !== 'production') { + ReactInstrumentation.debugTool.onHostOperation({ + instanceID: parentNodeDebugID, + type: 'insert child', + payload: { + toIndex: update.toIndex, + content: update.content.toString() + } + }); + } + break; + case 'MOVE_EXISTING': + moveChild(parentNode, update.fromNode, getNodeAfter(parentNode, update.afterNode)); + if (process.env.NODE_ENV !== 'production') { + ReactInstrumentation.debugTool.onHostOperation({ + instanceID: parentNodeDebugID, + type: 'move child', + payload: { fromIndex: update.fromIndex, toIndex: update.toIndex } + }); + } + break; + case 'SET_MARKUP': + setInnerHTML(parentNode, update.content); + if (process.env.NODE_ENV !== 'production') { + ReactInstrumentation.debugTool.onHostOperation({ + instanceID: parentNodeDebugID, + type: 'replace children', + payload: update.content.toString() + }); + } + break; + case 'TEXT_CONTENT': + setTextContent(parentNode, update.content); + if (process.env.NODE_ENV !== 'production') { + ReactInstrumentation.debugTool.onHostOperation({ + instanceID: parentNodeDebugID, + type: 'replace text', + payload: update.content.toString() + }); + } + break; + case 'REMOVE_NODE': + removeChild(parentNode, update.fromNode); + if (process.env.NODE_ENV !== 'production') { + ReactInstrumentation.debugTool.onHostOperation({ + instanceID: parentNodeDebugID, + type: 'remove child', + payload: { fromIndex: update.fromIndex } + }); + } + break; + } + } + } +}; + +module.exports = DOMChildrenOperations; +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) + +/***/ }), +/* 48 */ +/***/ (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 DOMNamespaces = { + html: 'http://www.w3.org/1999/xhtml', + mathml: 'http://www.w3.org/1998/Math/MathML', + svg: 'http://www.w3.org/2000/svg' +}; + +module.exports = DOMNamespaces; + +/***/ }), +/* 49 */ +/***/ (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. + * + */ + +/* globals MSApp */ + + + +/** + * Create a function which has 'unsafe' privileges (required by windows8 apps) + */ + +var createMicrosoftUnsafeLocalFunction = function (func) { + if (typeof MSApp !== 'undefined' && MSApp.execUnsafeLocalFunction) { + return function (arg0, arg1, arg2, arg3) { + MSApp.execUnsafeLocalFunction(function () { + return func(arg0, arg1, arg2, arg3); + }); + }; + } else { + return func; + } +}; + +module.exports = createMicrosoftUnsafeLocalFunction; + +/***/ }), +/* 50 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(process) {/** + * 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__(4); + +var ReactPropTypesSecret = __webpack_require__(83); +var propTypesFactory = __webpack_require__(67); + +var React = __webpack_require__(21); +var PropTypes = propTypesFactory(React.isValidElement); + +var invariant = __webpack_require__(1); +var warning = __webpack_require__(3); + +var hasReadOnlyValue = { + button: true, + checkbox: true, + image: true, + hidden: true, + radio: true, + reset: true, + submit: true +}; + +function _assertSingleLink(inputProps) { + !(inputProps.checkedLink == null || inputProps.valueLink == null) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Cannot provide a checkedLink and a valueLink. If you want to use checkedLink, you probably don\'t want to use valueLink and vice versa.') : _prodInvariant('87') : void 0; +} +function _assertValueLink(inputProps) { + _assertSingleLink(inputProps); + !(inputProps.value == null && inputProps.onChange == null) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Cannot provide a valueLink and a value or onChange event. If you want to use value or onChange, you probably don\'t want to use valueLink.') : _prodInvariant('88') : void 0; +} + +function _assertCheckedLink(inputProps) { + _assertSingleLink(inputProps); + !(inputProps.checked == null && inputProps.onChange == null) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Cannot provide a checkedLink and a checked property or onChange event. If you want to use checked or onChange, you probably don\'t want to use checkedLink') : _prodInvariant('89') : void 0; +} + +var propTypes = { + value: function (props, propName, componentName) { + if (!props[propName] || hasReadOnlyValue[props.type] || props.onChange || props.readOnly || props.disabled) { + return null; + } + return new Error('You provided a `value` prop to a form field without an ' + '`onChange` handler. This will render a read-only field. If ' + 'the field should be mutable use `defaultValue`. Otherwise, ' + 'set either `onChange` or `readOnly`.'); + }, + checked: function (props, propName, componentName) { + if (!props[propName] || props.onChange || props.readOnly || props.disabled) { + return null; + } + return new Error('You provided a `checked` prop to a form field without an ' + '`onChange` handler. This will render a read-only field. If ' + 'the field should be mutable use `defaultChecked`. Otherwise, ' + 'set either `onChange` or `readOnly`.'); + }, + onChange: PropTypes.func +}; + +var loggedTypeFailures = {}; +function getDeclarationErrorAddendum(owner) { + if (owner) { + var name = owner.getName(); + if (name) { + return ' Check the render method of `' + name + '`.'; + } + } + return ''; +} + +/** + * Provide a linked `value` attribute for controlled forms. You should not use + * this outside of the ReactDOM controlled form components. + */ +var LinkedValueUtils = { + checkPropTypes: function (tagName, props, owner) { + for (var propName in propTypes) { + if (propTypes.hasOwnProperty(propName)) { + var error = propTypes[propName](props, propName, tagName, 'prop', null, ReactPropTypesSecret); + } + if (error instanceof Error && !(error.message in loggedTypeFailures)) { + // Only monitor this failure once because there tends to be a lot of the + // same error. + loggedTypeFailures[error.message] = true; + + var addendum = getDeclarationErrorAddendum(owner); + process.env.NODE_ENV !== 'production' ? warning(false, 'Failed form propType: %s%s', error.message, addendum) : void 0; + } + } + }, + + /** + * @param {object} inputProps Props for form component + * @return {*} current value of the input either from value prop or link. + */ + getValue: function (inputProps) { + if (inputProps.valueLink) { + _assertValueLink(inputProps); + return inputProps.valueLink.value; + } + return inputProps.value; + }, + + /** + * @param {object} inputProps Props for form component + * @return {*} current checked status of the input either from checked prop + * or link. + */ + getChecked: function (inputProps) { + if (inputProps.checkedLink) { + _assertCheckedLink(inputProps); + return inputProps.checkedLink.value; + } + return inputProps.checked; + }, + + /** + * @param {object} inputProps Props for form component + * @param {SyntheticEvent} event change event to handle + */ + executeOnChange: function (inputProps, event) { + if (inputProps.valueLink) { + _assertValueLink(inputProps); + return inputProps.valueLink.requestChange(event.target.value); + } else if (inputProps.checkedLink) { + _assertCheckedLink(inputProps); + return inputProps.checkedLink.requestChange(event.target.checked); + } else if (inputProps.onChange) { + return inputProps.onChange.call(undefined, event); + } + } +}; + +module.exports = LinkedValueUtils; +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) + +/***/ }), +/* 51 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(process) {/** + * 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 _prodInvariant = __webpack_require__(4); + +var invariant = __webpack_require__(1); + +var injected = false; + +var ReactComponentEnvironment = { + /** + * Optionally injectable hook for swapping out mount images in the middle of + * the tree. + */ + replaceNodeWithMarkup: null, + + /** + * Optionally injectable hook for processing a queue of child updates. Will + * later move into MultiChildComponents. + */ + processChildrenUpdates: null, + + injection: { + injectEnvironment: function (environment) { + !!injected ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactCompositeComponent: injectEnvironment() can only be called once.') : _prodInvariant('104') : void 0; + ReactComponentEnvironment.replaceNodeWithMarkup = environment.replaceNodeWithMarkup; + ReactComponentEnvironment.processChildrenUpdates = environment.processChildrenUpdates; + injected = true; + } + } +}; + +module.exports = ReactComponentEnvironment; +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) + +/***/ }), +/* 52 */ +/***/ (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. + * + * @typechecks + * + */ + +/*eslint-disable no-self-compare */ + + + +var hasOwnProperty = Object.prototype.hasOwnProperty; + +/** + * inlined Object.is polyfill to avoid requiring consumers ship their own + * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is + */ +function is(x, y) { + // SameValue algorithm + if (x === y) { + // Steps 1-5, 7-10 + // Steps 6.b-6.e: +0 != -0 + // Added the nonzero y check to make Flow happy, but it is redundant + return x !== 0 || y !== 0 || 1 / x === 1 / y; + } else { + // Step 6.a: NaN == NaN + return x !== x && y !== y; + } +} + +/** + * Performs equality by iterating through keys on an object and returning false + * when any key has values which are not strictly equal between the arguments. + * Returns true when the values of all keys are strictly equal. + */ +function shallowEqual(objA, objB) { + if (is(objA, objB)) { + return true; + } + + if (typeof objA !== 'object' || objA === null || typeof objB !== 'object' || objB === null) { + return false; + } + + var keysA = Object.keys(objA); + var keysB = Object.keys(objB); + + if (keysA.length !== keysB.length) { + return false; + } + + // Test for A's keys different from B. + for (var i = 0; i < keysA.length; i++) { + if (!hasOwnProperty.call(objB, keysA[i]) || !is(objA[keysA[i]], objB[keysA[i]])) { + return false; + } + } + + return true; +} + +module.exports = shallowEqual; + +/***/ }), +/* 53 */ +/***/ (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. + * + */ + + + +/** + * Given a `prevElement` and `nextElement`, determines if the existing + * instance should be updated as opposed to being destroyed or replaced by a new + * instance. Both arguments are elements. This ensures that this logic can + * operate on stateless trees without any backing instance. + * + * @param {?object} prevElement + * @param {?object} nextElement + * @return {boolean} True if the existing instance should be updated. + * @protected + */ + +function shouldUpdateReactComponent(prevElement, nextElement) { + var prevEmpty = prevElement === null || prevElement === false; + var nextEmpty = nextElement === null || nextElement === false; + if (prevEmpty || nextEmpty) { + return prevEmpty === nextEmpty; + } + + var prevType = typeof prevElement; + var nextType = typeof nextElement; + if (prevType === 'string' || prevType === 'number') { + return nextType === 'string' || nextType === 'number'; + } else { + return nextType === 'object' && prevElement.type === nextElement.type && prevElement.key === nextElement.key; + } +} + +module.exports = shouldUpdateReactComponent; + +/***/ }), +/* 54 */ +/***/ (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. + * + * + */ + + + +/** + * Escape and wrap key so it is safe to use as a reactid + * + * @param {string} key to be escaped. + * @return {string} the escaped key. + */ + +function escape(key) { + var escapeRegex = /[=:]/g; + var escaperLookup = { + '=': '=0', + ':': '=2' + }; + var escapedString = ('' + key).replace(escapeRegex, function (match) { + return escaperLookup[match]; + }); + + return '$' + escapedString; +} + +/** + * Unescape and unwrap key for human-readable display + * + * @param {string} key to unescape. + * @return {string} the unescaped key. + */ +function unescape(key) { + var unescapeRegex = /(=0|=2)/g; + var unescaperLookup = { + '=0': '=', + '=2': ':' + }; + var keySubstring = key[0] === '.' && key[1] === '$' ? key.substring(2) : key.substring(1); + + return ('' + keySubstring).replace(unescapeRegex, function (match) { + return unescaperLookup[match]; + }); +} + +var KeyEscapeUtils = { + escape: escape, + unescape: unescape +}; + +module.exports = KeyEscapeUtils; + +/***/ }), +/* 55 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(process) {/** + * 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 _prodInvariant = __webpack_require__(4); + +var ReactCurrentOwner = __webpack_require__(14); +var ReactInstanceMap = __webpack_require__(29); +var ReactInstrumentation = __webpack_require__(13); +var ReactUpdates = __webpack_require__(15); + +var invariant = __webpack_require__(1); +var warning = __webpack_require__(3); + +function enqueueUpdate(internalInstance) { + ReactUpdates.enqueueUpdate(internalInstance); +} + +function formatUnexpectedArgument(arg) { + var type = typeof arg; + if (type !== 'object') { + return type; + } + var displayName = arg.constructor && arg.constructor.name || type; + var keys = Object.keys(arg); + if (keys.length > 0 && keys.length < 20) { + return displayName + ' (keys: ' + keys.join(', ') + ')'; + } + return displayName; +} + +function getInternalInstanceReadyForUpdate(publicInstance, callerName) { + var internalInstance = ReactInstanceMap.get(publicInstance); + if (!internalInstance) { + if (process.env.NODE_ENV !== 'production') { + var ctor = publicInstance.constructor; + // Only warn when we have a callerName. Otherwise we should be silent. + // We're probably calling from enqueueCallback. We don't want to warn + // there because we already warned for the corresponding lifecycle method. + process.env.NODE_ENV !== 'production' ? warning(!callerName, '%s(...): Can only update a mounted or mounting component. ' + 'This usually means you called %s() on an unmounted component. ' + 'This is a no-op. Please check the code for the %s component.', callerName, callerName, ctor && (ctor.displayName || ctor.name) || 'ReactClass') : void 0; + } + return null; + } + + if (process.env.NODE_ENV !== 'production') { + process.env.NODE_ENV !== 'production' ? warning(ReactCurrentOwner.current == null, '%s(...): Cannot update during an existing state transition (such as ' + "within `render` or another component's constructor). Render methods " + 'should be a pure function of props and state; constructor ' + 'side-effects are an anti-pattern, but can be moved to ' + '`componentWillMount`.', callerName) : void 0; + } + + return internalInstance; +} + +/** + * ReactUpdateQueue allows for state updates to be scheduled into a later + * reconciliation step. + */ +var ReactUpdateQueue = { + /** + * Checks whether or not this composite component is mounted. + * @param {ReactClass} publicInstance The instance we want to test. + * @return {boolean} True if mounted, false otherwise. + * @protected + * @final + */ + isMounted: function (publicInstance) { + if (process.env.NODE_ENV !== 'production') { + var owner = ReactCurrentOwner.current; + if (owner !== null) { + process.env.NODE_ENV !== 'production' ? warning(owner._warnedAboutRefsInRender, '%s is accessing isMounted inside its render() function. ' + 'render() should be a pure function of props and state. It should ' + 'never access something that requires stale data from the previous ' + 'render, such as refs. Move this logic to componentDidMount and ' + 'componentDidUpdate instead.', owner.getName() || 'A component') : void 0; + owner._warnedAboutRefsInRender = true; + } + } + var internalInstance = ReactInstanceMap.get(publicInstance); + if (internalInstance) { + // During componentWillMount and render this will still be null but after + // that will always render to something. At least for now. So we can use + // this hack. + return !!internalInstance._renderedComponent; + } else { + return false; + } + }, + + /** + * Enqueue a callback that will be executed after all the pending updates + * have processed. + * + * @param {ReactClass} publicInstance The instance to use as `this` context. + * @param {?function} callback Called after state is updated. + * @param {string} callerName Name of the calling function in the public API. + * @internal + */ + enqueueCallback: function (publicInstance, callback, callerName) { + ReactUpdateQueue.validateCallback(callback, callerName); + var internalInstance = getInternalInstanceReadyForUpdate(publicInstance); + + // Previously we would throw an error if we didn't have an internal + // instance. Since we want to make it a no-op instead, we mirror the same + // behavior we have in other enqueue* methods. + // We also need to ignore callbacks in componentWillMount. See + // enqueueUpdates. + if (!internalInstance) { + return null; + } + + if (internalInstance._pendingCallbacks) { + internalInstance._pendingCallbacks.push(callback); + } else { + internalInstance._pendingCallbacks = [callback]; + } + // TODO: The callback here is ignored when setState is called from + // componentWillMount. Either fix it or disallow doing so completely in + // favor of getInitialState. Alternatively, we can disallow + // componentWillMount during server-side rendering. + enqueueUpdate(internalInstance); + }, + + enqueueCallbackInternal: function (internalInstance, callback) { + if (internalInstance._pendingCallbacks) { + internalInstance._pendingCallbacks.push(callback); + } else { + internalInstance._pendingCallbacks = [callback]; + } + enqueueUpdate(internalInstance); + }, + + /** + * Forces an update. This should only be invoked when it is known with + * certainty that we are **not** in a DOM transaction. + * + * You may want to call this when you know that some deeper aspect of the + * component's state has changed but `setState` was not called. + * + * This will not invoke `shouldComponentUpdate`, but it will invoke + * `componentWillUpdate` and `componentDidUpdate`. + * + * @param {ReactClass} publicInstance The instance that should rerender. + * @internal + */ + enqueueForceUpdate: function (publicInstance) { + var internalInstance = getInternalInstanceReadyForUpdate(publicInstance, 'forceUpdate'); + + if (!internalInstance) { + return; + } + + internalInstance._pendingForceUpdate = true; + + enqueueUpdate(internalInstance); + }, + + /** + * Replaces all of the state. Always use this or `setState` to mutate state. + * You should treat `this.state` as immutable. + * + * There is no guarantee that `this.state` will be immediately updated, so + * accessing `this.state` after calling this method may return the old value. + * + * @param {ReactClass} publicInstance The instance that should rerender. + * @param {object} completeState Next state. + * @internal + */ + enqueueReplaceState: function (publicInstance, completeState, callback) { + var internalInstance = getInternalInstanceReadyForUpdate(publicInstance, 'replaceState'); + + if (!internalInstance) { + return; + } + + internalInstance._pendingStateQueue = [completeState]; + internalInstance._pendingReplaceState = true; + + // Future-proof 15.5 + if (callback !== undefined && callback !== null) { + ReactUpdateQueue.validateCallback(callback, 'replaceState'); + if (internalInstance._pendingCallbacks) { + internalInstance._pendingCallbacks.push(callback); + } else { + internalInstance._pendingCallbacks = [callback]; + } + } + + enqueueUpdate(internalInstance); + }, + + /** + * Sets a subset of the state. This only exists because _pendingState is + * internal. This provides a merging strategy that is not available to deep + * properties which is confusing. TODO: Expose pendingState or don't use it + * during the merge. + * + * @param {ReactClass} publicInstance The instance that should rerender. + * @param {object} partialState Next partial state to be merged with state. + * @internal + */ + enqueueSetState: function (publicInstance, partialState) { + if (process.env.NODE_ENV !== 'production') { + ReactInstrumentation.debugTool.onSetState(); + process.env.NODE_ENV !== 'production' ? warning(partialState != null, 'setState(...): You passed an undefined or null state object; ' + 'instead, use forceUpdate().') : void 0; + } + + var internalInstance = getInternalInstanceReadyForUpdate(publicInstance, 'setState'); + + if (!internalInstance) { + return; + } + + var queue = internalInstance._pendingStateQueue || (internalInstance._pendingStateQueue = []); + queue.push(partialState); + + enqueueUpdate(internalInstance); + }, + + enqueueElementInternal: function (internalInstance, nextElement, nextContext) { + internalInstance._pendingElement = nextElement; + // TODO: introduce _pendingContext instead of setting it directly. + internalInstance._context = nextContext; + enqueueUpdate(internalInstance); + }, + + validateCallback: function (callback, callerName) { + !(!callback || typeof callback === 'function') ? process.env.NODE_ENV !== 'production' ? invariant(false, '%s(...): Expected the last optional `callback` argument to be a function. Instead received: %s.', callerName, formatUnexpectedArgument(callback)) : _prodInvariant('122', callerName, formatUnexpectedArgument(callback)) : void 0; + } +}; + +module.exports = ReactUpdateQueue; +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) + +/***/ }), +/* 56 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(process) {/** + * 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 _assign = __webpack_require__(8); + +var emptyFunction = __webpack_require__(12); +var warning = __webpack_require__(3); + +var validateDOMNesting = emptyFunction; + +if (process.env.NODE_ENV !== 'production') { + // This validation code was written based on the HTML5 parsing spec: + // https://html.spec.whatwg.org/multipage/syntax.html#has-an-element-in-scope + // + // Note: this does not catch all invalid nesting, nor does it try to (as it's + // not clear what practical benefit doing so provides); instead, we warn only + // for cases where the parser will give a parse tree differing from what React + // intended. For example,
is invalid but we don't warn + // because it still parses correctly; we do warn for other cases like nested + //

tags where the beginning of the second element implicitly closes the + // first, causing a confusing mess. + + // https://html.spec.whatwg.org/multipage/syntax.html#special + var specialTags = ['address', 'applet', 'area', 'article', 'aside', 'base', 'basefont', 'bgsound', 'blockquote', 'body', 'br', 'button', 'caption', 'center', 'col', 'colgroup', 'dd', 'details', 'dir', 'div', 'dl', 'dt', 'embed', 'fieldset', 'figcaption', 'figure', 'footer', 'form', 'frame', 'frameset', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'header', 'hgroup', 'hr', 'html', 'iframe', 'img', 'input', 'isindex', 'li', 'link', 'listing', 'main', 'marquee', 'menu', 'menuitem', 'meta', 'nav', 'noembed', 'noframes', 'noscript', 'object', 'ol', 'p', 'param', 'plaintext', 'pre', 'script', 'section', 'select', 'source', 'style', 'summary', 'table', 'tbody', 'td', 'template', 'textarea', 'tfoot', 'th', 'thead', 'title', 'tr', 'track', 'ul', 'wbr', 'xmp']; + + // https://html.spec.whatwg.org/multipage/syntax.html#has-an-element-in-scope + var inScopeTags = ['applet', 'caption', 'html', 'table', 'td', 'th', 'marquee', 'object', 'template', + + // https://html.spec.whatwg.org/multipage/syntax.html#html-integration-point + // TODO: Distinguish by namespace here -- for , including it here + // errs on the side of fewer warnings + 'foreignObject', 'desc', 'title']; + + // https://html.spec.whatwg.org/multipage/syntax.html#has-an-element-in-button-scope + var buttonScopeTags = inScopeTags.concat(['button']); + + // https://html.spec.whatwg.org/multipage/syntax.html#generate-implied-end-tags + var impliedEndTags = ['dd', 'dt', 'li', 'option', 'optgroup', 'p', 'rp', 'rt']; + + var emptyAncestorInfo = { + current: null, + + formTag: null, + aTagInScope: null, + buttonTagInScope: null, + nobrTagInScope: null, + pTagInButtonScope: null, + + listItemTagAutoclosing: null, + dlItemTagAutoclosing: null + }; + + var updatedAncestorInfo = function (oldInfo, tag, instance) { + var ancestorInfo = _assign({}, oldInfo || emptyAncestorInfo); + var info = { tag: tag, instance: instance }; + + if (inScopeTags.indexOf(tag) !== -1) { + ancestorInfo.aTagInScope = null; + ancestorInfo.buttonTagInScope = null; + ancestorInfo.nobrTagInScope = null; + } + if (buttonScopeTags.indexOf(tag) !== -1) { + ancestorInfo.pTagInButtonScope = null; + } + + // See rules for 'li', 'dd', 'dt' start tags in + // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-inbody + if (specialTags.indexOf(tag) !== -1 && tag !== 'address' && tag !== 'div' && tag !== 'p') { + ancestorInfo.listItemTagAutoclosing = null; + ancestorInfo.dlItemTagAutoclosing = null; + } + + ancestorInfo.current = info; + + if (tag === 'form') { + ancestorInfo.formTag = info; + } + if (tag === 'a') { + ancestorInfo.aTagInScope = info; + } + if (tag === 'button') { + ancestorInfo.buttonTagInScope = info; + } + if (tag === 'nobr') { + ancestorInfo.nobrTagInScope = info; + } + if (tag === 'p') { + ancestorInfo.pTagInButtonScope = info; + } + if (tag === 'li') { + ancestorInfo.listItemTagAutoclosing = info; + } + if (tag === 'dd' || tag === 'dt') { + ancestorInfo.dlItemTagAutoclosing = info; + } + + return ancestorInfo; + }; + + /** + * Returns whether + */ + var isTagValidWithParent = function (tag, parentTag) { + // First, let's check if we're in an unusual parsing mode... + switch (parentTag) { + // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-inselect + case 'select': + return tag === 'option' || tag === 'optgroup' || tag === '#text'; + case 'optgroup': + return tag === 'option' || tag === '#text'; + // Strictly speaking, seeing an <option> doesn't mean we're in a <select> + // but + case 'option': + return tag === '#text'; + // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-intd + // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-incaption + // No special behavior since these rules fall back to "in body" mode for + // all except special table nodes which cause bad parsing behavior anyway. + + // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-intr + case 'tr': + return tag === 'th' || tag === 'td' || tag === 'style' || tag === 'script' || tag === 'template'; + // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-intbody + case 'tbody': + case 'thead': + case 'tfoot': + return tag === 'tr' || tag === 'style' || tag === 'script' || tag === 'template'; + // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-incolgroup + case 'colgroup': + return tag === 'col' || tag === 'template'; + // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-intable + case 'table': + return tag === 'caption' || tag === 'colgroup' || tag === 'tbody' || tag === 'tfoot' || tag === 'thead' || tag === 'style' || tag === 'script' || tag === 'template'; + // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-inhead + case 'head': + return tag === 'base' || tag === 'basefont' || tag === 'bgsound' || tag === 'link' || tag === 'meta' || tag === 'title' || tag === 'noscript' || tag === 'noframes' || tag === 'style' || tag === 'script' || tag === 'template'; + // https://html.spec.whatwg.org/multipage/semantics.html#the-html-element + case 'html': + return tag === 'head' || tag === 'body'; + case '#document': + return tag === 'html'; + } + + // Probably in the "in body" parsing mode, so we outlaw only tag combos + // where the parsing rules cause implicit opens or closes to be added. + // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-inbody + switch (tag) { + case 'h1': + case 'h2': + case 'h3': + case 'h4': + case 'h5': + case 'h6': + return parentTag !== 'h1' && parentTag !== 'h2' && parentTag !== 'h3' && parentTag !== 'h4' && parentTag !== 'h5' && parentTag !== 'h6'; + + case 'rp': + case 'rt': + return impliedEndTags.indexOf(parentTag) === -1; + + case 'body': + case 'caption': + case 'col': + case 'colgroup': + case 'frame': + case 'head': + case 'html': + case 'tbody': + case 'td': + case 'tfoot': + case 'th': + case 'thead': + case 'tr': + // These tags are only valid with a few parents that have special child + // parsing rules -- if we're down here, then none of those matched and + // so we allow it only if we don't know what the parent is, as all other + // cases are invalid. + return parentTag == null; + } + + return true; + }; + + /** + * Returns whether + */ + var findInvalidAncestorForTag = function (tag, ancestorInfo) { + switch (tag) { + case 'address': + case 'article': + case 'aside': + case 'blockquote': + case 'center': + case 'details': + case 'dialog': + case 'dir': + case 'div': + case 'dl': + case 'fieldset': + case 'figcaption': + case 'figure': + case 'footer': + case 'header': + case 'hgroup': + case 'main': + case 'menu': + case 'nav': + case 'ol': + case 'p': + case 'section': + case 'summary': + case 'ul': + case 'pre': + case 'listing': + case 'table': + case 'hr': + case 'xmp': + case 'h1': + case 'h2': + case 'h3': + case 'h4': + case 'h5': + case 'h6': + return ancestorInfo.pTagInButtonScope; + + case 'form': + return ancestorInfo.formTag || ancestorInfo.pTagInButtonScope; + + case 'li': + return ancestorInfo.listItemTagAutoclosing; + + case 'dd': + case 'dt': + return ancestorInfo.dlItemTagAutoclosing; + + case 'button': + return ancestorInfo.buttonTagInScope; + + case 'a': + // Spec says something about storing a list of markers, but it sounds + // equivalent to this check. + return ancestorInfo.aTagInScope; + + case 'nobr': + return ancestorInfo.nobrTagInScope; + } + + return null; + }; + + /** + * Given a ReactCompositeComponent instance, return a list of its recursive + * owners, starting at the root and ending with the instance itself. + */ + var findOwnerStack = function (instance) { + if (!instance) { + return []; + } + + var stack = []; + do { + stack.push(instance); + } while (instance = instance._currentElement._owner); + stack.reverse(); + return stack; + }; + + var didWarn = {}; + + validateDOMNesting = function (childTag, childText, childInstance, ancestorInfo) { + ancestorInfo = ancestorInfo || emptyAncestorInfo; + var parentInfo = ancestorInfo.current; + var parentTag = parentInfo && parentInfo.tag; + + if (childText != null) { + process.env.NODE_ENV !== 'production' ? warning(childTag == null, 'validateDOMNesting: when childText is passed, childTag should be null') : void 0; + childTag = '#text'; + } + + var invalidParent = isTagValidWithParent(childTag, parentTag) ? null : parentInfo; + var invalidAncestor = invalidParent ? null : findInvalidAncestorForTag(childTag, ancestorInfo); + var problematic = invalidParent || invalidAncestor; + + if (problematic) { + var ancestorTag = problematic.tag; + var ancestorInstance = problematic.instance; + + var childOwner = childInstance && childInstance._currentElement._owner; + var ancestorOwner = ancestorInstance && ancestorInstance._currentElement._owner; + + var childOwners = findOwnerStack(childOwner); + var ancestorOwners = findOwnerStack(ancestorOwner); + + var minStackLen = Math.min(childOwners.length, ancestorOwners.length); + var i; + + var deepestCommon = -1; + for (i = 0; i < minStackLen; i++) { + if (childOwners[i] === ancestorOwners[i]) { + deepestCommon = i; + } else { + break; + } + } + + var UNKNOWN = '(unknown)'; + var childOwnerNames = childOwners.slice(deepestCommon + 1).map(function (inst) { + return inst.getName() || UNKNOWN; + }); + var ancestorOwnerNames = ancestorOwners.slice(deepestCommon + 1).map(function (inst) { + return inst.getName() || UNKNOWN; + }); + var ownerInfo = [].concat( + // If the parent and child instances have a common owner ancestor, start + // with that -- otherwise we just start with the parent's owners. + deepestCommon !== -1 ? childOwners[deepestCommon].getName() || UNKNOWN : [], ancestorOwnerNames, ancestorTag, + // If we're warning about an invalid (non-parent) ancestry, add '...' + invalidAncestor ? ['...'] : [], childOwnerNames, childTag).join(' > '); + + var warnKey = !!invalidParent + '|' + childTag + '|' + ancestorTag + '|' + ownerInfo; + if (didWarn[warnKey]) { + return; + } + didWarn[warnKey] = true; + + var tagDisplayName = childTag; + var whitespaceInfo = ''; + if (childTag === '#text') { + if (/\S/.test(childText)) { + tagDisplayName = 'Text nodes'; + } else { + tagDisplayName = 'Whitespace text nodes'; + whitespaceInfo = " Make sure you don't have any extra whitespace between tags on " + 'each line of your source code.'; + } + } else { + tagDisplayName = '<' + childTag + '>'; + } + + if (invalidParent) { + var info = ''; + if (ancestorTag === 'table' && childTag === 'tr') { + info += ' Add a <tbody> to your code to match the DOM tree generated by ' + 'the browser.'; + } + process.env.NODE_ENV !== 'production' ? warning(false, 'validateDOMNesting(...): %s cannot appear as a child of <%s>.%s ' + 'See %s.%s', tagDisplayName, ancestorTag, whitespaceInfo, ownerInfo, info) : void 0; + } else { + process.env.NODE_ENV !== 'production' ? warning(false, 'validateDOMNesting(...): %s cannot appear as a descendant of ' + '<%s>. See %s.', tagDisplayName, ancestorTag, ownerInfo) : void 0; + } + } + }; + + validateDOMNesting.updatedAncestorInfo = updatedAncestorInfo; + + // For testing + validateDOMNesting.isTagValidInContext = function (tag, ancestorInfo) { + ancestorInfo = ancestorInfo || emptyAncestorInfo; + var parentInfo = ancestorInfo.current; + var parentTag = parentInfo && parentInfo.tag; + return isTagValidWithParent(tag, parentTag) && !findInvalidAncestorForTag(tag, ancestorInfo); + }; +} + +module.exports = validateDOMNesting; +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) + +/***/ }), +/* 57 */ +/***/ (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. + * + */ + + + +/** + * `charCode` represents the actual "character code" and is safe to use with + * `String.fromCharCode`. As such, only keys that correspond to printable + * characters produce a valid `charCode`, the only exception to this is Enter. + * The Tab-key is considered non-printable and does not have a `charCode`, + * presumably because it does not produce a tab-character in browsers. + * + * @param {object} nativeEvent Native browser event. + * @return {number} Normalized `charCode` property. + */ + +function getEventCharCode(nativeEvent) { + var charCode; + var keyCode = nativeEvent.keyCode; + + if ('charCode' in nativeEvent) { + charCode = nativeEvent.charCode; + + // FF does not set `charCode` for the Enter-key, check against `keyCode`. + if (charCode === 0 && keyCode === 13) { + charCode = 13; + } + } else { + // IE8 does not implement `charCode`, but `keyCode` has the correct value. + charCode = keyCode; + } + + // Some non-printable keys are reported in `charCode`/`keyCode`, discard them. + // Must not discard the (non-)printable Enter-key. + if (charCode >= 32 || charCode === 13) { + return charCode; + } + + return 0; +} + +module.exports = getEventCharCode; + +/***/ }), +/* 58 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export (immutable) */ __webpack_exports__["a"] = warning; +/** + * Prints a warning in the console if it exists. + * + * @param {String} message The warning message. + * @returns {void} + */ +function warning(message) { + /* eslint-disable no-console */ + if (typeof console !== 'undefined' && typeof console.error === 'function') { + console.error(message); + } + /* eslint-enable no-console */ + try { + // This error was thrown as a convenience so that if you enable + // "break on all exceptions" in your console, + // it would pause the execution at this line. + throw new Error(message); + /* eslint-disable no-empty */ + } catch (e) {} + /* eslint-enable no-empty */ +} + +/***/ }), +/* 59 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); +/* WEBPACK VAR INJECTION */(function(process) {/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__createStore__ = __webpack_require__(97); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__combineReducers__ = __webpack_require__(230); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__bindActionCreators__ = __webpack_require__(231); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__applyMiddleware__ = __webpack_require__(232); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__compose__ = __webpack_require__(101); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__utils_warning__ = __webpack_require__(100); +/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "createStore", function() { return __WEBPACK_IMPORTED_MODULE_0__createStore__["b"]; }); +/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "combineReducers", function() { return __WEBPACK_IMPORTED_MODULE_1__combineReducers__["a"]; }); +/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "bindActionCreators", function() { return __WEBPACK_IMPORTED_MODULE_2__bindActionCreators__["a"]; }); +/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "applyMiddleware", function() { return __WEBPACK_IMPORTED_MODULE_3__applyMiddleware__["a"]; }); +/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "compose", function() { return __WEBPACK_IMPORTED_MODULE_4__compose__["a"]; }); + + + + + + + +/* +* This is a dummy function to check if the function name has been altered by minification. +* If the function has been minified and NODE_ENV !== 'production', warn the user. +*/ +function isCrushed() {} + +if (process.env.NODE_ENV !== 'production' && typeof isCrushed.name === 'string' && isCrushed.name !== 'isCrushed') { + Object(__WEBPACK_IMPORTED_MODULE_5__utils_warning__["a" /* default */])('You are currently using minified code outside of NODE_ENV === \'production\'. ' + 'This means that you are running a slower development build of Redux. ' + 'You can use loose-envify (https://github.com/zertosh/loose-envify) for browserify ' + 'or DefinePlugin for webpack (http://stackoverflow.com/questions/30030031) ' + 'to ensure you have the correct code for your production build.'); +} + + +/* WEBPACK VAR INJECTION */}.call(__webpack_exports__, __webpack_require__(0))) + +/***/ }), +/* 60 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__baseGetTag_js__ = __webpack_require__(220); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__getPrototype_js__ = __webpack_require__(225); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__isObjectLike_js__ = __webpack_require__(227); + + + + +/** `Object#toString` result references. */ +var objectTag = '[object Object]'; + +/** Used for built-in method references. */ +var funcProto = Function.prototype, + objectProto = Object.prototype; + +/** Used to resolve the decompiled source of functions. */ +var funcToString = funcProto.toString; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** Used to infer the `Object` constructor. */ +var objectCtorString = funcToString.call(Object); + +/** + * Checks if `value` is a plain object, that is, an object created by the + * `Object` constructor or one with a `[[Prototype]]` of `null`. + * + * @static + * @memberOf _ + * @since 0.8.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a plain object, else `false`. + * @example + * + * function Foo() { + * this.a = 1; + * } + * + * _.isPlainObject(new Foo); + * // => false + * + * _.isPlainObject([1, 2, 3]); + * // => false + * + * _.isPlainObject({ 'x': 0, 'y': 0 }); + * // => true + * + * _.isPlainObject(Object.create(null)); + * // => true + */ +function isPlainObject(value) { + if (!Object(__WEBPACK_IMPORTED_MODULE_2__isObjectLike_js__["a" /* default */])(value) || Object(__WEBPACK_IMPORTED_MODULE_0__baseGetTag_js__["a" /* default */])(value) != objectTag) { + return false; + } + var proto = Object(__WEBPACK_IMPORTED_MODULE_1__getPrototype_js__["a" /* default */])(value); + if (proto === null) { + return true; + } + var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor; + return typeof Ctor == 'function' && Ctor instanceof Ctor && + funcToString.call(Ctor) == objectCtorString; +} + +/* harmony default export */ __webpack_exports__["a"] = (isPlainObject); + + +/***/ }), +/* 61 */ +/***/ (function(module, exports) { + +var g; + +// This works in non-strict mode +g = (function() { + return this; +})(); + +try { + // This works if eval is allowed (see CSP) + g = g || Function("return this")() || (1,eval)("this"); +} catch(e) { + // This works if the window reference is available + if(typeof window === "object") + g = window; +} + +// g can still be undefined, but nothing to do about it... +// We return undefined, instead of nothing here, so it's +// easier to handle this case. if(!global) { ...} + +module.exports = g; + + +/***/ }), +/* 62 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(process) {/** + * 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__(22), + _assign = __webpack_require__(39); + +var ReactNoopUpdateQueue = __webpack_require__(63); + +var canDefineProperty = __webpack_require__(30); +var emptyObject = __webpack_require__(31); +var invariant = __webpack_require__(1); +var lowPriorityWarning = __webpack_require__(40); + +/** + * Base class helpers for the updating state of a component. + */ +function ReactComponent(props, context, updater) { + this.props = props; + this.context = context; + this.refs = emptyObject; + // We initialize the default updater but the real one gets injected by the + // renderer. + this.updater = updater || ReactNoopUpdateQueue; +} + +ReactComponent.prototype.isReactComponent = {}; + +/** + * Sets a subset of the state. Always use this to mutate + * state. You should treat `this.state` as immutable. + * + * There is no guarantee that `this.state` will be immediately updated, so + * accessing `this.state` after calling this method may return the old value. + * + * There is no guarantee that calls to `setState` will run synchronously, + * as they may eventually be batched together. You can provide an optional + * callback that will be executed when the call to setState is actually + * completed. + * + * When a function is provided to setState, it will be called at some point in + * the future (not synchronously). It will be called with the up to date + * component arguments (state, props, context). These values can be different + * from this.* because your function may be called after receiveProps but before + * shouldComponentUpdate, and this new state, props, and context will not yet be + * assigned to this. + * + * @param {object|function} partialState Next partial state or function to + * produce next partial state to be merged with current state. + * @param {?function} callback Called after state is updated. + * @final + * @protected + */ +ReactComponent.prototype.setState = function (partialState, callback) { + !(typeof partialState === 'object' || typeof partialState === 'function' || partialState == null) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'setState(...): takes an object of state variables to update or a function which returns an object of state variables.') : _prodInvariant('85') : void 0; + this.updater.enqueueSetState(this, partialState); + if (callback) { + this.updater.enqueueCallback(this, callback, 'setState'); + } +}; + +/** + * Forces an update. This should only be invoked when it is known with + * certainty that we are **not** in a DOM transaction. + * + * You may want to call this when you know that some deeper aspect of the + * component's state has changed but `setState` was not called. + * + * This will not invoke `shouldComponentUpdate`, but it will invoke + * `componentWillUpdate` and `componentDidUpdate`. + * + * @param {?function} callback Called after update is complete. + * @final + * @protected + */ +ReactComponent.prototype.forceUpdate = function (callback) { + this.updater.enqueueForceUpdate(this); + if (callback) { + this.updater.enqueueCallback(this, callback, 'forceUpdate'); + } +}; + +/** + * Deprecated APIs. These APIs used to exist on classic React classes but since + * we would like to deprecate them, we're not going to move them over to this + * modern base class. Instead, we define a getter that warns if it's accessed. + */ +if (process.env.NODE_ENV !== 'production') { + var deprecatedAPIs = { + isMounted: ['isMounted', 'Instead, make sure to clean up subscriptions and pending requests in ' + 'componentWillUnmount to prevent memory leaks.'], + replaceState: ['replaceState', 'Refactor your code to use setState instead (see ' + 'https://github.com/facebook/react/issues/3236).'] + }; + var defineDeprecationWarning = function (methodName, info) { + if (canDefineProperty) { + Object.defineProperty(ReactComponent.prototype, methodName, { + get: function () { + lowPriorityWarning(false, '%s(...) is deprecated in plain JavaScript React classes. %s', info[0], info[1]); + return undefined; + } + }); + } + }; + for (var fnName in deprecatedAPIs) { + if (deprecatedAPIs.hasOwnProperty(fnName)) { + defineDeprecationWarning(fnName, deprecatedAPIs[fnName]); + } + } +} + +/** + * Base class helpers for the updating state of a component. + */ +function ReactPureComponent(props, context, updater) { + // Duplicated from ReactComponent. + this.props = props; + this.context = context; + this.refs = emptyObject; + // We initialize the default updater but the real one gets injected by the + // renderer. + this.updater = updater || ReactNoopUpdateQueue; +} + +function ComponentDummy() {} +ComponentDummy.prototype = ReactComponent.prototype; +ReactPureComponent.prototype = new ComponentDummy(); +ReactPureComponent.prototype.constructor = ReactPureComponent; +// Avoid an extra prototype jump for these methods. +_assign(ReactPureComponent.prototype, ReactComponent.prototype); +ReactPureComponent.prototype.isPureReactComponent = true; + +module.exports = { + Component: ReactComponent, + PureComponent: ReactPureComponent +}; +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) + +/***/ }), +/* 63 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(process) {/** + * 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 warning = __webpack_require__(3); + +function warnNoop(publicInstance, callerName) { + if (process.env.NODE_ENV !== 'production') { + var constructor = publicInstance.constructor; + process.env.NODE_ENV !== 'production' ? warning(false, '%s(...): Can only update a mounted or mounting component. ' + 'This usually means you called %s() on an unmounted component. ' + 'This is a no-op. Please check the code for the %s component.', callerName, callerName, constructor && (constructor.displayName || constructor.name) || 'ReactClass') : void 0; + } +} + +/** + * This is the abstract API for an update queue. + */ +var ReactNoopUpdateQueue = { + /** + * Checks whether or not this composite component is mounted. + * @param {ReactClass} publicInstance The instance we want to test. + * @return {boolean} True if mounted, false otherwise. + * @protected + * @final + */ + isMounted: function (publicInstance) { + return false; + }, + + /** + * Enqueue a callback that will be executed after all the pending updates + * have processed. + * + * @param {ReactClass} publicInstance The instance to use as `this` context. + * @param {?function} callback Called after state is updated. + * @internal + */ + enqueueCallback: function (publicInstance, callback) {}, + + /** + * Forces an update. This should only be invoked when it is known with + * certainty that we are **not** in a DOM transaction. + * + * You may want to call this when you know that some deeper aspect of the + * component's state has changed but `setState` was not called. + * + * This will not invoke `shouldComponentUpdate`, but it will invoke + * `componentWillUpdate` and `componentDidUpdate`. + * + * @param {ReactClass} publicInstance The instance that should rerender. + * @internal + */ + enqueueForceUpdate: function (publicInstance) { + warnNoop(publicInstance, 'forceUpdate'); + }, + + /** + * Replaces all of the state. Always use this or `setState` to mutate state. + * You should treat `this.state` as immutable. + * + * There is no guarantee that `this.state` will be immediately updated, so + * accessing `this.state` after calling this method may return the old value. + * + * @param {ReactClass} publicInstance The instance that should rerender. + * @param {object} completeState Next state. + * @internal + */ + enqueueReplaceState: function (publicInstance, completeState) { + warnNoop(publicInstance, 'replaceState'); + }, + + /** + * Sets a subset of the state. This only exists because _pendingState is + * internal. This provides a merging strategy that is not available to deep + * properties which is confusing. TODO: Expose pendingState or don't use it + * during the merge. + * + * @param {ReactClass} publicInstance The instance that should rerender. + * @param {object} partialState Next partial state to be merged with state. + * @internal + */ + enqueueSetState: function (publicInstance, partialState) { + warnNoop(publicInstance, 'setState'); + } +}; + +module.exports = ReactNoopUpdateQueue; +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) + +/***/ }), +/* 64 */ +/***/ (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. + * + * + */ + + + +// The Symbol used to tag the ReactElement type. If there is no native Symbol +// nor polyfill, then a plain number is used for performance. + +var REACT_ELEMENT_TYPE = typeof Symbol === 'function' && Symbol['for'] && Symbol['for']('react.element') || 0xeac7; + +module.exports = REACT_ELEMENT_TYPE; + +/***/ }), +/* 65 */ +/***/ (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. + * + * + */ + + + +/* global Symbol */ + +var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator; +var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec. + +/** + * Returns the iterator method function contained on the iterable object. + * + * Be sure to invoke the function with the iterable as context: + * + * var iteratorFn = getIteratorFn(myIterable); + * if (iteratorFn) { + * var iterator = iteratorFn.call(myIterable); + * ... + * } + * + * @param {?object} maybeIterable + * @return {?function} + */ +function getIteratorFn(maybeIterable) { + var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]); + if (typeof iteratorFn === 'function') { + return iteratorFn; + } +} + +module.exports = getIteratorFn; + +/***/ }), +/* 66 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(process) {/** + * 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. + * + */ + +/** + * ReactElementValidator provides a wrapper around a element factory + * which validates the props passed to the element. This is intended to be + * used only in DEV and could be replaced by a static type checker for languages + * that support it. + */ + + + +var ReactCurrentOwner = __webpack_require__(14); +var ReactComponentTreeHook = __webpack_require__(11); +var ReactElement = __webpack_require__(19); + +var checkReactTypeSpec = __webpack_require__(117); + +var canDefineProperty = __webpack_require__(30); +var getIteratorFn = __webpack_require__(65); +var warning = __webpack_require__(3); +var lowPriorityWarning = __webpack_require__(40); + +function getDeclarationErrorAddendum() { + if (ReactCurrentOwner.current) { + var name = ReactCurrentOwner.current.getName(); + if (name) { + return ' Check the render method of `' + name + '`.'; + } + } + return ''; +} + +function getSourceInfoErrorAddendum(elementProps) { + if (elementProps !== null && elementProps !== undefined && elementProps.__source !== undefined) { + var source = elementProps.__source; + var fileName = source.fileName.replace(/^.*[\\\/]/, ''); + var lineNumber = source.lineNumber; + return ' Check your code at ' + fileName + ':' + lineNumber + '.'; + } + return ''; +} + +/** + * Warn if there's no key explicitly set on dynamic arrays of children or + * object keys are not valid. This allows us to keep track of children between + * updates. + */ +var ownerHasKeyUseWarning = {}; + +function getCurrentComponentErrorInfo(parentType) { + var info = getDeclarationErrorAddendum(); + + if (!info) { + var parentName = typeof parentType === 'string' ? parentType : parentType.displayName || parentType.name; + if (parentName) { + info = ' Check the top-level render call using <' + parentName + '>.'; + } + } + return info; +} + +/** + * Warn if the element doesn't have an explicit key assigned to it. + * This element is in an array. The array could grow and shrink or be + * reordered. All children that haven't already been validated are required to + * have a "key" property assigned to it. Error statuses are cached so a warning + * will only be shown once. + * + * @internal + * @param {ReactElement} element Element that requires a key. + * @param {*} parentType element's parent's type. + */ +function validateExplicitKey(element, parentType) { + if (!element._store || element._store.validated || element.key != null) { + return; + } + element._store.validated = true; + + var memoizer = ownerHasKeyUseWarning.uniqueKey || (ownerHasKeyUseWarning.uniqueKey = {}); + + var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType); + if (memoizer[currentComponentErrorInfo]) { + return; + } + memoizer[currentComponentErrorInfo] = true; + + // Usually the current owner is the offender, but if it accepts children as a + // property, it may be the creator of the child that's responsible for + // assigning it a key. + var childOwner = ''; + if (element && element._owner && element._owner !== ReactCurrentOwner.current) { + // Give the component that originally created this child. + childOwner = ' It was passed a child from ' + element._owner.getName() + '.'; + } + + process.env.NODE_ENV !== 'production' ? warning(false, 'Each child in an array or iterator should have a unique "key" prop.' + '%s%s See https://fb.me/react-warning-keys for more information.%s', currentComponentErrorInfo, childOwner, ReactComponentTreeHook.getCurrentStackAddendum(element)) : void 0; +} + +/** + * Ensure that every element either is passed in a static location, in an + * array with an explicit keys property defined, or in an object literal + * with valid key property. + * + * @internal + * @param {ReactNode} node Statically passed child of any type. + * @param {*} parentType node's parent's type. + */ +function validateChildKeys(node, parentType) { + if (typeof node !== 'object') { + return; + } + if (Array.isArray(node)) { + for (var i = 0; i < node.length; i++) { + var child = node[i]; + if (ReactElement.isValidElement(child)) { + validateExplicitKey(child, parentType); + } + } + } else if (ReactElement.isValidElement(node)) { + // This element was passed in a valid location. + if (node._store) { + node._store.validated = true; + } + } else if (node) { + var iteratorFn = getIteratorFn(node); + // Entry iterators provide implicit keys. + if (iteratorFn) { + if (iteratorFn !== node.entries) { + var iterator = iteratorFn.call(node); + var step; + while (!(step = iterator.next()).done) { + if (ReactElement.isValidElement(step.value)) { + validateExplicitKey(step.value, parentType); + } + } + } + } + } +} + +/** + * Given an element, validate that its props follow the propTypes definition, + * provided by the type. + * + * @param {ReactElement} element + */ +function validatePropTypes(element) { + var componentClass = element.type; + if (typeof componentClass !== 'function') { + return; + } + var name = componentClass.displayName || componentClass.name; + if (componentClass.propTypes) { + checkReactTypeSpec(componentClass.propTypes, element.props, 'prop', name, element, null); + } + if (typeof componentClass.getDefaultProps === 'function') { + process.env.NODE_ENV !== 'production' ? warning(componentClass.getDefaultProps.isReactClassApproved, 'getDefaultProps is only used on classic React.createClass ' + 'definitions. Use a static property named `defaultProps` instead.') : void 0; + } +} + +var ReactElementValidator = { + createElement: function (type, props, children) { + var validType = typeof type === 'string' || typeof type === 'function'; + // We warn in this case but don't throw. We expect the element creation to + // succeed and there will likely be errors in render. + if (!validType) { + if (typeof type !== 'function' && typeof type !== 'string') { + var info = ''; + if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) { + info += ' You likely forgot to export your component from the file ' + "it's defined in."; + } + + var sourceInfo = getSourceInfoErrorAddendum(props); + if (sourceInfo) { + info += sourceInfo; + } else { + info += getDeclarationErrorAddendum(); + } + + info += ReactComponentTreeHook.getCurrentStackAddendum(); + + var currentSource = props !== null && props !== undefined && props.__source !== undefined ? props.__source : null; + ReactComponentTreeHook.pushNonStandardWarningStack(true, currentSource); + process.env.NODE_ENV !== 'production' ? warning(false, 'React.createElement: type is invalid -- expected a string (for ' + 'built-in components) or a class/function (for composite ' + 'components) but got: %s.%s', type == null ? type : typeof type, info) : void 0; + ReactComponentTreeHook.popNonStandardWarningStack(); + } + } + + var element = ReactElement.createElement.apply(this, arguments); + + // The result can be nullish if a mock or a custom function is used. + // TODO: Drop this when these are no longer allowed as the type argument. + if (element == null) { + return element; + } + + // Skip key warning if the type isn't valid since our key validation logic + // doesn't expect a non-string/function type and can throw confusing errors. + // We don't want exception behavior to differ between dev and prod. + // (Rendering will throw with a helpful message and as soon as the type is + // fixed, the key warnings will appear.) + if (validType) { + for (var i = 2; i < arguments.length; i++) { + validateChildKeys(arguments[i], type); + } + } + + validatePropTypes(element); + + return element; + }, + + createFactory: function (type) { + var validatedFactory = ReactElementValidator.createElement.bind(null, type); + // Legacy hook TODO: Warn if this is accessed + validatedFactory.type = type; + + if (process.env.NODE_ENV !== 'production') { + if (canDefineProperty) { + Object.defineProperty(validatedFactory, 'type', { + enumerable: false, + get: function () { + lowPriorityWarning(false, 'Factory.type is deprecated. Access the class directly ' + 'before passing it to createFactory.'); + Object.defineProperty(this, 'type', { + value: type + }); + return type; + } + }); + } + } + + return validatedFactory; + }, + + cloneElement: function (element, props, children) { + var newElement = ReactElement.cloneElement.apply(this, arguments); + for (var i = 2; i < arguments.length; i++) { + validateChildKeys(arguments[i], newElement.type); + } + validatePropTypes(newElement); + return newElement; + } +}; + +module.exports = ReactElementValidator; +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) + +/***/ }), +/* 67 */ +/***/ (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. + */ + + + +// React 15.5 references this module, and assumes PropTypes are still callable in production. +// Therefore we re-export development-only version with all the PropTypes checks here. +// However if one is migrating to the `prop-types` npm library, they will go through the +// `index.js` entry point, and it will branch depending on the environment. +var factory = __webpack_require__(68); +module.exports = function(isValidElement) { + // It is still allowed in 15.5. + var throwOnDirectAccess = false; + return factory(isValidElement, throwOnDirectAccess); +}; + + +/***/ }), +/* 68 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(process) {/** + * 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 emptyFunction = __webpack_require__(12); +var invariant = __webpack_require__(1); +var warning = __webpack_require__(3); +var assign = __webpack_require__(121); + +var ReactPropTypesSecret = __webpack_require__(41); +var checkPropTypes = __webpack_require__(122); + +module.exports = function(isValidElement, throwOnDirectAccess) { + /* global Symbol */ + var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator; + var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec. + + /** + * Returns the iterator method function contained on the iterable object. + * + * Be sure to invoke the function with the iterable as context: + * + * var iteratorFn = getIteratorFn(myIterable); + * if (iteratorFn) { + * var iterator = iteratorFn.call(myIterable); + * ... + * } + * + * @param {?object} maybeIterable + * @return {?function} + */ + function getIteratorFn(maybeIterable) { + var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]); + if (typeof iteratorFn === 'function') { + return iteratorFn; + } + } + + /** + * Collection of methods that allow declaration and validation of props that are + * supplied to React components. Example usage: + * + * var Props = require('ReactPropTypes'); + * var MyArticle = React.createClass({ + * propTypes: { + * // An optional string prop named "description". + * description: Props.string, + * + * // A required enum prop named "category". + * category: Props.oneOf(['News','Photos']).isRequired, + * + * // A prop named "dialog" that requires an instance of Dialog. + * dialog: Props.instanceOf(Dialog).isRequired + * }, + * render: function() { ... } + * }); + * + * A more formal specification of how these methods are used: + * + * type := array|bool|func|object|number|string|oneOf([...])|instanceOf(...) + * decl := ReactPropTypes.{type}(.isRequired)? + * + * Each and every declaration produces a function with the same signature. This + * allows the creation of custom validation functions. For example: + * + * var MyLink = React.createClass({ + * propTypes: { + * // An optional string or URI prop named "href". + * href: function(props, propName, componentName) { + * var propValue = props[propName]; + * if (propValue != null && typeof propValue !== 'string' && + * !(propValue instanceof URI)) { + * return new Error( + * 'Expected a string or an URI for ' + propName + ' in ' + + * componentName + * ); + * } + * } + * }, + * render: function() {...} + * }); + * + * @internal + */ + + var ANONYMOUS = '<<anonymous>>'; + + // Important! + // Keep this list in sync with production version in `./factoryWithThrowingShims.js`. + var ReactPropTypes = { + array: createPrimitiveTypeChecker('array'), + bool: createPrimitiveTypeChecker('boolean'), + func: createPrimitiveTypeChecker('function'), + number: createPrimitiveTypeChecker('number'), + object: createPrimitiveTypeChecker('object'), + string: createPrimitiveTypeChecker('string'), + symbol: createPrimitiveTypeChecker('symbol'), + + any: createAnyTypeChecker(), + arrayOf: createArrayOfTypeChecker, + element: createElementTypeChecker(), + instanceOf: createInstanceTypeChecker, + node: createNodeChecker(), + objectOf: createObjectOfTypeChecker, + oneOf: createEnumTypeChecker, + oneOfType: createUnionTypeChecker, + shape: createShapeTypeChecker, + exact: createStrictShapeTypeChecker, + }; + + /** + * inlined Object.is polyfill to avoid requiring consumers ship their own + * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is + */ + /*eslint-disable no-self-compare*/ + function is(x, y) { + // SameValue algorithm + if (x === y) { + // Steps 1-5, 7-10 + // Steps 6.b-6.e: +0 != -0 + return x !== 0 || 1 / x === 1 / y; + } else { + // Step 6.a: NaN == NaN + return x !== x && y !== y; + } + } + /*eslint-enable no-self-compare*/ + + /** + * We use an Error-like object for backward compatibility as people may call + * PropTypes directly and inspect their output. However, we don't use real + * Errors anymore. We don't inspect their stack anyway, and creating them + * is prohibitively expensive if they are created too often, such as what + * happens in oneOfType() for any type before the one that matched. + */ + function PropTypeError(message) { + this.message = message; + this.stack = ''; + } + // Make `instanceof Error` still work for returned errors. + PropTypeError.prototype = Error.prototype; + + function createChainableTypeChecker(validate) { + if (process.env.NODE_ENV !== 'production') { + var manualPropTypeCallCache = {}; + var manualPropTypeWarningCount = 0; + } + function checkType(isRequired, props, propName, componentName, location, propFullName, secret) { + componentName = componentName || ANONYMOUS; + propFullName = propFullName || propName; + + if (secret !== ReactPropTypesSecret) { + if (throwOnDirectAccess) { + // New behavior only for users of `prop-types` package + invariant( + false, + 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' + + 'Use `PropTypes.checkPropTypes()` to call them. ' + + 'Read more at http://fb.me/use-check-prop-types' + ); + } else if (process.env.NODE_ENV !== 'production' && typeof console !== 'undefined') { + // Old behavior for people using React.PropTypes + var cacheKey = componentName + ':' + propName; + if ( + !manualPropTypeCallCache[cacheKey] && + // Avoid spamming the console because they are often not actionable except for lib authors + manualPropTypeWarningCount < 3 + ) { + warning( + false, + 'You are manually calling a React.PropTypes validation ' + + 'function for the `%s` prop on `%s`. This is deprecated ' + + 'and will throw in the standalone `prop-types` package. ' + + 'You may be seeing this warning due to a third-party PropTypes ' + + 'library. See https://fb.me/react-warning-dont-call-proptypes ' + 'for details.', + propFullName, + componentName + ); + manualPropTypeCallCache[cacheKey] = true; + manualPropTypeWarningCount++; + } + } + } + if (props[propName] == null) { + if (isRequired) { + if (props[propName] === null) { + return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required ' + ('in `' + componentName + '`, but its value is `null`.')); + } + return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required in ' + ('`' + componentName + '`, but its value is `undefined`.')); + } + return null; + } else { + return validate(props, propName, componentName, location, propFullName); + } + } + + var chainedCheckType = checkType.bind(null, false); + chainedCheckType.isRequired = checkType.bind(null, true); + + return chainedCheckType; + } + + function createPrimitiveTypeChecker(expectedType) { + function validate(props, propName, componentName, location, propFullName, secret) { + var propValue = props[propName]; + var propType = getPropType(propValue); + if (propType !== expectedType) { + // `propValue` being instance of, say, date/regexp, pass the 'object' + // check, but we can offer a more precise error message here rather than + // 'of type `object`'. + var preciseType = getPreciseType(propValue); + + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.')); + } + return null; + } + return createChainableTypeChecker(validate); + } + + function createAnyTypeChecker() { + return createChainableTypeChecker(emptyFunction.thatReturnsNull); + } + + function createArrayOfTypeChecker(typeChecker) { + function validate(props, propName, componentName, location, propFullName) { + if (typeof typeChecker !== 'function') { + return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside arrayOf.'); + } + var propValue = props[propName]; + if (!Array.isArray(propValue)) { + var propType = getPropType(propValue); + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an array.')); + } + for (var i = 0; i < propValue.length; i++) { + var error = typeChecker(propValue, i, componentName, location, propFullName + '[' + i + ']', ReactPropTypesSecret); + if (error instanceof Error) { + return error; + } + } + return null; + } + return createChainableTypeChecker(validate); + } + + function createElementTypeChecker() { + function validate(props, propName, componentName, location, propFullName) { + var propValue = props[propName]; + if (!isValidElement(propValue)) { + var propType = getPropType(propValue); + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement.')); + } + return null; + } + return createChainableTypeChecker(validate); + } + + function createInstanceTypeChecker(expectedClass) { + function validate(props, propName, componentName, location, propFullName) { + if (!(props[propName] instanceof expectedClass)) { + var expectedClassName = expectedClass.name || ANONYMOUS; + var actualClassName = getClassName(props[propName]); + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + actualClassName + '` supplied to `' + componentName + '`, expected ') + ('instance of `' + expectedClassName + '`.')); + } + return null; + } + return createChainableTypeChecker(validate); + } + + function createEnumTypeChecker(expectedValues) { + if (!Array.isArray(expectedValues)) { + process.env.NODE_ENV !== 'production' ? warning(false, 'Invalid argument supplied to oneOf, expected an instance of array.') : void 0; + return emptyFunction.thatReturnsNull; + } + + function validate(props, propName, componentName, location, propFullName) { + var propValue = props[propName]; + for (var i = 0; i < expectedValues.length; i++) { + if (is(propValue, expectedValues[i])) { + return null; + } + } + + var valuesString = JSON.stringify(expectedValues); + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of value `' + propValue + '` ' + ('supplied to `' + componentName + '`, expected one of ' + valuesString + '.')); + } + return createChainableTypeChecker(validate); + } + + function createObjectOfTypeChecker(typeChecker) { + function validate(props, propName, componentName, location, propFullName) { + if (typeof typeChecker !== 'function') { + return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside objectOf.'); + } + var propValue = props[propName]; + var propType = getPropType(propValue); + if (propType !== 'object') { + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.')); + } + for (var key in propValue) { + if (propValue.hasOwnProperty(key)) { + var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret); + if (error instanceof Error) { + return error; + } + } + } + return null; + } + return createChainableTypeChecker(validate); + } + + function createUnionTypeChecker(arrayOfTypeCheckers) { + if (!Array.isArray(arrayOfTypeCheckers)) { + process.env.NODE_ENV !== 'production' ? warning(false, 'Invalid argument supplied to oneOfType, expected an instance of array.') : void 0; + return emptyFunction.thatReturnsNull; + } + + for (var i = 0; i < arrayOfTypeCheckers.length; i++) { + var checker = arrayOfTypeCheckers[i]; + if (typeof checker !== 'function') { + warning( + false, + 'Invalid argument supplied to oneOfType. Expected an array of check functions, but ' + + 'received %s at index %s.', + getPostfixForTypeWarning(checker), + i + ); + return emptyFunction.thatReturnsNull; + } + } + + function validate(props, propName, componentName, location, propFullName) { + for (var i = 0; i < arrayOfTypeCheckers.length; i++) { + var checker = arrayOfTypeCheckers[i]; + if (checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret) == null) { + return null; + } + } + + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`.')); + } + return createChainableTypeChecker(validate); + } + + function createNodeChecker() { + function validate(props, propName, componentName, location, propFullName) { + if (!isNode(props[propName])) { + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a ReactNode.')); + } + return null; + } + return createChainableTypeChecker(validate); + } + + function createShapeTypeChecker(shapeTypes) { + function validate(props, propName, componentName, location, propFullName) { + var propValue = props[propName]; + var propType = getPropType(propValue); + if (propType !== 'object') { + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.')); + } + for (var key in shapeTypes) { + var checker = shapeTypes[key]; + if (!checker) { + continue; + } + var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret); + if (error) { + return error; + } + } + return null; + } + return createChainableTypeChecker(validate); + } + + function createStrictShapeTypeChecker(shapeTypes) { + function validate(props, propName, componentName, location, propFullName) { + var propValue = props[propName]; + var propType = getPropType(propValue); + if (propType !== 'object') { + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.')); + } + // We need to check all keys in case some are required but missing from + // props. + var allKeys = assign({}, props[propName], shapeTypes); + for (var key in allKeys) { + var checker = shapeTypes[key]; + if (!checker) { + return new PropTypeError( + 'Invalid ' + location + ' `' + propFullName + '` key `' + key + '` supplied to `' + componentName + '`.' + + '\nBad object: ' + JSON.stringify(props[propName], null, ' ') + + '\nValid keys: ' + JSON.stringify(Object.keys(shapeTypes), null, ' ') + ); + } + var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret); + if (error) { + return error; + } + } + return null; + } + + return createChainableTypeChecker(validate); + } + + function isNode(propValue) { + switch (typeof propValue) { + case 'number': + case 'string': + case 'undefined': + return true; + case 'boolean': + return !propValue; + case 'object': + if (Array.isArray(propValue)) { + return propValue.every(isNode); + } + if (propValue === null || isValidElement(propValue)) { + return true; + } + + var iteratorFn = getIteratorFn(propValue); + if (iteratorFn) { + var iterator = iteratorFn.call(propValue); + var step; + if (iteratorFn !== propValue.entries) { + while (!(step = iterator.next()).done) { + if (!isNode(step.value)) { + return false; + } + } + } else { + // Iterator will provide entry [k,v] tuples rather than values. + while (!(step = iterator.next()).done) { + var entry = step.value; + if (entry) { + if (!isNode(entry[1])) { + return false; + } + } + } + } + } else { + return false; + } + + return true; + default: + return false; + } + } + + function isSymbol(propType, propValue) { + // Native Symbol. + if (propType === 'symbol') { + return true; + } + + // 19.4.3.5 Symbol.prototype[@@toStringTag] === 'Symbol' + if (propValue['@@toStringTag'] === 'Symbol') { + return true; + } + + // Fallback for non-spec compliant Symbols which are polyfilled. + if (typeof Symbol === 'function' && propValue instanceof Symbol) { + return true; + } + + return false; + } + + // Equivalent of `typeof` but with special handling for array and regexp. + function getPropType(propValue) { + var propType = typeof propValue; + if (Array.isArray(propValue)) { + return 'array'; + } + if (propValue instanceof RegExp) { + // Old webkits (at least until Android 4.0) return 'function' rather than + // 'object' for typeof a RegExp. We'll normalize this here so that /bla/ + // passes PropTypes.object. + return 'object'; + } + if (isSymbol(propType, propValue)) { + return 'symbol'; + } + return propType; + } + + // This handles more types than `getPropType`. Only used for error messages. + // See `createPrimitiveTypeChecker`. + function getPreciseType(propValue) { + if (typeof propValue === 'undefined' || propValue === null) { + return '' + propValue; + } + var propType = getPropType(propValue); + if (propType === 'object') { + if (propValue instanceof Date) { + return 'date'; + } else if (propValue instanceof RegExp) { + return 'regexp'; + } + } + return propType; + } + + // Returns a string that is postfixed to a warning about an invalid type. + // For example, "undefined" or "of type array" + function getPostfixForTypeWarning(value) { + var type = getPreciseType(value); + switch (type) { + case 'array': + case 'object': + return 'an ' + type; + case 'boolean': + case 'date': + case 'regexp': + return 'a ' + type; + default: + return type; + } + } + + // Returns class name of the object, if any. + function getClassName(propValue) { + if (!propValue.constructor || !propValue.constructor.name) { + return ANONYMOUS; + } + return propValue.constructor.name; + } + + ReactPropTypes.checkPropTypes = checkPropTypes; + ReactPropTypes.PropTypes = ReactPropTypes; + + return ReactPropTypes; +}; + +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) + +/***/ }), +/* 69 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(process) {/** + * 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__(125); + +var emptyObject = __webpack_require__(31); +var _invariant = __webpack_require__(1); + +if (process.env.NODE_ENV !== 'production') { + var warning = __webpack_require__(3); +} + +var MIXINS_KEY = 'mixins'; + +// Helper function to allow the creation of anonymous functions which do not +// have .name set to the name of the variable being assigned to. +function identity(fn) { + return fn; +} + +var ReactPropTypeLocationNames; +if (process.env.NODE_ENV !== 'production') { + ReactPropTypeLocationNames = { + prop: 'prop', + context: 'context', + childContext: 'child context' + }; +} else { + ReactPropTypeLocationNames = {}; +} + +function factory(ReactComponent, isValidElement, ReactNoopUpdateQueue) { + /** + * Policies that describe methods in `ReactClassInterface`. + */ + + var injectedMixins = []; + + /** + * Composite components are higher-level components that compose other composite + * or host components. + * + * To create a new type of `ReactClass`, pass a specification of + * your new class to `React.createClass`. The only requirement of your class + * specification is that you implement a `render` method. + * + * var MyComponent = React.createClass({ + * render: function() { + * return <div>Hello World</div>; + * } + * }); + * + * The class specification supports a specific protocol of methods that have + * special meaning (e.g. `render`). See `ReactClassInterface` for + * more the comprehensive protocol. Any other properties and methods in the + * class specification will be available on the prototype. + * + * @interface ReactClassInterface + * @internal + */ + var ReactClassInterface = { + /** + * An array of Mixin objects to include when defining your component. + * + * @type {array} + * @optional + */ + mixins: 'DEFINE_MANY', + + /** + * An object containing properties and methods that should be defined on + * the component's constructor instead of its prototype (static methods). + * + * @type {object} + * @optional + */ + statics: 'DEFINE_MANY', + + /** + * Definition of prop types for this component. + * + * @type {object} + * @optional + */ + propTypes: 'DEFINE_MANY', + + /** + * Definition of context types for this component. + * + * @type {object} + * @optional + */ + contextTypes: 'DEFINE_MANY', + + /** + * Definition of context types this component sets for its children. + * + * @type {object} + * @optional + */ + childContextTypes: 'DEFINE_MANY', + + // ==== Definition methods ==== + + /** + * Invoked when the component is mounted. Values in the mapping will be set on + * `this.props` if that prop is not specified (i.e. using an `in` check). + * + * This method is invoked before `getInitialState` and therefore cannot rely + * on `this.state` or use `this.setState`. + * + * @return {object} + * @optional + */ + getDefaultProps: 'DEFINE_MANY_MERGED', + + /** + * Invoked once before the component is mounted. The return value will be used + * as the initial value of `this.state`. + * + * getInitialState: function() { + * return { + * isOn: false, + * fooBaz: new BazFoo() + * } + * } + * + * @return {object} + * @optional + */ + getInitialState: 'DEFINE_MANY_MERGED', + + /** + * @return {object} + * @optional + */ + getChildContext: 'DEFINE_MANY_MERGED', + + /** + * Uses props from `this.props` and state from `this.state` to render the + * structure of the component. + * + * No guarantees are made about when or how often this method is invoked, so + * it must not have side effects. + * + * render: function() { + * var name = this.props.name; + * return <div>Hello, {name}!</div>; + * } + * + * @return {ReactComponent} + * @required + */ + render: 'DEFINE_ONCE', + + // ==== Delegate methods ==== + + /** + * Invoked when the component is initially created and about to be mounted. + * This may have side effects, but any external subscriptions or data created + * by this method must be cleaned up in `componentWillUnmount`. + * + * @optional + */ + componentWillMount: 'DEFINE_MANY', + + /** + * Invoked when the component has been mounted and has a DOM representation. + * However, there is no guarantee that the DOM node is in the document. + * + * Use this as an opportunity to operate on the DOM when the component has + * been mounted (initialized and rendered) for the first time. + * + * @param {DOMElement} rootNode DOM element representing the component. + * @optional + */ + componentDidMount: 'DEFINE_MANY', + + /** + * Invoked before the component receives new props. + * + * Use this as an opportunity to react to a prop transition by updating the + * state using `this.setState`. Current props are accessed via `this.props`. + * + * componentWillReceiveProps: function(nextProps, nextContext) { + * this.setState({ + * likesIncreasing: nextProps.likeCount > this.props.likeCount + * }); + * } + * + * NOTE: There is no equivalent `componentWillReceiveState`. An incoming prop + * transition may cause a state change, but the opposite is not true. If you + * need it, you are probably looking for `componentWillUpdate`. + * + * @param {object} nextProps + * @optional + */ + componentWillReceiveProps: 'DEFINE_MANY', + + /** + * Invoked while deciding if the component should be updated as a result of + * receiving new props, state and/or context. + * + * Use this as an opportunity to `return false` when you're certain that the + * transition to the new props/state/context will not require a component + * update. + * + * shouldComponentUpdate: function(nextProps, nextState, nextContext) { + * return !equal(nextProps, this.props) || + * !equal(nextState, this.state) || + * !equal(nextContext, this.context); + * } + * + * @param {object} nextProps + * @param {?object} nextState + * @param {?object} nextContext + * @return {boolean} True if the component should update. + * @optional + */ + shouldComponentUpdate: 'DEFINE_ONCE', + + /** + * Invoked when the component is about to update due to a transition from + * `this.props`, `this.state` and `this.context` to `nextProps`, `nextState` + * and `nextContext`. + * + * Use this as an opportunity to perform preparation before an update occurs. + * + * NOTE: You **cannot** use `this.setState()` in this method. + * + * @param {object} nextProps + * @param {?object} nextState + * @param {?object} nextContext + * @param {ReactReconcileTransaction} transaction + * @optional + */ + componentWillUpdate: 'DEFINE_MANY', + + /** + * Invoked when the component's DOM representation has been updated. + * + * Use this as an opportunity to operate on the DOM when the component has + * been updated. + * + * @param {object} prevProps + * @param {?object} prevState + * @param {?object} prevContext + * @param {DOMElement} rootNode DOM element representing the component. + * @optional + */ + componentDidUpdate: 'DEFINE_MANY', + + /** + * Invoked when the component is about to be removed from its parent and have + * its DOM representation destroyed. + * + * Use this as an opportunity to deallocate any external resources. + * + * NOTE: There is no `componentDidUnmount` since your component will have been + * destroyed by that point. + * + * @optional + */ + componentWillUnmount: 'DEFINE_MANY', + + // ==== Advanced methods ==== + + /** + * Updates the component's currently mounted DOM representation. + * + * By default, this implements React's rendering and reconciliation algorithm. + * Sophisticated clients may wish to override this. + * + * @param {ReactReconcileTransaction} transaction + * @internal + * @overridable + */ + updateComponent: 'OVERRIDE_BASE' + }; + + /** + * Mapping from class specification keys to special processing functions. + * + * Although these are declared like instance properties in the specification + * when defining classes using `React.createClass`, they are actually static + * and are accessible on the constructor instead of the prototype. Despite + * being static, they must be defined outside of the "statics" key under + * which all other static methods are defined. + */ + var RESERVED_SPEC_KEYS = { + displayName: function(Constructor, displayName) { + Constructor.displayName = displayName; + }, + mixins: function(Constructor, mixins) { + if (mixins) { + for (var i = 0; i < mixins.length; i++) { + mixSpecIntoComponent(Constructor, mixins[i]); + } + } + }, + childContextTypes: function(Constructor, childContextTypes) { + if (process.env.NODE_ENV !== 'production') { + validateTypeDef(Constructor, childContextTypes, 'childContext'); + } + Constructor.childContextTypes = _assign( + {}, + Constructor.childContextTypes, + childContextTypes + ); + }, + contextTypes: function(Constructor, contextTypes) { + if (process.env.NODE_ENV !== 'production') { + validateTypeDef(Constructor, contextTypes, 'context'); + } + Constructor.contextTypes = _assign( + {}, + Constructor.contextTypes, + contextTypes + ); + }, + /** + * Special case getDefaultProps which should move into statics but requires + * automatic merging. + */ + getDefaultProps: function(Constructor, getDefaultProps) { + if (Constructor.getDefaultProps) { + Constructor.getDefaultProps = createMergedResultFunction( + Constructor.getDefaultProps, + getDefaultProps + ); + } else { + Constructor.getDefaultProps = getDefaultProps; + } + }, + propTypes: function(Constructor, propTypes) { + if (process.env.NODE_ENV !== 'production') { + validateTypeDef(Constructor, propTypes, 'prop'); + } + Constructor.propTypes = _assign({}, Constructor.propTypes, propTypes); + }, + statics: function(Constructor, statics) { + mixStaticSpecIntoComponent(Constructor, statics); + }, + autobind: function() {} + }; + + function validateTypeDef(Constructor, typeDef, location) { + for (var propName in typeDef) { + if (typeDef.hasOwnProperty(propName)) { + // use a warning instead of an _invariant so components + // don't show up in prod but only in __DEV__ + if (process.env.NODE_ENV !== 'production') { + warning( + typeof typeDef[propName] === 'function', + '%s: %s type `%s` is invalid; it must be a function, usually from ' + + 'React.PropTypes.', + Constructor.displayName || 'ReactClass', + ReactPropTypeLocationNames[location], + propName + ); + } + } + } + } + + function validateMethodOverride(isAlreadyDefined, name) { + var specPolicy = ReactClassInterface.hasOwnProperty(name) + ? ReactClassInterface[name] + : null; + + // Disallow overriding of base class methods unless explicitly allowed. + if (ReactClassMixin.hasOwnProperty(name)) { + _invariant( + specPolicy === 'OVERRIDE_BASE', + 'ReactClassInterface: You are attempting to override ' + + '`%s` from your class specification. Ensure that your method names ' + + 'do not overlap with React methods.', + name + ); + } + + // Disallow defining methods more than once unless explicitly allowed. + if (isAlreadyDefined) { + _invariant( + specPolicy === 'DEFINE_MANY' || specPolicy === 'DEFINE_MANY_MERGED', + 'ReactClassInterface: You are attempting to define ' + + '`%s` on your component more than once. This conflict may be due ' + + 'to a mixin.', + name + ); + } + } + + /** + * Mixin helper which handles policy validation and reserved + * specification keys when building React classes. + */ + function mixSpecIntoComponent(Constructor, spec) { + if (!spec) { + if (process.env.NODE_ENV !== 'production') { + var typeofSpec = typeof spec; + var isMixinValid = typeofSpec === 'object' && spec !== null; + + if (process.env.NODE_ENV !== 'production') { + warning( + isMixinValid, + "%s: You're attempting to include a mixin that is either null " + + 'or not an object. Check the mixins included by the component, ' + + 'as well as any mixins they include themselves. ' + + 'Expected object but got %s.', + Constructor.displayName || 'ReactClass', + spec === null ? null : typeofSpec + ); + } + } + + return; + } + + _invariant( + typeof spec !== 'function', + "ReactClass: You're attempting to " + + 'use a component class or function as a mixin. Instead, just use a ' + + 'regular object.' + ); + _invariant( + !isValidElement(spec), + "ReactClass: You're attempting to " + + 'use a component as a mixin. Instead, just use a regular object.' + ); + + var proto = Constructor.prototype; + var autoBindPairs = proto.__reactAutoBindPairs; + + // By handling mixins before any other properties, we ensure the same + // chaining order is applied to methods with DEFINE_MANY policy, whether + // mixins are listed before or after these methods in the spec. + if (spec.hasOwnProperty(MIXINS_KEY)) { + RESERVED_SPEC_KEYS.mixins(Constructor, spec.mixins); + } + + for (var name in spec) { + if (!spec.hasOwnProperty(name)) { + continue; + } + + if (name === MIXINS_KEY) { + // We have already handled mixins in a special case above. + continue; + } + + var property = spec[name]; + var isAlreadyDefined = proto.hasOwnProperty(name); + validateMethodOverride(isAlreadyDefined, name); + + if (RESERVED_SPEC_KEYS.hasOwnProperty(name)) { + RESERVED_SPEC_KEYS[name](Constructor, property); + } else { + // Setup methods on prototype: + // The following member methods should not be automatically bound: + // 1. Expected ReactClass methods (in the "interface"). + // 2. Overridden methods (that were mixed in). + var isReactClassMethod = ReactClassInterface.hasOwnProperty(name); + var isFunction = typeof property === 'function'; + var shouldAutoBind = + isFunction && + !isReactClassMethod && + !isAlreadyDefined && + spec.autobind !== false; + + if (shouldAutoBind) { + autoBindPairs.push(name, property); + proto[name] = property; + } else { + if (isAlreadyDefined) { + var specPolicy = ReactClassInterface[name]; + + // These cases should already be caught by validateMethodOverride. + _invariant( + isReactClassMethod && + (specPolicy === 'DEFINE_MANY_MERGED' || + specPolicy === 'DEFINE_MANY'), + 'ReactClass: Unexpected spec policy %s for key %s ' + + 'when mixing in component specs.', + specPolicy, + name + ); + + // For methods which are defined more than once, call the existing + // methods before calling the new property, merging if appropriate. + if (specPolicy === 'DEFINE_MANY_MERGED') { + proto[name] = createMergedResultFunction(proto[name], property); + } else if (specPolicy === 'DEFINE_MANY') { + proto[name] = createChainedFunction(proto[name], property); + } + } else { + proto[name] = property; + if (process.env.NODE_ENV !== 'production') { + // Add verbose displayName to the function, which helps when looking + // at profiling tools. + if (typeof property === 'function' && spec.displayName) { + proto[name].displayName = spec.displayName + '_' + name; + } + } + } + } + } + } + } + + function mixStaticSpecIntoComponent(Constructor, statics) { + if (!statics) { + return; + } + for (var name in statics) { + var property = statics[name]; + if (!statics.hasOwnProperty(name)) { + continue; + } + + var isReserved = name in RESERVED_SPEC_KEYS; + _invariant( + !isReserved, + 'ReactClass: You are attempting to define a reserved ' + + 'property, `%s`, that shouldn\'t be on the "statics" key. Define it ' + + 'as an instance property instead; it will still be accessible on the ' + + 'constructor.', + name + ); + + var isInherited = name in Constructor; + _invariant( + !isInherited, + 'ReactClass: You are attempting to define ' + + '`%s` on your component more than once. This conflict may be ' + + 'due to a mixin.', + name + ); + Constructor[name] = property; + } + } + + /** + * Merge two objects, but throw if both contain the same key. + * + * @param {object} one The first object, which is mutated. + * @param {object} two The second object + * @return {object} one after it has been mutated to contain everything in two. + */ + function mergeIntoWithNoDuplicateKeys(one, two) { + _invariant( + one && two && typeof one === 'object' && typeof two === 'object', + 'mergeIntoWithNoDuplicateKeys(): Cannot merge non-objects.' + ); + + for (var key in two) { + if (two.hasOwnProperty(key)) { + _invariant( + one[key] === undefined, + 'mergeIntoWithNoDuplicateKeys(): ' + + 'Tried to merge two objects with the same key: `%s`. This conflict ' + + 'may be due to a mixin; in particular, this may be caused by two ' + + 'getInitialState() or getDefaultProps() methods returning objects ' + + 'with clashing keys.', + key + ); + one[key] = two[key]; + } + } + return one; + } + + /** + * Creates a function that invokes two functions and merges their return values. + * + * @param {function} one Function to invoke first. + * @param {function} two Function to invoke second. + * @return {function} Function that invokes the two argument functions. + * @private + */ + function createMergedResultFunction(one, two) { + return function mergedResult() { + var a = one.apply(this, arguments); + var b = two.apply(this, arguments); + if (a == null) { + return b; + } else if (b == null) { + return a; + } + var c = {}; + mergeIntoWithNoDuplicateKeys(c, a); + mergeIntoWithNoDuplicateKeys(c, b); + return c; + }; + } + + /** + * Creates a function that invokes two functions and ignores their return vales. + * + * @param {function} one Function to invoke first. + * @param {function} two Function to invoke second. + * @return {function} Function that invokes the two argument functions. + * @private + */ + function createChainedFunction(one, two) { + return function chainedFunction() { + one.apply(this, arguments); + two.apply(this, arguments); + }; + } + + /** + * Binds a method to the component. + * + * @param {object} component Component whose method is going to be bound. + * @param {function} method Method to be bound. + * @return {function} The bound method. + */ + function bindAutoBindMethod(component, method) { + var boundMethod = method.bind(component); + if (process.env.NODE_ENV !== 'production') { + boundMethod.__reactBoundContext = component; + boundMethod.__reactBoundMethod = method; + boundMethod.__reactBoundArguments = null; + var componentName = component.constructor.displayName; + var _bind = boundMethod.bind; + boundMethod.bind = function(newThis) { + for ( + var _len = arguments.length, + args = Array(_len > 1 ? _len - 1 : 0), + _key = 1; + _key < _len; + _key++ + ) { + args[_key - 1] = arguments[_key]; + } + + // User is trying to bind() an autobound method; we effectively will + // ignore the value of "this" that the user is trying to use, so + // let's warn. + if (newThis !== component && newThis !== null) { + if (process.env.NODE_ENV !== 'production') { + warning( + false, + 'bind(): React component methods may only be bound to the ' + + 'component instance. See %s', + componentName + ); + } + } else if (!args.length) { + if (process.env.NODE_ENV !== 'production') { + warning( + false, + 'bind(): You are binding a component method to the component. ' + + 'React does this for you automatically in a high-performance ' + + 'way, so you can safely remove this call. See %s', + componentName + ); + } + return boundMethod; + } + var reboundMethod = _bind.apply(boundMethod, arguments); + reboundMethod.__reactBoundContext = component; + reboundMethod.__reactBoundMethod = method; + reboundMethod.__reactBoundArguments = args; + return reboundMethod; + }; + } + return boundMethod; + } + + /** + * Binds all auto-bound methods in a component. + * + * @param {object} component Component whose method is going to be bound. + */ + function bindAutoBindMethods(component) { + var pairs = component.__reactAutoBindPairs; + for (var i = 0; i < pairs.length; i += 2) { + var autoBindKey = pairs[i]; + var method = pairs[i + 1]; + component[autoBindKey] = bindAutoBindMethod(component, method); + } + } + + var IsMountedPreMixin = { + componentDidMount: function() { + this.__isMounted = true; + } + }; + + var IsMountedPostMixin = { + componentWillUnmount: function() { + this.__isMounted = false; + } + }; + + /** + * Add more to the ReactClass base class. These are all legacy features and + * therefore not already part of the modern ReactComponent. + */ + var ReactClassMixin = { + /** + * TODO: This will be deprecated because state should always keep a consistent + * type signature and the only use case for this, is to avoid that. + */ + replaceState: function(newState, callback) { + this.updater.enqueueReplaceState(this, newState, callback); + }, + + /** + * Checks whether or not this composite component is mounted. + * @return {boolean} True if mounted, false otherwise. + * @protected + * @final + */ + isMounted: function() { + if (process.env.NODE_ENV !== 'production') { + warning( + this.__didWarnIsMounted, + '%s: isMounted is deprecated. Instead, make sure to clean up ' + + 'subscriptions and pending requests in componentWillUnmount to ' + + 'prevent memory leaks.', + (this.constructor && this.constructor.displayName) || + this.name || + 'Component' + ); + this.__didWarnIsMounted = true; + } + return !!this.__isMounted; + } + }; + + var ReactClassComponent = function() {}; + _assign( + ReactClassComponent.prototype, + ReactComponent.prototype, + ReactClassMixin + ); + + /** + * Creates a composite component class given a class specification. + * See https://facebook.github.io/react/docs/top-level-api.html#react.createclass + * + * @param {object} spec Class specification (which must define `render`). + * @return {function} Component constructor function. + * @public + */ + function createClass(spec) { + // To keep our warnings more understandable, we'll use a little hack here to + // ensure that Constructor.name !== 'Constructor'. This makes sure we don't + // unnecessarily identify a class without displayName as 'Constructor'. + var Constructor = identity(function(props, context, updater) { + // This constructor gets overridden by mocks. The argument is used + // by mocks to assert on what gets mounted. + + if (process.env.NODE_ENV !== 'production') { + warning( + this instanceof Constructor, + 'Something is calling a React component directly. Use a factory or ' + + 'JSX instead. See: https://fb.me/react-legacyfactory' + ); + } + + // Wire up auto-binding + if (this.__reactAutoBindPairs.length) { + bindAutoBindMethods(this); + } + + this.props = props; + this.context = context; + this.refs = emptyObject; + this.updater = updater || ReactNoopUpdateQueue; + + this.state = null; + + // ReactClasses doesn't have constructors. Instead, they use the + // getInitialState and componentWillMount methods for initialization. + + var initialState = this.getInitialState ? this.getInitialState() : null; + if (process.env.NODE_ENV !== 'production') { + // We allow auto-mocks to proceed as if they're returning null. + if ( + initialState === undefined && + this.getInitialState._isMockFunction + ) { + // This is probably bad practice. Consider warning here and + // deprecating this convenience. + initialState = null; + } + } + _invariant( + typeof initialState === 'object' && !Array.isArray(initialState), + '%s.getInitialState(): must return an object or null', + Constructor.displayName || 'ReactCompositeComponent' + ); + + this.state = initialState; + }); + Constructor.prototype = new ReactClassComponent(); + Constructor.prototype.constructor = Constructor; + Constructor.prototype.__reactAutoBindPairs = []; + + injectedMixins.forEach(mixSpecIntoComponent.bind(null, Constructor)); + + mixSpecIntoComponent(Constructor, IsMountedPreMixin); + mixSpecIntoComponent(Constructor, spec); + mixSpecIntoComponent(Constructor, IsMountedPostMixin); + + // Initialize the defaultProps property after all mixins have been merged. + if (Constructor.getDefaultProps) { + Constructor.defaultProps = Constructor.getDefaultProps(); + } + + if (process.env.NODE_ENV !== 'production') { + // This is a tag to indicate that the use of these method names is ok, + // since it's used with createClass. If it's not, then it's likely a + // mistake so we'll warn you to use the static property, property + // initializer or constructor respectively. + if (Constructor.getDefaultProps) { + Constructor.getDefaultProps.isReactClassApproved = {}; + } + if (Constructor.prototype.getInitialState) { + Constructor.prototype.getInitialState.isReactClassApproved = {}; + } + } + + _invariant( + Constructor.prototype.render, + 'createClass(...): Class specification must implement a `render` method.' + ); + + if (process.env.NODE_ENV !== 'production') { + warning( + !Constructor.prototype.componentShouldUpdate, + '%s has a method called ' + + 'componentShouldUpdate(). Did you mean shouldComponentUpdate()? ' + + 'The name is phrased as a question because the function is ' + + 'expected to return a value.', + spec.displayName || 'A component' + ); + warning( + !Constructor.prototype.componentWillRecieveProps, + '%s has a method called ' + + 'componentWillRecieveProps(). Did you mean componentWillReceiveProps()?', + spec.displayName || 'A component' + ); + } + + // Reduce time spent doing lookups by setting these on the prototype. + for (var methodName in ReactClassInterface) { + if (!Constructor.prototype[methodName]) { + Constructor.prototype[methodName] = null; + } + } + + return Constructor; + } + + return createClass; +} + +module.exports = factory; + +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) + +/***/ }), +/* 70 */ +/***/ (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 ReactDOMComponentFlags = { + hasCachedChildNodes: 1 << 0 +}; + +module.exports = ReactDOMComponentFlags; + +/***/ }), +/* 71 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(process) {/** + * 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 _prodInvariant = __webpack_require__(4); + +var invariant = __webpack_require__(1); + +/** + * Accumulates items that must not be null or undefined into the first one. This + * is used to conserve memory by avoiding array allocations, and thus sacrifices + * API cleanness. Since `current` can be null before being passed in and not + * null after this function, make sure to assign it back to `current`: + * + * `a = accumulateInto(a, b);` + * + * This API should be sparingly used. Try `accumulate` for something cleaner. + * + * @return {*|array<*>} An accumulation of items. + */ + +function accumulateInto(current, next) { + !(next != null) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'accumulateInto(...): Accumulated items must not be null or undefined.') : _prodInvariant('30') : void 0; + + if (current == null) { + return next; + } + + // Both are not empty. Warning: Never call x.concat(y) when you are not + // certain that x is an Array (x could be a string with concat method). + if (Array.isArray(current)) { + if (Array.isArray(next)) { + current.push.apply(current, next); + return current; + } + current.push(next); + return current; + } + + if (Array.isArray(next)) { + // A bit too dangerous to mutate `next`. + return [current].concat(next); + } + + return [current, next]; +} + +module.exports = accumulateInto; +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) + +/***/ }), +/* 72 */ +/***/ (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. + * + * + */ + + + +/** + * @param {array} arr an "accumulation" of items which is either an Array or + * a single item. Useful when paired with the `accumulate` module. This is a + * simple utility that allows us to reason about a collection of items, but + * handling the case when there is exactly one item (and we do not need to + * allocate an array). + */ + +function forEachAccumulated(arr, cb, scope) { + if (Array.isArray(arr)) { + arr.forEach(cb, scope); + } else if (arr) { + cb.call(scope, arr); + } +} + +module.exports = forEachAccumulated; + +/***/ }), +/* 73 */ +/***/ (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 ExecutionEnvironment = __webpack_require__(9); + +var contentKey = null; + +/** + * Gets the key used to access text content on a DOM node. + * + * @return {?string} Key used to access text content. + * @internal + */ +function getTextContentAccessor() { + if (!contentKey && ExecutionEnvironment.canUseDOM) { + // Prefer textContent to innerText because many browsers support both but + // SVG <text> elements don't support innerText even when <div> does. + contentKey = 'textContent' in document.documentElement ? 'textContent' : 'innerText'; + } + return contentKey; +} + +module.exports = getTextContentAccessor; + +/***/ }), +/* 74 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(process) {/** + * 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__(4); + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +var PooledClass = __webpack_require__(20); + +var invariant = __webpack_require__(1); + +/** + * A specialized pseudo-event module to help keep track of components waiting to + * be notified when their DOM representations are available for use. + * + * This implements `PooledClass`, so you should never need to instantiate this. + * Instead, use `CallbackQueue.getPooled()`. + * + * @class ReactMountReady + * @implements PooledClass + * @internal + */ + +var CallbackQueue = function () { + function CallbackQueue(arg) { + _classCallCheck(this, CallbackQueue); + + this._callbacks = null; + this._contexts = null; + this._arg = arg; + } + + /** + * Enqueues a callback to be invoked when `notifyAll` is invoked. + * + * @param {function} callback Invoked when `notifyAll` is invoked. + * @param {?object} context Context to call `callback` with. + * @internal + */ + + + CallbackQueue.prototype.enqueue = function enqueue(callback, context) { + this._callbacks = this._callbacks || []; + this._callbacks.push(callback); + this._contexts = this._contexts || []; + this._contexts.push(context); + }; + + /** + * Invokes all enqueued callbacks and clears the queue. This is invoked after + * the DOM representation of a component has been created or updated. + * + * @internal + */ + + + CallbackQueue.prototype.notifyAll = function notifyAll() { + var callbacks = this._callbacks; + var contexts = this._contexts; + var arg = this._arg; + if (callbacks && contexts) { + !(callbacks.length === contexts.length) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Mismatched list of contexts in callback queue') : _prodInvariant('24') : void 0; + this._callbacks = null; + this._contexts = null; + for (var i = 0; i < callbacks.length; i++) { + callbacks[i].call(contexts[i], arg); + } + callbacks.length = 0; + contexts.length = 0; + } + }; + + CallbackQueue.prototype.checkpoint = function checkpoint() { + return this._callbacks ? this._callbacks.length : 0; + }; + + CallbackQueue.prototype.rollback = function rollback(len) { + if (this._callbacks && this._contexts) { + this._callbacks.length = len; + this._contexts.length = len; + } + }; + + /** + * Resets the internal queue. + * + * @internal + */ + + + CallbackQueue.prototype.reset = function reset() { + this._callbacks = null; + this._contexts = null; + }; + + /** + * `PooledClass` looks for this. + */ + + + CallbackQueue.prototype.destructor = function destructor() { + this.reset(); + }; + + return CallbackQueue; +}(); + +module.exports = PooledClass.addPoolingTo(CallbackQueue); +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) + +/***/ }), +/* 75 */ +/***/ (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 ReactFeatureFlags = { + // When true, call console.time() before and .timeEnd() after each top-level + // render (both initial renders and updates). Useful when looking at prod-mode + // timeline profiles in Chrome, for example. + logTopLevelRenders: false +}; + +module.exports = ReactFeatureFlags; + +/***/ }), +/* 76 */ +/***/ (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 ReactDOMComponentTree = __webpack_require__(7); + +function isCheckable(elem) { + var type = elem.type; + var nodeName = elem.nodeName; + return nodeName && nodeName.toLowerCase() === 'input' && (type === 'checkbox' || type === 'radio'); +} + +function getTracker(inst) { + return inst._wrapperState.valueTracker; +} + +function attachTracker(inst, tracker) { + inst._wrapperState.valueTracker = tracker; +} + +function detachTracker(inst) { + inst._wrapperState.valueTracker = null; +} + +function getValueFromNode(node) { + var value; + if (node) { + value = isCheckable(node) ? '' + node.checked : node.value; + } + return value; +} + +var inputValueTracking = { + // exposed for testing + _getTrackerFromNode: function (node) { + return getTracker(ReactDOMComponentTree.getInstanceFromNode(node)); + }, + + + track: function (inst) { + if (getTracker(inst)) { + return; + } + + var node = ReactDOMComponentTree.getNodeFromInstance(inst); + var valueField = isCheckable(node) ? 'checked' : 'value'; + var descriptor = Object.getOwnPropertyDescriptor(node.constructor.prototype, valueField); + + var currentValue = '' + node[valueField]; + + // if someone has already defined a value or Safari, then bail + // and don't track value will cause over reporting of changes, + // but it's better then a hard failure + // (needed for certain tests that spyOn input values and Safari) + if (node.hasOwnProperty(valueField) || typeof descriptor.get !== 'function' || typeof descriptor.set !== 'function') { + return; + } + + Object.defineProperty(node, valueField, { + enumerable: descriptor.enumerable, + configurable: true, + get: function () { + return descriptor.get.call(this); + }, + set: function (value) { + currentValue = '' + value; + descriptor.set.call(this, value); + } + }); + + attachTracker(inst, { + getValue: function () { + return currentValue; + }, + setValue: function (value) { + currentValue = '' + value; + }, + stopTracking: function () { + detachTracker(inst); + delete node[valueField]; + } + }); + }, + + updateValueIfChanged: function (inst) { + if (!inst) { + return false; + } + var tracker = getTracker(inst); + + if (!tracker) { + inputValueTracking.track(inst); + return true; + } + + var lastValue = tracker.getValue(); + var nextValue = getValueFromNode(ReactDOMComponentTree.getNodeFromInstance(inst)); + + if (nextValue !== lastValue) { + tracker.setValue(nextValue); + return true; + } + + return false; + }, + stopTracking: function (inst) { + var tracker = getTracker(inst); + if (tracker) { + tracker.stopTracking(); + } + } +}; + +module.exports = inputValueTracking; + +/***/ }), +/* 77 */ +/***/ (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. + * + * + */ + + + +/** + * @see http://www.whatwg.org/specs/web-apps/current-work/multipage/the-input-element.html#input-type-attr-summary + */ + +var supportedInputTypes = { + color: true, + date: true, + datetime: true, + 'datetime-local': true, + email: true, + month: true, + number: true, + password: true, + range: true, + search: true, + tel: true, + text: true, + time: true, + url: true, + week: true +}; + +function isTextInputElement(elem) { + var nodeName = elem && elem.nodeName && elem.nodeName.toLowerCase(); + + if (nodeName === 'input') { + return !!supportedInputTypes[elem.type]; + } + + if (nodeName === 'textarea') { + return true; + } + + return false; +} + +module.exports = isTextInputElement; + +/***/ }), +/* 78 */ +/***/ (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 ViewportMetrics = { + currentScrollLeft: 0, + + currentScrollTop: 0, + + refreshScrollValues: function (scrollPosition) { + ViewportMetrics.currentScrollLeft = scrollPosition.x; + ViewportMetrics.currentScrollTop = scrollPosition.y; + } +}; + +module.exports = ViewportMetrics; + +/***/ }), +/* 79 */ +/***/ (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 ExecutionEnvironment = __webpack_require__(9); +var escapeTextContentForBrowser = __webpack_require__(37); +var setInnerHTML = __webpack_require__(36); + +/** + * Set the textContent property of a node, ensuring that whitespace is preserved + * even in IE8. innerText is a poor substitute for textContent and, among many + * issues, inserts <br> instead of the literal newline chars. innerHTML behaves + * as it should. + * + * @param {DOMElement} node + * @param {string} text + * @internal + */ +var setTextContent = function (node, text) { + if (text) { + var firstChild = node.firstChild; + + if (firstChild && firstChild === node.lastChild && firstChild.nodeType === 3) { + firstChild.nodeValue = text; + return; + } + } + node.textContent = text; +}; + +if (ExecutionEnvironment.canUseDOM) { + if (!('textContent' in document.documentElement)) { + setTextContent = function (node, text) { + if (node.nodeType === 3) { + node.nodeValue = text; + return; + } + setInnerHTML(node, escapeTextContentForBrowser(text)); + }; + } +} + +module.exports = setTextContent; + +/***/ }), +/* 80 */ +/***/ (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. + * + */ + + + +/** + * @param {DOMElement} node input/textarea to focus + */ + +function focusNode(node) { + // IE8 can throw "Can't move focus to the control because it is invisible, + // not enabled, or of a type that does not accept the focus." for all kinds of + // reasons that are too expensive and fragile to test. + try { + node.focus(); + } catch (e) {} +} + +module.exports = focusNode; + +/***/ }), +/* 81 */ +/***/ (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. + * + */ + + + +/** + * CSS properties which accept numbers but are not in units of "px". + */ + +var isUnitlessNumber = { + animationIterationCount: true, + borderImageOutset: true, + borderImageSlice: true, + borderImageWidth: true, + boxFlex: true, + boxFlexGroup: true, + boxOrdinalGroup: true, + columnCount: true, + columns: true, + flex: true, + flexGrow: true, + flexPositive: true, + flexShrink: true, + flexNegative: true, + flexOrder: true, + gridRow: true, + gridRowEnd: true, + gridRowSpan: true, + gridRowStart: true, + gridColumn: true, + gridColumnEnd: true, + gridColumnSpan: true, + gridColumnStart: true, + fontWeight: true, + lineClamp: true, + lineHeight: true, + opacity: true, + order: true, + orphans: true, + tabSize: true, + widows: true, + zIndex: true, + zoom: true, + + // SVG-related properties + fillOpacity: true, + floodOpacity: true, + stopOpacity: true, + strokeDasharray: true, + strokeDashoffset: true, + strokeMiterlimit: true, + strokeOpacity: true, + strokeWidth: true +}; + +/** + * @param {string} prefix vendor-specific prefix, eg: Webkit + * @param {string} key style name, eg: transitionDuration + * @return {string} style name prefixed with `prefix`, properly camelCased, eg: + * WebkitTransitionDuration + */ +function prefixKey(prefix, key) { + return prefix + key.charAt(0).toUpperCase() + key.substring(1); +} + +/** + * Support style names that may come passed in prefixed by adding permutations + * of vendor prefixes. + */ +var prefixes = ['Webkit', 'ms', 'Moz', 'O']; + +// Using Object.keys here, or else the vanilla for-in loop makes IE8 go into an +// infinite loop, because it iterates over the newly added props too. +Object.keys(isUnitlessNumber).forEach(function (prop) { + prefixes.forEach(function (prefix) { + isUnitlessNumber[prefixKey(prefix, prop)] = isUnitlessNumber[prop]; + }); +}); + +/** + * Most style properties can be unset by doing .style[prop] = '' but IE8 + * doesn't like doing that with shorthand properties so for the properties that + * IE8 breaks on, which are listed here, we instead unset each of the + * individual properties. See http://bugs.jquery.com/ticket/12385. + * The 4-value 'clock' properties like margin, padding, border-width seem to + * behave without any problems. Curiously, list-style works too without any + * special prodding. + */ +var shorthandPropertyExpansions = { + background: { + backgroundAttachment: true, + backgroundColor: true, + backgroundImage: true, + backgroundPositionX: true, + backgroundPositionY: true, + backgroundRepeat: true + }, + backgroundPosition: { + backgroundPositionX: true, + backgroundPositionY: true + }, + border: { + borderWidth: true, + borderStyle: true, + borderColor: true + }, + borderBottom: { + borderBottomWidth: true, + borderBottomStyle: true, + borderBottomColor: true + }, + borderLeft: { + borderLeftWidth: true, + borderLeftStyle: true, + borderLeftColor: true + }, + borderRight: { + borderRightWidth: true, + borderRightStyle: true, + borderRightColor: true + }, + borderTop: { + borderTopWidth: true, + borderTopStyle: true, + borderTopColor: true + }, + font: { + fontStyle: true, + fontVariant: true, + fontWeight: true, + fontSize: true, + lineHeight: true, + fontFamily: true + }, + outline: { + outlineWidth: true, + outlineStyle: true, + outlineColor: true + } +}; + +var CSSProperty = { + isUnitlessNumber: isUnitlessNumber, + shorthandPropertyExpansions: shorthandPropertyExpansions +}; + +module.exports = CSSProperty; + +/***/ }), +/* 82 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(process) {/** + * 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 DOMProperty = __webpack_require__(17); +var ReactDOMComponentTree = __webpack_require__(7); +var ReactInstrumentation = __webpack_require__(13); + +var quoteAttributeValueForBrowser = __webpack_require__(160); +var warning = __webpack_require__(3); + +var VALID_ATTRIBUTE_NAME_REGEX = new RegExp('^[' + DOMProperty.ATTRIBUTE_NAME_START_CHAR + '][' + DOMProperty.ATTRIBUTE_NAME_CHAR + ']*$'); +var illegalAttributeNameCache = {}; +var validatedAttributeNameCache = {}; + +function isAttributeNameSafe(attributeName) { + if (validatedAttributeNameCache.hasOwnProperty(attributeName)) { + return true; + } + if (illegalAttributeNameCache.hasOwnProperty(attributeName)) { + return false; + } + if (VALID_ATTRIBUTE_NAME_REGEX.test(attributeName)) { + validatedAttributeNameCache[attributeName] = true; + return true; + } + illegalAttributeNameCache[attributeName] = true; + process.env.NODE_ENV !== 'production' ? warning(false, 'Invalid attribute name: `%s`', attributeName) : void 0; + return false; +} + +function shouldIgnoreValue(propertyInfo, value) { + return value == null || propertyInfo.hasBooleanValue && !value || propertyInfo.hasNumericValue && isNaN(value) || propertyInfo.hasPositiveNumericValue && value < 1 || propertyInfo.hasOverloadedBooleanValue && value === false; +} + +/** + * Operations for dealing with DOM properties. + */ +var DOMPropertyOperations = { + /** + * Creates markup for the ID property. + * + * @param {string} id Unescaped ID. + * @return {string} Markup string. + */ + createMarkupForID: function (id) { + return DOMProperty.ID_ATTRIBUTE_NAME + '=' + quoteAttributeValueForBrowser(id); + }, + + setAttributeForID: function (node, id) { + node.setAttribute(DOMProperty.ID_ATTRIBUTE_NAME, id); + }, + + createMarkupForRoot: function () { + return DOMProperty.ROOT_ATTRIBUTE_NAME + '=""'; + }, + + setAttributeForRoot: function (node) { + node.setAttribute(DOMProperty.ROOT_ATTRIBUTE_NAME, ''); + }, + + /** + * Creates markup for a property. + * + * @param {string} name + * @param {*} value + * @return {?string} Markup string, or null if the property was invalid. + */ + createMarkupForProperty: function (name, value) { + var propertyInfo = DOMProperty.properties.hasOwnProperty(name) ? DOMProperty.properties[name] : null; + if (propertyInfo) { + if (shouldIgnoreValue(propertyInfo, value)) { + return ''; + } + var attributeName = propertyInfo.attributeName; + if (propertyInfo.hasBooleanValue || propertyInfo.hasOverloadedBooleanValue && value === true) { + return attributeName + '=""'; + } + return attributeName + '=' + quoteAttributeValueForBrowser(value); + } else if (DOMProperty.isCustomAttribute(name)) { + if (value == null) { + return ''; + } + return name + '=' + quoteAttributeValueForBrowser(value); + } + return null; + }, + + /** + * Creates markup for a custom property. + * + * @param {string} name + * @param {*} value + * @return {string} Markup string, or empty string if the property was invalid. + */ + createMarkupForCustomAttribute: function (name, value) { + if (!isAttributeNameSafe(name) || value == null) { + return ''; + } + return name + '=' + quoteAttributeValueForBrowser(value); + }, + + /** + * Sets the value for a property on a node. + * + * @param {DOMElement} node + * @param {string} name + * @param {*} value + */ + setValueForProperty: function (node, name, value) { + var propertyInfo = DOMProperty.properties.hasOwnProperty(name) ? DOMProperty.properties[name] : null; + if (propertyInfo) { + var mutationMethod = propertyInfo.mutationMethod; + if (mutationMethod) { + mutationMethod(node, value); + } else if (shouldIgnoreValue(propertyInfo, value)) { + this.deleteValueForProperty(node, name); + return; + } else if (propertyInfo.mustUseProperty) { + // Contrary to `setAttribute`, object properties are properly + // `toString`ed by IE8/9. + node[propertyInfo.propertyName] = value; + } else { + var attributeName = propertyInfo.attributeName; + var namespace = propertyInfo.attributeNamespace; + // `setAttribute` with objects becomes only `[object]` in IE8/9, + // ('' + value) makes it output the correct toString()-value. + if (namespace) { + node.setAttributeNS(namespace, attributeName, '' + value); + } else if (propertyInfo.hasBooleanValue || propertyInfo.hasOverloadedBooleanValue && value === true) { + node.setAttribute(attributeName, ''); + } else { + node.setAttribute(attributeName, '' + value); + } + } + } else if (DOMProperty.isCustomAttribute(name)) { + DOMPropertyOperations.setValueForAttribute(node, name, value); + return; + } + + if (process.env.NODE_ENV !== 'production') { + var payload = {}; + payload[name] = value; + ReactInstrumentation.debugTool.onHostOperation({ + instanceID: ReactDOMComponentTree.getInstanceFromNode(node)._debugID, + type: 'update attribute', + payload: payload + }); + } + }, + + setValueForAttribute: function (node, name, value) { + if (!isAttributeNameSafe(name)) { + return; + } + if (value == null) { + node.removeAttribute(name); + } else { + node.setAttribute(name, '' + value); + } + + if (process.env.NODE_ENV !== 'production') { + var payload = {}; + payload[name] = value; + ReactInstrumentation.debugTool.onHostOperation({ + instanceID: ReactDOMComponentTree.getInstanceFromNode(node)._debugID, + type: 'update attribute', + payload: payload + }); + } + }, + + /** + * Deletes an attributes from a node. + * + * @param {DOMElement} node + * @param {string} name + */ + deleteValueForAttribute: function (node, name) { + node.removeAttribute(name); + if (process.env.NODE_ENV !== 'production') { + ReactInstrumentation.debugTool.onHostOperation({ + instanceID: ReactDOMComponentTree.getInstanceFromNode(node)._debugID, + type: 'remove attribute', + payload: name + }); + } + }, + + /** + * Deletes the value for a property on a node. + * + * @param {DOMElement} node + * @param {string} name + */ + deleteValueForProperty: function (node, name) { + var propertyInfo = DOMProperty.properties.hasOwnProperty(name) ? DOMProperty.properties[name] : null; + if (propertyInfo) { + var mutationMethod = propertyInfo.mutationMethod; + if (mutationMethod) { + mutationMethod(node, undefined); + } else if (propertyInfo.mustUseProperty) { + var propName = propertyInfo.propertyName; + if (propertyInfo.hasBooleanValue) { + node[propName] = false; + } else { + node[propName] = ''; + } + } else { + node.removeAttribute(propertyInfo.attributeName); + } + } else if (DOMProperty.isCustomAttribute(name)) { + node.removeAttribute(name); + } + + if (process.env.NODE_ENV !== 'production') { + ReactInstrumentation.debugTool.onHostOperation({ + instanceID: ReactDOMComponentTree.getInstanceFromNode(node)._debugID, + type: 'remove attribute', + payload: name + }); + } + } +}; + +module.exports = DOMPropertyOperations; +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) + +/***/ }), +/* 83 */ +/***/ (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 ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED'; + +module.exports = ReactPropTypesSecret; + +/***/ }), +/* 84 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(process) {/** + * 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__(8); + +var LinkedValueUtils = __webpack_require__(50); +var ReactDOMComponentTree = __webpack_require__(7); +var ReactUpdates = __webpack_require__(15); + +var warning = __webpack_require__(3); + +var didWarnValueLink = false; +var didWarnValueDefaultValue = false; + +function updateOptionsIfPendingUpdateAndMounted() { + if (this._rootNodeID && this._wrapperState.pendingUpdate) { + this._wrapperState.pendingUpdate = false; + + var props = this._currentElement.props; + var value = LinkedValueUtils.getValue(props); + + if (value != null) { + updateOptions(this, Boolean(props.multiple), value); + } + } +} + +function getDeclarationErrorAddendum(owner) { + if (owner) { + var name = owner.getName(); + if (name) { + return ' Check the render method of `' + name + '`.'; + } + } + return ''; +} + +var valuePropNames = ['value', 'defaultValue']; + +/** + * Validation function for `value` and `defaultValue`. + * @private + */ +function checkSelectPropTypes(inst, props) { + var owner = inst._currentElement._owner; + LinkedValueUtils.checkPropTypes('select', props, owner); + + if (props.valueLink !== undefined && !didWarnValueLink) { + process.env.NODE_ENV !== 'production' ? warning(false, '`valueLink` prop on `select` is deprecated; set `value` and `onChange` instead.') : void 0; + didWarnValueLink = true; + } + + for (var i = 0; i < valuePropNames.length; i++) { + var propName = valuePropNames[i]; + if (props[propName] == null) { + continue; + } + var isArray = Array.isArray(props[propName]); + if (props.multiple && !isArray) { + process.env.NODE_ENV !== 'production' ? warning(false, 'The `%s` prop supplied to <select> must be an array if ' + '`multiple` is true.%s', propName, getDeclarationErrorAddendum(owner)) : void 0; + } else if (!props.multiple && isArray) { + process.env.NODE_ENV !== 'production' ? warning(false, 'The `%s` prop supplied to <select> must be a scalar ' + 'value if `multiple` is false.%s', propName, getDeclarationErrorAddendum(owner)) : void 0; + } + } +} + +/** + * @param {ReactDOMComponent} inst + * @param {boolean} multiple + * @param {*} propValue A stringable (with `multiple`, a list of stringables). + * @private + */ +function updateOptions(inst, multiple, propValue) { + var selectedValue, i; + var options = ReactDOMComponentTree.getNodeFromInstance(inst).options; + + if (multiple) { + selectedValue = {}; + for (i = 0; i < propValue.length; i++) { + selectedValue['' + propValue[i]] = true; + } + for (i = 0; i < options.length; i++) { + var selected = selectedValue.hasOwnProperty(options[i].value); + if (options[i].selected !== selected) { + options[i].selected = selected; + } + } + } else { + // Do not set `select.value` as exact behavior isn't consistent across all + // browsers for all cases. + selectedValue = '' + propValue; + for (i = 0; i < options.length; i++) { + if (options[i].value === selectedValue) { + options[i].selected = true; + return; + } + } + if (options.length) { + options[0].selected = true; + } + } +} + +/** + * Implements a <select> host component that allows optionally setting the + * props `value` and `defaultValue`. If `multiple` is false, the prop must be a + * stringable. If `multiple` is true, the prop must be an array of stringables. + * + * If `value` is not supplied (or null/undefined), user actions that change the + * selected option will trigger updates to the rendered options. + * + * If it is supplied (and not null/undefined), the rendered options will not + * update in response to user actions. Instead, the `value` prop must change in + * order for the rendered options to update. + * + * If `defaultValue` is provided, any options with the supplied values will be + * selected. + */ +var ReactDOMSelect = { + getHostProps: function (inst, props) { + return _assign({}, props, { + onChange: inst._wrapperState.onChange, + value: undefined + }); + }, + + mountWrapper: function (inst, props) { + if (process.env.NODE_ENV !== 'production') { + checkSelectPropTypes(inst, props); + } + + var value = LinkedValueUtils.getValue(props); + inst._wrapperState = { + pendingUpdate: false, + initialValue: value != null ? value : props.defaultValue, + listeners: null, + onChange: _handleChange.bind(inst), + wasMultiple: Boolean(props.multiple) + }; + + if (props.value !== undefined && props.defaultValue !== undefined && !didWarnValueDefaultValue) { + process.env.NODE_ENV !== 'production' ? warning(false, 'Select elements must be either controlled or uncontrolled ' + '(specify either the value prop, or the defaultValue prop, but not ' + 'both). Decide between using a controlled or uncontrolled select ' + 'element and remove one of these props. More info: ' + 'https://fb.me/react-controlled-components') : void 0; + didWarnValueDefaultValue = true; + } + }, + + getSelectValueContext: function (inst) { + // ReactDOMOption looks at this initial value so the initial generated + // markup has correct `selected` attributes + return inst._wrapperState.initialValue; + }, + + postUpdateWrapper: function (inst) { + var props = inst._currentElement.props; + + // After the initial mount, we control selected-ness manually so don't pass + // this value down + inst._wrapperState.initialValue = undefined; + + var wasMultiple = inst._wrapperState.wasMultiple; + inst._wrapperState.wasMultiple = Boolean(props.multiple); + + var value = LinkedValueUtils.getValue(props); + if (value != null) { + inst._wrapperState.pendingUpdate = false; + updateOptions(inst, Boolean(props.multiple), value); + } else if (wasMultiple !== Boolean(props.multiple)) { + // For simplicity, reapply `defaultValue` if `multiple` is toggled. + if (props.defaultValue != null) { + updateOptions(inst, Boolean(props.multiple), props.defaultValue); + } else { + // Revert the select back to its default unselected state. + updateOptions(inst, Boolean(props.multiple), props.multiple ? [] : ''); + } + } + } +}; + +function _handleChange(event) { + var props = this._currentElement.props; + var returnValue = LinkedValueUtils.executeOnChange(props, event); + + if (this._rootNodeID) { + this._wrapperState.pendingUpdate = true; + } + ReactUpdates.asap(updateOptionsIfPendingUpdateAndMounted, this); + return returnValue; +} + +module.exports = ReactDOMSelect; +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) + +/***/ }), +/* 85 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(process) {/** + * 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__(4), + _assign = __webpack_require__(8); + +var ReactCompositeComponent = __webpack_require__(168); +var ReactEmptyComponent = __webpack_require__(87); +var ReactHostComponent = __webpack_require__(88); + +var getNextDebugID = __webpack_require__(171); +var invariant = __webpack_require__(1); +var warning = __webpack_require__(3); + +// To avoid a cyclic dependency, we create the final class in this module +var ReactCompositeComponentWrapper = function (element) { + this.construct(element); +}; + +function getDeclarationErrorAddendum(owner) { + if (owner) { + var name = owner.getName(); + if (name) { + return ' Check the render method of `' + name + '`.'; + } + } + return ''; +} + +/** + * Check if the type reference is a known internal type. I.e. not a user + * provided composite type. + * + * @param {function} type + * @return {boolean} Returns true if this is a valid internal type. + */ +function isInternalComponentType(type) { + return typeof type === 'function' && typeof type.prototype !== 'undefined' && typeof type.prototype.mountComponent === 'function' && typeof type.prototype.receiveComponent === 'function'; +} + +/** + * Given a ReactNode, create an instance that will actually be mounted. + * + * @param {ReactNode} node + * @param {boolean} shouldHaveDebugID + * @return {object} A new instance of the element's constructor. + * @protected + */ +function instantiateReactComponent(node, shouldHaveDebugID) { + var instance; + + if (node === null || node === false) { + instance = ReactEmptyComponent.create(instantiateReactComponent); + } else if (typeof node === 'object') { + var element = node; + var type = element.type; + if (typeof type !== 'function' && typeof type !== 'string') { + var info = ''; + if (process.env.NODE_ENV !== 'production') { + if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) { + info += ' You likely forgot to export your component from the file ' + "it's defined in."; + } + } + info += getDeclarationErrorAddendum(element._owner); + true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s', type == null ? type : typeof type, info) : _prodInvariant('130', type == null ? type : typeof type, info) : void 0; + } + + // Special case string values + if (typeof element.type === 'string') { + instance = ReactHostComponent.createInternalComponent(element); + } else if (isInternalComponentType(element.type)) { + // This is temporarily available for custom components that are not string + // representations. I.e. ART. Once those are updated to use the string + // representation, we can drop this code path. + instance = new element.type(element); + + // We renamed this. Allow the old name for compat. :( + if (!instance.getHostNode) { + instance.getHostNode = instance.getNativeNode; + } + } else { + instance = new ReactCompositeComponentWrapper(element); + } + } else if (typeof node === 'string' || typeof node === 'number') { + instance = ReactHostComponent.createInstanceForText(node); + } else { + true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Encountered invalid React node of type %s', typeof node) : _prodInvariant('131', typeof node) : void 0; + } + + if (process.env.NODE_ENV !== 'production') { + process.env.NODE_ENV !== 'production' ? warning(typeof instance.mountComponent === 'function' && typeof instance.receiveComponent === 'function' && typeof instance.getHostNode === 'function' && typeof instance.unmountComponent === 'function', 'Only React Components can be mounted.') : void 0; + } + + // These two fields are used by the DOM and ART diffing algorithms + // respectively. Instead of using expandos on components, we should be + // storing the state needed by the diffing algorithms elsewhere. + instance._mountIndex = 0; + instance._mountImage = null; + + if (process.env.NODE_ENV !== 'production') { + instance._debugID = shouldHaveDebugID ? getNextDebugID() : 0; + } + + // Internal instances should fully constructed at this point, so they should + // not get any new fields added to them at this point. + if (process.env.NODE_ENV !== 'production') { + if (Object.preventExtensions) { + Object.preventExtensions(instance); + } + } + + return instance; +} + +_assign(ReactCompositeComponentWrapper.prototype, ReactCompositeComponent, { + _instantiateReactComponent: instantiateReactComponent +}); + +module.exports = instantiateReactComponent; +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) + +/***/ }), +/* 86 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(process) {/** + * 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__(4); + +var React = __webpack_require__(21); + +var invariant = __webpack_require__(1); + +var ReactNodeTypes = { + HOST: 0, + COMPOSITE: 1, + EMPTY: 2, + + getType: function (node) { + if (node === null || node === false) { + return ReactNodeTypes.EMPTY; + } else if (React.isValidElement(node)) { + if (typeof node.type === 'function') { + return ReactNodeTypes.COMPOSITE; + } else { + return ReactNodeTypes.HOST; + } + } + true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Unexpected node: %s', node) : _prodInvariant('26', node) : void 0; + } +}; + +module.exports = ReactNodeTypes; +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) + +/***/ }), +/* 87 */ +/***/ (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 emptyComponentFactory; + +var ReactEmptyComponentInjection = { + injectEmptyComponentFactory: function (factory) { + emptyComponentFactory = factory; + } +}; + +var ReactEmptyComponent = { + create: function (instantiate) { + return emptyComponentFactory(instantiate); + } +}; + +ReactEmptyComponent.injection = ReactEmptyComponentInjection; + +module.exports = ReactEmptyComponent; + +/***/ }), +/* 88 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(process) {/** + * 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 _prodInvariant = __webpack_require__(4); + +var invariant = __webpack_require__(1); + +var genericComponentClass = null; +var textComponentClass = null; + +var ReactHostComponentInjection = { + // This accepts a class that receives the tag string. This is a catch all + // that can render any kind of tag. + injectGenericComponentClass: function (componentClass) { + genericComponentClass = componentClass; + }, + // This accepts a text component class that takes the text string to be + // rendered as props. + injectTextComponentClass: function (componentClass) { + textComponentClass = componentClass; + } +}; + +/** + * Get a host internal component class for a specific tag. + * + * @param {ReactElement} element The element to create. + * @return {function} The internal class constructor function. + */ +function createInternalComponent(element) { + !genericComponentClass ? process.env.NODE_ENV !== 'production' ? invariant(false, 'There is no registered component for the tag %s', element.type) : _prodInvariant('111', element.type) : void 0; + return new genericComponentClass(element); +} + +/** + * @param {ReactText} text + * @return {ReactComponent} + */ +function createInstanceForText(text) { + return new textComponentClass(text); +} + +/** + * @param {ReactComponent} component + * @return {boolean} + */ +function isTextComponent(component) { + return component instanceof textComponentClass; +} + +var ReactHostComponent = { + createInternalComponent: createInternalComponent, + createInstanceForText: createInstanceForText, + isTextComponent: isTextComponent, + injection: ReactHostComponentInjection +}; + +module.exports = ReactHostComponent; +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) + +/***/ }), +/* 89 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(process) {/** + * 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__(4); + +var ReactCurrentOwner = __webpack_require__(14); +var REACT_ELEMENT_TYPE = __webpack_require__(172); + +var getIteratorFn = __webpack_require__(173); +var invariant = __webpack_require__(1); +var KeyEscapeUtils = __webpack_require__(54); +var warning = __webpack_require__(3); + +var SEPARATOR = '.'; +var SUBSEPARATOR = ':'; + +/** + * This is inlined from ReactElement since this file is shared between + * isomorphic and renderers. We could extract this to a + * + */ + +/** + * TODO: Test that a single child and an array with one item have the same key + * pattern. + */ + +var didWarnAboutMaps = false; + +/** + * Generate a key string that identifies a component within a set. + * + * @param {*} component A component that could contain a manual key. + * @param {number} index Index that is used if a manual key is not provided. + * @return {string} + */ +function getComponentKey(component, index) { + // Do some typechecking here since we call this blindly. We want to ensure + // that we don't block potential future ES APIs. + if (component && typeof component === 'object' && component.key != null) { + // Explicit key + return KeyEscapeUtils.escape(component.key); + } + // Implicit key determined by the index in the set + return index.toString(36); +} + +/** + * @param {?*} children Children tree container. + * @param {!string} nameSoFar Name of the key path so far. + * @param {!function} callback Callback to invoke with each child found. + * @param {?*} traverseContext Used to pass information throughout the traversal + * process. + * @return {!number} The number of children in this subtree. + */ +function traverseAllChildrenImpl(children, nameSoFar, callback, traverseContext) { + var type = typeof children; + + if (type === 'undefined' || type === 'boolean') { + // All of the above are perceived as null. + children = null; + } + + if (children === null || type === 'string' || type === 'number' || + // The following is inlined from ReactElement. This means we can optimize + // some checks. React Fiber also inlines this logic for similar purposes. + type === 'object' && children.$$typeof === REACT_ELEMENT_TYPE) { + callback(traverseContext, children, + // If it's the only child, treat the name as if it was wrapped in an array + // so that it's consistent if the number of children grows. + nameSoFar === '' ? SEPARATOR + getComponentKey(children, 0) : nameSoFar); + return 1; + } + + var child; + var nextName; + var subtreeCount = 0; // Count of children found in the current subtree. + var nextNamePrefix = nameSoFar === '' ? SEPARATOR : nameSoFar + SUBSEPARATOR; + + if (Array.isArray(children)) { + for (var i = 0; i < children.length; i++) { + child = children[i]; + nextName = nextNamePrefix + getComponentKey(child, i); + subtreeCount += traverseAllChildrenImpl(child, nextName, callback, traverseContext); + } + } else { + var iteratorFn = getIteratorFn(children); + if (iteratorFn) { + var iterator = iteratorFn.call(children); + var step; + if (iteratorFn !== children.entries) { + var ii = 0; + while (!(step = iterator.next()).done) { + child = step.value; + nextName = nextNamePrefix + getComponentKey(child, ii++); + subtreeCount += traverseAllChildrenImpl(child, nextName, callback, traverseContext); + } + } else { + if (process.env.NODE_ENV !== 'production') { + var mapsAsChildrenAddendum = ''; + if (ReactCurrentOwner.current) { + var mapsAsChildrenOwnerName = ReactCurrentOwner.current.getName(); + if (mapsAsChildrenOwnerName) { + mapsAsChildrenAddendum = ' Check the render method of `' + mapsAsChildrenOwnerName + '`.'; + } + } + process.env.NODE_ENV !== 'production' ? warning(didWarnAboutMaps, 'Using Maps as children is not yet fully supported. It is an ' + 'experimental feature that might be removed. Convert it to a ' + 'sequence / iterable of keyed ReactElements instead.%s', mapsAsChildrenAddendum) : void 0; + didWarnAboutMaps = true; + } + // Iterator will provide entry [k,v] tuples rather than values. + while (!(step = iterator.next()).done) { + var entry = step.value; + if (entry) { + child = entry[1]; + nextName = nextNamePrefix + KeyEscapeUtils.escape(entry[0]) + SUBSEPARATOR + getComponentKey(child, 0); + subtreeCount += traverseAllChildrenImpl(child, nextName, callback, traverseContext); + } + } + } + } else if (type === 'object') { + var addendum = ''; + if (process.env.NODE_ENV !== 'production') { + addendum = ' If you meant to render a collection of children, use an array ' + 'instead or wrap the object using createFragment(object) from the ' + 'React add-ons.'; + if (children._isReactElement) { + addendum = " It looks like you're using an element created by a different " + 'version of React. Make sure to use only one copy of React.'; + } + if (ReactCurrentOwner.current) { + var name = ReactCurrentOwner.current.getName(); + if (name) { + addendum += ' Check the render method of `' + name + '`.'; + } + } + } + var childrenString = String(children); + true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Objects are not valid as a React child (found: %s).%s', childrenString === '[object Object]' ? 'object with keys {' + Object.keys(children).join(', ') + '}' : childrenString, addendum) : _prodInvariant('31', childrenString === '[object Object]' ? 'object with keys {' + Object.keys(children).join(', ') + '}' : childrenString, addendum) : void 0; + } + } + + return subtreeCount; +} + +/** + * Traverses children that are typically specified as `props.children`, but + * might also be specified through attributes: + * + * - `traverseAllChildren(this.props.children, ...)` + * - `traverseAllChildren(this.props.leftPanelChildren, ...)` + * + * The `traverseContext` is an optional argument that is passed through the + * entire traversal. It can be used to store accumulations or anything else that + * the callback might find relevant. + * + * @param {?*} children Children tree object. + * @param {!function} callback To invoke upon traversing each child. + * @param {?*} traverseContext Context for traversal. + * @return {!number} The number of children in this subtree. + */ +function traverseAllChildren(children, callback, traverseContext) { + if (children == null) { + return 0; + } + + return traverseAllChildrenImpl(children, '', callback, traverseContext); +} + +module.exports = traverseAllChildren; +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) + +/***/ }), +/* 90 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(process) { + +/** + * 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. + * + * @typechecks + */ + +var emptyFunction = __webpack_require__(12); + +/** + * Upstream version of event listener. Does not take into account specific + * nature of platform. + */ +var EventListener = { + /** + * Listen to DOM events during the bubble phase. + * + * @param {DOMEventTarget} target DOM element to register listener on. + * @param {string} eventType Event type, e.g. 'click' or 'mouseover'. + * @param {function} callback Callback function. + * @return {object} Object with a `remove` method. + */ + listen: function listen(target, eventType, callback) { + if (target.addEventListener) { + target.addEventListener(eventType, callback, false); + return { + remove: function remove() { + target.removeEventListener(eventType, callback, false); + } + }; + } else if (target.attachEvent) { + target.attachEvent('on' + eventType, callback); + return { + remove: function remove() { + target.detachEvent('on' + eventType, callback); + } + }; + } + }, + + /** + * Listen to DOM events during the capture phase. + * + * @param {DOMEventTarget} target DOM element to register listener on. + * @param {string} eventType Event type, e.g. 'click' or 'mouseover'. + * @param {function} callback Callback function. + * @return {object} Object with a `remove` method. + */ + capture: function capture(target, eventType, callback) { + if (target.addEventListener) { + target.addEventListener(eventType, callback, true); + return { + remove: function remove() { + target.removeEventListener(eventType, callback, true); + } + }; + } else { + if (process.env.NODE_ENV !== 'production') { + console.error('Attempted to listen to events during the capture phase on a ' + 'browser that does not support the capture phase. Your application ' + 'will not receive some events.'); + } + return { + remove: emptyFunction + }; + } + }, + + registerDefault: function registerDefault() {} +}; + +module.exports = EventListener; +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) + +/***/ }), +/* 91 */ +/***/ (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 ReactDOMSelection = __webpack_require__(185); + +var containsNode = __webpack_require__(187); +var focusNode = __webpack_require__(80); +var getActiveElement = __webpack_require__(92); + +function isInDocument(node) { + return containsNode(document.documentElement, node); +} + +/** + * @ReactInputSelection: React input selection module. Based on Selection.js, + * but modified to be suitable for react and has a couple of bug fixes (doesn't + * assume buttons have range selections allowed). + * Input selection module for React. + */ +var ReactInputSelection = { + hasSelectionCapabilities: function (elem) { + var nodeName = elem && elem.nodeName && elem.nodeName.toLowerCase(); + return nodeName && (nodeName === 'input' && elem.type === 'text' || nodeName === 'textarea' || elem.contentEditable === 'true'); + }, + + getSelectionInformation: function () { + var focusedElem = getActiveElement(); + return { + focusedElem: focusedElem, + selectionRange: ReactInputSelection.hasSelectionCapabilities(focusedElem) ? ReactInputSelection.getSelection(focusedElem) : null + }; + }, + + /** + * @restoreSelection: If any selection information was potentially lost, + * restore it. This is useful when performing operations that could remove dom + * nodes and place them back in, resulting in focus being lost. + */ + restoreSelection: function (priorSelectionInformation) { + var curFocusedElem = getActiveElement(); + var priorFocusedElem = priorSelectionInformation.focusedElem; + var priorSelectionRange = priorSelectionInformation.selectionRange; + if (curFocusedElem !== priorFocusedElem && isInDocument(priorFocusedElem)) { + if (ReactInputSelection.hasSelectionCapabilities(priorFocusedElem)) { + ReactInputSelection.setSelection(priorFocusedElem, priorSelectionRange); + } + focusNode(priorFocusedElem); + } + }, + + /** + * @getSelection: Gets the selection bounds of a focused textarea, input or + * contentEditable node. + * -@input: Look up selection bounds of this input + * -@return {start: selectionStart, end: selectionEnd} + */ + getSelection: function (input) { + var selection; + + if ('selectionStart' in input) { + // Modern browser with input or textarea. + selection = { + start: input.selectionStart, + end: input.selectionEnd + }; + } else if (document.selection && input.nodeName && input.nodeName.toLowerCase() === 'input') { + // IE8 input. + var range = document.selection.createRange(); + // There can only be one selection per document in IE, so it must + // be in our element. + if (range.parentElement() === input) { + selection = { + start: -range.moveStart('character', -input.value.length), + end: -range.moveEnd('character', -input.value.length) + }; + } + } else { + // Content editable or old IE textarea. + selection = ReactDOMSelection.getOffsets(input); + } + + return selection || { start: 0, end: 0 }; + }, + + /** + * @setSelection: Sets the selection bounds of a textarea or input and focuses + * the input. + * -@input Set selection bounds of this input or textarea + * -@offsets Object of same form that is returned from get* + */ + setSelection: function (input, offsets) { + var start = offsets.start; + var end = offsets.end; + if (end === undefined) { + end = start; + } + + if ('selectionStart' in input) { + input.selectionStart = start; + input.selectionEnd = Math.min(end, input.value.length); + } else if (document.selection && input.nodeName && input.nodeName.toLowerCase() === 'input') { + var range = input.createTextRange(); + range.collapse(true); + range.moveStart('character', start); + range.moveEnd('character', end - start); + range.select(); + } else { + ReactDOMSelection.setOffsets(input, offsets); + } + } +}; + +module.exports = ReactInputSelection; + +/***/ }), +/* 92 */ +/***/ (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. + * + * @typechecks + */ + +/* eslint-disable fb-www/typeof-undefined */ + +/** + * Same as document.activeElement but wraps in a try-catch block. In IE it is + * not safe to call document.activeElement if there is nothing focused. + * + * The activeElement will be null only if the document or document body is not + * yet defined. + * + * @param {?DOMDocument} doc Defaults to current document. + * @return {?DOMElement} + */ +function getActiveElement(doc) /*?DOMElement*/{ + doc = doc || (typeof document !== 'undefined' ? document : undefined); + if (typeof doc === 'undefined') { + return null; + } + try { + return doc.activeElement || doc.body; + } catch (e) { + return doc.body; + } +} + +module.exports = getActiveElement; + +/***/ }), +/* 93 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(process) {/** + * 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__(4); + +var DOMLazyTree = __webpack_require__(24); +var DOMProperty = __webpack_require__(17); +var React = __webpack_require__(21); +var ReactBrowserEventEmitter = __webpack_require__(38); +var ReactCurrentOwner = __webpack_require__(14); +var ReactDOMComponentTree = __webpack_require__(7); +var ReactDOMContainerInfo = __webpack_require__(202); +var ReactDOMFeatureFlags = __webpack_require__(203); +var ReactFeatureFlags = __webpack_require__(75); +var ReactInstanceMap = __webpack_require__(29); +var ReactInstrumentation = __webpack_require__(13); +var ReactMarkupChecksum = __webpack_require__(204); +var ReactReconciler = __webpack_require__(23); +var ReactUpdateQueue = __webpack_require__(55); +var ReactUpdates = __webpack_require__(15); + +var emptyObject = __webpack_require__(31); +var instantiateReactComponent = __webpack_require__(85); +var invariant = __webpack_require__(1); +var setInnerHTML = __webpack_require__(36); +var shouldUpdateReactComponent = __webpack_require__(53); +var warning = __webpack_require__(3); + +var ATTR_NAME = DOMProperty.ID_ATTRIBUTE_NAME; +var ROOT_ATTR_NAME = DOMProperty.ROOT_ATTRIBUTE_NAME; + +var ELEMENT_NODE_TYPE = 1; +var DOC_NODE_TYPE = 9; +var DOCUMENT_FRAGMENT_NODE_TYPE = 11; + +var instancesByReactRootID = {}; + +/** + * Finds the index of the first character + * that's not common between the two given strings. + * + * @return {number} the index of the character where the strings diverge + */ +function firstDifferenceIndex(string1, string2) { + var minLen = Math.min(string1.length, string2.length); + for (var i = 0; i < minLen; i++) { + if (string1.charAt(i) !== string2.charAt(i)) { + return i; + } + } + return string1.length === string2.length ? -1 : minLen; +} + +/** + * @param {DOMElement|DOMDocument} container DOM element that may contain + * a React component + * @return {?*} DOM element that may have the reactRoot ID, or null. + */ +function getReactRootElementInContainer(container) { + if (!container) { + return null; + } + + if (container.nodeType === DOC_NODE_TYPE) { + return container.documentElement; + } else { + return container.firstChild; + } +} + +function internalGetID(node) { + // If node is something like a window, document, or text node, none of + // which support attributes or a .getAttribute method, gracefully return + // the empty string, as if the attribute were missing. + return node.getAttribute && node.getAttribute(ATTR_NAME) || ''; +} + +/** + * Mounts this component and inserts it into the DOM. + * + * @param {ReactComponent} componentInstance The instance to mount. + * @param {DOMElement} container DOM element to mount into. + * @param {ReactReconcileTransaction} transaction + * @param {boolean} shouldReuseMarkup If true, do not insert markup + */ +function mountComponentIntoNode(wrapperInstance, container, transaction, shouldReuseMarkup, context) { + var markerName; + if (ReactFeatureFlags.logTopLevelRenders) { + var wrappedElement = wrapperInstance._currentElement.props.child; + var type = wrappedElement.type; + markerName = 'React mount: ' + (typeof type === 'string' ? type : type.displayName || type.name); + console.time(markerName); + } + + var markup = ReactReconciler.mountComponent(wrapperInstance, transaction, null, ReactDOMContainerInfo(wrapperInstance, container), context, 0 /* parentDebugID */ + ); + + if (markerName) { + console.timeEnd(markerName); + } + + wrapperInstance._renderedComponent._topLevelWrapper = wrapperInstance; + ReactMount._mountImageIntoNode(markup, container, wrapperInstance, shouldReuseMarkup, transaction); +} + +/** + * Batched mount. + * + * @param {ReactComponent} componentInstance The instance to mount. + * @param {DOMElement} container DOM element to mount into. + * @param {boolean} shouldReuseMarkup If true, do not insert markup + */ +function batchedMountComponentIntoNode(componentInstance, container, shouldReuseMarkup, context) { + var transaction = ReactUpdates.ReactReconcileTransaction.getPooled( + /* useCreateElement */ + !shouldReuseMarkup && ReactDOMFeatureFlags.useCreateElement); + transaction.perform(mountComponentIntoNode, null, componentInstance, container, transaction, shouldReuseMarkup, context); + ReactUpdates.ReactReconcileTransaction.release(transaction); +} + +/** + * Unmounts a component and removes it from the DOM. + * + * @param {ReactComponent} instance React component instance. + * @param {DOMElement} container DOM element to unmount from. + * @final + * @internal + * @see {ReactMount.unmountComponentAtNode} + */ +function unmountComponentFromNode(instance, container, safely) { + if (process.env.NODE_ENV !== 'production') { + ReactInstrumentation.debugTool.onBeginFlush(); + } + ReactReconciler.unmountComponent(instance, safely); + if (process.env.NODE_ENV !== 'production') { + ReactInstrumentation.debugTool.onEndFlush(); + } + + if (container.nodeType === DOC_NODE_TYPE) { + container = container.documentElement; + } + + // http://jsperf.com/emptying-a-node + while (container.lastChild) { + container.removeChild(container.lastChild); + } +} + +/** + * True if the supplied DOM node has a direct React-rendered child that is + * not a React root element. Useful for warning in `render`, + * `unmountComponentAtNode`, etc. + * + * @param {?DOMElement} node The candidate DOM node. + * @return {boolean} True if the DOM element contains a direct child that was + * rendered by React but is not a root element. + * @internal + */ +function hasNonRootReactChild(container) { + var rootEl = getReactRootElementInContainer(container); + if (rootEl) { + var inst = ReactDOMComponentTree.getInstanceFromNode(rootEl); + return !!(inst && inst._hostParent); + } +} + +/** + * True if the supplied DOM node is a React DOM element and + * it has been rendered by another copy of React. + * + * @param {?DOMElement} node The candidate DOM node. + * @return {boolean} True if the DOM has been rendered by another copy of React + * @internal + */ +function nodeIsRenderedByOtherInstance(container) { + var rootEl = getReactRootElementInContainer(container); + return !!(rootEl && isReactNode(rootEl) && !ReactDOMComponentTree.getInstanceFromNode(rootEl)); +} + +/** + * True if the supplied DOM node is a valid node element. + * + * @param {?DOMElement} node The candidate DOM node. + * @return {boolean} True if the DOM is a valid DOM node. + * @internal + */ +function isValidContainer(node) { + return !!(node && (node.nodeType === ELEMENT_NODE_TYPE || node.nodeType === DOC_NODE_TYPE || node.nodeType === DOCUMENT_FRAGMENT_NODE_TYPE)); +} + +/** + * True if the supplied DOM node is a valid React node element. + * + * @param {?DOMElement} node The candidate DOM node. + * @return {boolean} True if the DOM is a valid React DOM node. + * @internal + */ +function isReactNode(node) { + return isValidContainer(node) && (node.hasAttribute(ROOT_ATTR_NAME) || node.hasAttribute(ATTR_NAME)); +} + +function getHostRootInstanceInContainer(container) { + var rootEl = getReactRootElementInContainer(container); + var prevHostInstance = rootEl && ReactDOMComponentTree.getInstanceFromNode(rootEl); + return prevHostInstance && !prevHostInstance._hostParent ? prevHostInstance : null; +} + +function getTopLevelWrapperInContainer(container) { + var root = getHostRootInstanceInContainer(container); + return root ? root._hostContainerInfo._topLevelWrapper : null; +} + +/** + * Temporary (?) hack so that we can store all top-level pending updates on + * composites instead of having to worry about different types of components + * here. + */ +var topLevelRootCounter = 1; +var TopLevelWrapper = function () { + this.rootID = topLevelRootCounter++; +}; +TopLevelWrapper.prototype.isReactComponent = {}; +if (process.env.NODE_ENV !== 'production') { + TopLevelWrapper.displayName = 'TopLevelWrapper'; +} +TopLevelWrapper.prototype.render = function () { + return this.props.child; +}; +TopLevelWrapper.isReactTopLevelWrapper = true; + +/** + * Mounting is the process of initializing a React component by creating its + * representative DOM elements and inserting them into a supplied `container`. + * Any prior content inside `container` is destroyed in the process. + * + * ReactMount.render( + * component, + * document.getElementById('container') + * ); + * + * <div id="container"> <-- Supplied `container`. + * <div data-reactid=".3"> <-- Rendered reactRoot of React + * // ... component. + * </div> + * </div> + * + * Inside of `container`, the first element rendered is the "reactRoot". + */ +var ReactMount = { + TopLevelWrapper: TopLevelWrapper, + + /** + * Used by devtools. The keys are not important. + */ + _instancesByReactRootID: instancesByReactRootID, + + /** + * This is a hook provided to support rendering React components while + * ensuring that the apparent scroll position of its `container` does not + * change. + * + * @param {DOMElement} container The `container` being rendered into. + * @param {function} renderCallback This must be called once to do the render. + */ + scrollMonitor: function (container, renderCallback) { + renderCallback(); + }, + + /** + * Take a component that's already mounted into the DOM and replace its props + * @param {ReactComponent} prevComponent component instance already in the DOM + * @param {ReactElement} nextElement component instance to render + * @param {DOMElement} container container to render into + * @param {?function} callback function triggered on completion + */ + _updateRootComponent: function (prevComponent, nextElement, nextContext, container, callback) { + ReactMount.scrollMonitor(container, function () { + ReactUpdateQueue.enqueueElementInternal(prevComponent, nextElement, nextContext); + if (callback) { + ReactUpdateQueue.enqueueCallbackInternal(prevComponent, callback); + } + }); + + return prevComponent; + }, + + /** + * Render a new component into the DOM. Hooked by hooks! + * + * @param {ReactElement} nextElement element to render + * @param {DOMElement} container container to render into + * @param {boolean} shouldReuseMarkup if we should skip the markup insertion + * @return {ReactComponent} nextComponent + */ + _renderNewRootComponent: function (nextElement, container, shouldReuseMarkup, context) { + // Various parts of our code (such as ReactCompositeComponent's + // _renderValidatedComponent) assume that calls to render aren't nested; + // verify that that's the case. + process.env.NODE_ENV !== 'production' ? warning(ReactCurrentOwner.current == null, '_renderNewRootComponent(): Render methods should be a pure function ' + 'of props and state; triggering nested component updates from ' + 'render is not allowed. If necessary, trigger nested updates in ' + 'componentDidUpdate. Check the render method of %s.', ReactCurrentOwner.current && ReactCurrentOwner.current.getName() || 'ReactCompositeComponent') : void 0; + + !isValidContainer(container) ? process.env.NODE_ENV !== 'production' ? invariant(false, '_registerComponent(...): Target container is not a DOM element.') : _prodInvariant('37') : void 0; + + ReactBrowserEventEmitter.ensureScrollValueMonitoring(); + var componentInstance = instantiateReactComponent(nextElement, false); + + // The initial render is synchronous but any updates that happen during + // rendering, in componentWillMount or componentDidMount, will be batched + // according to the current batching strategy. + + ReactUpdates.batchedUpdates(batchedMountComponentIntoNode, componentInstance, container, shouldReuseMarkup, context); + + var wrapperID = componentInstance._instance.rootID; + instancesByReactRootID[wrapperID] = componentInstance; + + return componentInstance; + }, + + /** + * Renders a React component into the DOM in the supplied `container`. + * + * If the React component was previously rendered into `container`, this will + * perform an update on it and only mutate the DOM as necessary to reflect the + * latest React component. + * + * @param {ReactComponent} parentComponent The conceptual parent of this render tree. + * @param {ReactElement} nextElement Component element to render. + * @param {DOMElement} container DOM element to render into. + * @param {?function} callback function triggered on completion + * @return {ReactComponent} Component instance rendered in `container`. + */ + renderSubtreeIntoContainer: function (parentComponent, nextElement, container, callback) { + !(parentComponent != null && ReactInstanceMap.has(parentComponent)) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'parentComponent must be a valid React Component') : _prodInvariant('38') : void 0; + return ReactMount._renderSubtreeIntoContainer(parentComponent, nextElement, container, callback); + }, + + _renderSubtreeIntoContainer: function (parentComponent, nextElement, container, callback) { + ReactUpdateQueue.validateCallback(callback, 'ReactDOM.render'); + !React.isValidElement(nextElement) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactDOM.render(): Invalid component element.%s', typeof nextElement === 'string' ? " Instead of passing a string like 'div', pass " + "React.createElement('div') or <div />." : typeof nextElement === 'function' ? ' Instead of passing a class like Foo, pass ' + 'React.createElement(Foo) or <Foo />.' : // Check if it quacks like an element + nextElement != null && nextElement.props !== undefined ? ' This may be caused by unintentionally loading two independent ' + 'copies of React.' : '') : _prodInvariant('39', typeof nextElement === 'string' ? " Instead of passing a string like 'div', pass " + "React.createElement('div') or <div />." : typeof nextElement === 'function' ? ' Instead of passing a class like Foo, pass ' + 'React.createElement(Foo) or <Foo />.' : nextElement != null && nextElement.props !== undefined ? ' This may be caused by unintentionally loading two independent ' + 'copies of React.' : '') : void 0; + + process.env.NODE_ENV !== 'production' ? warning(!container || !container.tagName || container.tagName.toUpperCase() !== 'BODY', 'render(): Rendering components directly into document.body is ' + 'discouraged, since its children are often manipulated by third-party ' + 'scripts and browser extensions. This may lead to subtle ' + 'reconciliation issues. Try rendering into a container element created ' + 'for your app.') : void 0; + + var nextWrappedElement = React.createElement(TopLevelWrapper, { + child: nextElement + }); + + var nextContext; + if (parentComponent) { + var parentInst = ReactInstanceMap.get(parentComponent); + nextContext = parentInst._processChildContext(parentInst._context); + } else { + nextContext = emptyObject; + } + + var prevComponent = getTopLevelWrapperInContainer(container); + + if (prevComponent) { + var prevWrappedElement = prevComponent._currentElement; + var prevElement = prevWrappedElement.props.child; + if (shouldUpdateReactComponent(prevElement, nextElement)) { + var publicInst = prevComponent._renderedComponent.getPublicInstance(); + var updatedCallback = callback && function () { + callback.call(publicInst); + }; + ReactMount._updateRootComponent(prevComponent, nextWrappedElement, nextContext, container, updatedCallback); + return publicInst; + } else { + ReactMount.unmountComponentAtNode(container); + } + } + + var reactRootElement = getReactRootElementInContainer(container); + var containerHasReactMarkup = reactRootElement && !!internalGetID(reactRootElement); + var containerHasNonRootReactChild = hasNonRootReactChild(container); + + if (process.env.NODE_ENV !== 'production') { + process.env.NODE_ENV !== 'production' ? warning(!containerHasNonRootReactChild, 'render(...): Replacing React-rendered children with a new root ' + 'component. If you intended to update the children of this node, ' + 'you should instead have the existing children update their state ' + 'and render the new components instead of calling ReactDOM.render.') : void 0; + + if (!containerHasReactMarkup || reactRootElement.nextSibling) { + var rootElementSibling = reactRootElement; + while (rootElementSibling) { + if (internalGetID(rootElementSibling)) { + process.env.NODE_ENV !== 'production' ? warning(false, 'render(): Target node has markup rendered by React, but there ' + 'are unrelated nodes as well. This is most commonly caused by ' + 'white-space inserted around server-rendered markup.') : void 0; + break; + } + rootElementSibling = rootElementSibling.nextSibling; + } + } + } + + var shouldReuseMarkup = containerHasReactMarkup && !prevComponent && !containerHasNonRootReactChild; + var component = ReactMount._renderNewRootComponent(nextWrappedElement, container, shouldReuseMarkup, nextContext)._renderedComponent.getPublicInstance(); + if (callback) { + callback.call(component); + } + return component; + }, + + /** + * Renders a React component into the DOM in the supplied `container`. + * See https://facebook.github.io/react/docs/top-level-api.html#reactdom.render + * + * If the React component was previously rendered into `container`, this will + * perform an update on it and only mutate the DOM as necessary to reflect the + * latest React component. + * + * @param {ReactElement} nextElement Component element to render. + * @param {DOMElement} container DOM element to render into. + * @param {?function} callback function triggered on completion + * @return {ReactComponent} Component instance rendered in `container`. + */ + render: function (nextElement, container, callback) { + return ReactMount._renderSubtreeIntoContainer(null, nextElement, container, callback); + }, + + /** + * Unmounts and destroys the React component rendered in the `container`. + * See https://facebook.github.io/react/docs/top-level-api.html#reactdom.unmountcomponentatnode + * + * @param {DOMElement} container DOM element containing a React component. + * @return {boolean} True if a component was found in and unmounted from + * `container` + */ + unmountComponentAtNode: function (container) { + // Various parts of our code (such as ReactCompositeComponent's + // _renderValidatedComponent) assume that calls to render aren't nested; + // verify that that's the case. (Strictly speaking, unmounting won't cause a + // render but we still don't expect to be in a render call here.) + process.env.NODE_ENV !== 'production' ? warning(ReactCurrentOwner.current == null, 'unmountComponentAtNode(): Render methods should be a pure function ' + 'of props and state; triggering nested component updates from render ' + 'is not allowed. If necessary, trigger nested updates in ' + 'componentDidUpdate. Check the render method of %s.', ReactCurrentOwner.current && ReactCurrentOwner.current.getName() || 'ReactCompositeComponent') : void 0; + + !isValidContainer(container) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'unmountComponentAtNode(...): Target container is not a DOM element.') : _prodInvariant('40') : void 0; + + if (process.env.NODE_ENV !== 'production') { + process.env.NODE_ENV !== 'production' ? warning(!nodeIsRenderedByOtherInstance(container), "unmountComponentAtNode(): The node you're attempting to unmount " + 'was rendered by another copy of React.') : void 0; + } + + var prevComponent = getTopLevelWrapperInContainer(container); + if (!prevComponent) { + // Check if the node being unmounted was rendered by React, but isn't a + // root node. + var containerHasNonRootReactChild = hasNonRootReactChild(container); + + // Check if the container itself is a React root node. + var isContainerReactRoot = container.nodeType === 1 && container.hasAttribute(ROOT_ATTR_NAME); + + if (process.env.NODE_ENV !== 'production') { + process.env.NODE_ENV !== 'production' ? warning(!containerHasNonRootReactChild, "unmountComponentAtNode(): The node you're attempting to unmount " + 'was rendered by React and is not a top-level container. %s', isContainerReactRoot ? 'You may have accidentally passed in a React root node instead ' + 'of its container.' : 'Instead, have the parent component update its state and ' + 'rerender in order to remove this component.') : void 0; + } + + return false; + } + delete instancesByReactRootID[prevComponent._instance.rootID]; + ReactUpdates.batchedUpdates(unmountComponentFromNode, prevComponent, container, false); + return true; + }, + + _mountImageIntoNode: function (markup, container, instance, shouldReuseMarkup, transaction) { + !isValidContainer(container) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'mountComponentIntoNode(...): Target container is not valid.') : _prodInvariant('41') : void 0; + + if (shouldReuseMarkup) { + var rootElement = getReactRootElementInContainer(container); + if (ReactMarkupChecksum.canReuseMarkup(markup, rootElement)) { + ReactDOMComponentTree.precacheNode(instance, rootElement); + return; + } else { + var checksum = rootElement.getAttribute(ReactMarkupChecksum.CHECKSUM_ATTR_NAME); + rootElement.removeAttribute(ReactMarkupChecksum.CHECKSUM_ATTR_NAME); + + var rootMarkup = rootElement.outerHTML; + rootElement.setAttribute(ReactMarkupChecksum.CHECKSUM_ATTR_NAME, checksum); + + var normalizedMarkup = markup; + if (process.env.NODE_ENV !== 'production') { + // because rootMarkup is retrieved from the DOM, various normalizations + // will have occurred which will not be present in `markup`. Here, + // insert markup into a <div> or <iframe> depending on the container + // type to perform the same normalizations before comparing. + var normalizer; + if (container.nodeType === ELEMENT_NODE_TYPE) { + normalizer = document.createElement('div'); + normalizer.innerHTML = markup; + normalizedMarkup = normalizer.innerHTML; + } else { + normalizer = document.createElement('iframe'); + document.body.appendChild(normalizer); + normalizer.contentDocument.write(markup); + normalizedMarkup = normalizer.contentDocument.documentElement.outerHTML; + document.body.removeChild(normalizer); + } + } + + var diffIndex = firstDifferenceIndex(normalizedMarkup, rootMarkup); + var difference = ' (client) ' + normalizedMarkup.substring(diffIndex - 20, diffIndex + 20) + '\n (server) ' + rootMarkup.substring(diffIndex - 20, diffIndex + 20); + + !(container.nodeType !== DOC_NODE_TYPE) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'You\'re trying to render a component to the document using server rendering but the checksum was invalid. This usually means you rendered a different component type or props on the client from the one on the server, or your render() methods are impure. React cannot handle this case due to cross-browser quirks by rendering at the document root. You should look for environment dependent code in your components and ensure the props are the same client and server side:\n%s', difference) : _prodInvariant('42', difference) : void 0; + + if (process.env.NODE_ENV !== 'production') { + process.env.NODE_ENV !== 'production' ? warning(false, 'React attempted to reuse markup in a container but the ' + 'checksum was invalid. This generally means that you are ' + 'using server rendering and the markup generated on the ' + 'server was not what the client was expecting. React injected ' + 'new markup to compensate which works but you have lost many ' + 'of the benefits of server rendering. Instead, figure out ' + 'why the markup being generated is different on the client ' + 'or server:\n%s', difference) : void 0; + } + } + } + + !(container.nodeType !== DOC_NODE_TYPE) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'You\'re trying to render a component to the document but you didn\'t use server rendering. We can\'t do this without using server rendering due to cross-browser quirks. See ReactDOMServer.renderToString() for server rendering.') : _prodInvariant('43') : void 0; + + if (transaction.useCreateElement) { + while (container.lastChild) { + container.removeChild(container.lastChild); + } + DOMLazyTree.insertTreeBefore(container, markup, null); + } else { + setInnerHTML(container, markup); + ReactDOMComponentTree.precacheNode(instance, container.firstChild); + } + + if (process.env.NODE_ENV !== 'production') { + var hostNode = ReactDOMComponentTree.getInstanceFromNode(container.firstChild); + if (hostNode._debugID !== 0) { + ReactInstrumentation.debugTool.onHostOperation({ + instanceID: hostNode._debugID, + type: 'mount', + payload: markup.toString() + }); + } + } + } +}; + +module.exports = ReactMount; +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) + +/***/ }), +/* 94 */ +/***/ (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 ReactNodeTypes = __webpack_require__(86); + +function getHostComponentFromComposite(inst) { + var type; + + while ((type = inst._renderedNodeType) === ReactNodeTypes.COMPOSITE) { + inst = inst._renderedComponent; + } + + if (type === ReactNodeTypes.HOST) { + return inst._renderedComponent; + } else if (type === ReactNodeTypes.EMPTY) { + return null; + } +} + +module.exports = getHostComponentFromComposite; + +/***/ }), +/* 95 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return subscriptionShape; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return storeShape; }); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_prop_types__ = __webpack_require__(18); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_prop_types__); + + +var subscriptionShape = __WEBPACK_IMPORTED_MODULE_0_prop_types___default.a.shape({ + trySubscribe: __WEBPACK_IMPORTED_MODULE_0_prop_types___default.a.func.isRequired, + tryUnsubscribe: __WEBPACK_IMPORTED_MODULE_0_prop_types___default.a.func.isRequired, + notifyNestedSubs: __WEBPACK_IMPORTED_MODULE_0_prop_types___default.a.func.isRequired, + isSubscribed: __WEBPACK_IMPORTED_MODULE_0_prop_types___default.a.func.isRequired +}); + +var storeShape = __WEBPACK_IMPORTED_MODULE_0_prop_types___default.a.shape({ + subscribe: __WEBPACK_IMPORTED_MODULE_0_prop_types___default.a.func.isRequired, + dispatch: __WEBPACK_IMPORTED_MODULE_0_prop_types___default.a.func.isRequired, + getState: __WEBPACK_IMPORTED_MODULE_0_prop_types___default.a.func.isRequired +}); + +/***/ }), +/* 96 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(process) {/* harmony export (immutable) */ __webpack_exports__["a"] = connectAdvanced; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_hoist_non_react_statics__ = __webpack_require__(214); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_hoist_non_react_statics___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_hoist_non_react_statics__); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_invariant__ = __webpack_require__(215); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_invariant___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_invariant__); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_react__ = __webpack_require__(2); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_react__); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__utils_Subscription__ = __webpack_require__(216); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__utils_PropTypes__ = __webpack_require__(95); +var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; } + + + + + + + + +var hotReloadingVersion = 0; +var dummyState = {}; +function noop() {} +function makeSelectorStateful(sourceSelector, store) { + // wrap the selector in an object that tracks its results between runs. + var selector = { + run: function runComponentSelector(props) { + try { + var nextProps = sourceSelector(store.getState(), props); + if (nextProps !== selector.props || selector.error) { + selector.shouldComponentUpdate = true; + selector.props = nextProps; + selector.error = null; + } + } catch (error) { + selector.shouldComponentUpdate = true; + selector.error = error; + } + } + }; + + return selector; +} + +function connectAdvanced( +/* + selectorFactory is a func that is responsible for returning the selector function used to + compute new props from state, props, and dispatch. For example: + export default connectAdvanced((dispatch, options) => (state, props) => ({ + thing: state.things[props.thingId], + saveThing: fields => dispatch(actionCreators.saveThing(props.thingId, fields)), + }))(YourComponent) + Access to dispatch is provided to the factory so selectorFactories can bind actionCreators + outside of their selector as an optimization. Options passed to connectAdvanced are passed to + the selectorFactory, along with displayName and WrappedComponent, as the second argument. + Note that selectorFactory is responsible for all caching/memoization of inbound and outbound + props. Do not use connectAdvanced directly without memoizing results between calls to your + selector, otherwise the Connect component will re-render on every state or props change. +*/ +selectorFactory) { + var _contextTypes, _childContextTypes; + + var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, + _ref$getDisplayName = _ref.getDisplayName, + getDisplayName = _ref$getDisplayName === undefined ? function (name) { + return 'ConnectAdvanced(' + name + ')'; + } : _ref$getDisplayName, + _ref$methodName = _ref.methodName, + methodName = _ref$methodName === undefined ? 'connectAdvanced' : _ref$methodName, + _ref$renderCountProp = _ref.renderCountProp, + renderCountProp = _ref$renderCountProp === undefined ? undefined : _ref$renderCountProp, + _ref$shouldHandleStat = _ref.shouldHandleStateChanges, + shouldHandleStateChanges = _ref$shouldHandleStat === undefined ? true : _ref$shouldHandleStat, + _ref$storeKey = _ref.storeKey, + storeKey = _ref$storeKey === undefined ? 'store' : _ref$storeKey, + _ref$withRef = _ref.withRef, + withRef = _ref$withRef === undefined ? false : _ref$withRef, + connectOptions = _objectWithoutProperties(_ref, ['getDisplayName', 'methodName', 'renderCountProp', 'shouldHandleStateChanges', 'storeKey', 'withRef']); + + var subscriptionKey = storeKey + 'Subscription'; + var version = hotReloadingVersion++; + + var contextTypes = (_contextTypes = {}, _contextTypes[storeKey] = __WEBPACK_IMPORTED_MODULE_4__utils_PropTypes__["a" /* storeShape */], _contextTypes[subscriptionKey] = __WEBPACK_IMPORTED_MODULE_4__utils_PropTypes__["b" /* subscriptionShape */], _contextTypes); + var childContextTypes = (_childContextTypes = {}, _childContextTypes[subscriptionKey] = __WEBPACK_IMPORTED_MODULE_4__utils_PropTypes__["b" /* subscriptionShape */], _childContextTypes); + + return function wrapWithConnect(WrappedComponent) { + __WEBPACK_IMPORTED_MODULE_1_invariant___default()(typeof WrappedComponent == 'function', 'You must pass a component to the function returned by ' + ('connect. Instead received ' + JSON.stringify(WrappedComponent))); + + var wrappedComponentName = WrappedComponent.displayName || WrappedComponent.name || 'Component'; + + var displayName = getDisplayName(wrappedComponentName); + + var selectorFactoryOptions = _extends({}, connectOptions, { + getDisplayName: getDisplayName, + methodName: methodName, + renderCountProp: renderCountProp, + shouldHandleStateChanges: shouldHandleStateChanges, + storeKey: storeKey, + withRef: withRef, + displayName: displayName, + wrappedComponentName: wrappedComponentName, + WrappedComponent: WrappedComponent + }); + + var Connect = function (_Component) { + _inherits(Connect, _Component); + + function Connect(props, context) { + _classCallCheck(this, Connect); + + var _this = _possibleConstructorReturn(this, _Component.call(this, props, context)); + + _this.version = version; + _this.state = {}; + _this.renderCount = 0; + _this.store = props[storeKey] || context[storeKey]; + _this.propsMode = Boolean(props[storeKey]); + _this.setWrappedInstance = _this.setWrappedInstance.bind(_this); + + __WEBPACK_IMPORTED_MODULE_1_invariant___default()(_this.store, 'Could not find "' + storeKey + '" in either the context or props of ' + ('"' + displayName + '". Either wrap the root component in a <Provider>, ') + ('or explicitly pass "' + storeKey + '" as a prop to "' + displayName + '".')); + + _this.initSelector(); + _this.initSubscription(); + return _this; + } + + Connect.prototype.getChildContext = function getChildContext() { + var _ref2; + + // If this component received store from props, its subscription should be transparent + // to any descendants receiving store+subscription from context; it passes along + // subscription passed to it. Otherwise, it shadows the parent subscription, which allows + // Connect to control ordering of notifications to flow top-down. + var subscription = this.propsMode ? null : this.subscription; + return _ref2 = {}, _ref2[subscriptionKey] = subscription || this.context[subscriptionKey], _ref2; + }; + + Connect.prototype.componentDidMount = function componentDidMount() { + if (!shouldHandleStateChanges) return; + + // componentWillMount fires during server side rendering, but componentDidMount and + // componentWillUnmount do not. Because of this, trySubscribe happens during ...didMount. + // Otherwise, unsubscription would never take place during SSR, causing a memory leak. + // To handle the case where a child component may have triggered a state change by + // dispatching an action in its componentWillMount, we have to re-run the select and maybe + // re-render. + this.subscription.trySubscribe(); + this.selector.run(this.props); + if (this.selector.shouldComponentUpdate) this.forceUpdate(); + }; + + Connect.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) { + this.selector.run(nextProps); + }; + + Connect.prototype.shouldComponentUpdate = function shouldComponentUpdate() { + return this.selector.shouldComponentUpdate; + }; + + Connect.prototype.componentWillUnmount = function componentWillUnmount() { + if (this.subscription) this.subscription.tryUnsubscribe(); + this.subscription = null; + this.notifyNestedSubs = noop; + this.store = null; + this.selector.run = noop; + this.selector.shouldComponentUpdate = false; + }; + + Connect.prototype.getWrappedInstance = function getWrappedInstance() { + __WEBPACK_IMPORTED_MODULE_1_invariant___default()(withRef, 'To access the wrapped instance, you need to specify ' + ('{ withRef: true } in the options argument of the ' + methodName + '() call.')); + return this.wrappedInstance; + }; + + Connect.prototype.setWrappedInstance = function setWrappedInstance(ref) { + this.wrappedInstance = ref; + }; + + Connect.prototype.initSelector = function initSelector() { + var sourceSelector = selectorFactory(this.store.dispatch, selectorFactoryOptions); + this.selector = makeSelectorStateful(sourceSelector, this.store); + this.selector.run(this.props); + }; + + Connect.prototype.initSubscription = function initSubscription() { + if (!shouldHandleStateChanges) return; + + // parentSub's source should match where store came from: props vs. context. A component + // connected to the store via props shouldn't use subscription from context, or vice versa. + var parentSub = (this.propsMode ? this.props : this.context)[subscriptionKey]; + this.subscription = new __WEBPACK_IMPORTED_MODULE_3__utils_Subscription__["a" /* default */](this.store, parentSub, this.onStateChange.bind(this)); + + // `notifyNestedSubs` is duplicated to handle the case where the component is unmounted in + // the middle of the notification loop, where `this.subscription` will then be null. An + // extra null check every change can be avoided by copying the method onto `this` and then + // replacing it with a no-op on unmount. This can probably be avoided if Subscription's + // listeners logic is changed to not call listeners that have been unsubscribed in the + // middle of the notification loop. + this.notifyNestedSubs = this.subscription.notifyNestedSubs.bind(this.subscription); + }; + + Connect.prototype.onStateChange = function onStateChange() { + this.selector.run(this.props); + + if (!this.selector.shouldComponentUpdate) { + this.notifyNestedSubs(); + } else { + this.componentDidUpdate = this.notifyNestedSubsOnComponentDidUpdate; + this.setState(dummyState); + } + }; + + Connect.prototype.notifyNestedSubsOnComponentDidUpdate = function notifyNestedSubsOnComponentDidUpdate() { + // `componentDidUpdate` is conditionally implemented when `onStateChange` determines it + // needs to notify nested subs. Once called, it unimplements itself until further state + // changes occur. Doing it this way vs having a permanent `componentDidUpdate` that does + // a boolean check every time avoids an extra method call most of the time, resulting + // in some perf boost. + this.componentDidUpdate = undefined; + this.notifyNestedSubs(); + }; + + Connect.prototype.isSubscribed = function isSubscribed() { + return Boolean(this.subscription) && this.subscription.isSubscribed(); + }; + + Connect.prototype.addExtraProps = function addExtraProps(props) { + if (!withRef && !renderCountProp && !(this.propsMode && this.subscription)) return props; + // make a shallow copy so that fields added don't leak to the original selector. + // this is especially important for 'ref' since that's a reference back to the component + // instance. a singleton memoized selector would then be holding a reference to the + // instance, preventing the instance from being garbage collected, and that would be bad + var withExtras = _extends({}, props); + if (withRef) withExtras.ref = this.setWrappedInstance; + if (renderCountProp) withExtras[renderCountProp] = this.renderCount++; + if (this.propsMode && this.subscription) withExtras[subscriptionKey] = this.subscription; + return withExtras; + }; + + Connect.prototype.render = function render() { + var selector = this.selector; + selector.shouldComponentUpdate = false; + + if (selector.error) { + throw selector.error; + } else { + return Object(__WEBPACK_IMPORTED_MODULE_2_react__["createElement"])(WrappedComponent, this.addExtraProps(selector.props)); + } + }; + + return Connect; + }(__WEBPACK_IMPORTED_MODULE_2_react__["Component"]); + + Connect.WrappedComponent = WrappedComponent; + Connect.displayName = displayName; + Connect.childContextTypes = childContextTypes; + Connect.contextTypes = contextTypes; + Connect.propTypes = contextTypes; + + if (process.env.NODE_ENV !== 'production') { + Connect.prototype.componentWillUpdate = function componentWillUpdate() { + var _this2 = this; + + // We are hot reloading! + if (this.version !== version) { + this.version = version; + this.initSelector(); + + // If any connected descendants don't hot reload (and resubscribe in the process), their + // listeners will be lost when we unsubscribe. Unfortunately, by copying over all + // listeners, this does mean that the old versions of connected descendants will still be + // notified of state changes; however, their onStateChange function is a no-op so this + // isn't a huge deal. + var oldListeners = []; + + if (this.subscription) { + oldListeners = this.subscription.listeners.get(); + this.subscription.tryUnsubscribe(); + } + this.initSubscription(); + if (shouldHandleStateChanges) { + this.subscription.trySubscribe(); + oldListeners.forEach(function (listener) { + return _this2.subscription.listeners.subscribe(listener); + }); + } + } + }; + } + + return __WEBPACK_IMPORTED_MODULE_0_hoist_non_react_statics___default()(Connect, WrappedComponent); + }; +} +/* WEBPACK VAR INJECTION */}.call(__webpack_exports__, __webpack_require__(0))) + +/***/ }), +/* 97 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return ActionTypes; }); +/* harmony export (immutable) */ __webpack_exports__["b"] = createStore; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash_es_isPlainObject__ = __webpack_require__(60); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_symbol_observable__ = __webpack_require__(228); + + + +/** + * These are private action types reserved by Redux. + * For any unknown actions, you must return the current state. + * If the current state is undefined, you must return the initial state. + * Do not reference these action types directly in your code. + */ +var ActionTypes = { + INIT: '@@redux/INIT' + + /** + * Creates a Redux store that holds the state tree. + * The only way to change the data in the store is to call `dispatch()` on it. + * + * There should only be a single store in your app. To specify how different + * parts of the state tree respond to actions, you may combine several reducers + * into a single reducer function by using `combineReducers`. + * + * @param {Function} reducer A function that returns the next state tree, given + * the current state tree and the action to handle. + * + * @param {any} [preloadedState] The initial state. You may optionally specify it + * to hydrate the state from the server in universal apps, or to restore a + * previously serialized user session. + * If you use `combineReducers` to produce the root reducer function, this must be + * an object with the same shape as `combineReducers` keys. + * + * @param {Function} [enhancer] The store enhancer. You may optionally specify it + * to enhance the store with third-party capabilities such as middleware, + * time travel, persistence, etc. The only store enhancer that ships with Redux + * is `applyMiddleware()`. + * + * @returns {Store} A Redux store that lets you read the state, dispatch actions + * and subscribe to changes. + */ +};function createStore(reducer, preloadedState, enhancer) { + var _ref2; + + if (typeof preloadedState === 'function' && typeof enhancer === 'undefined') { + enhancer = preloadedState; + preloadedState = undefined; + } + + if (typeof enhancer !== 'undefined') { + if (typeof enhancer !== 'function') { + throw new Error('Expected the enhancer to be a function.'); + } + + return enhancer(createStore)(reducer, preloadedState); + } + + if (typeof reducer !== 'function') { + throw new Error('Expected the reducer to be a function.'); + } + + var currentReducer = reducer; + var currentState = preloadedState; + var currentListeners = []; + var nextListeners = currentListeners; + var isDispatching = false; + + function ensureCanMutateNextListeners() { + if (nextListeners === currentListeners) { + nextListeners = currentListeners.slice(); + } + } + + /** + * Reads the state tree managed by the store. + * + * @returns {any} The current state tree of your application. + */ + function getState() { + return currentState; + } + + /** + * Adds a change listener. It will be called any time an action is dispatched, + * and some part of the state tree may potentially have changed. You may then + * call `getState()` to read the current state tree inside the callback. + * + * You may call `dispatch()` from a change listener, with the following + * caveats: + * + * 1. The subscriptions are snapshotted just before every `dispatch()` call. + * If you subscribe or unsubscribe while the listeners are being invoked, this + * will not have any effect on the `dispatch()` that is currently in progress. + * However, the next `dispatch()` call, whether nested or not, will use a more + * recent snapshot of the subscription list. + * + * 2. The listener should not expect to see all state changes, as the state + * might have been updated multiple times during a nested `dispatch()` before + * the listener is called. It is, however, guaranteed that all subscribers + * registered before the `dispatch()` started will be called with the latest + * state by the time it exits. + * + * @param {Function} listener A callback to be invoked on every dispatch. + * @returns {Function} A function to remove this change listener. + */ + function subscribe(listener) { + if (typeof listener !== 'function') { + throw new Error('Expected listener to be a function.'); + } + + var isSubscribed = true; + + ensureCanMutateNextListeners(); + nextListeners.push(listener); + + return function unsubscribe() { + if (!isSubscribed) { + return; + } + + isSubscribed = false; + + ensureCanMutateNextListeners(); + var index = nextListeners.indexOf(listener); + nextListeners.splice(index, 1); + }; + } + + /** + * Dispatches an action. It is the only way to trigger a state change. + * + * The `reducer` function, used to create the store, will be called with the + * current state tree and the given `action`. Its return value will + * be considered the **next** state of the tree, and the change listeners + * will be notified. + * + * The base implementation only supports plain object actions. If you want to + * dispatch a Promise, an Observable, a thunk, or something else, you need to + * wrap your store creating function into the corresponding middleware. For + * example, see the documentation for the `redux-thunk` package. Even the + * middleware will eventually dispatch plain object actions using this method. + * + * @param {Object} action A plain object representing “what changed”. It is + * a good idea to keep actions serializable so you can record and replay user + * sessions, or use the time travelling `redux-devtools`. An action must have + * a `type` property which may not be `undefined`. It is a good idea to use + * string constants for action types. + * + * @returns {Object} For convenience, the same action object you dispatched. + * + * Note that, if you use a custom middleware, it may wrap `dispatch()` to + * return something else (for example, a Promise you can await). + */ + function dispatch(action) { + if (!Object(__WEBPACK_IMPORTED_MODULE_0_lodash_es_isPlainObject__["a" /* default */])(action)) { + throw new Error('Actions must be plain objects. ' + 'Use custom middleware for async actions.'); + } + + if (typeof action.type === 'undefined') { + throw new Error('Actions may not have an undefined "type" property. ' + 'Have you misspelled a constant?'); + } + + if (isDispatching) { + throw new Error('Reducers may not dispatch actions.'); + } + + try { + isDispatching = true; + currentState = currentReducer(currentState, action); + } finally { + isDispatching = false; + } + + var listeners = currentListeners = nextListeners; + for (var i = 0; i < listeners.length; i++) { + var listener = listeners[i]; + listener(); + } + + return action; + } + + /** + * Replaces the reducer currently used by the store to calculate the state. + * + * You might need this if your app implements code splitting and you want to + * load some of the reducers dynamically. You might also need this if you + * implement a hot reloading mechanism for Redux. + * + * @param {Function} nextReducer The reducer for the store to use instead. + * @returns {void} + */ + function replaceReducer(nextReducer) { + if (typeof nextReducer !== 'function') { + throw new Error('Expected the nextReducer to be a function.'); + } + + currentReducer = nextReducer; + dispatch({ type: ActionTypes.INIT }); + } + + /** + * Interoperability point for observable/reactive libraries. + * @returns {observable} A minimal observable of state changes. + * For more information, see the observable proposal: + * https://github.com/tc39/proposal-observable + */ + function observable() { + var _ref; + + var outerSubscribe = subscribe; + return _ref = { + /** + * The minimal observable subscription method. + * @param {Object} observer Any object that can be used as an observer. + * The observer object should have a `next` method. + * @returns {subscription} An object with an `unsubscribe` method that can + * be used to unsubscribe the observable from the store, and prevent further + * emission of values from the observable. + */ + subscribe: function subscribe(observer) { + if (typeof observer !== 'object') { + throw new TypeError('Expected the observer to be an object.'); + } + + function observeState() { + if (observer.next) { + observer.next(getState()); + } + } + + observeState(); + var unsubscribe = outerSubscribe(observeState); + return { unsubscribe: unsubscribe }; + } + }, _ref[__WEBPACK_IMPORTED_MODULE_1_symbol_observable__["a" /* default */]] = function () { + return this; + }, _ref; + } + + // When a store is created, an "INIT" action is dispatched so that every + // reducer returns their initial state. This effectively populates + // the initial state tree. + dispatch({ type: ActionTypes.INIT }); + + return _ref2 = { + dispatch: dispatch, + subscribe: subscribe, + getState: getState, + replaceReducer: replaceReducer + }, _ref2[__WEBPACK_IMPORTED_MODULE_1_symbol_observable__["a" /* default */]] = observable, _ref2; +} + +/***/ }), +/* 98 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__root_js__ = __webpack_require__(221); + + +/** Built-in value references. */ +var Symbol = __WEBPACK_IMPORTED_MODULE_0__root_js__["a" /* default */].Symbol; + +/* harmony default export */ __webpack_exports__["a"] = (Symbol); + + +/***/ }), +/* 99 */ +/***/ (function(module, exports) { + +module.exports = function(originalModule) { + if(!originalModule.webpackPolyfill) { + var module = Object.create(originalModule); + // module.parent = undefined by default + if(!module.children) module.children = []; + Object.defineProperty(module, "loaded", { + enumerable: true, + get: function() { + return module.l; + } + }); + Object.defineProperty(module, "id", { + enumerable: true, + get: function() { + return module.i; + } + }); + Object.defineProperty(module, "exports", { + enumerable: true, + }); + module.webpackPolyfill = 1; + } + return module; +}; + + +/***/ }), +/* 100 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export (immutable) */ __webpack_exports__["a"] = warning; +/** + * Prints a warning in the console if it exists. + * + * @param {String} message The warning message. + * @returns {void} + */ +function warning(message) { + /* eslint-disable no-console */ + if (typeof console !== 'undefined' && typeof console.error === 'function') { + console.error(message); + } + /* eslint-enable no-console */ + try { + // This error was thrown as a convenience so that if you enable + // "break on all exceptions" in your console, + // it would pause the execution at this line. + throw new Error(message); + /* eslint-disable no-empty */ + } catch (e) {} + /* eslint-enable no-empty */ +} + +/***/ }), +/* 101 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export (immutable) */ __webpack_exports__["a"] = compose; +/** + * Composes single-argument functions from right to left. The rightmost + * function can take multiple arguments as it provides the signature for + * the resulting composite function. + * + * @param {...Function} funcs The functions to compose. + * @returns {Function} A function obtained by composing the argument functions + * from right to left. For example, compose(f, g, h) is identical to doing + * (...args) => f(g(h(...args))). + */ + +function compose() { + for (var _len = arguments.length, funcs = Array(_len), _key = 0; _key < _len; _key++) { + funcs[_key] = arguments[_key]; + } + + if (funcs.length === 0) { + return function (arg) { + return arg; + }; + } + + if (funcs.length === 1) { + return funcs[0]; + } + + return funcs.reduce(function (a, b) { + return function () { + return a(b.apply(undefined, arguments)); + }; + }); +} + +/***/ }), +/* 102 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(process) {/* harmony export (immutable) */ __webpack_exports__["a"] = wrapMapToPropsConstant; +/* unused harmony export getDependsOnOwnProps */ +/* harmony export (immutable) */ __webpack_exports__["b"] = wrapMapToPropsFunc; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__utils_verifyPlainObject__ = __webpack_require__(103); + + +function wrapMapToPropsConstant(getConstant) { + return function initConstantSelector(dispatch, options) { + var constant = getConstant(dispatch, options); + + function constantSelector() { + return constant; + } + constantSelector.dependsOnOwnProps = false; + return constantSelector; + }; +} + +// dependsOnOwnProps is used by createMapToPropsProxy to determine whether to pass props as args +// to the mapToProps function being wrapped. It is also used by makePurePropsSelector to determine +// whether mapToProps needs to be invoked when props have changed. +// +// A length of one signals that mapToProps does not depend on props from the parent component. +// A length of zero is assumed to mean mapToProps is getting args via arguments or ...args and +// therefore not reporting its length accurately.. +function getDependsOnOwnProps(mapToProps) { + return mapToProps.dependsOnOwnProps !== null && mapToProps.dependsOnOwnProps !== undefined ? Boolean(mapToProps.dependsOnOwnProps) : mapToProps.length !== 1; +} + +// Used by whenMapStateToPropsIsFunction and whenMapDispatchToPropsIsFunction, +// this function wraps mapToProps in a proxy function which does several things: +// +// * Detects whether the mapToProps function being called depends on props, which +// is used by selectorFactory to decide if it should reinvoke on props changes. +// +// * On first call, handles mapToProps if returns another function, and treats that +// new function as the true mapToProps for subsequent calls. +// +// * On first call, verifies the first result is a plain object, in order to warn +// the developer that their mapToProps function is not returning a valid result. +// +function wrapMapToPropsFunc(mapToProps, methodName) { + return function initProxySelector(dispatch, _ref) { + var displayName = _ref.displayName; + + var proxy = function mapToPropsProxy(stateOrDispatch, ownProps) { + return proxy.dependsOnOwnProps ? proxy.mapToProps(stateOrDispatch, ownProps) : proxy.mapToProps(stateOrDispatch); + }; + + // allow detectFactoryAndVerify to get ownProps + proxy.dependsOnOwnProps = true; + + proxy.mapToProps = function detectFactoryAndVerify(stateOrDispatch, ownProps) { + proxy.mapToProps = mapToProps; + proxy.dependsOnOwnProps = getDependsOnOwnProps(mapToProps); + var props = proxy(stateOrDispatch, ownProps); + + if (typeof props === 'function') { + proxy.mapToProps = props; + proxy.dependsOnOwnProps = getDependsOnOwnProps(props); + props = proxy(stateOrDispatch, ownProps); + } + + if (process.env.NODE_ENV !== 'production') Object(__WEBPACK_IMPORTED_MODULE_0__utils_verifyPlainObject__["a" /* default */])(props, displayName, methodName); + + return props; + }; + + return proxy; + }; +} +/* WEBPACK VAR INJECTION */}.call(__webpack_exports__, __webpack_require__(0))) + +/***/ }), +/* 103 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export (immutable) */ __webpack_exports__["a"] = verifyPlainObject; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash_es_isPlainObject__ = __webpack_require__(60); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__warning__ = __webpack_require__(58); + + + +function verifyPlainObject(value, displayName, methodName) { + if (!Object(__WEBPACK_IMPORTED_MODULE_0_lodash_es_isPlainObject__["a" /* default */])(value)) { + Object(__WEBPACK_IMPORTED_MODULE_1__warning__["a" /* default */])(methodName + '() in ' + displayName + ' must return a plain object. Instead received ' + value + '.'); + } +} + +/***/ }), +/* 104 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.StickyContainer = exports.Sticky = undefined; + +var _Sticky = __webpack_require__(249); + +var _Sticky2 = _interopRequireDefault(_Sticky); + +var _Container = __webpack_require__(250); + +var _Container2 = _interopRequireDefault(_Container); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +exports.Sticky = _Sticky2.default; +exports.StickyContainer = _Container2.default; +exports.default = _Sticky2.default; + +/***/ }), +/* 105 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _templateObject = _taggedTemplateLiteral(['\n display: block;\n height: 35px;\n'], ['\n display: block;\n height: 35px;\n']); + +var _react = __webpack_require__(2); + +var _react2 = _interopRequireDefault(_react); + +var _styledComponents = __webpack_require__(5); + +var _styledComponents2 = _interopRequireDefault(_styledComponents); + +var _logo = __webpack_require__(257); + +var _logo2 = _interopRequireDefault(_logo); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +function _taggedTemplateLiteral(strings, raw) { return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); } + +var LogoImage = _styledComponents2.default.img(_templateObject); + +var Logo = function (_React$Component) { + _inherits(Logo, _React$Component); + + function Logo() { + _classCallCheck(this, Logo); + + return _possibleConstructorReturn(this, (Logo.__proto__ || Object.getPrototypeOf(Logo)).apply(this, arguments)); + } + + _createClass(Logo, [{ + key: 'render', + value: function render() { + return _react2.default.createElement( + 'a', + { href: 'https://garris.github.io/BackstopJS/', target: '_blank' }, + _react2.default.createElement(LogoImage, { src: _logo2.default }) + ); + } + }]); + + return Logo; +}(_react2.default.Component); + +exports.default = Logo; + +/***/ }), +/* 106 */ +/***/ (function(module, exports, __webpack_require__) { + +"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 _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _templateObject = _taggedTemplateLiteral([''], ['']), + _templateObject2 = _taggedTemplateLiteral(['\n padding: 5px 0;\n'], ['\n padding: 5px 0;\n']), + _templateObject3 = _taggedTemplateLiteral(['\n font-family: ', ';\n color: ', ';\n font-size: 14px;\n padding-right: 8px;\n'], ['\n font-family: ', ';\n color: ', ';\n font-size: 14px;\n padding-right: 8px;\n']), + _templateObject4 = _taggedTemplateLiteral(['\n font-family ', ';\n color: ', ';\n font-size: 14px;\n padding-right: 20px;\n'], ['\n font-family ', ';\n color: ', ';\n font-size: 14px;\n padding-right: 20px;\n']), + _templateObject5 = _taggedTemplateLiteral(['\n display: ', ';\n position: absolute;\n background-color: ', ';\n padding: 10px;\n top: -28px;\n left: 20px;\n box-shadow: 0 3px 6px 0 rgba(0, 0, 0, 0.16);\n z-index: 999;\n'], ['\n display: ', ';\n position: absolute;\n background-color: ', ';\n padding: 10px;\n top: -28px;\n left: 20px;\n box-shadow: 0 3px 6px 0 rgba(0, 0, 0, 0.16);\n z-index: 999;\n']); + +var _react = __webpack_require__(2); + +var _react2 = _interopRequireDefault(_react); + +var _reactRedux = __webpack_require__(10); + +var _styledComponents = __webpack_require__(5); + +var _styledComponents2 = _interopRequireDefault(_styledComponents); + +var _DiffDetails = __webpack_require__(273); + +var _DiffDetails2 = _interopRequireDefault(_DiffDetails); + +var _UrlDetails = __webpack_require__(274); + +var _UrlDetails2 = _interopRequireDefault(_UrlDetails); + +var _styles = __webpack_require__(6); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +function _taggedTemplateLiteral(strings, raw) { return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); } + +// styled +var WrapperDetails = _styledComponents2.default.div(_templateObject); + +var Row = _styledComponents2.default.div(_templateObject2); + +var Label = _styledComponents2.default.span(_templateObject3, _styles.fonts.latoRegular, _styles.colors.secondaryText); + +var Value = _styledComponents2.default.span(_templateObject4, _styles.fonts.latoBold, _styles.colors.primaryText); + +var DetailsPanel = _styledComponents2.default.div(_templateObject5, function (props) { + return props.showPanel ? 'block' : 'none'; +}, _styles.colors.white); + +var TextDetails = function (_React$Component) { + _inherits(TextDetails, _React$Component); + + function TextDetails(props) { + _classCallCheck(this, TextDetails); + + var _this = _possibleConstructorReturn(this, (TextDetails.__proto__ || Object.getPrototypeOf(TextDetails)).call(this, props)); + + _this.state = { + showPanel: false + }; + + _this.showPanel = _this.showPanel.bind(_this); + _this.hidePanel = _this.hidePanel.bind(_this); + return _this; + } + + _createClass(TextDetails, [{ + key: 'showPanel', + value: function showPanel() { + var settings = this.props.settings; + + if (!settings.textInfo) { + this.setState({ + showPanel: true + }); + } + } + }, { + key: 'hidePanel', + value: function hidePanel() { + this.setState({ + showPanel: false + }); + } + }, { + key: 'render', + value: function render() { + var _props$info = this.props.info, + label = _props$info.label, + fileName = _props$info.fileName, + selector = _props$info.selector, + diff = _props$info.diff, + url = _props$info.url, + referenceUrl = _props$info.referenceUrl; + var settings = this.props.settings; + var showPanel = this.state.showPanel; + + + return _react2.default.createElement( + WrapperDetails, + null, + _react2.default.createElement( + Row, + { hidden: !settings.textInfo }, + _react2.default.createElement( + Label, + null, + 'label: ' + ), + _react2.default.createElement( + Value, + null, + label + ), + _react2.default.createElement( + Label, + null, + 'selector: ' + ), + _react2.default.createElement( + Value, + null, + selector + ) + ), + _react2.default.createElement( + Row, + null, + _react2.default.createElement( + Label, + null, + 'filename: ' + ), + _react2.default.createElement( + Value, + { onMouseOver: this.showPanel }, + fileName + ) + ), + _react2.default.createElement(_DiffDetails2.default, { suppress: !settings.textInfo, diff: diff }), + _react2.default.createElement( + DetailsPanel, + _extends({ showPanel: showPanel }, { onMouseLeave: this.hidePanel }), + _react2.default.createElement( + Row, + null, + _react2.default.createElement( + Label, + null, + 'label: ' + ), + _react2.default.createElement( + Value, + null, + label, + ' ' + ), + _react2.default.createElement( + Label, + null, + 'selector: ' + ), + _react2.default.createElement( + Value, + null, + selector, + ' ' + ) + ), + _react2.default.createElement( + Row, + null, + _react2.default.createElement( + Label, + null, + 'filename: ' + ), + _react2.default.createElement( + Value, + null, + fileName, + ' ' + ) + ), + _react2.default.createElement( + Row, + null, + _react2.default.createElement(_UrlDetails2.default, { url: url, referenceUrl: referenceUrl }), + _react2.default.createElement(_DiffDetails2.default, { diff: diff }) + ) + ) + ); + } + }]); + + return TextDetails; +}(_react2.default.Component); + +var mapStateToProps = function mapStateToProps(state) { + return { + settings: state.layoutSettings + }; +}; + +var TextDetailsContainer = (0, _reactRedux.connect)(mapStateToProps)(TextDetails); + +exports.default = TextDetailsContainer; + +/***/ }), +/* 107 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = findTabbableDescendants; +/*! + * Adapted from jQuery UI core + * + * http://jqueryui.com + * + * Copyright 2014 jQuery Foundation and other contributors + * Released under the MIT license. + * http://jquery.org/license + * + * http://api.jqueryui.com/category/ui-core/ + */ + +var tabbableNode = /input|select|textarea|button|object/; + +function hidesContents(element) { + var zeroSize = element.offsetWidth <= 0 && element.offsetHeight <= 0; + + // If the node is empty, this is good enough + if (zeroSize && !element.innerHTML) return true; + + // Otherwise we need to check some styles + var style = window.getComputedStyle(element); + return zeroSize ? style.getPropertyValue("overflow") !== "visible" : style.getPropertyValue("display") == "none"; +} + +function visible(element) { + var parentElement = element; + while (parentElement) { + if (parentElement === document.body) break; + if (hidesContents(parentElement)) return false; + parentElement = parentElement.parentNode; + } + return true; +} + +function focusable(element, isTabIndexNotNaN) { + var nodeName = element.nodeName.toLowerCase(); + var res = tabbableNode.test(nodeName) && !element.disabled || (nodeName === "a" ? element.href || isTabIndexNotNaN : isTabIndexNotNaN); + return res && visible(element); +} + +function tabbable(element) { + var tabIndex = element.getAttribute("tabindex"); + if (tabIndex === null) tabIndex = undefined; + var isTabIndexNaN = isNaN(tabIndex); + return (isTabIndexNaN || tabIndex >= 0) && focusable(element, !isTabIndexNaN); +} + +function findTabbableDescendants(element) { + return [].slice.call(element.querySelectorAll("*"), 0).filter(tabbable); +} +module.exports = exports["default"]; + +/***/ }), +/* 108 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.assertNodeList = assertNodeList; +exports.setElement = setElement; +exports.validateElement = validateElement; +exports.hide = hide; +exports.show = show; +exports.documentNotReadyOrSSRTesting = documentNotReadyOrSSRTesting; +exports.resetForTesting = resetForTesting; + +var _warning = __webpack_require__(290); + +var _warning2 = _interopRequireDefault(_warning); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +var globalElement = null; + +function assertNodeList(nodeList, selector) { + if (!nodeList || !nodeList.length) { + throw new Error("react-modal: No elements were found for selector " + selector + "."); + } +} + +function setElement(element) { + var useElement = element; + if (typeof useElement === "string") { + var el = document.querySelectorAll(useElement); + assertNodeList(el, useElement); + useElement = "length" in el ? el[0] : el; + } + globalElement = useElement || globalElement; + return globalElement; +} + +function validateElement(appElement) { + if (!appElement && !globalElement) { + (0, _warning2.default)(false, ["react-modal: App element is not defined.", "Please use `Modal.setAppElement(el)` or set `appElement={el}`.", "This is needed so screen readers don't see main content", "when modal is opened. It is not recommended, but you can opt-out", "by setting `ariaHideApp={false}`."].join(" ")); + + return false; + } + + return true; +} + +function hide(appElement) { + if (validateElement(appElement)) { + (appElement || globalElement).setAttribute("aria-hidden", "true"); + } +} + +function show(appElement) { + if (validateElement(appElement)) { + (appElement || globalElement).removeAttribute("aria-hidden"); + } +} + +function documentNotReadyOrSSRTesting() { + globalElement = null; +} + +function resetForTesting() { + globalElement = null; +} + +/***/ }), +/* 109 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.get = get; +exports.add = add; +exports.remove = remove; +exports.totalCount = totalCount; +var classListMap = {}; + +function get() { + return classListMap; +} + +function add(bodyClass) { + // Set variable and default if none + if (!classListMap[bodyClass]) { + classListMap[bodyClass] = 0; + } + classListMap[bodyClass] += 1; + return bodyClass; +} + +function remove(bodyClass) { + if (classListMap[bodyClass]) { + classListMap[bodyClass] -= 1; + } + return bodyClass; +} + +function totalCount() { + return Object.keys(classListMap).reduce(function (acc, curr) { + return acc + classListMap[curr]; + }, 0); +} + +/***/ }), +/* 110 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.canUseDOM = undefined; + +var _exenv = __webpack_require__(292); + +var _exenv2 = _interopRequireDefault(_exenv); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +var EE = _exenv2.default; + +var SafeHTMLElement = EE.canUseDOM ? window.HTMLElement : {}; + +var canUseDOM = exports.canUseDOM = EE.canUseDOM; + +exports.default = SafeHTMLElement; + +/***/ }), +/* 111 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var _react = __webpack_require__(2); + +var _react2 = _interopRequireDefault(_react); + +var _reactDom = __webpack_require__(32); + +var _reactDom2 = _interopRequireDefault(_reactDom); + +var _reactRedux = __webpack_require__(10); + +var _store = __webpack_require__(237); + +var _store2 = _interopRequireDefault(_store); + +var _App = __webpack_require__(244); + +var _App2 = _interopRequireDefault(_App); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +_reactDom2.default.render(_react2.default.createElement( + _reactRedux.Provider, + { store: _store2.default }, + _react2.default.createElement(_App2.default, null) +), document.getElementById('root')); + +/***/ }), +/* 112 */ +/***/ (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 PooledClass = __webpack_require__(113); +var ReactElement = __webpack_require__(19); + +var emptyFunction = __webpack_require__(12); +var traverseAllChildren = __webpack_require__(114); + +var twoArgumentPooler = PooledClass.twoArgumentPooler; +var fourArgumentPooler = PooledClass.fourArgumentPooler; + +var userProvidedKeyEscapeRegex = /\/+/g; +function escapeUserProvidedKey(text) { + return ('' + text).replace(userProvidedKeyEscapeRegex, '$&/'); +} + +/** + * PooledClass representing the bookkeeping associated with performing a child + * traversal. Allows avoiding binding callbacks. + * + * @constructor ForEachBookKeeping + * @param {!function} forEachFunction Function to perform traversal with. + * @param {?*} forEachContext Context to perform context with. + */ +function ForEachBookKeeping(forEachFunction, forEachContext) { + this.func = forEachFunction; + this.context = forEachContext; + this.count = 0; +} +ForEachBookKeeping.prototype.destructor = function () { + this.func = null; + this.context = null; + this.count = 0; +}; +PooledClass.addPoolingTo(ForEachBookKeeping, twoArgumentPooler); + +function forEachSingleChild(bookKeeping, child, name) { + var func = bookKeeping.func, + context = bookKeeping.context; + + func.call(context, child, bookKeeping.count++); +} + +/** + * Iterates through children that are typically specified as `props.children`. + * + * See https://facebook.github.io/react/docs/top-level-api.html#react.children.foreach + * + * The provided forEachFunc(child, index) will be called for each + * leaf child. + * + * @param {?*} children Children tree container. + * @param {function(*, int)} forEachFunc + * @param {*} forEachContext Context for forEachContext. + */ +function forEachChildren(children, forEachFunc, forEachContext) { + if (children == null) { + return children; + } + var traverseContext = ForEachBookKeeping.getPooled(forEachFunc, forEachContext); + traverseAllChildren(children, forEachSingleChild, traverseContext); + ForEachBookKeeping.release(traverseContext); +} + +/** + * PooledClass representing the bookkeeping associated with performing a child + * mapping. Allows avoiding binding callbacks. + * + * @constructor MapBookKeeping + * @param {!*} mapResult Object containing the ordered map of results. + * @param {!function} mapFunction Function to perform mapping with. + * @param {?*} mapContext Context to perform mapping with. + */ +function MapBookKeeping(mapResult, keyPrefix, mapFunction, mapContext) { + this.result = mapResult; + this.keyPrefix = keyPrefix; + this.func = mapFunction; + this.context = mapContext; + this.count = 0; +} +MapBookKeeping.prototype.destructor = function () { + this.result = null; + this.keyPrefix = null; + this.func = null; + this.context = null; + this.count = 0; +}; +PooledClass.addPoolingTo(MapBookKeeping, fourArgumentPooler); + +function mapSingleChildIntoContext(bookKeeping, child, childKey) { + var result = bookKeeping.result, + keyPrefix = bookKeeping.keyPrefix, + func = bookKeeping.func, + context = bookKeeping.context; + + + var mappedChild = func.call(context, child, bookKeeping.count++); + if (Array.isArray(mappedChild)) { + mapIntoWithKeyPrefixInternal(mappedChild, result, childKey, emptyFunction.thatReturnsArgument); + } else if (mappedChild != null) { + if (ReactElement.isValidElement(mappedChild)) { + mappedChild = ReactElement.cloneAndReplaceKey(mappedChild, + // Keep both the (mapped) and old keys if they differ, just as + // traverseAllChildren used to do for objects as children + keyPrefix + (mappedChild.key && (!child || child.key !== mappedChild.key) ? escapeUserProvidedKey(mappedChild.key) + '/' : '') + childKey); + } + result.push(mappedChild); + } +} + +function mapIntoWithKeyPrefixInternal(children, array, prefix, func, context) { + var escapedPrefix = ''; + if (prefix != null) { + escapedPrefix = escapeUserProvidedKey(prefix) + '/'; + } + var traverseContext = MapBookKeeping.getPooled(array, escapedPrefix, func, context); + traverseAllChildren(children, mapSingleChildIntoContext, traverseContext); + MapBookKeeping.release(traverseContext); +} + +/** + * Maps children that are typically specified as `props.children`. + * + * See https://facebook.github.io/react/docs/top-level-api.html#react.children.map + * + * The provided mapFunction(child, key, index) will be called for each + * leaf child. + * + * @param {?*} children Children tree container. + * @param {function(*, int)} func The map function. + * @param {*} context Context for mapFunction. + * @return {object} Object containing the ordered map of results. + */ +function mapChildren(children, func, context) { + if (children == null) { + return children; + } + var result = []; + mapIntoWithKeyPrefixInternal(children, result, null, func, context); + return result; +} + +function forEachSingleChildDummy(traverseContext, child, name) { + return null; +} + +/** + * Count the number of children that are typically specified as + * `props.children`. + * + * See https://facebook.github.io/react/docs/top-level-api.html#react.children.count + * + * @param {?*} children Children tree container. + * @return {number} The number of children. + */ +function countChildren(children, context) { + return traverseAllChildren(children, forEachSingleChildDummy, null); +} + +/** + * Flatten a children object (typically specified as `props.children`) and + * return an array with appropriately re-keyed children. + * + * See https://facebook.github.io/react/docs/top-level-api.html#react.children.toarray + */ +function toArray(children) { + var result = []; + mapIntoWithKeyPrefixInternal(children, result, null, emptyFunction.thatReturnsArgument); + return result; +} + +var ReactChildren = { + forEach: forEachChildren, + map: mapChildren, + mapIntoWithKeyPrefixInternal: mapIntoWithKeyPrefixInternal, + count: countChildren, + toArray: toArray +}; + +module.exports = ReactChildren; + +/***/ }), +/* 113 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(process) {/** + * 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__(22); + +var invariant = __webpack_require__(1); + +/** + * 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; +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) + +/***/ }), +/* 114 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(process) {/** + * 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__(22); + +var ReactCurrentOwner = __webpack_require__(14); +var REACT_ELEMENT_TYPE = __webpack_require__(64); + +var getIteratorFn = __webpack_require__(65); +var invariant = __webpack_require__(1); +var KeyEscapeUtils = __webpack_require__(115); +var warning = __webpack_require__(3); + +var SEPARATOR = '.'; +var SUBSEPARATOR = ':'; + +/** + * This is inlined from ReactElement since this file is shared between + * isomorphic and renderers. We could extract this to a + * + */ + +/** + * TODO: Test that a single child and an array with one item have the same key + * pattern. + */ + +var didWarnAboutMaps = false; + +/** + * Generate a key string that identifies a component within a set. + * + * @param {*} component A component that could contain a manual key. + * @param {number} index Index that is used if a manual key is not provided. + * @return {string} + */ +function getComponentKey(component, index) { + // Do some typechecking here since we call this blindly. We want to ensure + // that we don't block potential future ES APIs. + if (component && typeof component === 'object' && component.key != null) { + // Explicit key + return KeyEscapeUtils.escape(component.key); + } + // Implicit key determined by the index in the set + return index.toString(36); +} + +/** + * @param {?*} children Children tree container. + * @param {!string} nameSoFar Name of the key path so far. + * @param {!function} callback Callback to invoke with each child found. + * @param {?*} traverseContext Used to pass information throughout the traversal + * process. + * @return {!number} The number of children in this subtree. + */ +function traverseAllChildrenImpl(children, nameSoFar, callback, traverseContext) { + var type = typeof children; + + if (type === 'undefined' || type === 'boolean') { + // All of the above are perceived as null. + children = null; + } + + if (children === null || type === 'string' || type === 'number' || + // The following is inlined from ReactElement. This means we can optimize + // some checks. React Fiber also inlines this logic for similar purposes. + type === 'object' && children.$$typeof === REACT_ELEMENT_TYPE) { + callback(traverseContext, children, + // If it's the only child, treat the name as if it was wrapped in an array + // so that it's consistent if the number of children grows. + nameSoFar === '' ? SEPARATOR + getComponentKey(children, 0) : nameSoFar); + return 1; + } + + var child; + var nextName; + var subtreeCount = 0; // Count of children found in the current subtree. + var nextNamePrefix = nameSoFar === '' ? SEPARATOR : nameSoFar + SUBSEPARATOR; + + if (Array.isArray(children)) { + for (var i = 0; i < children.length; i++) { + child = children[i]; + nextName = nextNamePrefix + getComponentKey(child, i); + subtreeCount += traverseAllChildrenImpl(child, nextName, callback, traverseContext); + } + } else { + var iteratorFn = getIteratorFn(children); + if (iteratorFn) { + var iterator = iteratorFn.call(children); + var step; + if (iteratorFn !== children.entries) { + var ii = 0; + while (!(step = iterator.next()).done) { + child = step.value; + nextName = nextNamePrefix + getComponentKey(child, ii++); + subtreeCount += traverseAllChildrenImpl(child, nextName, callback, traverseContext); + } + } else { + if (process.env.NODE_ENV !== 'production') { + var mapsAsChildrenAddendum = ''; + if (ReactCurrentOwner.current) { + var mapsAsChildrenOwnerName = ReactCurrentOwner.current.getName(); + if (mapsAsChildrenOwnerName) { + mapsAsChildrenAddendum = ' Check the render method of `' + mapsAsChildrenOwnerName + '`.'; + } + } + process.env.NODE_ENV !== 'production' ? warning(didWarnAboutMaps, 'Using Maps as children is not yet fully supported. It is an ' + 'experimental feature that might be removed. Convert it to a ' + 'sequence / iterable of keyed ReactElements instead.%s', mapsAsChildrenAddendum) : void 0; + didWarnAboutMaps = true; + } + // Iterator will provide entry [k,v] tuples rather than values. + while (!(step = iterator.next()).done) { + var entry = step.value; + if (entry) { + child = entry[1]; + nextName = nextNamePrefix + KeyEscapeUtils.escape(entry[0]) + SUBSEPARATOR + getComponentKey(child, 0); + subtreeCount += traverseAllChildrenImpl(child, nextName, callback, traverseContext); + } + } + } + } else if (type === 'object') { + var addendum = ''; + if (process.env.NODE_ENV !== 'production') { + addendum = ' If you meant to render a collection of children, use an array ' + 'instead or wrap the object using createFragment(object) from the ' + 'React add-ons.'; + if (children._isReactElement) { + addendum = " It looks like you're using an element created by a different " + 'version of React. Make sure to use only one copy of React.'; + } + if (ReactCurrentOwner.current) { + var name = ReactCurrentOwner.current.getName(); + if (name) { + addendum += ' Check the render method of `' + name + '`.'; + } + } + } + var childrenString = String(children); + true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Objects are not valid as a React child (found: %s).%s', childrenString === '[object Object]' ? 'object with keys {' + Object.keys(children).join(', ') + '}' : childrenString, addendum) : _prodInvariant('31', childrenString === '[object Object]' ? 'object with keys {' + Object.keys(children).join(', ') + '}' : childrenString, addendum) : void 0; + } + } + + return subtreeCount; +} + +/** + * Traverses children that are typically specified as `props.children`, but + * might also be specified through attributes: + * + * - `traverseAllChildren(this.props.children, ...)` + * - `traverseAllChildren(this.props.leftPanelChildren, ...)` + * + * The `traverseContext` is an optional argument that is passed through the + * entire traversal. It can be used to store accumulations or anything else that + * the callback might find relevant. + * + * @param {?*} children Children tree object. + * @param {!function} callback To invoke upon traversing each child. + * @param {?*} traverseContext Context for traversal. + * @return {!number} The number of children in this subtree. + */ +function traverseAllChildren(children, callback, traverseContext) { + if (children == null) { + return 0; + } + + return traverseAllChildrenImpl(children, '', callback, traverseContext); +} + +module.exports = traverseAllChildren; +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) + +/***/ }), +/* 115 */ +/***/ (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. + * + * + */ + + + +/** + * Escape and wrap key so it is safe to use as a reactid + * + * @param {string} key to be escaped. + * @return {string} the escaped key. + */ + +function escape(key) { + var escapeRegex = /[=:]/g; + var escaperLookup = { + '=': '=0', + ':': '=2' + }; + var escapedString = ('' + key).replace(escapeRegex, function (match) { + return escaperLookup[match]; + }); + + return '$' + escapedString; +} + +/** + * Unescape and unwrap key for human-readable display + * + * @param {string} key to unescape. + * @return {string} the unescaped key. + */ +function unescape(key) { + var unescapeRegex = /(=0|=2)/g; + var unescaperLookup = { + '=0': '=', + '=2': ':' + }; + var keySubstring = key[0] === '.' && key[1] === '$' ? key.substring(2) : key.substring(1); + + return ('' + keySubstring).replace(unescapeRegex, function (match) { + return unescaperLookup[match]; + }); +} + +var KeyEscapeUtils = { + escape: escape, + unescape: unescape +}; + +module.exports = KeyEscapeUtils; + +/***/ }), +/* 116 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(process) {/** + * 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 ReactElement = __webpack_require__(19); + +/** + * Create a factory that creates HTML tag elements. + * + * @private + */ +var createDOMFactory = ReactElement.createFactory; +if (process.env.NODE_ENV !== 'production') { + var ReactElementValidator = __webpack_require__(66); + createDOMFactory = ReactElementValidator.createFactory; +} + +/** + * Creates a mapping from supported HTML tags to `ReactDOMComponent` classes. + * + * @public + */ +var ReactDOMFactories = { + a: createDOMFactory('a'), + abbr: createDOMFactory('abbr'), + address: createDOMFactory('address'), + area: createDOMFactory('area'), + article: createDOMFactory('article'), + aside: createDOMFactory('aside'), + audio: createDOMFactory('audio'), + b: createDOMFactory('b'), + base: createDOMFactory('base'), + bdi: createDOMFactory('bdi'), + bdo: createDOMFactory('bdo'), + big: createDOMFactory('big'), + blockquote: createDOMFactory('blockquote'), + body: createDOMFactory('body'), + br: createDOMFactory('br'), + button: createDOMFactory('button'), + canvas: createDOMFactory('canvas'), + caption: createDOMFactory('caption'), + cite: createDOMFactory('cite'), + code: createDOMFactory('code'), + col: createDOMFactory('col'), + colgroup: createDOMFactory('colgroup'), + data: createDOMFactory('data'), + datalist: createDOMFactory('datalist'), + dd: createDOMFactory('dd'), + del: createDOMFactory('del'), + details: createDOMFactory('details'), + dfn: createDOMFactory('dfn'), + dialog: createDOMFactory('dialog'), + div: createDOMFactory('div'), + dl: createDOMFactory('dl'), + dt: createDOMFactory('dt'), + em: createDOMFactory('em'), + embed: createDOMFactory('embed'), + fieldset: createDOMFactory('fieldset'), + figcaption: createDOMFactory('figcaption'), + figure: createDOMFactory('figure'), + footer: createDOMFactory('footer'), + form: createDOMFactory('form'), + h1: createDOMFactory('h1'), + h2: createDOMFactory('h2'), + h3: createDOMFactory('h3'), + h4: createDOMFactory('h4'), + h5: createDOMFactory('h5'), + h6: createDOMFactory('h6'), + head: createDOMFactory('head'), + header: createDOMFactory('header'), + hgroup: createDOMFactory('hgroup'), + hr: createDOMFactory('hr'), + html: createDOMFactory('html'), + i: createDOMFactory('i'), + iframe: createDOMFactory('iframe'), + img: createDOMFactory('img'), + input: createDOMFactory('input'), + ins: createDOMFactory('ins'), + kbd: createDOMFactory('kbd'), + keygen: createDOMFactory('keygen'), + label: createDOMFactory('label'), + legend: createDOMFactory('legend'), + li: createDOMFactory('li'), + link: createDOMFactory('link'), + main: createDOMFactory('main'), + map: createDOMFactory('map'), + mark: createDOMFactory('mark'), + menu: createDOMFactory('menu'), + menuitem: createDOMFactory('menuitem'), + meta: createDOMFactory('meta'), + meter: createDOMFactory('meter'), + nav: createDOMFactory('nav'), + noscript: createDOMFactory('noscript'), + object: createDOMFactory('object'), + ol: createDOMFactory('ol'), + optgroup: createDOMFactory('optgroup'), + option: createDOMFactory('option'), + output: createDOMFactory('output'), + p: createDOMFactory('p'), + param: createDOMFactory('param'), + picture: createDOMFactory('picture'), + pre: createDOMFactory('pre'), + progress: createDOMFactory('progress'), + q: createDOMFactory('q'), + rp: createDOMFactory('rp'), + rt: createDOMFactory('rt'), + ruby: createDOMFactory('ruby'), + s: createDOMFactory('s'), + samp: createDOMFactory('samp'), + script: createDOMFactory('script'), + section: createDOMFactory('section'), + select: createDOMFactory('select'), + small: createDOMFactory('small'), + source: createDOMFactory('source'), + span: createDOMFactory('span'), + strong: createDOMFactory('strong'), + style: createDOMFactory('style'), + sub: createDOMFactory('sub'), + summary: createDOMFactory('summary'), + sup: createDOMFactory('sup'), + table: createDOMFactory('table'), + tbody: createDOMFactory('tbody'), + td: createDOMFactory('td'), + textarea: createDOMFactory('textarea'), + tfoot: createDOMFactory('tfoot'), + th: createDOMFactory('th'), + thead: createDOMFactory('thead'), + time: createDOMFactory('time'), + title: createDOMFactory('title'), + tr: createDOMFactory('tr'), + track: createDOMFactory('track'), + u: createDOMFactory('u'), + ul: createDOMFactory('ul'), + 'var': createDOMFactory('var'), + video: createDOMFactory('video'), + wbr: createDOMFactory('wbr'), + + // SVG + circle: createDOMFactory('circle'), + clipPath: createDOMFactory('clipPath'), + defs: createDOMFactory('defs'), + ellipse: createDOMFactory('ellipse'), + g: createDOMFactory('g'), + image: createDOMFactory('image'), + line: createDOMFactory('line'), + linearGradient: createDOMFactory('linearGradient'), + mask: createDOMFactory('mask'), + path: createDOMFactory('path'), + pattern: createDOMFactory('pattern'), + polygon: createDOMFactory('polygon'), + polyline: createDOMFactory('polyline'), + radialGradient: createDOMFactory('radialGradient'), + rect: createDOMFactory('rect'), + stop: createDOMFactory('stop'), + svg: createDOMFactory('svg'), + text: createDOMFactory('text'), + tspan: createDOMFactory('tspan') +}; + +module.exports = ReactDOMFactories; +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) + +/***/ }), +/* 117 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(process) {/** + * 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__(22); + +var ReactPropTypeLocationNames = __webpack_require__(118); +var ReactPropTypesSecret = __webpack_require__(119); + +var invariant = __webpack_require__(1); +var warning = __webpack_require__(3); + +var ReactComponentTreeHook; + +if (typeof process !== 'undefined' && process.env && process.env.NODE_ENV === 'test') { + // Temporary hack. + // Inline requires don't work well with Jest: + // https://github.com/facebook/react/issues/7240 + // Remove the inline requires when we don't need them anymore: + // https://github.com/facebook/react/pull/7178 + ReactComponentTreeHook = __webpack_require__(11); +} + +var loggedTypeFailures = {}; + +/** + * Assert that the values match with the type specs. + * Error messages are memorized and will only be shown once. + * + * @param {object} typeSpecs Map of name to a ReactPropType + * @param {object} values Runtime values that need to be type-checked + * @param {string} location e.g. "prop", "context", "child context" + * @param {string} componentName Name of the component for error messages. + * @param {?object} element The React element that is being type-checked + * @param {?number} debugID The React component instance that is being type-checked + * @private + */ +function checkReactTypeSpec(typeSpecs, values, location, componentName, element, debugID) { + for (var typeSpecName in typeSpecs) { + if (typeSpecs.hasOwnProperty(typeSpecName)) { + var error; + // Prop type validation may throw. In case they do, we don't want to + // fail the render phase where it didn't fail before. So we log it. + // After these have been cleaned up, we'll let them throw. + try { + // This is intentionally an invariant that gets caught. It's the same + // behavior as without this statement except with a better message. + !(typeof typeSpecs[typeSpecName] === 'function') ? process.env.NODE_ENV !== 'production' ? invariant(false, '%s: %s type `%s` is invalid; it must be a function, usually from React.PropTypes.', componentName || 'React class', ReactPropTypeLocationNames[location], typeSpecName) : _prodInvariant('84', componentName || 'React class', ReactPropTypeLocationNames[location], typeSpecName) : void 0; + error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret); + } catch (ex) { + error = ex; + } + process.env.NODE_ENV !== 'production' ? warning(!error || error instanceof Error, '%s: type specification of %s `%s` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a %s. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).', componentName || 'React class', ReactPropTypeLocationNames[location], typeSpecName, typeof error) : void 0; + if (error instanceof Error && !(error.message in loggedTypeFailures)) { + // Only monitor this failure once because there tends to be a lot of the + // same error. + loggedTypeFailures[error.message] = true; + + var componentStackInfo = ''; + + if (process.env.NODE_ENV !== 'production') { + if (!ReactComponentTreeHook) { + ReactComponentTreeHook = __webpack_require__(11); + } + if (debugID !== null) { + componentStackInfo = ReactComponentTreeHook.getStackAddendumByID(debugID); + } else if (element !== null) { + componentStackInfo = ReactComponentTreeHook.getCurrentStackAddendum(element); + } + } + + process.env.NODE_ENV !== 'production' ? warning(false, 'Failed %s type: %s%s', location, error.message, componentStackInfo) : void 0; + } + } + } +} + +module.exports = checkReactTypeSpec; +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) + +/***/ }), +/* 118 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(process) {/** + * 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 ReactPropTypeLocationNames = {}; + +if (process.env.NODE_ENV !== 'production') { + ReactPropTypeLocationNames = { + prop: 'prop', + context: 'context', + childContext: 'child context' + }; +} + +module.exports = ReactPropTypeLocationNames; +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) + +/***/ }), +/* 119 */ +/***/ (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 ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED'; + +module.exports = ReactPropTypesSecret; + +/***/ }), +/* 120 */ +/***/ (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 _require = __webpack_require__(19), + isValidElement = _require.isValidElement; + +var factory = __webpack_require__(67); + +module.exports = factory(isValidElement); + +/***/ }), +/* 121 */ +/***/ (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; +}; + + +/***/ }), +/* 122 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(process) {/** + * 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. + */ + + + +if (process.env.NODE_ENV !== 'production') { + var invariant = __webpack_require__(1); + var warning = __webpack_require__(3); + var ReactPropTypesSecret = __webpack_require__(41); + var loggedTypeFailures = {}; +} + +/** + * Assert that the values match with the type specs. + * Error messages are memorized and will only be shown once. + * + * @param {object} typeSpecs Map of name to a ReactPropType + * @param {object} values Runtime values that need to be type-checked + * @param {string} location e.g. "prop", "context", "child context" + * @param {string} componentName Name of the component for error messages. + * @param {?Function} getStack Returns the component stack. + * @private + */ +function checkPropTypes(typeSpecs, values, location, componentName, getStack) { + if (process.env.NODE_ENV !== 'production') { + for (var typeSpecName in typeSpecs) { + if (typeSpecs.hasOwnProperty(typeSpecName)) { + var error; + // Prop type validation may throw. In case they do, we don't want to + // fail the render phase where it didn't fail before. So we log it. + // After these have been cleaned up, we'll let them throw. + try { + // This is intentionally an invariant that gets caught. It's the same + // behavior as without this statement except with a better message. + invariant(typeof typeSpecs[typeSpecName] === 'function', '%s: %s type `%s` is invalid; it must be a function, usually from ' + 'the `prop-types` package, but received `%s`.', componentName || 'React class', location, typeSpecName, typeof typeSpecs[typeSpecName]); + error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret); + } catch (ex) { + error = ex; + } + warning(!error || error instanceof Error, '%s: type specification of %s `%s` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a %s. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).', componentName || 'React class', location, typeSpecName, typeof error); + if (error instanceof Error && !(error.message in loggedTypeFailures)) { + // Only monitor this failure once because there tends to be a lot of the + // same error. + loggedTypeFailures[error.message] = true; + + var stack = getStack ? getStack() : ''; + + warning(false, 'Failed %s type: %s%s', location, error.message, stack != null ? stack : ''); + } + } + } + } +} + +module.exports = checkPropTypes; + +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) + +/***/ }), +/* 123 */ +/***/ (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. + * + */ + + + +module.exports = '15.6.2'; + +/***/ }), +/* 124 */ +/***/ (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 _require = __webpack_require__(62), + Component = _require.Component; + +var _require2 = __webpack_require__(19), + isValidElement = _require2.isValidElement; + +var ReactNoopUpdateQueue = __webpack_require__(63); +var factory = __webpack_require__(69); + +module.exports = factory(Component, isValidElement, ReactNoopUpdateQueue); + +/***/ }), +/* 125 */ +/***/ (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; +}; + + +/***/ }), +/* 126 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(process) {/** + * 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__(22); + +var ReactElement = __webpack_require__(19); + +var invariant = __webpack_require__(1); + +/** + * Returns the first child in a collection of children and verifies that there + * is only one child in the collection. + * + * See https://facebook.github.io/react/docs/top-level-api.html#react.children.only + * + * The current implementation of this function assumes that a single child gets + * passed without a wrapper, but the purpose of this helper function is to + * abstract away the particular structure of children. + * + * @param {?object} children Child collection structure. + * @return {ReactElement} The first and only `ReactElement` contained in the + * structure. + */ +function onlyChild(children) { + !ReactElement.isValidElement(children) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'React.Children.only expected to receive a single React element child.') : _prodInvariant('143') : void 0; + return children; +} + +module.exports = onlyChild; +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) + +/***/ }), +/* 127 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(process) {/** + * 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. + * + */ + +/* globals __REACT_DEVTOOLS_GLOBAL_HOOK__*/ + + + +var ReactDOMComponentTree = __webpack_require__(7); +var ReactDefaultInjection = __webpack_require__(128); +var ReactMount = __webpack_require__(93); +var ReactReconciler = __webpack_require__(23); +var ReactUpdates = __webpack_require__(15); +var ReactVersion = __webpack_require__(206); + +var findDOMNode = __webpack_require__(207); +var getHostComponentFromComposite = __webpack_require__(94); +var renderSubtreeIntoContainer = __webpack_require__(208); +var warning = __webpack_require__(3); + +ReactDefaultInjection.inject(); + +var ReactDOM = { + findDOMNode: findDOMNode, + render: ReactMount.render, + unmountComponentAtNode: ReactMount.unmountComponentAtNode, + version: ReactVersion, + + /* eslint-disable camelcase */ + unstable_batchedUpdates: ReactUpdates.batchedUpdates, + unstable_renderSubtreeIntoContainer: renderSubtreeIntoContainer + /* eslint-enable camelcase */ +}; + +// Inject the runtime into a devtools global hook regardless of browser. +// Allows for debugging when the hook is injected on the page. +if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.inject === 'function') { + __REACT_DEVTOOLS_GLOBAL_HOOK__.inject({ + ComponentTree: { + getClosestInstanceFromNode: ReactDOMComponentTree.getClosestInstanceFromNode, + getNodeFromInstance: function (inst) { + // inst is an internal instance (but could be a composite) + if (inst._renderedComponent) { + inst = getHostComponentFromComposite(inst); + } + if (inst) { + return ReactDOMComponentTree.getNodeFromInstance(inst); + } else { + return null; + } + } + }, + Mount: ReactMount, + Reconciler: ReactReconciler + }); +} + +if (process.env.NODE_ENV !== 'production') { + var ExecutionEnvironment = __webpack_require__(9); + if (ExecutionEnvironment.canUseDOM && window.top === window.self) { + // First check if devtools is not installed + if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ === 'undefined') { + // If we're in Chrome or Firefox, provide a download link if not installed. + if (navigator.userAgent.indexOf('Chrome') > -1 && navigator.userAgent.indexOf('Edge') === -1 || navigator.userAgent.indexOf('Firefox') > -1) { + // Firefox does not have the issue with devtools loaded over file:// + var showFileUrlMessage = window.location.protocol.indexOf('http') === -1 && navigator.userAgent.indexOf('Firefox') === -1; + console.debug('Download the React DevTools ' + (showFileUrlMessage ? 'and use an HTTP server (instead of a file: URL) ' : '') + 'for a better development experience: ' + 'https://fb.me/react-devtools'); + } + } + + var testFunc = function testFn() {}; + process.env.NODE_ENV !== 'production' ? warning((testFunc.name || testFunc.toString()).indexOf('testFn') !== -1, "It looks like you're using a minified copy of the development build " + 'of React. When deploying React apps to production, make sure to use ' + 'the production build which skips development warnings and is faster. ' + 'See https://fb.me/react-minification for more details.') : void 0; + + // If we're in IE8, check to see if we are in compatibility mode and provide + // information on preventing compatibility mode + var ieCompatibilityMode = document.documentMode && document.documentMode < 8; + + process.env.NODE_ENV !== 'production' ? warning(!ieCompatibilityMode, 'Internet Explorer is running in compatibility mode; please add the ' + 'following tag to your HTML to prevent this from happening: ' + '<meta http-equiv="X-UA-Compatible" content="IE=edge" />') : void 0; + + var expectedFeatures = [ + // shims + Array.isArray, Array.prototype.every, Array.prototype.forEach, Array.prototype.indexOf, Array.prototype.map, Date.now, Function.prototype.bind, Object.keys, String.prototype.trim]; + + for (var i = 0; i < expectedFeatures.length; i++) { + if (!expectedFeatures[i]) { + process.env.NODE_ENV !== 'production' ? warning(false, 'One or more ES5 shims expected by React are not available: ' + 'https://fb.me/react-warning-polyfills') : void 0; + break; + } + } + } +} + +if (process.env.NODE_ENV !== 'production') { + var ReactInstrumentation = __webpack_require__(13); + var ReactDOMUnknownPropertyHook = __webpack_require__(209); + var ReactDOMNullInputValuePropHook = __webpack_require__(210); + var ReactDOMInvalidARIAHook = __webpack_require__(211); + + ReactInstrumentation.debugTool.addHook(ReactDOMUnknownPropertyHook); + ReactInstrumentation.debugTool.addHook(ReactDOMNullInputValuePropHook); + ReactInstrumentation.debugTool.addHook(ReactDOMInvalidARIAHook); +} + +module.exports = ReactDOM; +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) + +/***/ }), +/* 128 */ +/***/ (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 ARIADOMPropertyConfig = __webpack_require__(129); +var BeforeInputEventPlugin = __webpack_require__(130); +var ChangeEventPlugin = __webpack_require__(134); +var DefaultEventPluginOrder = __webpack_require__(142); +var EnterLeaveEventPlugin = __webpack_require__(143); +var HTMLDOMPropertyConfig = __webpack_require__(144); +var ReactComponentBrowserEnvironment = __webpack_require__(145); +var ReactDOMComponent = __webpack_require__(151); +var ReactDOMComponentTree = __webpack_require__(7); +var ReactDOMEmptyComponent = __webpack_require__(177); +var ReactDOMTreeTraversal = __webpack_require__(178); +var ReactDOMTextComponent = __webpack_require__(179); +var ReactDefaultBatchingStrategy = __webpack_require__(180); +var ReactEventListener = __webpack_require__(181); +var ReactInjection = __webpack_require__(183); +var ReactReconcileTransaction = __webpack_require__(184); +var SVGDOMPropertyConfig = __webpack_require__(190); +var SelectEventPlugin = __webpack_require__(191); +var SimpleEventPlugin = __webpack_require__(192); + +var alreadyInjected = false; + +function inject() { + if (alreadyInjected) { + // TODO: This is currently true because these injections are shared between + // the client and the server package. They should be built independently + // and not share any injection state. Then this problem will be solved. + return; + } + alreadyInjected = true; + + ReactInjection.EventEmitter.injectReactEventListener(ReactEventListener); + + /** + * Inject modules for resolving DOM hierarchy and plugin ordering. + */ + ReactInjection.EventPluginHub.injectEventPluginOrder(DefaultEventPluginOrder); + ReactInjection.EventPluginUtils.injectComponentTree(ReactDOMComponentTree); + ReactInjection.EventPluginUtils.injectTreeTraversal(ReactDOMTreeTraversal); + + /** + * Some important event plugins included by default (without having to require + * them). + */ + ReactInjection.EventPluginHub.injectEventPluginsByName({ + SimpleEventPlugin: SimpleEventPlugin, + EnterLeaveEventPlugin: EnterLeaveEventPlugin, + ChangeEventPlugin: ChangeEventPlugin, + SelectEventPlugin: SelectEventPlugin, + BeforeInputEventPlugin: BeforeInputEventPlugin + }); + + ReactInjection.HostComponent.injectGenericComponentClass(ReactDOMComponent); + + ReactInjection.HostComponent.injectTextComponentClass(ReactDOMTextComponent); + + ReactInjection.DOMProperty.injectDOMPropertyConfig(ARIADOMPropertyConfig); + ReactInjection.DOMProperty.injectDOMPropertyConfig(HTMLDOMPropertyConfig); + ReactInjection.DOMProperty.injectDOMPropertyConfig(SVGDOMPropertyConfig); + + ReactInjection.EmptyComponent.injectEmptyComponentFactory(function (instantiate) { + return new ReactDOMEmptyComponent(instantiate); + }); + + ReactInjection.Updates.injectReconcileTransaction(ReactReconcileTransaction); + ReactInjection.Updates.injectBatchingStrategy(ReactDefaultBatchingStrategy); + + ReactInjection.Component.injectEnvironment(ReactComponentBrowserEnvironment); +} + +module.exports = { + inject: inject +}; + +/***/ }), +/* 129 */ +/***/ (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 ARIADOMPropertyConfig = { + Properties: { + // Global States and Properties + 'aria-current': 0, // state + 'aria-details': 0, + 'aria-disabled': 0, // state + 'aria-hidden': 0, // state + 'aria-invalid': 0, // state + 'aria-keyshortcuts': 0, + 'aria-label': 0, + 'aria-roledescription': 0, + // Widget Attributes + 'aria-autocomplete': 0, + 'aria-checked': 0, + 'aria-expanded': 0, + 'aria-haspopup': 0, + 'aria-level': 0, + 'aria-modal': 0, + 'aria-multiline': 0, + 'aria-multiselectable': 0, + 'aria-orientation': 0, + 'aria-placeholder': 0, + 'aria-pressed': 0, + 'aria-readonly': 0, + 'aria-required': 0, + 'aria-selected': 0, + 'aria-sort': 0, + 'aria-valuemax': 0, + 'aria-valuemin': 0, + 'aria-valuenow': 0, + 'aria-valuetext': 0, + // Live Region Attributes + 'aria-atomic': 0, + 'aria-busy': 0, + 'aria-live': 0, + 'aria-relevant': 0, + // Drag-and-Drop Attributes + 'aria-dropeffect': 0, + 'aria-grabbed': 0, + // Relationship Attributes + 'aria-activedescendant': 0, + 'aria-colcount': 0, + 'aria-colindex': 0, + 'aria-colspan': 0, + 'aria-controls': 0, + 'aria-describedby': 0, + 'aria-errormessage': 0, + 'aria-flowto': 0, + 'aria-labelledby': 0, + 'aria-owns': 0, + 'aria-posinset': 0, + 'aria-rowcount': 0, + 'aria-rowindex': 0, + 'aria-rowspan': 0, + 'aria-setsize': 0 + }, + DOMAttributeNames: {}, + DOMPropertyNames: {} +}; + +module.exports = ARIADOMPropertyConfig; + +/***/ }), +/* 130 */ +/***/ (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 EventPropagators = __webpack_require__(26); +var ExecutionEnvironment = __webpack_require__(9); +var FallbackCompositionState = __webpack_require__(131); +var SyntheticCompositionEvent = __webpack_require__(132); +var SyntheticInputEvent = __webpack_require__(133); + +var END_KEYCODES = [9, 13, 27, 32]; // Tab, Return, Esc, Space +var START_KEYCODE = 229; + +var canUseCompositionEvent = ExecutionEnvironment.canUseDOM && 'CompositionEvent' in window; + +var documentMode = null; +if (ExecutionEnvironment.canUseDOM && 'documentMode' in document) { + documentMode = document.documentMode; +} + +// Webkit offers a very useful `textInput` event that can be used to +// directly represent `beforeInput`. The IE `textinput` event is not as +// useful, so we don't use it. +var canUseTextInputEvent = ExecutionEnvironment.canUseDOM && 'TextEvent' in window && !documentMode && !isPresto(); + +// In IE9+, we have access to composition events, but the data supplied +// by the native compositionend event may be incorrect. Japanese ideographic +// spaces, for instance (\u3000) are not recorded correctly. +var useFallbackCompositionData = ExecutionEnvironment.canUseDOM && (!canUseCompositionEvent || documentMode && documentMode > 8 && documentMode <= 11); + +/** + * Opera <= 12 includes TextEvent in window, but does not fire + * text input events. Rely on keypress instead. + */ +function isPresto() { + var opera = window.opera; + return typeof opera === 'object' && typeof opera.version === 'function' && parseInt(opera.version(), 10) <= 12; +} + +var SPACEBAR_CODE = 32; +var SPACEBAR_CHAR = String.fromCharCode(SPACEBAR_CODE); + +// Events and their corresponding property names. +var eventTypes = { + beforeInput: { + phasedRegistrationNames: { + bubbled: 'onBeforeInput', + captured: 'onBeforeInputCapture' + }, + dependencies: ['topCompositionEnd', 'topKeyPress', 'topTextInput', 'topPaste'] + }, + compositionEnd: { + phasedRegistrationNames: { + bubbled: 'onCompositionEnd', + captured: 'onCompositionEndCapture' + }, + dependencies: ['topBlur', 'topCompositionEnd', 'topKeyDown', 'topKeyPress', 'topKeyUp', 'topMouseDown'] + }, + compositionStart: { + phasedRegistrationNames: { + bubbled: 'onCompositionStart', + captured: 'onCompositionStartCapture' + }, + dependencies: ['topBlur', 'topCompositionStart', 'topKeyDown', 'topKeyPress', 'topKeyUp', 'topMouseDown'] + }, + compositionUpdate: { + phasedRegistrationNames: { + bubbled: 'onCompositionUpdate', + captured: 'onCompositionUpdateCapture' + }, + dependencies: ['topBlur', 'topCompositionUpdate', 'topKeyDown', 'topKeyPress', 'topKeyUp', 'topMouseDown'] + } +}; + +// Track whether we've ever handled a keypress on the space key. +var hasSpaceKeypress = false; + +/** + * Return whether a native keypress event is assumed to be a command. + * This is required because Firefox fires `keypress` events for key commands + * (cut, copy, select-all, etc.) even though no character is inserted. + */ +function isKeypressCommand(nativeEvent) { + return (nativeEvent.ctrlKey || nativeEvent.altKey || nativeEvent.metaKey) && + // ctrlKey && altKey is equivalent to AltGr, and is not a command. + !(nativeEvent.ctrlKey && nativeEvent.altKey); +} + +/** + * Translate native top level events into event types. + * + * @param {string} topLevelType + * @return {object} + */ +function getCompositionEventType(topLevelType) { + switch (topLevelType) { + case 'topCompositionStart': + return eventTypes.compositionStart; + case 'topCompositionEnd': + return eventTypes.compositionEnd; + case 'topCompositionUpdate': + return eventTypes.compositionUpdate; + } +} + +/** + * Does our fallback best-guess model think this event signifies that + * composition has begun? + * + * @param {string} topLevelType + * @param {object} nativeEvent + * @return {boolean} + */ +function isFallbackCompositionStart(topLevelType, nativeEvent) { + return topLevelType === 'topKeyDown' && nativeEvent.keyCode === START_KEYCODE; +} + +/** + * Does our fallback mode think that this event is the end of composition? + * + * @param {string} topLevelType + * @param {object} nativeEvent + * @return {boolean} + */ +function isFallbackCompositionEnd(topLevelType, nativeEvent) { + switch (topLevelType) { + case 'topKeyUp': + // Command keys insert or clear IME input. + return END_KEYCODES.indexOf(nativeEvent.keyCode) !== -1; + case 'topKeyDown': + // Expect IME keyCode on each keydown. If we get any other + // code we must have exited earlier. + return nativeEvent.keyCode !== START_KEYCODE; + case 'topKeyPress': + case 'topMouseDown': + case 'topBlur': + // Events are not possible without cancelling IME. + return true; + default: + return false; + } +} + +/** + * Google Input Tools provides composition data via a CustomEvent, + * with the `data` property populated in the `detail` object. If this + * is available on the event object, use it. If not, this is a plain + * composition event and we have nothing special to extract. + * + * @param {object} nativeEvent + * @return {?string} + */ +function getDataFromCustomEvent(nativeEvent) { + var detail = nativeEvent.detail; + if (typeof detail === 'object' && 'data' in detail) { + return detail.data; + } + return null; +} + +// Track the current IME composition fallback object, if any. +var currentComposition = null; + +/** + * @return {?object} A SyntheticCompositionEvent. + */ +function extractCompositionEvent(topLevelType, targetInst, nativeEvent, nativeEventTarget) { + var eventType; + var fallbackData; + + if (canUseCompositionEvent) { + eventType = getCompositionEventType(topLevelType); + } else if (!currentComposition) { + if (isFallbackCompositionStart(topLevelType, nativeEvent)) { + eventType = eventTypes.compositionStart; + } + } else if (isFallbackCompositionEnd(topLevelType, nativeEvent)) { + eventType = eventTypes.compositionEnd; + } + + if (!eventType) { + return null; + } + + if (useFallbackCompositionData) { + // The current composition is stored statically and must not be + // overwritten while composition continues. + if (!currentComposition && eventType === eventTypes.compositionStart) { + currentComposition = FallbackCompositionState.getPooled(nativeEventTarget); + } else if (eventType === eventTypes.compositionEnd) { + if (currentComposition) { + fallbackData = currentComposition.getData(); + } + } + } + + var event = SyntheticCompositionEvent.getPooled(eventType, targetInst, nativeEvent, nativeEventTarget); + + if (fallbackData) { + // Inject data generated from fallback path into the synthetic event. + // This matches the property of native CompositionEventInterface. + event.data = fallbackData; + } else { + var customData = getDataFromCustomEvent(nativeEvent); + if (customData !== null) { + event.data = customData; + } + } + + EventPropagators.accumulateTwoPhaseDispatches(event); + return event; +} + +/** + * @param {string} topLevelType Record from `EventConstants`. + * @param {object} nativeEvent Native browser event. + * @return {?string} The string corresponding to this `beforeInput` event. + */ +function getNativeBeforeInputChars(topLevelType, nativeEvent) { + switch (topLevelType) { + case 'topCompositionEnd': + return getDataFromCustomEvent(nativeEvent); + case 'topKeyPress': + /** + * If native `textInput` events are available, our goal is to make + * use of them. However, there is a special case: the spacebar key. + * In Webkit, preventing default on a spacebar `textInput` event + * cancels character insertion, but it *also* causes the browser + * to fall back to its default spacebar behavior of scrolling the + * page. + * + * Tracking at: + * https://code.google.com/p/chromium/issues/detail?id=355103 + * + * To avoid this issue, use the keypress event as if no `textInput` + * event is available. + */ + var which = nativeEvent.which; + if (which !== SPACEBAR_CODE) { + return null; + } + + hasSpaceKeypress = true; + return SPACEBAR_CHAR; + + case 'topTextInput': + // Record the characters to be added to the DOM. + var chars = nativeEvent.data; + + // If it's a spacebar character, assume that we have already handled + // it at the keypress level and bail immediately. Android Chrome + // doesn't give us keycodes, so we need to blacklist it. + if (chars === SPACEBAR_CHAR && hasSpaceKeypress) { + return null; + } + + return chars; + + default: + // For other native event types, do nothing. + return null; + } +} + +/** + * For browsers that do not provide the `textInput` event, extract the + * appropriate string to use for SyntheticInputEvent. + * + * @param {string} topLevelType Record from `EventConstants`. + * @param {object} nativeEvent Native browser event. + * @return {?string} The fallback string for this `beforeInput` event. + */ +function getFallbackBeforeInputChars(topLevelType, nativeEvent) { + // If we are currently composing (IME) and using a fallback to do so, + // try to extract the composed characters from the fallback object. + // If composition event is available, we extract a string only at + // compositionevent, otherwise extract it at fallback events. + if (currentComposition) { + if (topLevelType === 'topCompositionEnd' || !canUseCompositionEvent && isFallbackCompositionEnd(topLevelType, nativeEvent)) { + var chars = currentComposition.getData(); + FallbackCompositionState.release(currentComposition); + currentComposition = null; + return chars; + } + return null; + } + + switch (topLevelType) { + case 'topPaste': + // If a paste event occurs after a keypress, throw out the input + // chars. Paste events should not lead to BeforeInput events. + return null; + case 'topKeyPress': + /** + * As of v27, Firefox may fire keypress events even when no character + * will be inserted. A few possibilities: + * + * - `which` is `0`. Arrow keys, Esc key, etc. + * + * - `which` is the pressed key code, but no char is available. + * Ex: 'AltGr + d` in Polish. There is no modified character for + * this key combination and no character is inserted into the + * document, but FF fires the keypress for char code `100` anyway. + * No `input` event will occur. + * + * - `which` is the pressed key code, but a command combination is + * being used. Ex: `Cmd+C`. No character is inserted, and no + * `input` event will occur. + */ + if (nativeEvent.which && !isKeypressCommand(nativeEvent)) { + return String.fromCharCode(nativeEvent.which); + } + return null; + case 'topCompositionEnd': + return useFallbackCompositionData ? null : nativeEvent.data; + default: + return null; + } +} + +/** + * Extract a SyntheticInputEvent for `beforeInput`, based on either native + * `textInput` or fallback behavior. + * + * @return {?object} A SyntheticInputEvent. + */ +function extractBeforeInputEvent(topLevelType, targetInst, nativeEvent, nativeEventTarget) { + var chars; + + if (canUseTextInputEvent) { + chars = getNativeBeforeInputChars(topLevelType, nativeEvent); + } else { + chars = getFallbackBeforeInputChars(topLevelType, nativeEvent); + } + + // If no characters are being inserted, no BeforeInput event should + // be fired. + if (!chars) { + return null; + } + + var event = SyntheticInputEvent.getPooled(eventTypes.beforeInput, targetInst, nativeEvent, nativeEventTarget); + + event.data = chars; + EventPropagators.accumulateTwoPhaseDispatches(event); + return event; +} + +/** + * Create an `onBeforeInput` event to match + * http://www.w3.org/TR/2013/WD-DOM-Level-3-Events-20131105/#events-inputevents. + * + * This event plugin is based on the native `textInput` event + * available in Chrome, Safari, Opera, and IE. This event fires after + * `onKeyPress` and `onCompositionEnd`, but before `onInput`. + * + * `beforeInput` is spec'd but not implemented in any browsers, and + * the `input` event does not provide any useful information about what has + * actually been added, contrary to the spec. Thus, `textInput` is the best + * available event to identify the characters that have actually been inserted + * into the target node. + * + * This plugin is also responsible for emitting `composition` events, thus + * allowing us to share composition fallback code for both `beforeInput` and + * `composition` event types. + */ +var BeforeInputEventPlugin = { + eventTypes: eventTypes, + + extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget) { + return [extractCompositionEvent(topLevelType, targetInst, nativeEvent, nativeEventTarget), extractBeforeInputEvent(topLevelType, targetInst, nativeEvent, nativeEventTarget)]; + } +}; + +module.exports = BeforeInputEventPlugin; + +/***/ }), +/* 131 */ +/***/ (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__(8); + +var PooledClass = __webpack_require__(20); + +var getTextContentAccessor = __webpack_require__(73); + +/** + * This helper class stores information about text content of a target node, + * allowing comparison of content before and after a given event. + * + * Identify the node where selection currently begins, then observe + * both its text content and its current position in the DOM. Since the + * browser may natively replace the target node during composition, we can + * use its position to find its replacement. + * + * @param {DOMEventTarget} root + */ +function FallbackCompositionState(root) { + this._root = root; + this._startText = this.getText(); + this._fallbackText = null; +} + +_assign(FallbackCompositionState.prototype, { + destructor: function () { + this._root = null; + this._startText = null; + this._fallbackText = null; + }, + + /** + * Get current text of input. + * + * @return {string} + */ + getText: function () { + if ('value' in this._root) { + return this._root.value; + } + return this._root[getTextContentAccessor()]; + }, + + /** + * Determine the differing substring between the initially stored + * text content and the current content. + * + * @return {string} + */ + getData: function () { + if (this._fallbackText) { + return this._fallbackText; + } + + var start; + var startValue = this._startText; + var startLength = startValue.length; + var end; + var endValue = this.getText(); + var endLength = endValue.length; + + for (start = 0; start < startLength; start++) { + if (startValue[start] !== endValue[start]) { + break; + } + } + + var minEnd = startLength - start; + for (end = 1; end <= minEnd; end++) { + if (startValue[startLength - end] !== endValue[endLength - end]) { + break; + } + } + + var sliceTail = end > 1 ? 1 - end : undefined; + this._fallbackText = endValue.slice(start, sliceTail); + return this._fallbackText; + } +}); + +PooledClass.addPoolingTo(FallbackCompositionState); + +module.exports = FallbackCompositionState; + +/***/ }), +/* 132 */ +/***/ (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 SyntheticEvent = __webpack_require__(16); + +/** + * @interface Event + * @see http://www.w3.org/TR/DOM-Level-3-Events/#events-compositionevents + */ +var CompositionEventInterface = { + data: null +}; + +/** + * @param {object} dispatchConfig Configuration used to dispatch this event. + * @param {string} dispatchMarker Marker identifying the event target. + * @param {object} nativeEvent Native browser event. + * @extends {SyntheticUIEvent} + */ +function SyntheticCompositionEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) { + return SyntheticEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget); +} + +SyntheticEvent.augmentClass(SyntheticCompositionEvent, CompositionEventInterface); + +module.exports = SyntheticCompositionEvent; + +/***/ }), +/* 133 */ +/***/ (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 SyntheticEvent = __webpack_require__(16); + +/** + * @interface Event + * @see http://www.w3.org/TR/2013/WD-DOM-Level-3-Events-20131105 + * /#events-inputevents + */ +var InputEventInterface = { + data: null +}; + +/** + * @param {object} dispatchConfig Configuration used to dispatch this event. + * @param {string} dispatchMarker Marker identifying the event target. + * @param {object} nativeEvent Native browser event. + * @extends {SyntheticUIEvent} + */ +function SyntheticInputEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) { + return SyntheticEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget); +} + +SyntheticEvent.augmentClass(SyntheticInputEvent, InputEventInterface); + +module.exports = SyntheticInputEvent; + +/***/ }), +/* 134 */ +/***/ (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 EventPluginHub = __webpack_require__(27); +var EventPropagators = __webpack_require__(26); +var ExecutionEnvironment = __webpack_require__(9); +var ReactDOMComponentTree = __webpack_require__(7); +var ReactUpdates = __webpack_require__(15); +var SyntheticEvent = __webpack_require__(16); + +var inputValueTracking = __webpack_require__(76); +var getEventTarget = __webpack_require__(44); +var isEventSupported = __webpack_require__(45); +var isTextInputElement = __webpack_require__(77); + +var eventTypes = { + change: { + phasedRegistrationNames: { + bubbled: 'onChange', + captured: 'onChangeCapture' + }, + dependencies: ['topBlur', 'topChange', 'topClick', 'topFocus', 'topInput', 'topKeyDown', 'topKeyUp', 'topSelectionChange'] + } +}; + +function createAndAccumulateChangeEvent(inst, nativeEvent, target) { + var event = SyntheticEvent.getPooled(eventTypes.change, inst, nativeEvent, target); + event.type = 'change'; + EventPropagators.accumulateTwoPhaseDispatches(event); + return event; +} +/** + * For IE shims + */ +var activeElement = null; +var activeElementInst = null; + +/** + * SECTION: handle `change` event + */ +function shouldUseChangeEvent(elem) { + var nodeName = elem.nodeName && elem.nodeName.toLowerCase(); + return nodeName === 'select' || nodeName === 'input' && elem.type === 'file'; +} + +var doesChangeEventBubble = false; +if (ExecutionEnvironment.canUseDOM) { + // See `handleChange` comment below + doesChangeEventBubble = isEventSupported('change') && (!document.documentMode || document.documentMode > 8); +} + +function manualDispatchChangeEvent(nativeEvent) { + var event = createAndAccumulateChangeEvent(activeElementInst, nativeEvent, getEventTarget(nativeEvent)); + + // If change and propertychange bubbled, we'd just bind to it like all the + // other events and have it go through ReactBrowserEventEmitter. Since it + // doesn't, we manually listen for the events and so we have to enqueue and + // process the abstract event manually. + // + // Batching is necessary here in order to ensure that all event handlers run + // before the next rerender (including event handlers attached to ancestor + // elements instead of directly on the input). Without this, controlled + // components don't work properly in conjunction with event bubbling because + // the component is rerendered and the value reverted before all the event + // handlers can run. See https://github.com/facebook/react/issues/708. + ReactUpdates.batchedUpdates(runEventInBatch, event); +} + +function runEventInBatch(event) { + EventPluginHub.enqueueEvents(event); + EventPluginHub.processEventQueue(false); +} + +function startWatchingForChangeEventIE8(target, targetInst) { + activeElement = target; + activeElementInst = targetInst; + activeElement.attachEvent('onchange', manualDispatchChangeEvent); +} + +function stopWatchingForChangeEventIE8() { + if (!activeElement) { + return; + } + activeElement.detachEvent('onchange', manualDispatchChangeEvent); + activeElement = null; + activeElementInst = null; +} + +function getInstIfValueChanged(targetInst, nativeEvent) { + var updated = inputValueTracking.updateValueIfChanged(targetInst); + var simulated = nativeEvent.simulated === true && ChangeEventPlugin._allowSimulatedPassThrough; + + if (updated || simulated) { + return targetInst; + } +} + +function getTargetInstForChangeEvent(topLevelType, targetInst) { + if (topLevelType === 'topChange') { + return targetInst; + } +} + +function handleEventsForChangeEventIE8(topLevelType, target, targetInst) { + if (topLevelType === 'topFocus') { + // stopWatching() should be a noop here but we call it just in case we + // missed a blur event somehow. + stopWatchingForChangeEventIE8(); + startWatchingForChangeEventIE8(target, targetInst); + } else if (topLevelType === 'topBlur') { + stopWatchingForChangeEventIE8(); + } +} + +/** + * SECTION: handle `input` event + */ +var isInputEventSupported = false; +if (ExecutionEnvironment.canUseDOM) { + // IE9 claims to support the input event but fails to trigger it when + // deleting text, so we ignore its input events. + + isInputEventSupported = isEventSupported('input') && (!document.documentMode || document.documentMode > 9); +} + +/** + * (For IE <=9) Starts tracking propertychange events on the passed-in element + * and override the value property so that we can distinguish user events from + * value changes in JS. + */ +function startWatchingForValueChange(target, targetInst) { + activeElement = target; + activeElementInst = targetInst; + activeElement.attachEvent('onpropertychange', handlePropertyChange); +} + +/** + * (For IE <=9) Removes the event listeners from the currently-tracked element, + * if any exists. + */ +function stopWatchingForValueChange() { + if (!activeElement) { + return; + } + activeElement.detachEvent('onpropertychange', handlePropertyChange); + + activeElement = null; + activeElementInst = null; +} + +/** + * (For IE <=9) Handles a propertychange event, sending a `change` event if + * the value of the active element has changed. + */ +function handlePropertyChange(nativeEvent) { + if (nativeEvent.propertyName !== 'value') { + return; + } + if (getInstIfValueChanged(activeElementInst, nativeEvent)) { + manualDispatchChangeEvent(nativeEvent); + } +} + +function handleEventsForInputEventPolyfill(topLevelType, target, targetInst) { + if (topLevelType === 'topFocus') { + // In IE8, we can capture almost all .value changes by adding a + // propertychange handler and looking for events with propertyName + // equal to 'value' + // In IE9, propertychange fires for most input events but is buggy and + // doesn't fire when text is deleted, but conveniently, selectionchange + // appears to fire in all of the remaining cases so we catch those and + // forward the event if the value has changed + // In either case, we don't want to call the event handler if the value + // is changed from JS so we redefine a setter for `.value` that updates + // our activeElementValue variable, allowing us to ignore those changes + // + // stopWatching() should be a noop here but we call it just in case we + // missed a blur event somehow. + stopWatchingForValueChange(); + startWatchingForValueChange(target, targetInst); + } else if (topLevelType === 'topBlur') { + stopWatchingForValueChange(); + } +} + +// For IE8 and IE9. +function getTargetInstForInputEventPolyfill(topLevelType, targetInst, nativeEvent) { + if (topLevelType === 'topSelectionChange' || topLevelType === 'topKeyUp' || topLevelType === 'topKeyDown') { + // On the selectionchange event, the target is just document which isn't + // helpful for us so just check activeElement instead. + // + // 99% of the time, keydown and keyup aren't necessary. IE8 fails to fire + // propertychange on the first input event after setting `value` from a + // script and fires only keydown, keypress, keyup. Catching keyup usually + // gets it and catching keydown lets us fire an event for the first + // keystroke if user does a key repeat (it'll be a little delayed: right + // before the second keystroke). Other input methods (e.g., paste) seem to + // fire selectionchange normally. + return getInstIfValueChanged(activeElementInst, nativeEvent); + } +} + +/** + * SECTION: handle `click` event + */ +function shouldUseClickEvent(elem) { + // Use the `click` event to detect changes to checkbox and radio inputs. + // This approach works across all browsers, whereas `change` does not fire + // until `blur` in IE8. + var nodeName = elem.nodeName; + return nodeName && nodeName.toLowerCase() === 'input' && (elem.type === 'checkbox' || elem.type === 'radio'); +} + +function getTargetInstForClickEvent(topLevelType, targetInst, nativeEvent) { + if (topLevelType === 'topClick') { + return getInstIfValueChanged(targetInst, nativeEvent); + } +} + +function getTargetInstForInputOrChangeEvent(topLevelType, targetInst, nativeEvent) { + if (topLevelType === 'topInput' || topLevelType === 'topChange') { + return getInstIfValueChanged(targetInst, nativeEvent); + } +} + +function handleControlledInputBlur(inst, node) { + // TODO: In IE, inst is occasionally null. Why? + if (inst == null) { + return; + } + + // Fiber and ReactDOM keep wrapper state in separate places + var state = inst._wrapperState || node._wrapperState; + + if (!state || !state.controlled || node.type !== 'number') { + return; + } + + // If controlled, assign the value attribute to the current value on blur + var value = '' + node.value; + if (node.getAttribute('value') !== value) { + node.setAttribute('value', value); + } +} + +/** + * This plugin creates an `onChange` event that normalizes change events + * across form elements. This event fires at a time when it's possible to + * change the element's value without seeing a flicker. + * + * Supported elements are: + * - input (see `isTextInputElement`) + * - textarea + * - select + */ +var ChangeEventPlugin = { + eventTypes: eventTypes, + + _allowSimulatedPassThrough: true, + _isInputEventSupported: isInputEventSupported, + + extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget) { + var targetNode = targetInst ? ReactDOMComponentTree.getNodeFromInstance(targetInst) : window; + + var getTargetInstFunc, handleEventFunc; + if (shouldUseChangeEvent(targetNode)) { + if (doesChangeEventBubble) { + getTargetInstFunc = getTargetInstForChangeEvent; + } else { + handleEventFunc = handleEventsForChangeEventIE8; + } + } else if (isTextInputElement(targetNode)) { + if (isInputEventSupported) { + getTargetInstFunc = getTargetInstForInputOrChangeEvent; + } else { + getTargetInstFunc = getTargetInstForInputEventPolyfill; + handleEventFunc = handleEventsForInputEventPolyfill; + } + } else if (shouldUseClickEvent(targetNode)) { + getTargetInstFunc = getTargetInstForClickEvent; + } + + if (getTargetInstFunc) { + var inst = getTargetInstFunc(topLevelType, targetInst, nativeEvent); + if (inst) { + var event = createAndAccumulateChangeEvent(inst, nativeEvent, nativeEventTarget); + return event; + } + } + + if (handleEventFunc) { + handleEventFunc(topLevelType, targetNode, targetInst); + } + + // When blurring, set the value attribute for number inputs + if (topLevelType === 'topBlur') { + handleControlledInputBlur(targetInst, targetNode); + } + } +}; + +module.exports = ChangeEventPlugin; + +/***/ }), +/* 135 */ +/***/ (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 ReactOwner = __webpack_require__(136); + +var ReactRef = {}; + +function attachRef(ref, component, owner) { + if (typeof ref === 'function') { + ref(component.getPublicInstance()); + } else { + // Legacy ref + ReactOwner.addComponentAsRefTo(component, ref, owner); + } +} + +function detachRef(ref, component, owner) { + if (typeof ref === 'function') { + ref(null); + } else { + // Legacy ref + ReactOwner.removeComponentAsRefFrom(component, ref, owner); + } +} + +ReactRef.attachRefs = function (instance, element) { + if (element === null || typeof element !== 'object') { + return; + } + var ref = element.ref; + if (ref != null) { + attachRef(ref, instance, element._owner); + } +}; + +ReactRef.shouldUpdateRefs = function (prevElement, nextElement) { + // If either the owner or a `ref` has changed, make sure the newest owner + // has stored a reference to `this`, and the previous owner (if different) + // has forgotten the reference to `this`. We use the element instead + // of the public this.props because the post processing cannot determine + // a ref. The ref conceptually lives on the element. + + // TODO: Should this even be possible? The owner cannot change because + // it's forbidden by shouldUpdateReactComponent. The ref can change + // if you swap the keys of but not the refs. Reconsider where this check + // is made. It probably belongs where the key checking and + // instantiateReactComponent is done. + + var prevRef = null; + var prevOwner = null; + if (prevElement !== null && typeof prevElement === 'object') { + prevRef = prevElement.ref; + prevOwner = prevElement._owner; + } + + var nextRef = null; + var nextOwner = null; + if (nextElement !== null && typeof nextElement === 'object') { + nextRef = nextElement.ref; + nextOwner = nextElement._owner; + } + + return prevRef !== nextRef || + // If owner changes but we have an unchanged function ref, don't update refs + typeof nextRef === 'string' && nextOwner !== prevOwner; +}; + +ReactRef.detachRefs = function (instance, element) { + if (element === null || typeof element !== 'object') { + return; + } + var ref = element.ref; + if (ref != null) { + detachRef(ref, instance, element._owner); + } +}; + +module.exports = ReactRef; + +/***/ }), +/* 136 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(process) {/** + * 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__(4); + +var invariant = __webpack_require__(1); + +/** + * @param {?object} object + * @return {boolean} True if `object` is a valid owner. + * @final + */ +function isValidOwner(object) { + return !!(object && typeof object.attachRef === 'function' && typeof object.detachRef === 'function'); +} + +/** + * ReactOwners are capable of storing references to owned components. + * + * All components are capable of //being// referenced by owner components, but + * only ReactOwner components are capable of //referencing// owned components. + * The named reference is known as a "ref". + * + * Refs are available when mounted and updated during reconciliation. + * + * var MyComponent = React.createClass({ + * render: function() { + * return ( + * <div onClick={this.handleClick}> + * <CustomComponent ref="custom" /> + * </div> + * ); + * }, + * handleClick: function() { + * this.refs.custom.handleClick(); + * }, + * componentDidMount: function() { + * this.refs.custom.initialize(); + * } + * }); + * + * Refs should rarely be used. When refs are used, they should only be done to + * control data that is not handled by React's data flow. + * + * @class ReactOwner + */ +var ReactOwner = { + /** + * Adds a component by ref to an owner component. + * + * @param {ReactComponent} component Component to reference. + * @param {string} ref Name by which to refer to the component. + * @param {ReactOwner} owner Component on which to record the ref. + * @final + * @internal + */ + addComponentAsRefTo: function (component, ref, owner) { + !isValidOwner(owner) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'addComponentAsRefTo(...): Only a ReactOwner can have refs. You might be adding a ref to a component that was not created inside a component\'s `render` method, or you have multiple copies of React loaded (details: https://fb.me/react-refs-must-have-owner).') : _prodInvariant('119') : void 0; + owner.attachRef(ref, component); + }, + + /** + * Removes a component by ref from an owner component. + * + * @param {ReactComponent} component Component to dereference. + * @param {string} ref Name of the ref to remove. + * @param {ReactOwner} owner Component on which the ref is recorded. + * @final + * @internal + */ + removeComponentAsRefFrom: function (component, ref, owner) { + !isValidOwner(owner) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'removeComponentAsRefFrom(...): Only a ReactOwner can have refs. You might be removing a ref to a component that was not created inside a component\'s `render` method, or you have multiple copies of React loaded (details: https://fb.me/react-refs-must-have-owner).') : _prodInvariant('120') : void 0; + var ownerPublicInstance = owner.getPublicInstance(); + // Check that `component`'s owner is still alive and that `component` is still the current ref + // because we do not want to detach the ref if another component stole it. + if (ownerPublicInstance && ownerPublicInstance.refs[ref] === component.getPublicInstance()) { + owner.detachRef(ref); + } + } +}; + +module.exports = ReactOwner; +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) + +/***/ }), +/* 137 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(process) {/** + * 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 ReactInvalidSetStateWarningHook = __webpack_require__(138); +var ReactHostOperationHistoryHook = __webpack_require__(139); +var ReactComponentTreeHook = __webpack_require__(11); +var ExecutionEnvironment = __webpack_require__(9); + +var performanceNow = __webpack_require__(140); +var warning = __webpack_require__(3); + +var hooks = []; +var didHookThrowForEvent = {}; + +function callHook(event, fn, context, arg1, arg2, arg3, arg4, arg5) { + try { + fn.call(context, arg1, arg2, arg3, arg4, arg5); + } catch (e) { + process.env.NODE_ENV !== 'production' ? warning(didHookThrowForEvent[event], 'Exception thrown by hook while handling %s: %s', event, e + '\n' + e.stack) : void 0; + didHookThrowForEvent[event] = true; + } +} + +function emitEvent(event, arg1, arg2, arg3, arg4, arg5) { + for (var i = 0; i < hooks.length; i++) { + var hook = hooks[i]; + var fn = hook[event]; + if (fn) { + callHook(event, fn, hook, arg1, arg2, arg3, arg4, arg5); + } + } +} + +var isProfiling = false; +var flushHistory = []; +var lifeCycleTimerStack = []; +var currentFlushNesting = 0; +var currentFlushMeasurements = []; +var currentFlushStartTime = 0; +var currentTimerDebugID = null; +var currentTimerStartTime = 0; +var currentTimerNestedFlushDuration = 0; +var currentTimerType = null; + +var lifeCycleTimerHasWarned = false; + +function clearHistory() { + ReactComponentTreeHook.purgeUnmountedComponents(); + ReactHostOperationHistoryHook.clearHistory(); +} + +function getTreeSnapshot(registeredIDs) { + return registeredIDs.reduce(function (tree, id) { + var ownerID = ReactComponentTreeHook.getOwnerID(id); + var parentID = ReactComponentTreeHook.getParentID(id); + tree[id] = { + displayName: ReactComponentTreeHook.getDisplayName(id), + text: ReactComponentTreeHook.getText(id), + updateCount: ReactComponentTreeHook.getUpdateCount(id), + childIDs: ReactComponentTreeHook.getChildIDs(id), + // Text nodes don't have owners but this is close enough. + ownerID: ownerID || parentID && ReactComponentTreeHook.getOwnerID(parentID) || 0, + parentID: parentID + }; + return tree; + }, {}); +} + +function resetMeasurements() { + var previousStartTime = currentFlushStartTime; + var previousMeasurements = currentFlushMeasurements; + var previousOperations = ReactHostOperationHistoryHook.getHistory(); + + if (currentFlushNesting === 0) { + currentFlushStartTime = 0; + currentFlushMeasurements = []; + clearHistory(); + return; + } + + if (previousMeasurements.length || previousOperations.length) { + var registeredIDs = ReactComponentTreeHook.getRegisteredIDs(); + flushHistory.push({ + duration: performanceNow() - previousStartTime, + measurements: previousMeasurements || [], + operations: previousOperations || [], + treeSnapshot: getTreeSnapshot(registeredIDs) + }); + } + + clearHistory(); + currentFlushStartTime = performanceNow(); + currentFlushMeasurements = []; +} + +function checkDebugID(debugID) { + var allowRoot = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; + + if (allowRoot && debugID === 0) { + return; + } + if (!debugID) { + process.env.NODE_ENV !== 'production' ? warning(false, 'ReactDebugTool: debugID may not be empty.') : void 0; + } +} + +function beginLifeCycleTimer(debugID, timerType) { + if (currentFlushNesting === 0) { + return; + } + if (currentTimerType && !lifeCycleTimerHasWarned) { + process.env.NODE_ENV !== 'production' ? warning(false, 'There is an internal error in the React performance measurement code. ' + 'Did not expect %s timer to start while %s timer is still in ' + 'progress for %s instance.', timerType, currentTimerType || 'no', debugID === currentTimerDebugID ? 'the same' : 'another') : void 0; + lifeCycleTimerHasWarned = true; + } + currentTimerStartTime = performanceNow(); + currentTimerNestedFlushDuration = 0; + currentTimerDebugID = debugID; + currentTimerType = timerType; +} + +function endLifeCycleTimer(debugID, timerType) { + if (currentFlushNesting === 0) { + return; + } + if (currentTimerType !== timerType && !lifeCycleTimerHasWarned) { + process.env.NODE_ENV !== 'production' ? warning(false, 'There is an internal error in the React performance measurement code. ' + 'We did not expect %s timer to stop while %s timer is still in ' + 'progress for %s instance. Please report this as a bug in React.', timerType, currentTimerType || 'no', debugID === currentTimerDebugID ? 'the same' : 'another') : void 0; + lifeCycleTimerHasWarned = true; + } + if (isProfiling) { + currentFlushMeasurements.push({ + timerType: timerType, + instanceID: debugID, + duration: performanceNow() - currentTimerStartTime - currentTimerNestedFlushDuration + }); + } + currentTimerStartTime = 0; + currentTimerNestedFlushDuration = 0; + currentTimerDebugID = null; + currentTimerType = null; +} + +function pauseCurrentLifeCycleTimer() { + var currentTimer = { + startTime: currentTimerStartTime, + nestedFlushStartTime: performanceNow(), + debugID: currentTimerDebugID, + timerType: currentTimerType + }; + lifeCycleTimerStack.push(currentTimer); + currentTimerStartTime = 0; + currentTimerNestedFlushDuration = 0; + currentTimerDebugID = null; + currentTimerType = null; +} + +function resumeCurrentLifeCycleTimer() { + var _lifeCycleTimerStack$ = lifeCycleTimerStack.pop(), + startTime = _lifeCycleTimerStack$.startTime, + nestedFlushStartTime = _lifeCycleTimerStack$.nestedFlushStartTime, + debugID = _lifeCycleTimerStack$.debugID, + timerType = _lifeCycleTimerStack$.timerType; + + var nestedFlushDuration = performanceNow() - nestedFlushStartTime; + currentTimerStartTime = startTime; + currentTimerNestedFlushDuration += nestedFlushDuration; + currentTimerDebugID = debugID; + currentTimerType = timerType; +} + +var lastMarkTimeStamp = 0; +var canUsePerformanceMeasure = typeof performance !== 'undefined' && typeof performance.mark === 'function' && typeof performance.clearMarks === 'function' && typeof performance.measure === 'function' && typeof performance.clearMeasures === 'function'; + +function shouldMark(debugID) { + if (!isProfiling || !canUsePerformanceMeasure) { + return false; + } + var element = ReactComponentTreeHook.getElement(debugID); + if (element == null || typeof element !== 'object') { + return false; + } + var isHostElement = typeof element.type === 'string'; + if (isHostElement) { + return false; + } + return true; +} + +function markBegin(debugID, markType) { + if (!shouldMark(debugID)) { + return; + } + + var markName = debugID + '::' + markType; + lastMarkTimeStamp = performanceNow(); + performance.mark(markName); +} + +function markEnd(debugID, markType) { + if (!shouldMark(debugID)) { + return; + } + + var markName = debugID + '::' + markType; + var displayName = ReactComponentTreeHook.getDisplayName(debugID) || 'Unknown'; + + // Chrome has an issue of dropping markers recorded too fast: + // https://bugs.chromium.org/p/chromium/issues/detail?id=640652 + // To work around this, we will not report very small measurements. + // I determined the magic number by tweaking it back and forth. + // 0.05ms was enough to prevent the issue, but I set it to 0.1ms to be safe. + // When the bug is fixed, we can `measure()` unconditionally if we want to. + var timeStamp = performanceNow(); + if (timeStamp - lastMarkTimeStamp > 0.1) { + var measurementName = displayName + ' [' + markType + ']'; + performance.measure(measurementName, markName); + } + + performance.clearMarks(markName); + if (measurementName) { + performance.clearMeasures(measurementName); + } +} + +var ReactDebugTool = { + addHook: function (hook) { + hooks.push(hook); + }, + removeHook: function (hook) { + for (var i = 0; i < hooks.length; i++) { + if (hooks[i] === hook) { + hooks.splice(i, 1); + i--; + } + } + }, + isProfiling: function () { + return isProfiling; + }, + beginProfiling: function () { + if (isProfiling) { + return; + } + + isProfiling = true; + flushHistory.length = 0; + resetMeasurements(); + ReactDebugTool.addHook(ReactHostOperationHistoryHook); + }, + endProfiling: function () { + if (!isProfiling) { + return; + } + + isProfiling = false; + resetMeasurements(); + ReactDebugTool.removeHook(ReactHostOperationHistoryHook); + }, + getFlushHistory: function () { + return flushHistory; + }, + onBeginFlush: function () { + currentFlushNesting++; + resetMeasurements(); + pauseCurrentLifeCycleTimer(); + emitEvent('onBeginFlush'); + }, + onEndFlush: function () { + resetMeasurements(); + currentFlushNesting--; + resumeCurrentLifeCycleTimer(); + emitEvent('onEndFlush'); + }, + onBeginLifeCycleTimer: function (debugID, timerType) { + checkDebugID(debugID); + emitEvent('onBeginLifeCycleTimer', debugID, timerType); + markBegin(debugID, timerType); + beginLifeCycleTimer(debugID, timerType); + }, + onEndLifeCycleTimer: function (debugID, timerType) { + checkDebugID(debugID); + endLifeCycleTimer(debugID, timerType); + markEnd(debugID, timerType); + emitEvent('onEndLifeCycleTimer', debugID, timerType); + }, + onBeginProcessingChildContext: function () { + emitEvent('onBeginProcessingChildContext'); + }, + onEndProcessingChildContext: function () { + emitEvent('onEndProcessingChildContext'); + }, + onHostOperation: function (operation) { + checkDebugID(operation.instanceID); + emitEvent('onHostOperation', operation); + }, + onSetState: function () { + emitEvent('onSetState'); + }, + onSetChildren: function (debugID, childDebugIDs) { + checkDebugID(debugID); + childDebugIDs.forEach(checkDebugID); + emitEvent('onSetChildren', debugID, childDebugIDs); + }, + onBeforeMountComponent: function (debugID, element, parentDebugID) { + checkDebugID(debugID); + checkDebugID(parentDebugID, true); + emitEvent('onBeforeMountComponent', debugID, element, parentDebugID); + markBegin(debugID, 'mount'); + }, + onMountComponent: function (debugID) { + checkDebugID(debugID); + markEnd(debugID, 'mount'); + emitEvent('onMountComponent', debugID); + }, + onBeforeUpdateComponent: function (debugID, element) { + checkDebugID(debugID); + emitEvent('onBeforeUpdateComponent', debugID, element); + markBegin(debugID, 'update'); + }, + onUpdateComponent: function (debugID) { + checkDebugID(debugID); + markEnd(debugID, 'update'); + emitEvent('onUpdateComponent', debugID); + }, + onBeforeUnmountComponent: function (debugID) { + checkDebugID(debugID); + emitEvent('onBeforeUnmountComponent', debugID); + markBegin(debugID, 'unmount'); + }, + onUnmountComponent: function (debugID) { + checkDebugID(debugID); + markEnd(debugID, 'unmount'); + emitEvent('onUnmountComponent', debugID); + }, + onTestEvent: function () { + emitEvent('onTestEvent'); + } +}; + +// TODO remove these when RN/www gets updated +ReactDebugTool.addDevtool = ReactDebugTool.addHook; +ReactDebugTool.removeDevtool = ReactDebugTool.removeHook; + +ReactDebugTool.addHook(ReactInvalidSetStateWarningHook); +ReactDebugTool.addHook(ReactComponentTreeHook); +var url = ExecutionEnvironment.canUseDOM && window.location.href || ''; +if (/[?&]react_perf\b/.test(url)) { + ReactDebugTool.beginProfiling(); +} + +module.exports = ReactDebugTool; +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) + +/***/ }), +/* 138 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(process) {/** + * 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 warning = __webpack_require__(3); + +if (process.env.NODE_ENV !== 'production') { + var processingChildContext = false; + + var warnInvalidSetState = function () { + process.env.NODE_ENV !== 'production' ? warning(!processingChildContext, 'setState(...): Cannot call setState() inside getChildContext()') : void 0; + }; +} + +var ReactInvalidSetStateWarningHook = { + onBeginProcessingChildContext: function () { + processingChildContext = true; + }, + onEndProcessingChildContext: function () { + processingChildContext = false; + }, + onSetState: function () { + warnInvalidSetState(); + } +}; + +module.exports = ReactInvalidSetStateWarningHook; +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) + +/***/ }), +/* 139 */ +/***/ (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 history = []; + +var ReactHostOperationHistoryHook = { + onHostOperation: function (operation) { + history.push(operation); + }, + clearHistory: function () { + if (ReactHostOperationHistoryHook._preventClearing) { + // Should only be used for tests. + return; + } + + history = []; + }, + getHistory: function () { + return history; + } +}; + +module.exports = ReactHostOperationHistoryHook; + +/***/ }), +/* 140 */ +/***/ (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. + * + * @typechecks + */ + +var performance = __webpack_require__(141); + +var performanceNow; + +/** + * Detect if we can use `window.performance.now()` and gracefully fallback to + * `Date.now()` if it doesn't exist. We need to support Firefox < 15 for now + * because of Facebook's testing infrastructure. + */ +if (performance.now) { + performanceNow = function performanceNow() { + return performance.now(); + }; +} else { + performanceNow = function performanceNow() { + return Date.now(); + }; +} + +module.exports = performanceNow; + +/***/ }), +/* 141 */ +/***/ (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. + * + * @typechecks + */ + + + +var ExecutionEnvironment = __webpack_require__(9); + +var performance; + +if (ExecutionEnvironment.canUseDOM) { + performance = window.performance || window.msPerformance || window.webkitPerformance; +} + +module.exports = performance || {}; + +/***/ }), +/* 142 */ +/***/ (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. + * + */ + + + +/** + * Module that is injectable into `EventPluginHub`, that specifies a + * deterministic ordering of `EventPlugin`s. A convenient way to reason about + * plugins, without having to package every one of them. This is better than + * having plugins be ordered in the same order that they are injected because + * that ordering would be influenced by the packaging order. + * `ResponderEventPlugin` must occur before `SimpleEventPlugin` so that + * preventing default on events is convenient in `SimpleEventPlugin` handlers. + */ + +var DefaultEventPluginOrder = ['ResponderEventPlugin', 'SimpleEventPlugin', 'TapEventPlugin', 'EnterLeaveEventPlugin', 'ChangeEventPlugin', 'SelectEventPlugin', 'BeforeInputEventPlugin']; + +module.exports = DefaultEventPluginOrder; + +/***/ }), +/* 143 */ +/***/ (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 EventPropagators = __webpack_require__(26); +var ReactDOMComponentTree = __webpack_require__(7); +var SyntheticMouseEvent = __webpack_require__(35); + +var eventTypes = { + mouseEnter: { + registrationName: 'onMouseEnter', + dependencies: ['topMouseOut', 'topMouseOver'] + }, + mouseLeave: { + registrationName: 'onMouseLeave', + dependencies: ['topMouseOut', 'topMouseOver'] + } +}; + +var EnterLeaveEventPlugin = { + eventTypes: eventTypes, + + /** + * For almost every interaction we care about, there will be both a top-level + * `mouseover` and `mouseout` event that occurs. Only use `mouseout` so that + * we do not extract duplicate events. However, moving the mouse into the + * browser from outside will not fire a `mouseout` event. In this case, we use + * the `mouseover` top-level event. + */ + extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget) { + if (topLevelType === 'topMouseOver' && (nativeEvent.relatedTarget || nativeEvent.fromElement)) { + return null; + } + if (topLevelType !== 'topMouseOut' && topLevelType !== 'topMouseOver') { + // Must not be a mouse in or mouse out - ignoring. + return null; + } + + var win; + if (nativeEventTarget.window === nativeEventTarget) { + // `nativeEventTarget` is probably a window object. + win = nativeEventTarget; + } else { + // TODO: Figure out why `ownerDocument` is sometimes undefined in IE8. + var doc = nativeEventTarget.ownerDocument; + if (doc) { + win = doc.defaultView || doc.parentWindow; + } else { + win = window; + } + } + + var from; + var to; + if (topLevelType === 'topMouseOut') { + from = targetInst; + var related = nativeEvent.relatedTarget || nativeEvent.toElement; + to = related ? ReactDOMComponentTree.getClosestInstanceFromNode(related) : null; + } else { + // Moving to a node from outside the window. + from = null; + to = targetInst; + } + + if (from === to) { + // Nothing pertains to our managed components. + return null; + } + + var fromNode = from == null ? win : ReactDOMComponentTree.getNodeFromInstance(from); + var toNode = to == null ? win : ReactDOMComponentTree.getNodeFromInstance(to); + + var leave = SyntheticMouseEvent.getPooled(eventTypes.mouseLeave, from, nativeEvent, nativeEventTarget); + leave.type = 'mouseleave'; + leave.target = fromNode; + leave.relatedTarget = toNode; + + var enter = SyntheticMouseEvent.getPooled(eventTypes.mouseEnter, to, nativeEvent, nativeEventTarget); + enter.type = 'mouseenter'; + enter.target = toNode; + enter.relatedTarget = fromNode; + + EventPropagators.accumulateEnterLeaveDispatches(leave, enter, from, to); + + return [leave, enter]; + } +}; + +module.exports = EnterLeaveEventPlugin; + +/***/ }), +/* 144 */ +/***/ (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 DOMProperty = __webpack_require__(17); + +var MUST_USE_PROPERTY = DOMProperty.injection.MUST_USE_PROPERTY; +var HAS_BOOLEAN_VALUE = DOMProperty.injection.HAS_BOOLEAN_VALUE; +var HAS_NUMERIC_VALUE = DOMProperty.injection.HAS_NUMERIC_VALUE; +var HAS_POSITIVE_NUMERIC_VALUE = DOMProperty.injection.HAS_POSITIVE_NUMERIC_VALUE; +var HAS_OVERLOADED_BOOLEAN_VALUE = DOMProperty.injection.HAS_OVERLOADED_BOOLEAN_VALUE; + +var HTMLDOMPropertyConfig = { + isCustomAttribute: RegExp.prototype.test.bind(new RegExp('^(data|aria)-[' + DOMProperty.ATTRIBUTE_NAME_CHAR + ']*$')), + Properties: { + /** + * Standard Properties + */ + accept: 0, + acceptCharset: 0, + accessKey: 0, + action: 0, + allowFullScreen: HAS_BOOLEAN_VALUE, + allowTransparency: 0, + alt: 0, + // specifies target context for links with `preload` type + as: 0, + async: HAS_BOOLEAN_VALUE, + autoComplete: 0, + // autoFocus is polyfilled/normalized by AutoFocusUtils + // autoFocus: HAS_BOOLEAN_VALUE, + autoPlay: HAS_BOOLEAN_VALUE, + capture: HAS_BOOLEAN_VALUE, + cellPadding: 0, + cellSpacing: 0, + charSet: 0, + challenge: 0, + checked: MUST_USE_PROPERTY | HAS_BOOLEAN_VALUE, + cite: 0, + classID: 0, + className: 0, + cols: HAS_POSITIVE_NUMERIC_VALUE, + colSpan: 0, + content: 0, + contentEditable: 0, + contextMenu: 0, + controls: HAS_BOOLEAN_VALUE, + controlsList: 0, + coords: 0, + crossOrigin: 0, + data: 0, // For `<object />` acts as `src`. + dateTime: 0, + 'default': HAS_BOOLEAN_VALUE, + defer: HAS_BOOLEAN_VALUE, + dir: 0, + disabled: HAS_BOOLEAN_VALUE, + download: HAS_OVERLOADED_BOOLEAN_VALUE, + draggable: 0, + encType: 0, + form: 0, + formAction: 0, + formEncType: 0, + formMethod: 0, + formNoValidate: HAS_BOOLEAN_VALUE, + formTarget: 0, + frameBorder: 0, + headers: 0, + height: 0, + hidden: HAS_BOOLEAN_VALUE, + high: 0, + href: 0, + hrefLang: 0, + htmlFor: 0, + httpEquiv: 0, + icon: 0, + id: 0, + inputMode: 0, + integrity: 0, + is: 0, + keyParams: 0, + keyType: 0, + kind: 0, + label: 0, + lang: 0, + list: 0, + loop: HAS_BOOLEAN_VALUE, + low: 0, + manifest: 0, + marginHeight: 0, + marginWidth: 0, + max: 0, + maxLength: 0, + media: 0, + mediaGroup: 0, + method: 0, + min: 0, + minLength: 0, + // Caution; `option.selected` is not updated if `select.multiple` is + // disabled with `removeAttribute`. + multiple: MUST_USE_PROPERTY | HAS_BOOLEAN_VALUE, + muted: MUST_USE_PROPERTY | HAS_BOOLEAN_VALUE, + name: 0, + nonce: 0, + noValidate: HAS_BOOLEAN_VALUE, + open: HAS_BOOLEAN_VALUE, + optimum: 0, + pattern: 0, + placeholder: 0, + playsInline: HAS_BOOLEAN_VALUE, + poster: 0, + preload: 0, + profile: 0, + radioGroup: 0, + readOnly: HAS_BOOLEAN_VALUE, + referrerPolicy: 0, + rel: 0, + required: HAS_BOOLEAN_VALUE, + reversed: HAS_BOOLEAN_VALUE, + role: 0, + rows: HAS_POSITIVE_NUMERIC_VALUE, + rowSpan: HAS_NUMERIC_VALUE, + sandbox: 0, + scope: 0, + scoped: HAS_BOOLEAN_VALUE, + scrolling: 0, + seamless: HAS_BOOLEAN_VALUE, + selected: MUST_USE_PROPERTY | HAS_BOOLEAN_VALUE, + shape: 0, + size: HAS_POSITIVE_NUMERIC_VALUE, + sizes: 0, + span: HAS_POSITIVE_NUMERIC_VALUE, + spellCheck: 0, + src: 0, + srcDoc: 0, + srcLang: 0, + srcSet: 0, + start: HAS_NUMERIC_VALUE, + step: 0, + style: 0, + summary: 0, + tabIndex: 0, + target: 0, + title: 0, + // Setting .type throws on non-<input> tags + type: 0, + useMap: 0, + value: 0, + width: 0, + wmode: 0, + wrap: 0, + + /** + * RDFa Properties + */ + about: 0, + datatype: 0, + inlist: 0, + prefix: 0, + // property is also supported for OpenGraph in meta tags. + property: 0, + resource: 0, + 'typeof': 0, + vocab: 0, + + /** + * Non-standard Properties + */ + // autoCapitalize and autoCorrect are supported in Mobile Safari for + // keyboard hints. + autoCapitalize: 0, + autoCorrect: 0, + // autoSave allows WebKit/Blink to persist values of input fields on page reloads + autoSave: 0, + // color is for Safari mask-icon link + color: 0, + // itemProp, itemScope, itemType are for + // Microdata support. See http://schema.org/docs/gs.html + itemProp: 0, + itemScope: HAS_BOOLEAN_VALUE, + itemType: 0, + // itemID and itemRef are for Microdata support as well but + // only specified in the WHATWG spec document. See + // https://html.spec.whatwg.org/multipage/microdata.html#microdata-dom-api + itemID: 0, + itemRef: 0, + // results show looking glass icon and recent searches on input + // search fields in WebKit/Blink + results: 0, + // IE-only attribute that specifies security restrictions on an iframe + // as an alternative to the sandbox attribute on IE<10 + security: 0, + // IE-only attribute that controls focus behavior + unselectable: 0 + }, + DOMAttributeNames: { + acceptCharset: 'accept-charset', + className: 'class', + htmlFor: 'for', + httpEquiv: 'http-equiv' + }, + DOMPropertyNames: {}, + DOMMutationMethods: { + value: function (node, value) { + if (value == null) { + return node.removeAttribute('value'); + } + + // Number inputs get special treatment due to some edge cases in + // Chrome. Let everything else assign the value attribute as normal. + // https://github.com/facebook/react/issues/7253#issuecomment-236074326 + if (node.type !== 'number' || node.hasAttribute('value') === false) { + node.setAttribute('value', '' + value); + } else if (node.validity && !node.validity.badInput && node.ownerDocument.activeElement !== node) { + // Don't assign an attribute if validation reports bad + // input. Chrome will clear the value. Additionally, don't + // operate on inputs that have focus, otherwise Chrome might + // strip off trailing decimal places and cause the user's + // cursor position to jump to the beginning of the input. + // + // In ReactDOMInput, we have an onBlur event that will trigger + // this function again when focus is lost. + node.setAttribute('value', '' + value); + } + } + } +}; + +module.exports = HTMLDOMPropertyConfig; + +/***/ }), +/* 145 */ +/***/ (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 DOMChildrenOperations = __webpack_require__(47); +var ReactDOMIDOperations = __webpack_require__(150); + +/** + * Abstracts away all functionality of the reconciler that requires knowledge of + * the browser context. TODO: These callers should be refactored to avoid the + * need for this injection. + */ +var ReactComponentBrowserEnvironment = { + processChildrenUpdates: ReactDOMIDOperations.dangerouslyProcessChildrenUpdates, + + replaceNodeWithMarkup: DOMChildrenOperations.dangerouslyReplaceNodeWithMarkup +}; + +module.exports = ReactComponentBrowserEnvironment; + +/***/ }), +/* 146 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(process) {/** + * 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__(4); + +var DOMLazyTree = __webpack_require__(24); +var ExecutionEnvironment = __webpack_require__(9); + +var createNodesFromMarkup = __webpack_require__(147); +var emptyFunction = __webpack_require__(12); +var invariant = __webpack_require__(1); + +var Danger = { + /** + * Replaces a node with a string of markup at its current position within its + * parent. The markup must render into a single root node. + * + * @param {DOMElement} oldChild Child node to replace. + * @param {string} markup Markup to render in place of the child node. + * @internal + */ + dangerouslyReplaceNodeWithMarkup: function (oldChild, markup) { + !ExecutionEnvironment.canUseDOM ? process.env.NODE_ENV !== 'production' ? invariant(false, 'dangerouslyReplaceNodeWithMarkup(...): Cannot render markup in a worker thread. Make sure `window` and `document` are available globally before requiring React when unit testing or use ReactDOMServer.renderToString() for server rendering.') : _prodInvariant('56') : void 0; + !markup ? process.env.NODE_ENV !== 'production' ? invariant(false, 'dangerouslyReplaceNodeWithMarkup(...): Missing markup.') : _prodInvariant('57') : void 0; + !(oldChild.nodeName !== 'HTML') ? process.env.NODE_ENV !== 'production' ? invariant(false, 'dangerouslyReplaceNodeWithMarkup(...): Cannot replace markup of the <html> node. This is because browser quirks make this unreliable and/or slow. If you want to render to the root you must use server rendering. See ReactDOMServer.renderToString().') : _prodInvariant('58') : void 0; + + if (typeof markup === 'string') { + var newChild = createNodesFromMarkup(markup, emptyFunction)[0]; + oldChild.parentNode.replaceChild(newChild, oldChild); + } else { + DOMLazyTree.replaceChildWithTree(oldChild, markup); + } + } +}; + +module.exports = Danger; +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) + +/***/ }), +/* 147 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(process) { + +/** + * 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. + * + * @typechecks + */ + +/*eslint-disable fb-www/unsafe-html*/ + +var ExecutionEnvironment = __webpack_require__(9); + +var createArrayFromMixed = __webpack_require__(148); +var getMarkupWrap = __webpack_require__(149); +var invariant = __webpack_require__(1); + +/** + * Dummy container used to render all markup. + */ +var dummyNode = ExecutionEnvironment.canUseDOM ? document.createElement('div') : null; + +/** + * Pattern used by `getNodeName`. + */ +var nodeNamePattern = /^\s*<(\w+)/; + +/** + * Extracts the `nodeName` of the first element in a string of markup. + * + * @param {string} markup String of markup. + * @return {?string} Node name of the supplied markup. + */ +function getNodeName(markup) { + var nodeNameMatch = markup.match(nodeNamePattern); + return nodeNameMatch && nodeNameMatch[1].toLowerCase(); +} + +/** + * Creates an array containing the nodes rendered from the supplied markup. The + * optionally supplied `handleScript` function will be invoked once for each + * <script> element that is rendered. If no `handleScript` function is supplied, + * an exception is thrown if any <script> elements are rendered. + * + * @param {string} markup A string of valid HTML markup. + * @param {?function} handleScript Invoked once for each rendered <script>. + * @return {array<DOMElement|DOMTextNode>} An array of rendered nodes. + */ +function createNodesFromMarkup(markup, handleScript) { + var node = dummyNode; + !!!dummyNode ? process.env.NODE_ENV !== 'production' ? invariant(false, 'createNodesFromMarkup dummy not initialized') : invariant(false) : void 0; + var nodeName = getNodeName(markup); + + var wrap = nodeName && getMarkupWrap(nodeName); + if (wrap) { + node.innerHTML = wrap[1] + markup + wrap[2]; + + var wrapDepth = wrap[0]; + while (wrapDepth--) { + node = node.lastChild; + } + } else { + node.innerHTML = markup; + } + + var scripts = node.getElementsByTagName('script'); + if (scripts.length) { + !handleScript ? process.env.NODE_ENV !== 'production' ? invariant(false, 'createNodesFromMarkup(...): Unexpected <script> element rendered.') : invariant(false) : void 0; + createArrayFromMixed(scripts).forEach(handleScript); + } + + var nodes = Array.from(node.childNodes); + while (node.lastChild) { + node.removeChild(node.lastChild); + } + return nodes; +} + +module.exports = createNodesFromMarkup; +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) + +/***/ }), +/* 148 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(process) { + +/** + * 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. + * + * @typechecks + */ + +var invariant = __webpack_require__(1); + +/** + * Convert array-like objects to arrays. + * + * This API assumes the caller knows the contents of the data type. For less + * well defined inputs use createArrayFromMixed. + * + * @param {object|function|filelist} obj + * @return {array} + */ +function toArray(obj) { + var length = obj.length; + + // Some browsers builtin objects can report typeof 'function' (e.g. NodeList + // in old versions of Safari). + !(!Array.isArray(obj) && (typeof obj === 'object' || typeof obj === 'function')) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'toArray: Array-like object expected') : invariant(false) : void 0; + + !(typeof length === 'number') ? process.env.NODE_ENV !== 'production' ? invariant(false, 'toArray: Object needs a length property') : invariant(false) : void 0; + + !(length === 0 || length - 1 in obj) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'toArray: Object should have keys for indices') : invariant(false) : void 0; + + !(typeof obj.callee !== 'function') ? process.env.NODE_ENV !== 'production' ? invariant(false, 'toArray: Object can\'t be `arguments`. Use rest params ' + '(function(...args) {}) or Array.from() instead.') : invariant(false) : void 0; + + // Old IE doesn't give collections access to hasOwnProperty. Assume inputs + // without method will throw during the slice call and skip straight to the + // fallback. + if (obj.hasOwnProperty) { + try { + return Array.prototype.slice.call(obj); + } catch (e) { + // IE < 9 does not support Array#slice on collections objects + } + } + + // Fall back to copying key by key. This assumes all keys have a value, + // so will not preserve sparsely populated inputs. + var ret = Array(length); + for (var ii = 0; ii < length; ii++) { + ret[ii] = obj[ii]; + } + return ret; +} + +/** + * Perform a heuristic test to determine if an object is "array-like". + * + * A monk asked Joshu, a Zen master, "Has a dog Buddha nature?" + * Joshu replied: "Mu." + * + * This function determines if its argument has "array nature": it returns + * true if the argument is an actual array, an `arguments' object, or an + * HTMLCollection (e.g. node.childNodes or node.getElementsByTagName()). + * + * It will return false for other array-like objects like Filelist. + * + * @param {*} obj + * @return {boolean} + */ +function hasArrayNature(obj) { + return ( + // not null/false + !!obj && ( + // arrays are objects, NodeLists are functions in Safari + typeof obj == 'object' || typeof obj == 'function') && + // quacks like an array + 'length' in obj && + // not window + !('setInterval' in obj) && + // no DOM node should be considered an array-like + // a 'select' element has 'length' and 'item' properties on IE8 + typeof obj.nodeType != 'number' && ( + // a real array + Array.isArray(obj) || + // arguments + 'callee' in obj || + // HTMLCollection/NodeList + 'item' in obj) + ); +} + +/** + * Ensure that the argument is an array by wrapping it in an array if it is not. + * Creates a copy of the argument if it is already an array. + * + * This is mostly useful idiomatically: + * + * var createArrayFromMixed = require('createArrayFromMixed'); + * + * function takesOneOrMoreThings(things) { + * things = createArrayFromMixed(things); + * ... + * } + * + * This allows you to treat `things' as an array, but accept scalars in the API. + * + * If you need to convert an array-like object, like `arguments`, into an array + * use toArray instead. + * + * @param {*} obj + * @return {array} + */ +function createArrayFromMixed(obj) { + if (!hasArrayNature(obj)) { + return [obj]; + } else if (Array.isArray(obj)) { + return obj.slice(); + } else { + return toArray(obj); + } +} + +module.exports = createArrayFromMixed; +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) + +/***/ }), +/* 149 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(process) { + +/** + * 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. + * + */ + +/*eslint-disable fb-www/unsafe-html */ + +var ExecutionEnvironment = __webpack_require__(9); + +var invariant = __webpack_require__(1); + +/** + * Dummy container used to detect which wraps are necessary. + */ +var dummyNode = ExecutionEnvironment.canUseDOM ? document.createElement('div') : null; + +/** + * Some browsers cannot use `innerHTML` to render certain elements standalone, + * so we wrap them, render the wrapped nodes, then extract the desired node. + * + * In IE8, certain elements cannot render alone, so wrap all elements ('*'). + */ + +var shouldWrap = {}; + +var selectWrap = [1, '<select multiple="true">', '</select>']; +var tableWrap = [1, '<table>', '</table>']; +var trWrap = [3, '<table><tbody><tr>', '</tr></tbody></table>']; + +var svgWrap = [1, '<svg xmlns="http://www.w3.org/2000/svg">', '</svg>']; + +var markupWrap = { + '*': [1, '?<div>', '</div>'], + + 'area': [1, '<map>', '</map>'], + 'col': [2, '<table><tbody></tbody><colgroup>', '</colgroup></table>'], + 'legend': [1, '<fieldset>', '</fieldset>'], + 'param': [1, '<object>', '</object>'], + 'tr': [2, '<table><tbody>', '</tbody></table>'], + + 'optgroup': selectWrap, + 'option': selectWrap, + + 'caption': tableWrap, + 'colgroup': tableWrap, + 'tbody': tableWrap, + 'tfoot': tableWrap, + 'thead': tableWrap, + + 'td': trWrap, + 'th': trWrap +}; + +// Initialize the SVG elements since we know they'll always need to be wrapped +// consistently. If they are created inside a <div> they will be initialized in +// the wrong namespace (and will not display). +var svgElements = ['circle', 'clipPath', 'defs', 'ellipse', 'g', 'image', 'line', 'linearGradient', 'mask', 'path', 'pattern', 'polygon', 'polyline', 'radialGradient', 'rect', 'stop', 'text', 'tspan']; +svgElements.forEach(function (nodeName) { + markupWrap[nodeName] = svgWrap; + shouldWrap[nodeName] = true; +}); + +/** + * Gets the markup wrap configuration for the supplied `nodeName`. + * + * NOTE: This lazily detects which wraps are necessary for the current browser. + * + * @param {string} nodeName Lowercase `nodeName`. + * @return {?array} Markup wrap configuration, if applicable. + */ +function getMarkupWrap(nodeName) { + !!!dummyNode ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Markup wrapping node not initialized') : invariant(false) : void 0; + if (!markupWrap.hasOwnProperty(nodeName)) { + nodeName = '*'; + } + if (!shouldWrap.hasOwnProperty(nodeName)) { + if (nodeName === '*') { + dummyNode.innerHTML = '<link />'; + } else { + dummyNode.innerHTML = '<' + nodeName + '></' + nodeName + '>'; + } + shouldWrap[nodeName] = !dummyNode.firstChild; + } + return shouldWrap[nodeName] ? markupWrap[nodeName] : null; +} + +module.exports = getMarkupWrap; +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) + +/***/ }), +/* 150 */ +/***/ (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 DOMChildrenOperations = __webpack_require__(47); +var ReactDOMComponentTree = __webpack_require__(7); + +/** + * Operations used to process updates to DOM nodes. + */ +var ReactDOMIDOperations = { + /** + * Updates a component's children by processing a series of updates. + * + * @param {array<object>} updates List of update configurations. + * @internal + */ + dangerouslyProcessChildrenUpdates: function (parentInst, updates) { + var node = ReactDOMComponentTree.getNodeFromInstance(parentInst); + DOMChildrenOperations.processUpdates(node, updates); + } +}; + +module.exports = ReactDOMIDOperations; + +/***/ }), +/* 151 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(process) {/** + * 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. + * + */ + +/* global hasOwnProperty:true */ + + + +var _prodInvariant = __webpack_require__(4), + _assign = __webpack_require__(8); + +var AutoFocusUtils = __webpack_require__(152); +var CSSPropertyOperations = __webpack_require__(153); +var DOMLazyTree = __webpack_require__(24); +var DOMNamespaces = __webpack_require__(48); +var DOMProperty = __webpack_require__(17); +var DOMPropertyOperations = __webpack_require__(82); +var EventPluginHub = __webpack_require__(27); +var EventPluginRegistry = __webpack_require__(33); +var ReactBrowserEventEmitter = __webpack_require__(38); +var ReactDOMComponentFlags = __webpack_require__(70); +var ReactDOMComponentTree = __webpack_require__(7); +var ReactDOMInput = __webpack_require__(163); +var ReactDOMOption = __webpack_require__(164); +var ReactDOMSelect = __webpack_require__(84); +var ReactDOMTextarea = __webpack_require__(165); +var ReactInstrumentation = __webpack_require__(13); +var ReactMultiChild = __webpack_require__(166); +var ReactServerRenderingTransaction = __webpack_require__(175); + +var emptyFunction = __webpack_require__(12); +var escapeTextContentForBrowser = __webpack_require__(37); +var invariant = __webpack_require__(1); +var isEventSupported = __webpack_require__(45); +var shallowEqual = __webpack_require__(52); +var inputValueTracking = __webpack_require__(76); +var validateDOMNesting = __webpack_require__(56); +var warning = __webpack_require__(3); + +var Flags = ReactDOMComponentFlags; +var deleteListener = EventPluginHub.deleteListener; +var getNode = ReactDOMComponentTree.getNodeFromInstance; +var listenTo = ReactBrowserEventEmitter.listenTo; +var registrationNameModules = EventPluginRegistry.registrationNameModules; + +// For quickly matching children type, to test if can be treated as content. +var CONTENT_TYPES = { string: true, number: true }; + +var STYLE = 'style'; +var HTML = '__html'; +var RESERVED_PROPS = { + children: null, + dangerouslySetInnerHTML: null, + suppressContentEditableWarning: null +}; + +// Node type for document fragments (Node.DOCUMENT_FRAGMENT_NODE). +var DOC_FRAGMENT_TYPE = 11; + +function getDeclarationErrorAddendum(internalInstance) { + if (internalInstance) { + var owner = internalInstance._currentElement._owner || null; + if (owner) { + var name = owner.getName(); + if (name) { + return ' This DOM node was rendered by `' + name + '`.'; + } + } + } + return ''; +} + +function friendlyStringify(obj) { + if (typeof obj === 'object') { + if (Array.isArray(obj)) { + return '[' + obj.map(friendlyStringify).join(', ') + ']'; + } else { + var pairs = []; + for (var key in obj) { + if (Object.prototype.hasOwnProperty.call(obj, key)) { + var keyEscaped = /^[a-z$_][\w$_]*$/i.test(key) ? key : JSON.stringify(key); + pairs.push(keyEscaped + ': ' + friendlyStringify(obj[key])); + } + } + return '{' + pairs.join(', ') + '}'; + } + } else if (typeof obj === 'string') { + return JSON.stringify(obj); + } else if (typeof obj === 'function') { + return '[function object]'; + } + // Differs from JSON.stringify in that undefined because undefined and that + // inf and nan don't become null + return String(obj); +} + +var styleMutationWarning = {}; + +function checkAndWarnForMutatedStyle(style1, style2, component) { + if (style1 == null || style2 == null) { + return; + } + if (shallowEqual(style1, style2)) { + return; + } + + var componentName = component._tag; + var owner = component._currentElement._owner; + var ownerName; + if (owner) { + ownerName = owner.getName(); + } + + var hash = ownerName + '|' + componentName; + + if (styleMutationWarning.hasOwnProperty(hash)) { + return; + } + + styleMutationWarning[hash] = true; + + process.env.NODE_ENV !== 'production' ? warning(false, '`%s` was passed a style object that has previously been mutated. ' + 'Mutating `style` is deprecated. Consider cloning it beforehand. Check ' + 'the `render` %s. Previous style: %s. Mutated style: %s.', componentName, owner ? 'of `' + ownerName + '`' : 'using <' + componentName + '>', friendlyStringify(style1), friendlyStringify(style2)) : void 0; +} + +/** + * @param {object} component + * @param {?object} props + */ +function assertValidProps(component, props) { + if (!props) { + return; + } + // Note the use of `==` which checks for null or undefined. + if (voidElementTags[component._tag]) { + !(props.children == null && props.dangerouslySetInnerHTML == null) ? process.env.NODE_ENV !== 'production' ? invariant(false, '%s is a void element tag and must neither have `children` nor use `dangerouslySetInnerHTML`.%s', component._tag, component._currentElement._owner ? ' Check the render method of ' + component._currentElement._owner.getName() + '.' : '') : _prodInvariant('137', component._tag, component._currentElement._owner ? ' Check the render method of ' + component._currentElement._owner.getName() + '.' : '') : void 0; + } + if (props.dangerouslySetInnerHTML != null) { + !(props.children == null) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Can only set one of `children` or `props.dangerouslySetInnerHTML`.') : _prodInvariant('60') : void 0; + !(typeof props.dangerouslySetInnerHTML === 'object' && HTML in props.dangerouslySetInnerHTML) ? process.env.NODE_ENV !== 'production' ? invariant(false, '`props.dangerouslySetInnerHTML` must be in the form `{__html: ...}`. Please visit https://fb.me/react-invariant-dangerously-set-inner-html for more information.') : _prodInvariant('61') : void 0; + } + if (process.env.NODE_ENV !== 'production') { + process.env.NODE_ENV !== 'production' ? warning(props.innerHTML == null, 'Directly setting property `innerHTML` is not permitted. ' + 'For more information, lookup documentation on `dangerouslySetInnerHTML`.') : void 0; + process.env.NODE_ENV !== 'production' ? warning(props.suppressContentEditableWarning || !props.contentEditable || props.children == null, 'A component is `contentEditable` and contains `children` managed by ' + 'React. It is now your responsibility to guarantee that none of ' + 'those nodes are unexpectedly modified or duplicated. This is ' + 'probably not intentional.') : void 0; + process.env.NODE_ENV !== 'production' ? warning(props.onFocusIn == null && props.onFocusOut == null, 'React uses onFocus and onBlur instead of onFocusIn and onFocusOut. ' + 'All React events are normalized to bubble, so onFocusIn and onFocusOut ' + 'are not needed/supported by React.') : void 0; + } + !(props.style == null || typeof props.style === 'object') ? process.env.NODE_ENV !== 'production' ? invariant(false, 'The `style` prop expects a mapping from style properties to values, not a string. For example, style={{marginRight: spacing + \'em\'}} when using JSX.%s', getDeclarationErrorAddendum(component)) : _prodInvariant('62', getDeclarationErrorAddendum(component)) : void 0; +} + +function enqueuePutListener(inst, registrationName, listener, transaction) { + if (transaction instanceof ReactServerRenderingTransaction) { + return; + } + if (process.env.NODE_ENV !== 'production') { + // IE8 has no API for event capturing and the `onScroll` event doesn't + // bubble. + process.env.NODE_ENV !== 'production' ? warning(registrationName !== 'onScroll' || isEventSupported('scroll', true), "This browser doesn't support the `onScroll` event") : void 0; + } + var containerInfo = inst._hostContainerInfo; + var isDocumentFragment = containerInfo._node && containerInfo._node.nodeType === DOC_FRAGMENT_TYPE; + var doc = isDocumentFragment ? containerInfo._node : containerInfo._ownerDocument; + listenTo(registrationName, doc); + transaction.getReactMountReady().enqueue(putListener, { + inst: inst, + registrationName: registrationName, + listener: listener + }); +} + +function putListener() { + var listenerToPut = this; + EventPluginHub.putListener(listenerToPut.inst, listenerToPut.registrationName, listenerToPut.listener); +} + +function inputPostMount() { + var inst = this; + ReactDOMInput.postMountWrapper(inst); +} + +function textareaPostMount() { + var inst = this; + ReactDOMTextarea.postMountWrapper(inst); +} + +function optionPostMount() { + var inst = this; + ReactDOMOption.postMountWrapper(inst); +} + +var setAndValidateContentChildDev = emptyFunction; +if (process.env.NODE_ENV !== 'production') { + setAndValidateContentChildDev = function (content) { + var hasExistingContent = this._contentDebugID != null; + var debugID = this._debugID; + // This ID represents the inlined child that has no backing instance: + var contentDebugID = -debugID; + + if (content == null) { + if (hasExistingContent) { + ReactInstrumentation.debugTool.onUnmountComponent(this._contentDebugID); + } + this._contentDebugID = null; + return; + } + + validateDOMNesting(null, String(content), this, this._ancestorInfo); + this._contentDebugID = contentDebugID; + if (hasExistingContent) { + ReactInstrumentation.debugTool.onBeforeUpdateComponent(contentDebugID, content); + ReactInstrumentation.debugTool.onUpdateComponent(contentDebugID); + } else { + ReactInstrumentation.debugTool.onBeforeMountComponent(contentDebugID, content, debugID); + ReactInstrumentation.debugTool.onMountComponent(contentDebugID); + ReactInstrumentation.debugTool.onSetChildren(debugID, [contentDebugID]); + } + }; +} + +// There are so many media events, it makes sense to just +// maintain a list rather than create a `trapBubbledEvent` for each +var mediaEvents = { + topAbort: 'abort', + topCanPlay: 'canplay', + topCanPlayThrough: 'canplaythrough', + topDurationChange: 'durationchange', + topEmptied: 'emptied', + topEncrypted: 'encrypted', + topEnded: 'ended', + topError: 'error', + topLoadedData: 'loadeddata', + topLoadedMetadata: 'loadedmetadata', + topLoadStart: 'loadstart', + topPause: 'pause', + topPlay: 'play', + topPlaying: 'playing', + topProgress: 'progress', + topRateChange: 'ratechange', + topSeeked: 'seeked', + topSeeking: 'seeking', + topStalled: 'stalled', + topSuspend: 'suspend', + topTimeUpdate: 'timeupdate', + topVolumeChange: 'volumechange', + topWaiting: 'waiting' +}; + +function trackInputValue() { + inputValueTracking.track(this); +} + +function trapBubbledEventsLocal() { + var inst = this; + // If a component renders to null or if another component fatals and causes + // the state of the tree to be corrupted, `node` here can be null. + !inst._rootNodeID ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Must be mounted to trap events') : _prodInvariant('63') : void 0; + var node = getNode(inst); + !node ? process.env.NODE_ENV !== 'production' ? invariant(false, 'trapBubbledEvent(...): Requires node to be rendered.') : _prodInvariant('64') : void 0; + + switch (inst._tag) { + case 'iframe': + case 'object': + inst._wrapperState.listeners = [ReactBrowserEventEmitter.trapBubbledEvent('topLoad', 'load', node)]; + break; + case 'video': + case 'audio': + inst._wrapperState.listeners = []; + // Create listener for each media event + for (var event in mediaEvents) { + if (mediaEvents.hasOwnProperty(event)) { + inst._wrapperState.listeners.push(ReactBrowserEventEmitter.trapBubbledEvent(event, mediaEvents[event], node)); + } + } + break; + case 'source': + inst._wrapperState.listeners = [ReactBrowserEventEmitter.trapBubbledEvent('topError', 'error', node)]; + break; + case 'img': + inst._wrapperState.listeners = [ReactBrowserEventEmitter.trapBubbledEvent('topError', 'error', node), ReactBrowserEventEmitter.trapBubbledEvent('topLoad', 'load', node)]; + break; + case 'form': + inst._wrapperState.listeners = [ReactBrowserEventEmitter.trapBubbledEvent('topReset', 'reset', node), ReactBrowserEventEmitter.trapBubbledEvent('topSubmit', 'submit', node)]; + break; + case 'input': + case 'select': + case 'textarea': + inst._wrapperState.listeners = [ReactBrowserEventEmitter.trapBubbledEvent('topInvalid', 'invalid', node)]; + break; + } +} + +function postUpdateSelectWrapper() { + ReactDOMSelect.postUpdateWrapper(this); +} + +// For HTML, certain tags should omit their close tag. We keep a whitelist for +// those special-case tags. + +var omittedCloseTags = { + area: true, + base: true, + br: true, + col: true, + embed: true, + hr: true, + img: true, + input: true, + keygen: true, + link: true, + meta: true, + param: true, + source: true, + track: true, + wbr: true + // NOTE: menuitem's close tag should be omitted, but that causes problems. +}; + +var newlineEatingTags = { + listing: true, + pre: true, + textarea: true +}; + +// For HTML, certain tags cannot have children. This has the same purpose as +// `omittedCloseTags` except that `menuitem` should still have its closing tag. + +var voidElementTags = _assign({ + menuitem: true +}, omittedCloseTags); + +// We accept any tag to be rendered but since this gets injected into arbitrary +// HTML, we want to make sure that it's a safe tag. +// http://www.w3.org/TR/REC-xml/#NT-Name + +var VALID_TAG_REGEX = /^[a-zA-Z][a-zA-Z:_\.\-\d]*$/; // Simplified subset +var validatedTagCache = {}; +var hasOwnProperty = {}.hasOwnProperty; + +function validateDangerousTag(tag) { + if (!hasOwnProperty.call(validatedTagCache, tag)) { + !VALID_TAG_REGEX.test(tag) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Invalid tag: %s', tag) : _prodInvariant('65', tag) : void 0; + validatedTagCache[tag] = true; + } +} + +function isCustomComponent(tagName, props) { + return tagName.indexOf('-') >= 0 || props.is != null; +} + +var globalIdCounter = 1; + +/** + * Creates a new React class that is idempotent and capable of containing other + * React components. It accepts event listeners and DOM properties that are + * valid according to `DOMProperty`. + * + * - Event listeners: `onClick`, `onMouseDown`, etc. + * - DOM properties: `className`, `name`, `title`, etc. + * + * The `style` property functions differently from the DOM API. It accepts an + * object mapping of style properties to values. + * + * @constructor ReactDOMComponent + * @extends ReactMultiChild + */ +function ReactDOMComponent(element) { + var tag = element.type; + validateDangerousTag(tag); + this._currentElement = element; + this._tag = tag.toLowerCase(); + this._namespaceURI = null; + this._renderedChildren = null; + this._previousStyle = null; + this._previousStyleCopy = null; + this._hostNode = null; + this._hostParent = null; + this._rootNodeID = 0; + this._domID = 0; + this._hostContainerInfo = null; + this._wrapperState = null; + this._topLevelWrapper = null; + this._flags = 0; + if (process.env.NODE_ENV !== 'production') { + this._ancestorInfo = null; + setAndValidateContentChildDev.call(this, null); + } +} + +ReactDOMComponent.displayName = 'ReactDOMComponent'; + +ReactDOMComponent.Mixin = { + /** + * Generates root tag markup then recurses. This method has side effects and + * is not idempotent. + * + * @internal + * @param {ReactReconcileTransaction|ReactServerRenderingTransaction} transaction + * @param {?ReactDOMComponent} the parent component instance + * @param {?object} info about the host container + * @param {object} context + * @return {string} The computed markup. + */ + mountComponent: function (transaction, hostParent, hostContainerInfo, context) { + this._rootNodeID = globalIdCounter++; + this._domID = hostContainerInfo._idCounter++; + this._hostParent = hostParent; + this._hostContainerInfo = hostContainerInfo; + + var props = this._currentElement.props; + + switch (this._tag) { + case 'audio': + case 'form': + case 'iframe': + case 'img': + case 'link': + case 'object': + case 'source': + case 'video': + this._wrapperState = { + listeners: null + }; + transaction.getReactMountReady().enqueue(trapBubbledEventsLocal, this); + break; + case 'input': + ReactDOMInput.mountWrapper(this, props, hostParent); + props = ReactDOMInput.getHostProps(this, props); + transaction.getReactMountReady().enqueue(trackInputValue, this); + transaction.getReactMountReady().enqueue(trapBubbledEventsLocal, this); + break; + case 'option': + ReactDOMOption.mountWrapper(this, props, hostParent); + props = ReactDOMOption.getHostProps(this, props); + break; + case 'select': + ReactDOMSelect.mountWrapper(this, props, hostParent); + props = ReactDOMSelect.getHostProps(this, props); + transaction.getReactMountReady().enqueue(trapBubbledEventsLocal, this); + break; + case 'textarea': + ReactDOMTextarea.mountWrapper(this, props, hostParent); + props = ReactDOMTextarea.getHostProps(this, props); + transaction.getReactMountReady().enqueue(trackInputValue, this); + transaction.getReactMountReady().enqueue(trapBubbledEventsLocal, this); + break; + } + + assertValidProps(this, props); + + // We create tags in the namespace of their parent container, except HTML + // tags get no namespace. + var namespaceURI; + var parentTag; + if (hostParent != null) { + namespaceURI = hostParent._namespaceURI; + parentTag = hostParent._tag; + } else if (hostContainerInfo._tag) { + namespaceURI = hostContainerInfo._namespaceURI; + parentTag = hostContainerInfo._tag; + } + if (namespaceURI == null || namespaceURI === DOMNamespaces.svg && parentTag === 'foreignobject') { + namespaceURI = DOMNamespaces.html; + } + if (namespaceURI === DOMNamespaces.html) { + if (this._tag === 'svg') { + namespaceURI = DOMNamespaces.svg; + } else if (this._tag === 'math') { + namespaceURI = DOMNamespaces.mathml; + } + } + this._namespaceURI = namespaceURI; + + if (process.env.NODE_ENV !== 'production') { + var parentInfo; + if (hostParent != null) { + parentInfo = hostParent._ancestorInfo; + } else if (hostContainerInfo._tag) { + parentInfo = hostContainerInfo._ancestorInfo; + } + if (parentInfo) { + // parentInfo should always be present except for the top-level + // component when server rendering + validateDOMNesting(this._tag, null, this, parentInfo); + } + this._ancestorInfo = validateDOMNesting.updatedAncestorInfo(parentInfo, this._tag, this); + } + + var mountImage; + if (transaction.useCreateElement) { + var ownerDocument = hostContainerInfo._ownerDocument; + var el; + if (namespaceURI === DOMNamespaces.html) { + if (this._tag === 'script') { + // Create the script via .innerHTML so its "parser-inserted" flag is + // set to true and it does not execute + var div = ownerDocument.createElement('div'); + var type = this._currentElement.type; + div.innerHTML = '<' + type + '></' + type + '>'; + el = div.removeChild(div.firstChild); + } else if (props.is) { + el = ownerDocument.createElement(this._currentElement.type, props.is); + } else { + // Separate else branch instead of using `props.is || undefined` above becuase of a Firefox bug. + // See discussion in https://github.com/facebook/react/pull/6896 + // and discussion in https://bugzilla.mozilla.org/show_bug.cgi?id=1276240 + el = ownerDocument.createElement(this._currentElement.type); + } + } else { + el = ownerDocument.createElementNS(namespaceURI, this._currentElement.type); + } + ReactDOMComponentTree.precacheNode(this, el); + this._flags |= Flags.hasCachedChildNodes; + if (!this._hostParent) { + DOMPropertyOperations.setAttributeForRoot(el); + } + this._updateDOMProperties(null, props, transaction); + var lazyTree = DOMLazyTree(el); + this._createInitialChildren(transaction, props, context, lazyTree); + mountImage = lazyTree; + } else { + var tagOpen = this._createOpenTagMarkupAndPutListeners(transaction, props); + var tagContent = this._createContentMarkup(transaction, props, context); + if (!tagContent && omittedCloseTags[this._tag]) { + mountImage = tagOpen + '/>'; + } else { + mountImage = tagOpen + '>' + tagContent + '</' + this._currentElement.type + '>'; + } + } + + switch (this._tag) { + case 'input': + transaction.getReactMountReady().enqueue(inputPostMount, this); + if (props.autoFocus) { + transaction.getReactMountReady().enqueue(AutoFocusUtils.focusDOMComponent, this); + } + break; + case 'textarea': + transaction.getReactMountReady().enqueue(textareaPostMount, this); + if (props.autoFocus) { + transaction.getReactMountReady().enqueue(AutoFocusUtils.focusDOMComponent, this); + } + break; + case 'select': + if (props.autoFocus) { + transaction.getReactMountReady().enqueue(AutoFocusUtils.focusDOMComponent, this); + } + break; + case 'button': + if (props.autoFocus) { + transaction.getReactMountReady().enqueue(AutoFocusUtils.focusDOMComponent, this); + } + break; + case 'option': + transaction.getReactMountReady().enqueue(optionPostMount, this); + break; + } + + return mountImage; + }, + + /** + * Creates markup for the open tag and all attributes. + * + * This method has side effects because events get registered. + * + * Iterating over object properties is faster than iterating over arrays. + * @see http://jsperf.com/obj-vs-arr-iteration + * + * @private + * @param {ReactReconcileTransaction|ReactServerRenderingTransaction} transaction + * @param {object} props + * @return {string} Markup of opening tag. + */ + _createOpenTagMarkupAndPutListeners: function (transaction, props) { + var ret = '<' + this._currentElement.type; + + for (var propKey in props) { + if (!props.hasOwnProperty(propKey)) { + continue; + } + var propValue = props[propKey]; + if (propValue == null) { + continue; + } + if (registrationNameModules.hasOwnProperty(propKey)) { + if (propValue) { + enqueuePutListener(this, propKey, propValue, transaction); + } + } else { + if (propKey === STYLE) { + if (propValue) { + if (process.env.NODE_ENV !== 'production') { + // See `_updateDOMProperties`. style block + this._previousStyle = propValue; + } + propValue = this._previousStyleCopy = _assign({}, props.style); + } + propValue = CSSPropertyOperations.createMarkupForStyles(propValue, this); + } + var markup = null; + if (this._tag != null && isCustomComponent(this._tag, props)) { + if (!RESERVED_PROPS.hasOwnProperty(propKey)) { + markup = DOMPropertyOperations.createMarkupForCustomAttribute(propKey, propValue); + } + } else { + markup = DOMPropertyOperations.createMarkupForProperty(propKey, propValue); + } + if (markup) { + ret += ' ' + markup; + } + } + } + + // For static pages, no need to put React ID and checksum. Saves lots of + // bytes. + if (transaction.renderToStaticMarkup) { + return ret; + } + + if (!this._hostParent) { + ret += ' ' + DOMPropertyOperations.createMarkupForRoot(); + } + ret += ' ' + DOMPropertyOperations.createMarkupForID(this._domID); + return ret; + }, + + /** + * Creates markup for the content between the tags. + * + * @private + * @param {ReactReconcileTransaction|ReactServerRenderingTransaction} transaction + * @param {object} props + * @param {object} context + * @return {string} Content markup. + */ + _createContentMarkup: function (transaction, props, context) { + var ret = ''; + + // Intentional use of != to avoid catching zero/false. + var innerHTML = props.dangerouslySetInnerHTML; + if (innerHTML != null) { + if (innerHTML.__html != null) { + ret = innerHTML.__html; + } + } else { + var contentToUse = CONTENT_TYPES[typeof props.children] ? props.children : null; + var childrenToUse = contentToUse != null ? null : props.children; + if (contentToUse != null) { + // TODO: Validate that text is allowed as a child of this node + ret = escapeTextContentForBrowser(contentToUse); + if (process.env.NODE_ENV !== 'production') { + setAndValidateContentChildDev.call(this, contentToUse); + } + } else if (childrenToUse != null) { + var mountImages = this.mountChildren(childrenToUse, transaction, context); + ret = mountImages.join(''); + } + } + if (newlineEatingTags[this._tag] && ret.charAt(0) === '\n') { + // text/html ignores the first character in these tags if it's a newline + // Prefer to break application/xml over text/html (for now) by adding + // a newline specifically to get eaten by the parser. (Alternately for + // textareas, replacing "^\n" with "\r\n" doesn't get eaten, and the first + // \r is normalized out by HTMLTextAreaElement#value.) + // See: <http://www.w3.org/TR/html-polyglot/#newlines-in-textarea-and-pre> + // See: <http://www.w3.org/TR/html5/syntax.html#element-restrictions> + // See: <http://www.w3.org/TR/html5/syntax.html#newlines> + // See: Parsing of "textarea" "listing" and "pre" elements + // from <http://www.w3.org/TR/html5/syntax.html#parsing-main-inbody> + return '\n' + ret; + } else { + return ret; + } + }, + + _createInitialChildren: function (transaction, props, context, lazyTree) { + // Intentional use of != to avoid catching zero/false. + var innerHTML = props.dangerouslySetInnerHTML; + if (innerHTML != null) { + if (innerHTML.__html != null) { + DOMLazyTree.queueHTML(lazyTree, innerHTML.__html); + } + } else { + var contentToUse = CONTENT_TYPES[typeof props.children] ? props.children : null; + var childrenToUse = contentToUse != null ? null : props.children; + // TODO: Validate that text is allowed as a child of this node + if (contentToUse != null) { + // Avoid setting textContent when the text is empty. In IE11 setting + // textContent on a text area will cause the placeholder to not + // show within the textarea until it has been focused and blurred again. + // https://github.com/facebook/react/issues/6731#issuecomment-254874553 + if (contentToUse !== '') { + if (process.env.NODE_ENV !== 'production') { + setAndValidateContentChildDev.call(this, contentToUse); + } + DOMLazyTree.queueText(lazyTree, contentToUse); + } + } else if (childrenToUse != null) { + var mountImages = this.mountChildren(childrenToUse, transaction, context); + for (var i = 0; i < mountImages.length; i++) { + DOMLazyTree.queueChild(lazyTree, mountImages[i]); + } + } + } + }, + + /** + * Receives a next element and updates the component. + * + * @internal + * @param {ReactElement} nextElement + * @param {ReactReconcileTransaction|ReactServerRenderingTransaction} transaction + * @param {object} context + */ + receiveComponent: function (nextElement, transaction, context) { + var prevElement = this._currentElement; + this._currentElement = nextElement; + this.updateComponent(transaction, prevElement, nextElement, context); + }, + + /** + * Updates a DOM component after it has already been allocated and + * attached to the DOM. Reconciles the root DOM node, then recurses. + * + * @param {ReactReconcileTransaction} transaction + * @param {ReactElement} prevElement + * @param {ReactElement} nextElement + * @internal + * @overridable + */ + updateComponent: function (transaction, prevElement, nextElement, context) { + var lastProps = prevElement.props; + var nextProps = this._currentElement.props; + + switch (this._tag) { + case 'input': + lastProps = ReactDOMInput.getHostProps(this, lastProps); + nextProps = ReactDOMInput.getHostProps(this, nextProps); + break; + case 'option': + lastProps = ReactDOMOption.getHostProps(this, lastProps); + nextProps = ReactDOMOption.getHostProps(this, nextProps); + break; + case 'select': + lastProps = ReactDOMSelect.getHostProps(this, lastProps); + nextProps = ReactDOMSelect.getHostProps(this, nextProps); + break; + case 'textarea': + lastProps = ReactDOMTextarea.getHostProps(this, lastProps); + nextProps = ReactDOMTextarea.getHostProps(this, nextProps); + break; + } + + assertValidProps(this, nextProps); + this._updateDOMProperties(lastProps, nextProps, transaction); + this._updateDOMChildren(lastProps, nextProps, transaction, context); + + switch (this._tag) { + case 'input': + // Update the wrapper around inputs *after* updating props. This has to + // happen after `_updateDOMProperties`. Otherwise HTML5 input validations + // raise warnings and prevent the new value from being assigned. + ReactDOMInput.updateWrapper(this); + + // We also check that we haven't missed a value update, such as a + // Radio group shifting the checked value to another named radio input. + inputValueTracking.updateValueIfChanged(this); + break; + case 'textarea': + ReactDOMTextarea.updateWrapper(this); + break; + case 'select': + // <select> value update needs to occur after <option> children + // reconciliation + transaction.getReactMountReady().enqueue(postUpdateSelectWrapper, this); + break; + } + }, + + /** + * Reconciles the properties by detecting differences in property values and + * updating the DOM as necessary. This function is probably the single most + * critical path for performance optimization. + * + * TODO: Benchmark whether checking for changed values in memory actually + * improves performance (especially statically positioned elements). + * TODO: Benchmark the effects of putting this at the top since 99% of props + * do not change for a given reconciliation. + * TODO: Benchmark areas that can be improved with caching. + * + * @private + * @param {object} lastProps + * @param {object} nextProps + * @param {?DOMElement} node + */ + _updateDOMProperties: function (lastProps, nextProps, transaction) { + var propKey; + var styleName; + var styleUpdates; + for (propKey in lastProps) { + if (nextProps.hasOwnProperty(propKey) || !lastProps.hasOwnProperty(propKey) || lastProps[propKey] == null) { + continue; + } + if (propKey === STYLE) { + var lastStyle = this._previousStyleCopy; + for (styleName in lastStyle) { + if (lastStyle.hasOwnProperty(styleName)) { + styleUpdates = styleUpdates || {}; + styleUpdates[styleName] = ''; + } + } + this._previousStyleCopy = null; + } else if (registrationNameModules.hasOwnProperty(propKey)) { + if (lastProps[propKey]) { + // Only call deleteListener if there was a listener previously or + // else willDeleteListener gets called when there wasn't actually a + // listener (e.g., onClick={null}) + deleteListener(this, propKey); + } + } else if (isCustomComponent(this._tag, lastProps)) { + if (!RESERVED_PROPS.hasOwnProperty(propKey)) { + DOMPropertyOperations.deleteValueForAttribute(getNode(this), propKey); + } + } else if (DOMProperty.properties[propKey] || DOMProperty.isCustomAttribute(propKey)) { + DOMPropertyOperations.deleteValueForProperty(getNode(this), propKey); + } + } + for (propKey in nextProps) { + var nextProp = nextProps[propKey]; + var lastProp = propKey === STYLE ? this._previousStyleCopy : lastProps != null ? lastProps[propKey] : undefined; + if (!nextProps.hasOwnProperty(propKey) || nextProp === lastProp || nextProp == null && lastProp == null) { + continue; + } + if (propKey === STYLE) { + if (nextProp) { + if (process.env.NODE_ENV !== 'production') { + checkAndWarnForMutatedStyle(this._previousStyleCopy, this._previousStyle, this); + this._previousStyle = nextProp; + } + nextProp = this._previousStyleCopy = _assign({}, nextProp); + } else { + this._previousStyleCopy = null; + } + if (lastProp) { + // Unset styles on `lastProp` but not on `nextProp`. + for (styleName in lastProp) { + if (lastProp.hasOwnProperty(styleName) && (!nextProp || !nextProp.hasOwnProperty(styleName))) { + styleUpdates = styleUpdates || {}; + styleUpdates[styleName] = ''; + } + } + // Update styles that changed since `lastProp`. + for (styleName in nextProp) { + if (nextProp.hasOwnProperty(styleName) && lastProp[styleName] !== nextProp[styleName]) { + styleUpdates = styleUpdates || {}; + styleUpdates[styleName] = nextProp[styleName]; + } + } + } else { + // Relies on `updateStylesByID` not mutating `styleUpdates`. + styleUpdates = nextProp; + } + } else if (registrationNameModules.hasOwnProperty(propKey)) { + if (nextProp) { + enqueuePutListener(this, propKey, nextProp, transaction); + } else if (lastProp) { + deleteListener(this, propKey); + } + } else if (isCustomComponent(this._tag, nextProps)) { + if (!RESERVED_PROPS.hasOwnProperty(propKey)) { + DOMPropertyOperations.setValueForAttribute(getNode(this), propKey, nextProp); + } + } else if (DOMProperty.properties[propKey] || DOMProperty.isCustomAttribute(propKey)) { + var node = getNode(this); + // If we're updating to null or undefined, we should remove the property + // from the DOM node instead of inadvertently setting to a string. This + // brings us in line with the same behavior we have on initial render. + if (nextProp != null) { + DOMPropertyOperations.setValueForProperty(node, propKey, nextProp); + } else { + DOMPropertyOperations.deleteValueForProperty(node, propKey); + } + } + } + if (styleUpdates) { + CSSPropertyOperations.setValueForStyles(getNode(this), styleUpdates, this); + } + }, + + /** + * Reconciles the children with the various properties that affect the + * children content. + * + * @param {object} lastProps + * @param {object} nextProps + * @param {ReactReconcileTransaction} transaction + * @param {object} context + */ + _updateDOMChildren: function (lastProps, nextProps, transaction, context) { + var lastContent = CONTENT_TYPES[typeof lastProps.children] ? lastProps.children : null; + var nextContent = CONTENT_TYPES[typeof nextProps.children] ? nextProps.children : null; + + var lastHtml = lastProps.dangerouslySetInnerHTML && lastProps.dangerouslySetInnerHTML.__html; + var nextHtml = nextProps.dangerouslySetInnerHTML && nextProps.dangerouslySetInnerHTML.__html; + + // Note the use of `!=` which checks for null or undefined. + var lastChildren = lastContent != null ? null : lastProps.children; + var nextChildren = nextContent != null ? null : nextProps.children; + + // If we're switching from children to content/html or vice versa, remove + // the old content + var lastHasContentOrHtml = lastContent != null || lastHtml != null; + var nextHasContentOrHtml = nextContent != null || nextHtml != null; + if (lastChildren != null && nextChildren == null) { + this.updateChildren(null, transaction, context); + } else if (lastHasContentOrHtml && !nextHasContentOrHtml) { + this.updateTextContent(''); + if (process.env.NODE_ENV !== 'production') { + ReactInstrumentation.debugTool.onSetChildren(this._debugID, []); + } + } + + if (nextContent != null) { + if (lastContent !== nextContent) { + this.updateTextContent('' + nextContent); + if (process.env.NODE_ENV !== 'production') { + setAndValidateContentChildDev.call(this, nextContent); + } + } + } else if (nextHtml != null) { + if (lastHtml !== nextHtml) { + this.updateMarkup('' + nextHtml); + } + if (process.env.NODE_ENV !== 'production') { + ReactInstrumentation.debugTool.onSetChildren(this._debugID, []); + } + } else if (nextChildren != null) { + if (process.env.NODE_ENV !== 'production') { + setAndValidateContentChildDev.call(this, null); + } + + this.updateChildren(nextChildren, transaction, context); + } + }, + + getHostNode: function () { + return getNode(this); + }, + + /** + * Destroys all event registrations for this instance. Does not remove from + * the DOM. That must be done by the parent. + * + * @internal + */ + unmountComponent: function (safely) { + switch (this._tag) { + case 'audio': + case 'form': + case 'iframe': + case 'img': + case 'link': + case 'object': + case 'source': + case 'video': + var listeners = this._wrapperState.listeners; + if (listeners) { + for (var i = 0; i < listeners.length; i++) { + listeners[i].remove(); + } + } + break; + case 'input': + case 'textarea': + inputValueTracking.stopTracking(this); + break; + case 'html': + case 'head': + case 'body': + /** + * Components like <html> <head> and <body> can't be removed or added + * easily in a cross-browser way, however it's valuable to be able to + * take advantage of React's reconciliation for styling and <title> + * management. So we just document it and throw in dangerous cases. + */ + true ? process.env.NODE_ENV !== 'production' ? invariant(false, '<%s> tried to unmount. Because of cross-browser quirks it is impossible to unmount some top-level components (eg <html>, <head>, and <body>) reliably and efficiently. To fix this, have a single top-level component that never unmounts render these elements.', this._tag) : _prodInvariant('66', this._tag) : void 0; + break; + } + + this.unmountChildren(safely); + ReactDOMComponentTree.uncacheNode(this); + EventPluginHub.deleteAllListeners(this); + this._rootNodeID = 0; + this._domID = 0; + this._wrapperState = null; + + if (process.env.NODE_ENV !== 'production') { + setAndValidateContentChildDev.call(this, null); + } + }, + + getPublicInstance: function () { + return getNode(this); + } +}; + +_assign(ReactDOMComponent.prototype, ReactDOMComponent.Mixin, ReactMultiChild.Mixin); + +module.exports = ReactDOMComponent; +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) + +/***/ }), +/* 152 */ +/***/ (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 ReactDOMComponentTree = __webpack_require__(7); + +var focusNode = __webpack_require__(80); + +var AutoFocusUtils = { + focusDOMComponent: function () { + focusNode(ReactDOMComponentTree.getNodeFromInstance(this)); + } +}; + +module.exports = AutoFocusUtils; + +/***/ }), +/* 153 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(process) {/** + * 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 CSSProperty = __webpack_require__(81); +var ExecutionEnvironment = __webpack_require__(9); +var ReactInstrumentation = __webpack_require__(13); + +var camelizeStyleName = __webpack_require__(154); +var dangerousStyleValue = __webpack_require__(156); +var hyphenateStyleName = __webpack_require__(157); +var memoizeStringOnly = __webpack_require__(159); +var warning = __webpack_require__(3); + +var processStyleName = memoizeStringOnly(function (styleName) { + return hyphenateStyleName(styleName); +}); + +var hasShorthandPropertyBug = false; +var styleFloatAccessor = 'cssFloat'; +if (ExecutionEnvironment.canUseDOM) { + var tempStyle = document.createElement('div').style; + try { + // IE8 throws "Invalid argument." if resetting shorthand style properties. + tempStyle.font = ''; + } catch (e) { + hasShorthandPropertyBug = true; + } + // IE8 only supports accessing cssFloat (standard) as styleFloat + if (document.documentElement.style.cssFloat === undefined) { + styleFloatAccessor = 'styleFloat'; + } +} + +if (process.env.NODE_ENV !== 'production') { + // 'msTransform' is correct, but the other prefixes should be capitalized + var badVendoredStyleNamePattern = /^(?:webkit|moz|o)[A-Z]/; + + // style values shouldn't contain a semicolon + var badStyleValueWithSemicolonPattern = /;\s*$/; + + var warnedStyleNames = {}; + var warnedStyleValues = {}; + var warnedForNaNValue = false; + + var warnHyphenatedStyleName = function (name, owner) { + if (warnedStyleNames.hasOwnProperty(name) && warnedStyleNames[name]) { + return; + } + + warnedStyleNames[name] = true; + process.env.NODE_ENV !== 'production' ? warning(false, 'Unsupported style property %s. Did you mean %s?%s', name, camelizeStyleName(name), checkRenderMessage(owner)) : void 0; + }; + + var warnBadVendoredStyleName = function (name, owner) { + if (warnedStyleNames.hasOwnProperty(name) && warnedStyleNames[name]) { + return; + } + + warnedStyleNames[name] = true; + process.env.NODE_ENV !== 'production' ? warning(false, 'Unsupported vendor-prefixed style property %s. Did you mean %s?%s', name, name.charAt(0).toUpperCase() + name.slice(1), checkRenderMessage(owner)) : void 0; + }; + + var warnStyleValueWithSemicolon = function (name, value, owner) { + if (warnedStyleValues.hasOwnProperty(value) && warnedStyleValues[value]) { + return; + } + + warnedStyleValues[value] = true; + process.env.NODE_ENV !== 'production' ? warning(false, "Style property values shouldn't contain a semicolon.%s " + 'Try "%s: %s" instead.', checkRenderMessage(owner), name, value.replace(badStyleValueWithSemicolonPattern, '')) : void 0; + }; + + var warnStyleValueIsNaN = function (name, value, owner) { + if (warnedForNaNValue) { + return; + } + + warnedForNaNValue = true; + process.env.NODE_ENV !== 'production' ? warning(false, '`NaN` is an invalid value for the `%s` css style property.%s', name, checkRenderMessage(owner)) : void 0; + }; + + var checkRenderMessage = function (owner) { + if (owner) { + var name = owner.getName(); + if (name) { + return ' Check the render method of `' + name + '`.'; + } + } + return ''; + }; + + /** + * @param {string} name + * @param {*} value + * @param {ReactDOMComponent} component + */ + var warnValidStyle = function (name, value, component) { + var owner; + if (component) { + owner = component._currentElement._owner; + } + if (name.indexOf('-') > -1) { + warnHyphenatedStyleName(name, owner); + } else if (badVendoredStyleNamePattern.test(name)) { + warnBadVendoredStyleName(name, owner); + } else if (badStyleValueWithSemicolonPattern.test(value)) { + warnStyleValueWithSemicolon(name, value, owner); + } + + if (typeof value === 'number' && isNaN(value)) { + warnStyleValueIsNaN(name, value, owner); + } + }; +} + +/** + * Operations for dealing with CSS properties. + */ +var CSSPropertyOperations = { + /** + * Serializes a mapping of style properties for use as inline styles: + * + * > createMarkupForStyles({width: '200px', height: 0}) + * "width:200px;height:0;" + * + * Undefined values are ignored so that declarative programming is easier. + * The result should be HTML-escaped before insertion into the DOM. + * + * @param {object} styles + * @param {ReactDOMComponent} component + * @return {?string} + */ + createMarkupForStyles: function (styles, component) { + var serialized = ''; + for (var styleName in styles) { + if (!styles.hasOwnProperty(styleName)) { + continue; + } + var isCustomProperty = styleName.indexOf('--') === 0; + var styleValue = styles[styleName]; + if (process.env.NODE_ENV !== 'production') { + if (!isCustomProperty) { + warnValidStyle(styleName, styleValue, component); + } + } + if (styleValue != null) { + serialized += processStyleName(styleName) + ':'; + serialized += dangerousStyleValue(styleName, styleValue, component, isCustomProperty) + ';'; + } + } + return serialized || null; + }, + + /** + * Sets the value for multiple styles on a node. If a value is specified as + * '' (empty string), the corresponding style property will be unset. + * + * @param {DOMElement} node + * @param {object} styles + * @param {ReactDOMComponent} component + */ + setValueForStyles: function (node, styles, component) { + if (process.env.NODE_ENV !== 'production') { + ReactInstrumentation.debugTool.onHostOperation({ + instanceID: component._debugID, + type: 'update styles', + payload: styles + }); + } + + var style = node.style; + for (var styleName in styles) { + if (!styles.hasOwnProperty(styleName)) { + continue; + } + var isCustomProperty = styleName.indexOf('--') === 0; + if (process.env.NODE_ENV !== 'production') { + if (!isCustomProperty) { + warnValidStyle(styleName, styles[styleName], component); + } + } + var styleValue = dangerousStyleValue(styleName, styles[styleName], component, isCustomProperty); + if (styleName === 'float' || styleName === 'cssFloat') { + styleName = styleFloatAccessor; + } + if (isCustomProperty) { + style.setProperty(styleName, styleValue); + } else if (styleValue) { + style[styleName] = styleValue; + } else { + var expansion = hasShorthandPropertyBug && CSSProperty.shorthandPropertyExpansions[styleName]; + if (expansion) { + // Shorthand property that IE8 won't like unsetting, so unset each + // component to placate it + for (var individualStyleName in expansion) { + style[individualStyleName] = ''; + } + } else { + style[styleName] = ''; + } + } + } + } +}; + +module.exports = CSSPropertyOperations; +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) + +/***/ }), +/* 154 */ +/***/ (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. + * + * @typechecks + */ + + + +var camelize = __webpack_require__(155); + +var msPattern = /^-ms-/; + +/** + * Camelcases a hyphenated CSS property name, for example: + * + * > camelizeStyleName('background-color') + * < "backgroundColor" + * > camelizeStyleName('-moz-transition') + * < "MozTransition" + * > camelizeStyleName('-ms-transition') + * < "msTransition" + * + * As Andi Smith suggests + * (http://www.andismith.com/blog/2012/02/modernizr-prefixed/), an `-ms` prefix + * is converted to lowercase `ms`. + * + * @param {string} string + * @return {string} + */ +function camelizeStyleName(string) { + return camelize(string.replace(msPattern, 'ms-')); +} + +module.exports = camelizeStyleName; + +/***/ }), +/* 155 */ +/***/ (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. + * + * @typechecks + */ + +var _hyphenPattern = /-(.)/g; + +/** + * Camelcases a hyphenated string, for example: + * + * > camelize('background-color') + * < "backgroundColor" + * + * @param {string} string + * @return {string} + */ +function camelize(string) { + return string.replace(_hyphenPattern, function (_, character) { + return character.toUpperCase(); + }); +} + +module.exports = camelize; + +/***/ }), +/* 156 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(process) {/** + * 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 CSSProperty = __webpack_require__(81); +var warning = __webpack_require__(3); + +var isUnitlessNumber = CSSProperty.isUnitlessNumber; +var styleWarnings = {}; + +/** + * Convert a value into the proper css writable value. The style name `name` + * should be logical (no hyphens), as specified + * in `CSSProperty.isUnitlessNumber`. + * + * @param {string} name CSS property name such as `topMargin`. + * @param {*} value CSS property value such as `10px`. + * @param {ReactDOMComponent} component + * @return {string} Normalized style value with dimensions applied. + */ +function dangerousStyleValue(name, value, component, isCustomProperty) { + // Note that we've removed escapeTextForBrowser() calls here since the + // whole string will be escaped when the attribute is injected into + // the markup. If you provide unsafe user data here they can inject + // arbitrary CSS which may be problematic (I couldn't repro this): + // https://www.owasp.org/index.php/XSS_Filter_Evasion_Cheat_Sheet + // http://www.thespanner.co.uk/2007/11/26/ultimate-xss-css-injection/ + // This is not an XSS hole but instead a potential CSS injection issue + // which has lead to a greater discussion about how we're going to + // trust URLs moving forward. See #2115901 + + var isEmpty = value == null || typeof value === 'boolean' || value === ''; + if (isEmpty) { + return ''; + } + + var isNonNumeric = isNaN(value); + if (isCustomProperty || isNonNumeric || value === 0 || isUnitlessNumber.hasOwnProperty(name) && isUnitlessNumber[name]) { + return '' + value; // cast to string + } + + if (typeof value === 'string') { + if (process.env.NODE_ENV !== 'production') { + // Allow '0' to pass through without warning. 0 is already special and + // doesn't require units, so we don't need to warn about it. + if (component && value !== '0') { + var owner = component._currentElement._owner; + var ownerName = owner ? owner.getName() : null; + if (ownerName && !styleWarnings[ownerName]) { + styleWarnings[ownerName] = {}; + } + var warned = false; + if (ownerName) { + var warnings = styleWarnings[ownerName]; + warned = warnings[name]; + if (!warned) { + warnings[name] = true; + } + } + if (!warned) { + process.env.NODE_ENV !== 'production' ? warning(false, 'a `%s` tag (owner: `%s`) was passed a numeric string value ' + 'for CSS property `%s` (value: `%s`) which will be treated ' + 'as a unitless number in a future version of React.', component._currentElement.type, ownerName || 'unknown', name, value) : void 0; + } + } + } + value = value.trim(); + } + return value + 'px'; +} + +module.exports = dangerousStyleValue; +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) + +/***/ }), +/* 157 */ +/***/ (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. + * + * @typechecks + */ + + + +var hyphenate = __webpack_require__(158); + +var msPattern = /^ms-/; + +/** + * Hyphenates a camelcased CSS property name, for example: + * + * > hyphenateStyleName('backgroundColor') + * < "background-color" + * > hyphenateStyleName('MozTransition') + * < "-moz-transition" + * > hyphenateStyleName('msTransition') + * < "-ms-transition" + * + * As Modernizr suggests (http://modernizr.com/docs/#prefixed), an `ms` prefix + * is converted to `-ms-`. + * + * @param {string} string + * @return {string} + */ +function hyphenateStyleName(string) { + return hyphenate(string).replace(msPattern, '-ms-'); +} + +module.exports = hyphenateStyleName; + +/***/ }), +/* 158 */ +/***/ (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. + * + * @typechecks + */ + +var _uppercasePattern = /([A-Z])/g; + +/** + * Hyphenates a camelcased string, for example: + * + * > hyphenate('backgroundColor') + * < "background-color" + * + * For CSS style names, use `hyphenateStyleName` instead which works properly + * with all vendor prefixes, including `ms`. + * + * @param {string} string + * @return {string} + */ +function hyphenate(string) { + return string.replace(_uppercasePattern, '-$1').toLowerCase(); +} + +module.exports = hyphenate; + +/***/ }), +/* 159 */ +/***/ (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. + * + * + * @typechecks static-only + */ + + + +/** + * Memoizes the return value of a function that accepts one string argument. + */ + +function memoizeStringOnly(callback) { + var cache = {}; + return function (string) { + if (!cache.hasOwnProperty(string)) { + cache[string] = callback.call(this, string); + } + return cache[string]; + }; +} + +module.exports = memoizeStringOnly; + +/***/ }), +/* 160 */ +/***/ (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 escapeTextContentForBrowser = __webpack_require__(37); + +/** + * Escapes attribute value to prevent scripting attacks. + * + * @param {*} value Value to escape. + * @return {string} An escaped string. + */ +function quoteAttributeValueForBrowser(value) { + return '"' + escapeTextContentForBrowser(value) + '"'; +} + +module.exports = quoteAttributeValueForBrowser; + +/***/ }), +/* 161 */ +/***/ (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 EventPluginHub = __webpack_require__(27); + +function runEventQueueInBatch(events) { + EventPluginHub.enqueueEvents(events); + EventPluginHub.processEventQueue(false); +} + +var ReactEventEmitterMixin = { + /** + * Streams a fired top-level event to `EventPluginHub` where plugins have the + * opportunity to create `ReactEvent`s to be dispatched. + */ + handleTopLevel: function (topLevelType, targetInst, nativeEvent, nativeEventTarget) { + var events = EventPluginHub.extractEvents(topLevelType, targetInst, nativeEvent, nativeEventTarget); + runEventQueueInBatch(events); + } +}; + +module.exports = ReactEventEmitterMixin; + +/***/ }), +/* 162 */ +/***/ (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 ExecutionEnvironment = __webpack_require__(9); + +/** + * Generate a mapping of standard vendor prefixes using the defined style property and event name. + * + * @param {string} styleProp + * @param {string} eventName + * @returns {object} + */ +function makePrefixMap(styleProp, eventName) { + var prefixes = {}; + + prefixes[styleProp.toLowerCase()] = eventName.toLowerCase(); + prefixes['Webkit' + styleProp] = 'webkit' + eventName; + prefixes['Moz' + styleProp] = 'moz' + eventName; + prefixes['ms' + styleProp] = 'MS' + eventName; + prefixes['O' + styleProp] = 'o' + eventName.toLowerCase(); + + return prefixes; +} + +/** + * A list of event names to a configurable list of vendor prefixes. + */ +var vendorPrefixes = { + animationend: makePrefixMap('Animation', 'AnimationEnd'), + animationiteration: makePrefixMap('Animation', 'AnimationIteration'), + animationstart: makePrefixMap('Animation', 'AnimationStart'), + transitionend: makePrefixMap('Transition', 'TransitionEnd') +}; + +/** + * Event names that have already been detected and prefixed (if applicable). + */ +var prefixedEventNames = {}; + +/** + * Element to check for prefixes on. + */ +var style = {}; + +/** + * Bootstrap if a DOM exists. + */ +if (ExecutionEnvironment.canUseDOM) { + style = document.createElement('div').style; + + // On some platforms, in particular some releases of Android 4.x, + // the un-prefixed "animation" and "transition" properties are defined on the + // style object but the events that fire will still be prefixed, so we need + // to check if the un-prefixed events are usable, and if not remove them from the map. + if (!('AnimationEvent' in window)) { + delete vendorPrefixes.animationend.animation; + delete vendorPrefixes.animationiteration.animation; + delete vendorPrefixes.animationstart.animation; + } + + // Same as above + if (!('TransitionEvent' in window)) { + delete vendorPrefixes.transitionend.transition; + } +} + +/** + * Attempts to determine the correct vendor prefixed event name. + * + * @param {string} eventName + * @returns {string} + */ +function getVendorPrefixedEventName(eventName) { + if (prefixedEventNames[eventName]) { + return prefixedEventNames[eventName]; + } else if (!vendorPrefixes[eventName]) { + return eventName; + } + + var prefixMap = vendorPrefixes[eventName]; + + for (var styleProp in prefixMap) { + if (prefixMap.hasOwnProperty(styleProp) && styleProp in style) { + return prefixedEventNames[eventName] = prefixMap[styleProp]; + } + } + + return ''; +} + +module.exports = getVendorPrefixedEventName; + +/***/ }), +/* 163 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(process) {/** + * 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__(4), + _assign = __webpack_require__(8); + +var DOMPropertyOperations = __webpack_require__(82); +var LinkedValueUtils = __webpack_require__(50); +var ReactDOMComponentTree = __webpack_require__(7); +var ReactUpdates = __webpack_require__(15); + +var invariant = __webpack_require__(1); +var warning = __webpack_require__(3); + +var didWarnValueLink = false; +var didWarnCheckedLink = false; +var didWarnValueDefaultValue = false; +var didWarnCheckedDefaultChecked = false; +var didWarnControlledToUncontrolled = false; +var didWarnUncontrolledToControlled = false; + +function forceUpdateIfMounted() { + if (this._rootNodeID) { + // DOM component is still mounted; update + ReactDOMInput.updateWrapper(this); + } +} + +function isControlled(props) { + var usesChecked = props.type === 'checkbox' || props.type === 'radio'; + return usesChecked ? props.checked != null : props.value != null; +} + +/** + * Implements an <input> host component that allows setting these optional + * props: `checked`, `value`, `defaultChecked`, and `defaultValue`. + * + * If `checked` or `value` are not supplied (or null/undefined), user actions + * that affect the checked state or value will trigger updates to the element. + * + * If they are supplied (and not null/undefined), the rendered element will not + * trigger updates to the element. Instead, the props must change in order for + * the rendered element to be updated. + * + * The rendered element will be initialized as unchecked (or `defaultChecked`) + * with an empty value (or `defaultValue`). + * + * @see http://www.w3.org/TR/2012/WD-html5-20121025/the-input-element.html + */ +var ReactDOMInput = { + getHostProps: function (inst, props) { + var value = LinkedValueUtils.getValue(props); + var checked = LinkedValueUtils.getChecked(props); + + var hostProps = _assign({ + // Make sure we set .type before any other properties (setting .value + // before .type means .value is lost in IE11 and below) + type: undefined, + // Make sure we set .step before .value (setting .value before .step + // means .value is rounded on mount, based upon step precision) + step: undefined, + // Make sure we set .min & .max before .value (to ensure proper order + // in corner cases such as min or max deriving from value, e.g. Issue #7170) + min: undefined, + max: undefined + }, props, { + defaultChecked: undefined, + defaultValue: undefined, + value: value != null ? value : inst._wrapperState.initialValue, + checked: checked != null ? checked : inst._wrapperState.initialChecked, + onChange: inst._wrapperState.onChange + }); + + return hostProps; + }, + + mountWrapper: function (inst, props) { + if (process.env.NODE_ENV !== 'production') { + LinkedValueUtils.checkPropTypes('input', props, inst._currentElement._owner); + + var owner = inst._currentElement._owner; + + if (props.valueLink !== undefined && !didWarnValueLink) { + process.env.NODE_ENV !== 'production' ? warning(false, '`valueLink` prop on `input` is deprecated; set `value` and `onChange` instead.') : void 0; + didWarnValueLink = true; + } + if (props.checkedLink !== undefined && !didWarnCheckedLink) { + process.env.NODE_ENV !== 'production' ? warning(false, '`checkedLink` prop on `input` is deprecated; set `value` and `onChange` instead.') : void 0; + didWarnCheckedLink = true; + } + if (props.checked !== undefined && props.defaultChecked !== undefined && !didWarnCheckedDefaultChecked) { + process.env.NODE_ENV !== 'production' ? warning(false, '%s contains an input of type %s with both checked and defaultChecked props. ' + 'Input elements must be either controlled or uncontrolled ' + '(specify either the checked prop, or the defaultChecked prop, but not ' + 'both). Decide between using a controlled or uncontrolled input ' + 'element and remove one of these props. More info: ' + 'https://fb.me/react-controlled-components', owner && owner.getName() || 'A component', props.type) : void 0; + didWarnCheckedDefaultChecked = true; + } + if (props.value !== undefined && props.defaultValue !== undefined && !didWarnValueDefaultValue) { + process.env.NODE_ENV !== 'production' ? warning(false, '%s contains an input of type %s with both value and defaultValue props. ' + 'Input elements must be either controlled or uncontrolled ' + '(specify either the value prop, or the defaultValue prop, but not ' + 'both). Decide between using a controlled or uncontrolled input ' + 'element and remove one of these props. More info: ' + 'https://fb.me/react-controlled-components', owner && owner.getName() || 'A component', props.type) : void 0; + didWarnValueDefaultValue = true; + } + } + + var defaultValue = props.defaultValue; + inst._wrapperState = { + initialChecked: props.checked != null ? props.checked : props.defaultChecked, + initialValue: props.value != null ? props.value : defaultValue, + listeners: null, + onChange: _handleChange.bind(inst), + controlled: isControlled(props) + }; + }, + + updateWrapper: function (inst) { + var props = inst._currentElement.props; + + if (process.env.NODE_ENV !== 'production') { + var controlled = isControlled(props); + var owner = inst._currentElement._owner; + + if (!inst._wrapperState.controlled && controlled && !didWarnUncontrolledToControlled) { + process.env.NODE_ENV !== 'production' ? warning(false, '%s is changing an uncontrolled input of type %s to be controlled. ' + 'Input elements should not switch from uncontrolled to controlled (or vice versa). ' + 'Decide between using a controlled or uncontrolled input ' + 'element for the lifetime of the component. More info: https://fb.me/react-controlled-components', owner && owner.getName() || 'A component', props.type) : void 0; + didWarnUncontrolledToControlled = true; + } + if (inst._wrapperState.controlled && !controlled && !didWarnControlledToUncontrolled) { + process.env.NODE_ENV !== 'production' ? warning(false, '%s is changing a controlled input of type %s to be uncontrolled. ' + 'Input elements should not switch from controlled to uncontrolled (or vice versa). ' + 'Decide between using a controlled or uncontrolled input ' + 'element for the lifetime of the component. More info: https://fb.me/react-controlled-components', owner && owner.getName() || 'A component', props.type) : void 0; + didWarnControlledToUncontrolled = true; + } + } + + // TODO: Shouldn't this be getChecked(props)? + var checked = props.checked; + if (checked != null) { + DOMPropertyOperations.setValueForProperty(ReactDOMComponentTree.getNodeFromInstance(inst), 'checked', checked || false); + } + + var node = ReactDOMComponentTree.getNodeFromInstance(inst); + var value = LinkedValueUtils.getValue(props); + if (value != null) { + if (value === 0 && node.value === '') { + node.value = '0'; + // Note: IE9 reports a number inputs as 'text', so check props instead. + } else if (props.type === 'number') { + // Simulate `input.valueAsNumber`. IE9 does not support it + var valueAsNumber = parseFloat(node.value, 10) || 0; + + if ( + // eslint-disable-next-line + value != valueAsNumber || + // eslint-disable-next-line + value == valueAsNumber && node.value != value) { + // Cast `value` to a string to ensure the value is set correctly. While + // browsers typically do this as necessary, jsdom doesn't. + node.value = '' + value; + } + } else if (node.value !== '' + value) { + // Cast `value` to a string to ensure the value is set correctly. While + // browsers typically do this as necessary, jsdom doesn't. + node.value = '' + value; + } + } else { + if (props.value == null && props.defaultValue != null) { + // In Chrome, assigning defaultValue to certain input types triggers input validation. + // For number inputs, the display value loses trailing decimal points. For email inputs, + // Chrome raises "The specified value <x> is not a valid email address". + // + // Here we check to see if the defaultValue has actually changed, avoiding these problems + // when the user is inputting text + // + // https://github.com/facebook/react/issues/7253 + if (node.defaultValue !== '' + props.defaultValue) { + node.defaultValue = '' + props.defaultValue; + } + } + if (props.checked == null && props.defaultChecked != null) { + node.defaultChecked = !!props.defaultChecked; + } + } + }, + + postMountWrapper: function (inst) { + var props = inst._currentElement.props; + + // This is in postMount because we need access to the DOM node, which is not + // available until after the component has mounted. + var node = ReactDOMComponentTree.getNodeFromInstance(inst); + + // Detach value from defaultValue. We won't do anything if we're working on + // submit or reset inputs as those values & defaultValues are linked. They + // are not resetable nodes so this operation doesn't matter and actually + // removes browser-default values (eg "Submit Query") when no value is + // provided. + + switch (props.type) { + case 'submit': + case 'reset': + break; + case 'color': + case 'date': + case 'datetime': + case 'datetime-local': + case 'month': + case 'time': + case 'week': + // This fixes the no-show issue on iOS Safari and Android Chrome: + // https://github.com/facebook/react/issues/7233 + node.value = ''; + node.value = node.defaultValue; + break; + default: + node.value = node.value; + break; + } + + // Normally, we'd just do `node.checked = node.checked` upon initial mount, less this bug + // this is needed to work around a chrome bug where setting defaultChecked + // will sometimes influence the value of checked (even after detachment). + // Reference: https://bugs.chromium.org/p/chromium/issues/detail?id=608416 + // We need to temporarily unset name to avoid disrupting radio button groups. + var name = node.name; + if (name !== '') { + node.name = ''; + } + node.defaultChecked = !node.defaultChecked; + node.defaultChecked = !node.defaultChecked; + if (name !== '') { + node.name = name; + } + } +}; + +function _handleChange(event) { + var props = this._currentElement.props; + + var returnValue = LinkedValueUtils.executeOnChange(props, event); + + // Here we use asap to wait until all updates have propagated, which + // is important when using controlled components within layers: + // https://github.com/facebook/react/issues/1698 + ReactUpdates.asap(forceUpdateIfMounted, this); + + var name = props.name; + if (props.type === 'radio' && name != null) { + var rootNode = ReactDOMComponentTree.getNodeFromInstance(this); + var queryRoot = rootNode; + + while (queryRoot.parentNode) { + queryRoot = queryRoot.parentNode; + } + + // If `rootNode.form` was non-null, then we could try `form.elements`, + // but that sometimes behaves strangely in IE8. We could also try using + // `form.getElementsByName`, but that will only return direct children + // and won't include inputs that use the HTML5 `form=` attribute. Since + // the input might not even be in a form, let's just use the global + // `querySelectorAll` to ensure we don't miss anything. + var group = queryRoot.querySelectorAll('input[name=' + JSON.stringify('' + name) + '][type="radio"]'); + + for (var i = 0; i < group.length; i++) { + var otherNode = group[i]; + if (otherNode === rootNode || otherNode.form !== rootNode.form) { + continue; + } + // This will throw if radio buttons rendered by different copies of React + // and the same name are rendered into the same form (same as #1939). + // That's probably okay; we don't support it just as we don't support + // mixing React radio buttons with non-React ones. + var otherInstance = ReactDOMComponentTree.getInstanceFromNode(otherNode); + !otherInstance ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactDOMInput: Mixing React and non-React radio inputs with the same `name` is not supported.') : _prodInvariant('90') : void 0; + // If this is a controlled radio button group, forcing the input that + // was previously checked to update will cause it to be come re-checked + // as appropriate. + ReactUpdates.asap(forceUpdateIfMounted, otherInstance); + } + } + + return returnValue; +} + +module.exports = ReactDOMInput; +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) + +/***/ }), +/* 164 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(process) {/** + * 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__(8); + +var React = __webpack_require__(21); +var ReactDOMComponentTree = __webpack_require__(7); +var ReactDOMSelect = __webpack_require__(84); + +var warning = __webpack_require__(3); +var didWarnInvalidOptionChildren = false; + +function flattenChildren(children) { + var content = ''; + + // Flatten children and warn if they aren't strings or numbers; + // invalid types are ignored. + React.Children.forEach(children, function (child) { + if (child == null) { + return; + } + if (typeof child === 'string' || typeof child === 'number') { + content += child; + } else if (!didWarnInvalidOptionChildren) { + didWarnInvalidOptionChildren = true; + process.env.NODE_ENV !== 'production' ? warning(false, 'Only strings and numbers are supported as <option> children.') : void 0; + } + }); + + return content; +} + +/** + * Implements an <option> host component that warns when `selected` is set. + */ +var ReactDOMOption = { + mountWrapper: function (inst, props, hostParent) { + // TODO (yungsters): Remove support for `selected` in <option>. + if (process.env.NODE_ENV !== 'production') { + process.env.NODE_ENV !== 'production' ? warning(props.selected == null, 'Use the `defaultValue` or `value` props on <select> instead of ' + 'setting `selected` on <option>.') : void 0; + } + + // Look up whether this option is 'selected' + var selectValue = null; + if (hostParent != null) { + var selectParent = hostParent; + + if (selectParent._tag === 'optgroup') { + selectParent = selectParent._hostParent; + } + + if (selectParent != null && selectParent._tag === 'select') { + selectValue = ReactDOMSelect.getSelectValueContext(selectParent); + } + } + + // If the value is null (e.g., no specified value or after initial mount) + // or missing (e.g., for <datalist>), we don't change props.selected + var selected = null; + if (selectValue != null) { + var value; + if (props.value != null) { + value = props.value + ''; + } else { + value = flattenChildren(props.children); + } + selected = false; + if (Array.isArray(selectValue)) { + // multiple + for (var i = 0; i < selectValue.length; i++) { + if ('' + selectValue[i] === value) { + selected = true; + break; + } + } + } else { + selected = '' + selectValue === value; + } + } + + inst._wrapperState = { selected: selected }; + }, + + postMountWrapper: function (inst) { + // value="" should make a value attribute (#6219) + var props = inst._currentElement.props; + if (props.value != null) { + var node = ReactDOMComponentTree.getNodeFromInstance(inst); + node.setAttribute('value', props.value); + } + }, + + getHostProps: function (inst, props) { + var hostProps = _assign({ selected: undefined, children: undefined }, props); + + // Read state only from initial mount because <select> updates value + // manually; we need the initial state only for server rendering + if (inst._wrapperState.selected != null) { + hostProps.selected = inst._wrapperState.selected; + } + + var content = flattenChildren(props.children); + + if (content) { + hostProps.children = content; + } + + return hostProps; + } +}; + +module.exports = ReactDOMOption; +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) + +/***/ }), +/* 165 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(process) {/** + * 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__(4), + _assign = __webpack_require__(8); + +var LinkedValueUtils = __webpack_require__(50); +var ReactDOMComponentTree = __webpack_require__(7); +var ReactUpdates = __webpack_require__(15); + +var invariant = __webpack_require__(1); +var warning = __webpack_require__(3); + +var didWarnValueLink = false; +var didWarnValDefaultVal = false; + +function forceUpdateIfMounted() { + if (this._rootNodeID) { + // DOM component is still mounted; update + ReactDOMTextarea.updateWrapper(this); + } +} + +/** + * Implements a <textarea> host component that allows setting `value`, and + * `defaultValue`. This differs from the traditional DOM API because value is + * usually set as PCDATA children. + * + * If `value` is not supplied (or null/undefined), user actions that affect the + * value will trigger updates to the element. + * + * If `value` is supplied (and not null/undefined), the rendered element will + * not trigger updates to the element. Instead, the `value` prop must change in + * order for the rendered element to be updated. + * + * The rendered element will be initialized with an empty value, the prop + * `defaultValue` if specified, or the children content (deprecated). + */ +var ReactDOMTextarea = { + getHostProps: function (inst, props) { + !(props.dangerouslySetInnerHTML == null) ? process.env.NODE_ENV !== 'production' ? invariant(false, '`dangerouslySetInnerHTML` does not make sense on <textarea>.') : _prodInvariant('91') : void 0; + + // Always set children to the same thing. In IE9, the selection range will + // get reset if `textContent` is mutated. We could add a check in setTextContent + // to only set the value if/when the value differs from the node value (which would + // completely solve this IE9 bug), but Sebastian+Ben seemed to like this solution. + // The value can be a boolean or object so that's why it's forced to be a string. + var hostProps = _assign({}, props, { + value: undefined, + defaultValue: undefined, + children: '' + inst._wrapperState.initialValue, + onChange: inst._wrapperState.onChange + }); + + return hostProps; + }, + + mountWrapper: function (inst, props) { + if (process.env.NODE_ENV !== 'production') { + LinkedValueUtils.checkPropTypes('textarea', props, inst._currentElement._owner); + if (props.valueLink !== undefined && !didWarnValueLink) { + process.env.NODE_ENV !== 'production' ? warning(false, '`valueLink` prop on `textarea` is deprecated; set `value` and `onChange` instead.') : void 0; + didWarnValueLink = true; + } + if (props.value !== undefined && props.defaultValue !== undefined && !didWarnValDefaultVal) { + process.env.NODE_ENV !== 'production' ? warning(false, 'Textarea elements must be either controlled or uncontrolled ' + '(specify either the value prop, or the defaultValue prop, but not ' + 'both). Decide between using a controlled or uncontrolled textarea ' + 'and remove one of these props. More info: ' + 'https://fb.me/react-controlled-components') : void 0; + didWarnValDefaultVal = true; + } + } + + var value = LinkedValueUtils.getValue(props); + var initialValue = value; + + // Only bother fetching default value if we're going to use it + if (value == null) { + var defaultValue = props.defaultValue; + // TODO (yungsters): Remove support for children content in <textarea>. + var children = props.children; + if (children != null) { + if (process.env.NODE_ENV !== 'production') { + process.env.NODE_ENV !== 'production' ? warning(false, 'Use the `defaultValue` or `value` props instead of setting ' + 'children on <textarea>.') : void 0; + } + !(defaultValue == null) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'If you supply `defaultValue` on a <textarea>, do not pass children.') : _prodInvariant('92') : void 0; + if (Array.isArray(children)) { + !(children.length <= 1) ? process.env.NODE_ENV !== 'production' ? invariant(false, '<textarea> can only have at most one child.') : _prodInvariant('93') : void 0; + children = children[0]; + } + + defaultValue = '' + children; + } + if (defaultValue == null) { + defaultValue = ''; + } + initialValue = defaultValue; + } + + inst._wrapperState = { + initialValue: '' + initialValue, + listeners: null, + onChange: _handleChange.bind(inst) + }; + }, + + updateWrapper: function (inst) { + var props = inst._currentElement.props; + + var node = ReactDOMComponentTree.getNodeFromInstance(inst); + var value = LinkedValueUtils.getValue(props); + if (value != null) { + // Cast `value` to a string to ensure the value is set correctly. While + // browsers typically do this as necessary, jsdom doesn't. + var newValue = '' + value; + + // To avoid side effects (such as losing text selection), only set value if changed + if (newValue !== node.value) { + node.value = newValue; + } + if (props.defaultValue == null) { + node.defaultValue = newValue; + } + } + if (props.defaultValue != null) { + node.defaultValue = props.defaultValue; + } + }, + + postMountWrapper: function (inst) { + // This is in postMount because we need access to the DOM node, which is not + // available until after the component has mounted. + var node = ReactDOMComponentTree.getNodeFromInstance(inst); + var textContent = node.textContent; + + // Only set node.value if textContent is equal to the expected + // initial value. In IE10/IE11 there is a bug where the placeholder attribute + // will populate textContent as well. + // https://developer.microsoft.com/microsoft-edge/platform/issues/101525/ + if (textContent === inst._wrapperState.initialValue) { + node.value = textContent; + } + } +}; + +function _handleChange(event) { + var props = this._currentElement.props; + var returnValue = LinkedValueUtils.executeOnChange(props, event); + ReactUpdates.asap(forceUpdateIfMounted, this); + return returnValue; +} + +module.exports = ReactDOMTextarea; +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) + +/***/ }), +/* 166 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(process) {/** + * 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__(4); + +var ReactComponentEnvironment = __webpack_require__(51); +var ReactInstanceMap = __webpack_require__(29); +var ReactInstrumentation = __webpack_require__(13); + +var ReactCurrentOwner = __webpack_require__(14); +var ReactReconciler = __webpack_require__(23); +var ReactChildReconciler = __webpack_require__(167); + +var emptyFunction = __webpack_require__(12); +var flattenChildren = __webpack_require__(174); +var invariant = __webpack_require__(1); + +/** + * Make an update for markup to be rendered and inserted at a supplied index. + * + * @param {string} markup Markup that renders into an element. + * @param {number} toIndex Destination index. + * @private + */ +function makeInsertMarkup(markup, afterNode, toIndex) { + // NOTE: Null values reduce hidden classes. + return { + type: 'INSERT_MARKUP', + content: markup, + fromIndex: null, + fromNode: null, + toIndex: toIndex, + afterNode: afterNode + }; +} + +/** + * Make an update for moving an existing element to another index. + * + * @param {number} fromIndex Source index of the existing element. + * @param {number} toIndex Destination index of the element. + * @private + */ +function makeMove(child, afterNode, toIndex) { + // NOTE: Null values reduce hidden classes. + return { + type: 'MOVE_EXISTING', + content: null, + fromIndex: child._mountIndex, + fromNode: ReactReconciler.getHostNode(child), + toIndex: toIndex, + afterNode: afterNode + }; +} + +/** + * Make an update for removing an element at an index. + * + * @param {number} fromIndex Index of the element to remove. + * @private + */ +function makeRemove(child, node) { + // NOTE: Null values reduce hidden classes. + return { + type: 'REMOVE_NODE', + content: null, + fromIndex: child._mountIndex, + fromNode: node, + toIndex: null, + afterNode: null + }; +} + +/** + * Make an update for setting the markup of a node. + * + * @param {string} markup Markup that renders into an element. + * @private + */ +function makeSetMarkup(markup) { + // NOTE: Null values reduce hidden classes. + return { + type: 'SET_MARKUP', + content: markup, + fromIndex: null, + fromNode: null, + toIndex: null, + afterNode: null + }; +} + +/** + * Make an update for setting the text content. + * + * @param {string} textContent Text content to set. + * @private + */ +function makeTextContent(textContent) { + // NOTE: Null values reduce hidden classes. + return { + type: 'TEXT_CONTENT', + content: textContent, + fromIndex: null, + fromNode: null, + toIndex: null, + afterNode: null + }; +} + +/** + * Push an update, if any, onto the queue. Creates a new queue if none is + * passed and always returns the queue. Mutative. + */ +function enqueue(queue, update) { + if (update) { + queue = queue || []; + queue.push(update); + } + return queue; +} + +/** + * Processes any enqueued updates. + * + * @private + */ +function processQueue(inst, updateQueue) { + ReactComponentEnvironment.processChildrenUpdates(inst, updateQueue); +} + +var setChildrenForInstrumentation = emptyFunction; +if (process.env.NODE_ENV !== 'production') { + var getDebugID = function (inst) { + if (!inst._debugID) { + // Check for ART-like instances. TODO: This is silly/gross. + var internal; + if (internal = ReactInstanceMap.get(inst)) { + inst = internal; + } + } + return inst._debugID; + }; + setChildrenForInstrumentation = function (children) { + var debugID = getDebugID(this); + // TODO: React Native empty components are also multichild. + // This means they still get into this method but don't have _debugID. + if (debugID !== 0) { + ReactInstrumentation.debugTool.onSetChildren(debugID, children ? Object.keys(children).map(function (key) { + return children[key]._debugID; + }) : []); + } + }; +} + +/** + * ReactMultiChild are capable of reconciling multiple children. + * + * @class ReactMultiChild + * @internal + */ +var ReactMultiChild = { + /** + * Provides common functionality for components that must reconcile multiple + * children. This is used by `ReactDOMComponent` to mount, update, and + * unmount child components. + * + * @lends {ReactMultiChild.prototype} + */ + Mixin: { + _reconcilerInstantiateChildren: function (nestedChildren, transaction, context) { + if (process.env.NODE_ENV !== 'production') { + var selfDebugID = getDebugID(this); + if (this._currentElement) { + try { + ReactCurrentOwner.current = this._currentElement._owner; + return ReactChildReconciler.instantiateChildren(nestedChildren, transaction, context, selfDebugID); + } finally { + ReactCurrentOwner.current = null; + } + } + } + return ReactChildReconciler.instantiateChildren(nestedChildren, transaction, context); + }, + + _reconcilerUpdateChildren: function (prevChildren, nextNestedChildrenElements, mountImages, removedNodes, transaction, context) { + var nextChildren; + var selfDebugID = 0; + if (process.env.NODE_ENV !== 'production') { + selfDebugID = getDebugID(this); + if (this._currentElement) { + try { + ReactCurrentOwner.current = this._currentElement._owner; + nextChildren = flattenChildren(nextNestedChildrenElements, selfDebugID); + } finally { + ReactCurrentOwner.current = null; + } + ReactChildReconciler.updateChildren(prevChildren, nextChildren, mountImages, removedNodes, transaction, this, this._hostContainerInfo, context, selfDebugID); + return nextChildren; + } + } + nextChildren = flattenChildren(nextNestedChildrenElements, selfDebugID); + ReactChildReconciler.updateChildren(prevChildren, nextChildren, mountImages, removedNodes, transaction, this, this._hostContainerInfo, context, selfDebugID); + return nextChildren; + }, + + /** + * Generates a "mount image" for each of the supplied children. In the case + * of `ReactDOMComponent`, a mount image is a string of markup. + * + * @param {?object} nestedChildren Nested child maps. + * @return {array} An array of mounted representations. + * @internal + */ + mountChildren: function (nestedChildren, transaction, context) { + var children = this._reconcilerInstantiateChildren(nestedChildren, transaction, context); + this._renderedChildren = children; + + var mountImages = []; + var index = 0; + for (var name in children) { + if (children.hasOwnProperty(name)) { + var child = children[name]; + var selfDebugID = 0; + if (process.env.NODE_ENV !== 'production') { + selfDebugID = getDebugID(this); + } + var mountImage = ReactReconciler.mountComponent(child, transaction, this, this._hostContainerInfo, context, selfDebugID); + child._mountIndex = index++; + mountImages.push(mountImage); + } + } + + if (process.env.NODE_ENV !== 'production') { + setChildrenForInstrumentation.call(this, children); + } + + return mountImages; + }, + + /** + * Replaces any rendered children with a text content string. + * + * @param {string} nextContent String of content. + * @internal + */ + updateTextContent: function (nextContent) { + var prevChildren = this._renderedChildren; + // Remove any rendered children. + ReactChildReconciler.unmountChildren(prevChildren, false); + for (var name in prevChildren) { + if (prevChildren.hasOwnProperty(name)) { + true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'updateTextContent called on non-empty component.') : _prodInvariant('118') : void 0; + } + } + // Set new text content. + var updates = [makeTextContent(nextContent)]; + processQueue(this, updates); + }, + + /** + * Replaces any rendered children with a markup string. + * + * @param {string} nextMarkup String of markup. + * @internal + */ + updateMarkup: function (nextMarkup) { + var prevChildren = this._renderedChildren; + // Remove any rendered children. + ReactChildReconciler.unmountChildren(prevChildren, false); + for (var name in prevChildren) { + if (prevChildren.hasOwnProperty(name)) { + true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'updateTextContent called on non-empty component.') : _prodInvariant('118') : void 0; + } + } + var updates = [makeSetMarkup(nextMarkup)]; + processQueue(this, updates); + }, + + /** + * Updates the rendered children with new children. + * + * @param {?object} nextNestedChildrenElements Nested child element maps. + * @param {ReactReconcileTransaction} transaction + * @internal + */ + updateChildren: function (nextNestedChildrenElements, transaction, context) { + // Hook used by React ART + this._updateChildren(nextNestedChildrenElements, transaction, context); + }, + + /** + * @param {?object} nextNestedChildrenElements Nested child element maps. + * @param {ReactReconcileTransaction} transaction + * @final + * @protected + */ + _updateChildren: function (nextNestedChildrenElements, transaction, context) { + var prevChildren = this._renderedChildren; + var removedNodes = {}; + var mountImages = []; + var nextChildren = this._reconcilerUpdateChildren(prevChildren, nextNestedChildrenElements, mountImages, removedNodes, transaction, context); + if (!nextChildren && !prevChildren) { + return; + } + var updates = null; + var name; + // `nextIndex` will increment for each child in `nextChildren`, but + // `lastIndex` will be the last index visited in `prevChildren`. + var nextIndex = 0; + var lastIndex = 0; + // `nextMountIndex` will increment for each newly mounted child. + var nextMountIndex = 0; + var lastPlacedNode = null; + for (name in nextChildren) { + if (!nextChildren.hasOwnProperty(name)) { + continue; + } + var prevChild = prevChildren && prevChildren[name]; + var nextChild = nextChildren[name]; + if (prevChild === nextChild) { + updates = enqueue(updates, this.moveChild(prevChild, lastPlacedNode, nextIndex, lastIndex)); + lastIndex = Math.max(prevChild._mountIndex, lastIndex); + prevChild._mountIndex = nextIndex; + } else { + if (prevChild) { + // Update `lastIndex` before `_mountIndex` gets unset by unmounting. + lastIndex = Math.max(prevChild._mountIndex, lastIndex); + // The `removedNodes` loop below will actually remove the child. + } + // The child must be instantiated before it's mounted. + updates = enqueue(updates, this._mountChildAtIndex(nextChild, mountImages[nextMountIndex], lastPlacedNode, nextIndex, transaction, context)); + nextMountIndex++; + } + nextIndex++; + lastPlacedNode = ReactReconciler.getHostNode(nextChild); + } + // Remove children that are no longer present. + for (name in removedNodes) { + if (removedNodes.hasOwnProperty(name)) { + updates = enqueue(updates, this._unmountChild(prevChildren[name], removedNodes[name])); + } + } + if (updates) { + processQueue(this, updates); + } + this._renderedChildren = nextChildren; + + if (process.env.NODE_ENV !== 'production') { + setChildrenForInstrumentation.call(this, nextChildren); + } + }, + + /** + * Unmounts all rendered children. This should be used to clean up children + * when this component is unmounted. It does not actually perform any + * backend operations. + * + * @internal + */ + unmountChildren: function (safely) { + var renderedChildren = this._renderedChildren; + ReactChildReconciler.unmountChildren(renderedChildren, safely); + this._renderedChildren = null; + }, + + /** + * Moves a child component to the supplied index. + * + * @param {ReactComponent} child Component to move. + * @param {number} toIndex Destination index of the element. + * @param {number} lastIndex Last index visited of the siblings of `child`. + * @protected + */ + moveChild: function (child, afterNode, toIndex, lastIndex) { + // If the index of `child` is less than `lastIndex`, then it needs to + // be moved. Otherwise, we do not need to move it because a child will be + // inserted or moved before `child`. + if (child._mountIndex < lastIndex) { + return makeMove(child, afterNode, toIndex); + } + }, + + /** + * Creates a child component. + * + * @param {ReactComponent} child Component to create. + * @param {string} mountImage Markup to insert. + * @protected + */ + createChild: function (child, afterNode, mountImage) { + return makeInsertMarkup(mountImage, afterNode, child._mountIndex); + }, + + /** + * Removes a child component. + * + * @param {ReactComponent} child Child to remove. + * @protected + */ + removeChild: function (child, node) { + return makeRemove(child, node); + }, + + /** + * Mounts a child with the supplied name. + * + * NOTE: This is part of `updateChildren` and is here for readability. + * + * @param {ReactComponent} child Component to mount. + * @param {string} name Name of the child. + * @param {number} index Index at which to insert the child. + * @param {ReactReconcileTransaction} transaction + * @private + */ + _mountChildAtIndex: function (child, mountImage, afterNode, index, transaction, context) { + child._mountIndex = index; + return this.createChild(child, afterNode, mountImage); + }, + + /** + * Unmounts a rendered child. + * + * NOTE: This is part of `updateChildren` and is here for readability. + * + * @param {ReactComponent} child Component to unmount. + * @private + */ + _unmountChild: function (child, node) { + var update = this.removeChild(child, node); + child._mountIndex = null; + return update; + } + } +}; + +module.exports = ReactMultiChild; +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) + +/***/ }), +/* 167 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(process) {/** + * 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 ReactReconciler = __webpack_require__(23); + +var instantiateReactComponent = __webpack_require__(85); +var KeyEscapeUtils = __webpack_require__(54); +var shouldUpdateReactComponent = __webpack_require__(53); +var traverseAllChildren = __webpack_require__(89); +var warning = __webpack_require__(3); + +var ReactComponentTreeHook; + +if (typeof process !== 'undefined' && process.env && process.env.NODE_ENV === 'test') { + // Temporary hack. + // Inline requires don't work well with Jest: + // https://github.com/facebook/react/issues/7240 + // Remove the inline requires when we don't need them anymore: + // https://github.com/facebook/react/pull/7178 + ReactComponentTreeHook = __webpack_require__(11); +} + +function instantiateChild(childInstances, child, name, selfDebugID) { + // We found a component instance. + var keyUnique = childInstances[name] === undefined; + if (process.env.NODE_ENV !== 'production') { + if (!ReactComponentTreeHook) { + ReactComponentTreeHook = __webpack_require__(11); + } + if (!keyUnique) { + process.env.NODE_ENV !== 'production' ? warning(false, 'flattenChildren(...): Encountered two children with the same key, ' + '`%s`. Child keys must be unique; when two children share a key, only ' + 'the first child will be used.%s', KeyEscapeUtils.unescape(name), ReactComponentTreeHook.getStackAddendumByID(selfDebugID)) : void 0; + } + } + if (child != null && keyUnique) { + childInstances[name] = instantiateReactComponent(child, true); + } +} + +/** + * ReactChildReconciler provides helpers for initializing or updating a set of + * children. Its output is suitable for passing it onto ReactMultiChild which + * does diffed reordering and insertion. + */ +var ReactChildReconciler = { + /** + * Generates a "mount image" for each of the supplied children. In the case + * of `ReactDOMComponent`, a mount image is a string of markup. + * + * @param {?object} nestedChildNodes Nested child maps. + * @return {?object} A set of child instances. + * @internal + */ + instantiateChildren: function (nestedChildNodes, transaction, context, selfDebugID) // 0 in production and for roots + { + if (nestedChildNodes == null) { + return null; + } + var childInstances = {}; + + if (process.env.NODE_ENV !== 'production') { + traverseAllChildren(nestedChildNodes, function (childInsts, child, name) { + return instantiateChild(childInsts, child, name, selfDebugID); + }, childInstances); + } else { + traverseAllChildren(nestedChildNodes, instantiateChild, childInstances); + } + return childInstances; + }, + + /** + * Updates the rendered children and returns a new set of children. + * + * @param {?object} prevChildren Previously initialized set of children. + * @param {?object} nextChildren Flat child element maps. + * @param {ReactReconcileTransaction} transaction + * @param {object} context + * @return {?object} A new set of child instances. + * @internal + */ + updateChildren: function (prevChildren, nextChildren, mountImages, removedNodes, transaction, hostParent, hostContainerInfo, context, selfDebugID) // 0 in production and for roots + { + // We currently don't have a way to track moves here but if we use iterators + // instead of for..in we can zip the iterators and check if an item has + // moved. + // TODO: If nothing has changed, return the prevChildren object so that we + // can quickly bailout if nothing has changed. + if (!nextChildren && !prevChildren) { + return; + } + var name; + var prevChild; + for (name in nextChildren) { + if (!nextChildren.hasOwnProperty(name)) { + continue; + } + prevChild = prevChildren && prevChildren[name]; + var prevElement = prevChild && prevChild._currentElement; + var nextElement = nextChildren[name]; + if (prevChild != null && shouldUpdateReactComponent(prevElement, nextElement)) { + ReactReconciler.receiveComponent(prevChild, nextElement, transaction, context); + nextChildren[name] = prevChild; + } else { + if (prevChild) { + removedNodes[name] = ReactReconciler.getHostNode(prevChild); + ReactReconciler.unmountComponent(prevChild, false); + } + // The child must be instantiated before it's mounted. + var nextChildInstance = instantiateReactComponent(nextElement, true); + nextChildren[name] = nextChildInstance; + // Creating mount image now ensures refs are resolved in right order + // (see https://github.com/facebook/react/pull/7101 for explanation). + var nextChildMountImage = ReactReconciler.mountComponent(nextChildInstance, transaction, hostParent, hostContainerInfo, context, selfDebugID); + mountImages.push(nextChildMountImage); + } + } + // Unmount children that are no longer present. + for (name in prevChildren) { + if (prevChildren.hasOwnProperty(name) && !(nextChildren && nextChildren.hasOwnProperty(name))) { + prevChild = prevChildren[name]; + removedNodes[name] = ReactReconciler.getHostNode(prevChild); + ReactReconciler.unmountComponent(prevChild, false); + } + } + }, + + /** + * Unmounts all rendered children. This should be used to clean up children + * when this component is unmounted. + * + * @param {?object} renderedChildren Previously initialized set of children. + * @internal + */ + unmountChildren: function (renderedChildren, safely) { + for (var name in renderedChildren) { + if (renderedChildren.hasOwnProperty(name)) { + var renderedChild = renderedChildren[name]; + ReactReconciler.unmountComponent(renderedChild, safely); + } + } + } +}; + +module.exports = ReactChildReconciler; +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) + +/***/ }), +/* 168 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(process) {/** + * 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__(4), + _assign = __webpack_require__(8); + +var React = __webpack_require__(21); +var ReactComponentEnvironment = __webpack_require__(51); +var ReactCurrentOwner = __webpack_require__(14); +var ReactErrorUtils = __webpack_require__(43); +var ReactInstanceMap = __webpack_require__(29); +var ReactInstrumentation = __webpack_require__(13); +var ReactNodeTypes = __webpack_require__(86); +var ReactReconciler = __webpack_require__(23); + +if (process.env.NODE_ENV !== 'production') { + var checkReactTypeSpec = __webpack_require__(169); +} + +var emptyObject = __webpack_require__(31); +var invariant = __webpack_require__(1); +var shallowEqual = __webpack_require__(52); +var shouldUpdateReactComponent = __webpack_require__(53); +var warning = __webpack_require__(3); + +var CompositeTypes = { + ImpureClass: 0, + PureClass: 1, + StatelessFunctional: 2 +}; + +function StatelessComponent(Component) {} +StatelessComponent.prototype.render = function () { + var Component = ReactInstanceMap.get(this)._currentElement.type; + var element = Component(this.props, this.context, this.updater); + warnIfInvalidElement(Component, element); + return element; +}; + +function warnIfInvalidElement(Component, element) { + if (process.env.NODE_ENV !== 'production') { + process.env.NODE_ENV !== 'production' ? warning(element === null || element === false || React.isValidElement(element), '%s(...): A valid React element (or null) must be returned. You may have ' + 'returned undefined, an array or some other invalid object.', Component.displayName || Component.name || 'Component') : void 0; + process.env.NODE_ENV !== 'production' ? warning(!Component.childContextTypes, '%s(...): childContextTypes cannot be defined on a functional component.', Component.displayName || Component.name || 'Component') : void 0; + } +} + +function shouldConstruct(Component) { + return !!(Component.prototype && Component.prototype.isReactComponent); +} + +function isPureComponent(Component) { + return !!(Component.prototype && Component.prototype.isPureReactComponent); +} + +// Separated into a function to contain deoptimizations caused by try/finally. +function measureLifeCyclePerf(fn, debugID, timerType) { + if (debugID === 0) { + // Top-level wrappers (see ReactMount) and empty components (see + // ReactDOMEmptyComponent) are invisible to hooks and devtools. + // Both are implementation details that should go away in the future. + return fn(); + } + + ReactInstrumentation.debugTool.onBeginLifeCycleTimer(debugID, timerType); + try { + return fn(); + } finally { + ReactInstrumentation.debugTool.onEndLifeCycleTimer(debugID, timerType); + } +} + +/** + * ------------------ The Life-Cycle of a Composite Component ------------------ + * + * - constructor: Initialization of state. The instance is now retained. + * - componentWillMount + * - render + * - [children's constructors] + * - [children's componentWillMount and render] + * - [children's componentDidMount] + * - componentDidMount + * + * Update Phases: + * - componentWillReceiveProps (only called if parent updated) + * - shouldComponentUpdate + * - componentWillUpdate + * - render + * - [children's constructors or receive props phases] + * - componentDidUpdate + * + * - componentWillUnmount + * - [children's componentWillUnmount] + * - [children destroyed] + * - (destroyed): The instance is now blank, released by React and ready for GC. + * + * ----------------------------------------------------------------------------- + */ + +/** + * An incrementing ID assigned to each component when it is mounted. This is + * used to enforce the order in which `ReactUpdates` updates dirty components. + * + * @private + */ +var nextMountID = 1; + +/** + * @lends {ReactCompositeComponent.prototype} + */ +var ReactCompositeComponent = { + /** + * Base constructor for all composite component. + * + * @param {ReactElement} element + * @final + * @internal + */ + construct: function (element) { + this._currentElement = element; + this._rootNodeID = 0; + this._compositeType = null; + this._instance = null; + this._hostParent = null; + this._hostContainerInfo = null; + + // See ReactUpdateQueue + this._updateBatchNumber = null; + this._pendingElement = null; + this._pendingStateQueue = null; + this._pendingReplaceState = false; + this._pendingForceUpdate = false; + + this._renderedNodeType = null; + this._renderedComponent = null; + this._context = null; + this._mountOrder = 0; + this._topLevelWrapper = null; + + // See ReactUpdates and ReactUpdateQueue. + this._pendingCallbacks = null; + + // ComponentWillUnmount shall only be called once + this._calledComponentWillUnmount = false; + + if (process.env.NODE_ENV !== 'production') { + this._warnedAboutRefsInRender = false; + } + }, + + /** + * Initializes the component, renders markup, and registers event listeners. + * + * @param {ReactReconcileTransaction|ReactServerRenderingTransaction} transaction + * @param {?object} hostParent + * @param {?object} hostContainerInfo + * @param {?object} context + * @return {?string} Rendered markup to be inserted into the DOM. + * @final + * @internal + */ + mountComponent: function (transaction, hostParent, hostContainerInfo, context) { + var _this = this; + + this._context = context; + this._mountOrder = nextMountID++; + this._hostParent = hostParent; + this._hostContainerInfo = hostContainerInfo; + + var publicProps = this._currentElement.props; + var publicContext = this._processContext(context); + + var Component = this._currentElement.type; + + var updateQueue = transaction.getUpdateQueue(); + + // Initialize the public class + var doConstruct = shouldConstruct(Component); + var inst = this._constructComponent(doConstruct, publicProps, publicContext, updateQueue); + var renderedElement; + + // Support functional components + if (!doConstruct && (inst == null || inst.render == null)) { + renderedElement = inst; + warnIfInvalidElement(Component, renderedElement); + !(inst === null || inst === false || React.isValidElement(inst)) ? process.env.NODE_ENV !== 'production' ? invariant(false, '%s(...): A valid React element (or null) must be returned. You may have returned undefined, an array or some other invalid object.', Component.displayName || Component.name || 'Component') : _prodInvariant('105', Component.displayName || Component.name || 'Component') : void 0; + inst = new StatelessComponent(Component); + this._compositeType = CompositeTypes.StatelessFunctional; + } else { + if (isPureComponent(Component)) { + this._compositeType = CompositeTypes.PureClass; + } else { + this._compositeType = CompositeTypes.ImpureClass; + } + } + + if (process.env.NODE_ENV !== 'production') { + // This will throw later in _renderValidatedComponent, but add an early + // warning now to help debugging + if (inst.render == null) { + process.env.NODE_ENV !== 'production' ? warning(false, '%s(...): No `render` method found on the returned component ' + 'instance: you may have forgotten to define `render`.', Component.displayName || Component.name || 'Component') : void 0; + } + + var propsMutated = inst.props !== publicProps; + var componentName = Component.displayName || Component.name || 'Component'; + + process.env.NODE_ENV !== 'production' ? warning(inst.props === undefined || !propsMutated, '%s(...): When calling super() in `%s`, make sure to pass ' + "up the same props that your component's constructor was passed.", componentName, componentName) : void 0; + } + + // These should be set up in the constructor, but as a convenience for + // simpler class abstractions, we set them up after the fact. + inst.props = publicProps; + inst.context = publicContext; + inst.refs = emptyObject; + inst.updater = updateQueue; + + this._instance = inst; + + // Store a reference from the instance back to the internal representation + ReactInstanceMap.set(inst, this); + + if (process.env.NODE_ENV !== 'production') { + // Since plain JS classes are defined without any special initialization + // logic, we can not catch common errors early. Therefore, we have to + // catch them here, at initialization time, instead. + process.env.NODE_ENV !== 'production' ? warning(!inst.getInitialState || inst.getInitialState.isReactClassApproved || inst.state, 'getInitialState was defined on %s, a plain JavaScript class. ' + 'This is only supported for classes created using React.createClass. ' + 'Did you mean to define a state property instead?', this.getName() || 'a component') : void 0; + process.env.NODE_ENV !== 'production' ? warning(!inst.getDefaultProps || inst.getDefaultProps.isReactClassApproved, 'getDefaultProps was defined on %s, a plain JavaScript class. ' + 'This is only supported for classes created using React.createClass. ' + 'Use a static property to define defaultProps instead.', this.getName() || 'a component') : void 0; + process.env.NODE_ENV !== 'production' ? warning(!inst.propTypes, 'propTypes was defined as an instance property on %s. Use a static ' + 'property to define propTypes instead.', this.getName() || 'a component') : void 0; + process.env.NODE_ENV !== 'production' ? warning(!inst.contextTypes, 'contextTypes was defined as an instance property on %s. Use a ' + 'static property to define contextTypes instead.', this.getName() || 'a component') : void 0; + process.env.NODE_ENV !== 'production' ? warning(typeof inst.componentShouldUpdate !== 'function', '%s has a method called ' + 'componentShouldUpdate(). Did you mean shouldComponentUpdate()? ' + 'The name is phrased as a question because the function is ' + 'expected to return a value.', this.getName() || 'A component') : void 0; + process.env.NODE_ENV !== 'production' ? warning(typeof inst.componentDidUnmount !== 'function', '%s has a method called ' + 'componentDidUnmount(). But there is no such lifecycle method. ' + 'Did you mean componentWillUnmount()?', this.getName() || 'A component') : void 0; + process.env.NODE_ENV !== 'production' ? warning(typeof inst.componentWillRecieveProps !== 'function', '%s has a method called ' + 'componentWillRecieveProps(). Did you mean componentWillReceiveProps()?', this.getName() || 'A component') : void 0; + } + + var initialState = inst.state; + if (initialState === undefined) { + inst.state = initialState = null; + } + !(typeof initialState === 'object' && !Array.isArray(initialState)) ? process.env.NODE_ENV !== 'production' ? invariant(false, '%s.state: must be set to an object or null', this.getName() || 'ReactCompositeComponent') : _prodInvariant('106', this.getName() || 'ReactCompositeComponent') : void 0; + + this._pendingStateQueue = null; + this._pendingReplaceState = false; + this._pendingForceUpdate = false; + + var markup; + if (inst.unstable_handleError) { + markup = this.performInitialMountWithErrorHandling(renderedElement, hostParent, hostContainerInfo, transaction, context); + } else { + markup = this.performInitialMount(renderedElement, hostParent, hostContainerInfo, transaction, context); + } + + if (inst.componentDidMount) { + if (process.env.NODE_ENV !== 'production') { + transaction.getReactMountReady().enqueue(function () { + measureLifeCyclePerf(function () { + return inst.componentDidMount(); + }, _this._debugID, 'componentDidMount'); + }); + } else { + transaction.getReactMountReady().enqueue(inst.componentDidMount, inst); + } + } + + return markup; + }, + + _constructComponent: function (doConstruct, publicProps, publicContext, updateQueue) { + if (process.env.NODE_ENV !== 'production' && !doConstruct) { + ReactCurrentOwner.current = this; + try { + return this._constructComponentWithoutOwner(doConstruct, publicProps, publicContext, updateQueue); + } finally { + ReactCurrentOwner.current = null; + } + } else { + return this._constructComponentWithoutOwner(doConstruct, publicProps, publicContext, updateQueue); + } + }, + + _constructComponentWithoutOwner: function (doConstruct, publicProps, publicContext, updateQueue) { + var Component = this._currentElement.type; + + if (doConstruct) { + if (process.env.NODE_ENV !== 'production') { + return measureLifeCyclePerf(function () { + return new Component(publicProps, publicContext, updateQueue); + }, this._debugID, 'ctor'); + } else { + return new Component(publicProps, publicContext, updateQueue); + } + } + + // This can still be an instance in case of factory components + // but we'll count this as time spent rendering as the more common case. + if (process.env.NODE_ENV !== 'production') { + return measureLifeCyclePerf(function () { + return Component(publicProps, publicContext, updateQueue); + }, this._debugID, 'render'); + } else { + return Component(publicProps, publicContext, updateQueue); + } + }, + + performInitialMountWithErrorHandling: function (renderedElement, hostParent, hostContainerInfo, transaction, context) { + var markup; + var checkpoint = transaction.checkpoint(); + try { + markup = this.performInitialMount(renderedElement, hostParent, hostContainerInfo, transaction, context); + } catch (e) { + // Roll back to checkpoint, handle error (which may add items to the transaction), and take a new checkpoint + transaction.rollback(checkpoint); + this._instance.unstable_handleError(e); + if (this._pendingStateQueue) { + this._instance.state = this._processPendingState(this._instance.props, this._instance.context); + } + checkpoint = transaction.checkpoint(); + + this._renderedComponent.unmountComponent(true); + transaction.rollback(checkpoint); + + // Try again - we've informed the component about the error, so they can render an error message this time. + // If this throws again, the error will bubble up (and can be caught by a higher error boundary). + markup = this.performInitialMount(renderedElement, hostParent, hostContainerInfo, transaction, context); + } + return markup; + }, + + performInitialMount: function (renderedElement, hostParent, hostContainerInfo, transaction, context) { + var inst = this._instance; + + var debugID = 0; + if (process.env.NODE_ENV !== 'production') { + debugID = this._debugID; + } + + if (inst.componentWillMount) { + if (process.env.NODE_ENV !== 'production') { + measureLifeCyclePerf(function () { + return inst.componentWillMount(); + }, debugID, 'componentWillMount'); + } else { + inst.componentWillMount(); + } + // When mounting, calls to `setState` by `componentWillMount` will set + // `this._pendingStateQueue` without triggering a re-render. + if (this._pendingStateQueue) { + inst.state = this._processPendingState(inst.props, inst.context); + } + } + + // If not a stateless component, we now render + if (renderedElement === undefined) { + renderedElement = this._renderValidatedComponent(); + } + + var nodeType = ReactNodeTypes.getType(renderedElement); + this._renderedNodeType = nodeType; + var child = this._instantiateReactComponent(renderedElement, nodeType !== ReactNodeTypes.EMPTY /* shouldHaveDebugID */ + ); + this._renderedComponent = child; + + var markup = ReactReconciler.mountComponent(child, transaction, hostParent, hostContainerInfo, this._processChildContext(context), debugID); + + if (process.env.NODE_ENV !== 'production') { + if (debugID !== 0) { + var childDebugIDs = child._debugID !== 0 ? [child._debugID] : []; + ReactInstrumentation.debugTool.onSetChildren(debugID, childDebugIDs); + } + } + + return markup; + }, + + getHostNode: function () { + return ReactReconciler.getHostNode(this._renderedComponent); + }, + + /** + * Releases any resources allocated by `mountComponent`. + * + * @final + * @internal + */ + unmountComponent: function (safely) { + if (!this._renderedComponent) { + return; + } + + var inst = this._instance; + + if (inst.componentWillUnmount && !inst._calledComponentWillUnmount) { + inst._calledComponentWillUnmount = true; + + if (safely) { + var name = this.getName() + '.componentWillUnmount()'; + ReactErrorUtils.invokeGuardedCallback(name, inst.componentWillUnmount.bind(inst)); + } else { + if (process.env.NODE_ENV !== 'production') { + measureLifeCyclePerf(function () { + return inst.componentWillUnmount(); + }, this._debugID, 'componentWillUnmount'); + } else { + inst.componentWillUnmount(); + } + } + } + + if (this._renderedComponent) { + ReactReconciler.unmountComponent(this._renderedComponent, safely); + this._renderedNodeType = null; + this._renderedComponent = null; + this._instance = null; + } + + // Reset pending fields + // Even if this component is scheduled for another update in ReactUpdates, + // it would still be ignored because these fields are reset. + this._pendingStateQueue = null; + this._pendingReplaceState = false; + this._pendingForceUpdate = false; + this._pendingCallbacks = null; + this._pendingElement = null; + + // These fields do not really need to be reset since this object is no + // longer accessible. + this._context = null; + this._rootNodeID = 0; + this._topLevelWrapper = null; + + // Delete the reference from the instance to this internal representation + // which allow the internals to be properly cleaned up even if the user + // leaks a reference to the public instance. + ReactInstanceMap.remove(inst); + + // Some existing components rely on inst.props even after they've been + // destroyed (in event handlers). + // TODO: inst.props = null; + // TODO: inst.state = null; + // TODO: inst.context = null; + }, + + /** + * Filters the context object to only contain keys specified in + * `contextTypes` + * + * @param {object} context + * @return {?object} + * @private + */ + _maskContext: function (context) { + var Component = this._currentElement.type; + var contextTypes = Component.contextTypes; + if (!contextTypes) { + return emptyObject; + } + var maskedContext = {}; + for (var contextName in contextTypes) { + maskedContext[contextName] = context[contextName]; + } + return maskedContext; + }, + + /** + * Filters the context object to only contain keys specified in + * `contextTypes`, and asserts that they are valid. + * + * @param {object} context + * @return {?object} + * @private + */ + _processContext: function (context) { + var maskedContext = this._maskContext(context); + if (process.env.NODE_ENV !== 'production') { + var Component = this._currentElement.type; + if (Component.contextTypes) { + this._checkContextTypes(Component.contextTypes, maskedContext, 'context'); + } + } + return maskedContext; + }, + + /** + * @param {object} currentContext + * @return {object} + * @private + */ + _processChildContext: function (currentContext) { + var Component = this._currentElement.type; + var inst = this._instance; + var childContext; + + if (inst.getChildContext) { + if (process.env.NODE_ENV !== 'production') { + ReactInstrumentation.debugTool.onBeginProcessingChildContext(); + try { + childContext = inst.getChildContext(); + } finally { + ReactInstrumentation.debugTool.onEndProcessingChildContext(); + } + } else { + childContext = inst.getChildContext(); + } + } + + if (childContext) { + !(typeof Component.childContextTypes === 'object') ? process.env.NODE_ENV !== 'production' ? invariant(false, '%s.getChildContext(): childContextTypes must be defined in order to use getChildContext().', this.getName() || 'ReactCompositeComponent') : _prodInvariant('107', this.getName() || 'ReactCompositeComponent') : void 0; + if (process.env.NODE_ENV !== 'production') { + this._checkContextTypes(Component.childContextTypes, childContext, 'child context'); + } + for (var name in childContext) { + !(name in Component.childContextTypes) ? process.env.NODE_ENV !== 'production' ? invariant(false, '%s.getChildContext(): key "%s" is not defined in childContextTypes.', this.getName() || 'ReactCompositeComponent', name) : _prodInvariant('108', this.getName() || 'ReactCompositeComponent', name) : void 0; + } + return _assign({}, currentContext, childContext); + } + return currentContext; + }, + + /** + * Assert that the context types are valid + * + * @param {object} typeSpecs Map of context field to a ReactPropType + * @param {object} values Runtime values that need to be type-checked + * @param {string} location e.g. "prop", "context", "child context" + * @private + */ + _checkContextTypes: function (typeSpecs, values, location) { + if (process.env.NODE_ENV !== 'production') { + checkReactTypeSpec(typeSpecs, values, location, this.getName(), null, this._debugID); + } + }, + + receiveComponent: function (nextElement, transaction, nextContext) { + var prevElement = this._currentElement; + var prevContext = this._context; + + this._pendingElement = null; + + this.updateComponent(transaction, prevElement, nextElement, prevContext, nextContext); + }, + + /** + * If any of `_pendingElement`, `_pendingStateQueue`, or `_pendingForceUpdate` + * is set, update the component. + * + * @param {ReactReconcileTransaction} transaction + * @internal + */ + performUpdateIfNecessary: function (transaction) { + if (this._pendingElement != null) { + ReactReconciler.receiveComponent(this, this._pendingElement, transaction, this._context); + } else if (this._pendingStateQueue !== null || this._pendingForceUpdate) { + this.updateComponent(transaction, this._currentElement, this._currentElement, this._context, this._context); + } else { + this._updateBatchNumber = null; + } + }, + + /** + * Perform an update to a mounted component. The componentWillReceiveProps and + * shouldComponentUpdate methods are called, then (assuming the update isn't + * skipped) the remaining update lifecycle methods are called and the DOM + * representation is updated. + * + * By default, this implements React's rendering and reconciliation algorithm. + * Sophisticated clients may wish to override this. + * + * @param {ReactReconcileTransaction} transaction + * @param {ReactElement} prevParentElement + * @param {ReactElement} nextParentElement + * @internal + * @overridable + */ + updateComponent: function (transaction, prevParentElement, nextParentElement, prevUnmaskedContext, nextUnmaskedContext) { + var inst = this._instance; + !(inst != null) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Attempted to update component `%s` that has already been unmounted (or failed to mount).', this.getName() || 'ReactCompositeComponent') : _prodInvariant('136', this.getName() || 'ReactCompositeComponent') : void 0; + + var willReceive = false; + var nextContext; + + // Determine if the context has changed or not + if (this._context === nextUnmaskedContext) { + nextContext = inst.context; + } else { + nextContext = this._processContext(nextUnmaskedContext); + willReceive = true; + } + + var prevProps = prevParentElement.props; + var nextProps = nextParentElement.props; + + // Not a simple state update but a props update + if (prevParentElement !== nextParentElement) { + willReceive = true; + } + + // An update here will schedule an update but immediately set + // _pendingStateQueue which will ensure that any state updates gets + // immediately reconciled instead of waiting for the next batch. + if (willReceive && inst.componentWillReceiveProps) { + if (process.env.NODE_ENV !== 'production') { + measureLifeCyclePerf(function () { + return inst.componentWillReceiveProps(nextProps, nextContext); + }, this._debugID, 'componentWillReceiveProps'); + } else { + inst.componentWillReceiveProps(nextProps, nextContext); + } + } + + var nextState = this._processPendingState(nextProps, nextContext); + var shouldUpdate = true; + + if (!this._pendingForceUpdate) { + if (inst.shouldComponentUpdate) { + if (process.env.NODE_ENV !== 'production') { + shouldUpdate = measureLifeCyclePerf(function () { + return inst.shouldComponentUpdate(nextProps, nextState, nextContext); + }, this._debugID, 'shouldComponentUpdate'); + } else { + shouldUpdate = inst.shouldComponentUpdate(nextProps, nextState, nextContext); + } + } else { + if (this._compositeType === CompositeTypes.PureClass) { + shouldUpdate = !shallowEqual(prevProps, nextProps) || !shallowEqual(inst.state, nextState); + } + } + } + + if (process.env.NODE_ENV !== 'production') { + process.env.NODE_ENV !== 'production' ? warning(shouldUpdate !== undefined, '%s.shouldComponentUpdate(): Returned undefined instead of a ' + 'boolean value. Make sure to return true or false.', this.getName() || 'ReactCompositeComponent') : void 0; + } + + this._updateBatchNumber = null; + if (shouldUpdate) { + this._pendingForceUpdate = false; + // Will set `this.props`, `this.state` and `this.context`. + this._performComponentUpdate(nextParentElement, nextProps, nextState, nextContext, transaction, nextUnmaskedContext); + } else { + // If it's determined that a component should not update, we still want + // to set props and state but we shortcut the rest of the update. + this._currentElement = nextParentElement; + this._context = nextUnmaskedContext; + inst.props = nextProps; + inst.state = nextState; + inst.context = nextContext; + } + }, + + _processPendingState: function (props, context) { + var inst = this._instance; + var queue = this._pendingStateQueue; + var replace = this._pendingReplaceState; + this._pendingReplaceState = false; + this._pendingStateQueue = null; + + if (!queue) { + return inst.state; + } + + if (replace && queue.length === 1) { + return queue[0]; + } + + var nextState = _assign({}, replace ? queue[0] : inst.state); + for (var i = replace ? 1 : 0; i < queue.length; i++) { + var partial = queue[i]; + _assign(nextState, typeof partial === 'function' ? partial.call(inst, nextState, props, context) : partial); + } + + return nextState; + }, + + /** + * Merges new props and state, notifies delegate methods of update and + * performs update. + * + * @param {ReactElement} nextElement Next element + * @param {object} nextProps Next public object to set as properties. + * @param {?object} nextState Next object to set as state. + * @param {?object} nextContext Next public object to set as context. + * @param {ReactReconcileTransaction} transaction + * @param {?object} unmaskedContext + * @private + */ + _performComponentUpdate: function (nextElement, nextProps, nextState, nextContext, transaction, unmaskedContext) { + var _this2 = this; + + var inst = this._instance; + + var hasComponentDidUpdate = Boolean(inst.componentDidUpdate); + var prevProps; + var prevState; + var prevContext; + if (hasComponentDidUpdate) { + prevProps = inst.props; + prevState = inst.state; + prevContext = inst.context; + } + + if (inst.componentWillUpdate) { + if (process.env.NODE_ENV !== 'production') { + measureLifeCyclePerf(function () { + return inst.componentWillUpdate(nextProps, nextState, nextContext); + }, this._debugID, 'componentWillUpdate'); + } else { + inst.componentWillUpdate(nextProps, nextState, nextContext); + } + } + + this._currentElement = nextElement; + this._context = unmaskedContext; + inst.props = nextProps; + inst.state = nextState; + inst.context = nextContext; + + this._updateRenderedComponent(transaction, unmaskedContext); + + if (hasComponentDidUpdate) { + if (process.env.NODE_ENV !== 'production') { + transaction.getReactMountReady().enqueue(function () { + measureLifeCyclePerf(inst.componentDidUpdate.bind(inst, prevProps, prevState, prevContext), _this2._debugID, 'componentDidUpdate'); + }); + } else { + transaction.getReactMountReady().enqueue(inst.componentDidUpdate.bind(inst, prevProps, prevState, prevContext), inst); + } + } + }, + + /** + * Call the component's `render` method and update the DOM accordingly. + * + * @param {ReactReconcileTransaction} transaction + * @internal + */ + _updateRenderedComponent: function (transaction, context) { + var prevComponentInstance = this._renderedComponent; + var prevRenderedElement = prevComponentInstance._currentElement; + var nextRenderedElement = this._renderValidatedComponent(); + + var debugID = 0; + if (process.env.NODE_ENV !== 'production') { + debugID = this._debugID; + } + + if (shouldUpdateReactComponent(prevRenderedElement, nextRenderedElement)) { + ReactReconciler.receiveComponent(prevComponentInstance, nextRenderedElement, transaction, this._processChildContext(context)); + } else { + var oldHostNode = ReactReconciler.getHostNode(prevComponentInstance); + ReactReconciler.unmountComponent(prevComponentInstance, false); + + var nodeType = ReactNodeTypes.getType(nextRenderedElement); + this._renderedNodeType = nodeType; + var child = this._instantiateReactComponent(nextRenderedElement, nodeType !== ReactNodeTypes.EMPTY /* shouldHaveDebugID */ + ); + this._renderedComponent = child; + + var nextMarkup = ReactReconciler.mountComponent(child, transaction, this._hostParent, this._hostContainerInfo, this._processChildContext(context), debugID); + + if (process.env.NODE_ENV !== 'production') { + if (debugID !== 0) { + var childDebugIDs = child._debugID !== 0 ? [child._debugID] : []; + ReactInstrumentation.debugTool.onSetChildren(debugID, childDebugIDs); + } + } + + this._replaceNodeWithMarkup(oldHostNode, nextMarkup, prevComponentInstance); + } + }, + + /** + * Overridden in shallow rendering. + * + * @protected + */ + _replaceNodeWithMarkup: function (oldHostNode, nextMarkup, prevInstance) { + ReactComponentEnvironment.replaceNodeWithMarkup(oldHostNode, nextMarkup, prevInstance); + }, + + /** + * @protected + */ + _renderValidatedComponentWithoutOwnerOrContext: function () { + var inst = this._instance; + var renderedElement; + + if (process.env.NODE_ENV !== 'production') { + renderedElement = measureLifeCyclePerf(function () { + return inst.render(); + }, this._debugID, 'render'); + } else { + renderedElement = inst.render(); + } + + if (process.env.NODE_ENV !== 'production') { + // We allow auto-mocks to proceed as if they're returning null. + if (renderedElement === undefined && inst.render._isMockFunction) { + // This is probably bad practice. Consider warning here and + // deprecating this convenience. + renderedElement = null; + } + } + + return renderedElement; + }, + + /** + * @private + */ + _renderValidatedComponent: function () { + var renderedElement; + if (process.env.NODE_ENV !== 'production' || this._compositeType !== CompositeTypes.StatelessFunctional) { + ReactCurrentOwner.current = this; + try { + renderedElement = this._renderValidatedComponentWithoutOwnerOrContext(); + } finally { + ReactCurrentOwner.current = null; + } + } else { + renderedElement = this._renderValidatedComponentWithoutOwnerOrContext(); + } + !( + // TODO: An `isValidNode` function would probably be more appropriate + renderedElement === null || renderedElement === false || React.isValidElement(renderedElement)) ? process.env.NODE_ENV !== 'production' ? invariant(false, '%s.render(): A valid React element (or null) must be returned. You may have returned undefined, an array or some other invalid object.', this.getName() || 'ReactCompositeComponent') : _prodInvariant('109', this.getName() || 'ReactCompositeComponent') : void 0; + + return renderedElement; + }, + + /** + * Lazily allocates the refs object and stores `component` as `ref`. + * + * @param {string} ref Reference name. + * @param {component} component Component to store as `ref`. + * @final + * @private + */ + attachRef: function (ref, component) { + var inst = this.getPublicInstance(); + !(inst != null) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Stateless function components cannot have refs.') : _prodInvariant('110') : void 0; + var publicComponentInstance = component.getPublicInstance(); + if (process.env.NODE_ENV !== 'production') { + var componentName = component && component.getName ? component.getName() : 'a component'; + process.env.NODE_ENV !== 'production' ? warning(publicComponentInstance != null || component._compositeType !== CompositeTypes.StatelessFunctional, 'Stateless function components cannot be given refs ' + '(See ref "%s" in %s created by %s). ' + 'Attempts to access this ref will fail.', ref, componentName, this.getName()) : void 0; + } + var refs = inst.refs === emptyObject ? inst.refs = {} : inst.refs; + refs[ref] = publicComponentInstance; + }, + + /** + * Detaches a reference name. + * + * @param {string} ref Name to dereference. + * @final + * @private + */ + detachRef: function (ref) { + var refs = this.getPublicInstance().refs; + delete refs[ref]; + }, + + /** + * Get a text description of the component that can be used to identify it + * in error messages. + * @return {string} The name or null. + * @internal + */ + getName: function () { + var type = this._currentElement.type; + var constructor = this._instance && this._instance.constructor; + return type.displayName || constructor && constructor.displayName || type.name || constructor && constructor.name || null; + }, + + /** + * Get the publicly accessible representation of this component - i.e. what + * is exposed by refs and returned by render. Can be null for stateless + * components. + * + * @return {ReactComponent} the public component instance. + * @internal + */ + getPublicInstance: function () { + var inst = this._instance; + if (this._compositeType === CompositeTypes.StatelessFunctional) { + return null; + } + return inst; + }, + + // Stub + _instantiateReactComponent: null +}; + +module.exports = ReactCompositeComponent; +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) + +/***/ }), +/* 169 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(process) {/** + * 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__(4); + +var ReactPropTypeLocationNames = __webpack_require__(170); +var ReactPropTypesSecret = __webpack_require__(83); + +var invariant = __webpack_require__(1); +var warning = __webpack_require__(3); + +var ReactComponentTreeHook; + +if (typeof process !== 'undefined' && process.env && process.env.NODE_ENV === 'test') { + // Temporary hack. + // Inline requires don't work well with Jest: + // https://github.com/facebook/react/issues/7240 + // Remove the inline requires when we don't need them anymore: + // https://github.com/facebook/react/pull/7178 + ReactComponentTreeHook = __webpack_require__(11); +} + +var loggedTypeFailures = {}; + +/** + * Assert that the values match with the type specs. + * Error messages are memorized and will only be shown once. + * + * @param {object} typeSpecs Map of name to a ReactPropType + * @param {object} values Runtime values that need to be type-checked + * @param {string} location e.g. "prop", "context", "child context" + * @param {string} componentName Name of the component for error messages. + * @param {?object} element The React element that is being type-checked + * @param {?number} debugID The React component instance that is being type-checked + * @private + */ +function checkReactTypeSpec(typeSpecs, values, location, componentName, element, debugID) { + for (var typeSpecName in typeSpecs) { + if (typeSpecs.hasOwnProperty(typeSpecName)) { + var error; + // Prop type validation may throw. In case they do, we don't want to + // fail the render phase where it didn't fail before. So we log it. + // After these have been cleaned up, we'll let them throw. + try { + // This is intentionally an invariant that gets caught. It's the same + // behavior as without this statement except with a better message. + !(typeof typeSpecs[typeSpecName] === 'function') ? process.env.NODE_ENV !== 'production' ? invariant(false, '%s: %s type `%s` is invalid; it must be a function, usually from React.PropTypes.', componentName || 'React class', ReactPropTypeLocationNames[location], typeSpecName) : _prodInvariant('84', componentName || 'React class', ReactPropTypeLocationNames[location], typeSpecName) : void 0; + error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret); + } catch (ex) { + error = ex; + } + process.env.NODE_ENV !== 'production' ? warning(!error || error instanceof Error, '%s: type specification of %s `%s` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a %s. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).', componentName || 'React class', ReactPropTypeLocationNames[location], typeSpecName, typeof error) : void 0; + if (error instanceof Error && !(error.message in loggedTypeFailures)) { + // Only monitor this failure once because there tends to be a lot of the + // same error. + loggedTypeFailures[error.message] = true; + + var componentStackInfo = ''; + + if (process.env.NODE_ENV !== 'production') { + if (!ReactComponentTreeHook) { + ReactComponentTreeHook = __webpack_require__(11); + } + if (debugID !== null) { + componentStackInfo = ReactComponentTreeHook.getStackAddendumByID(debugID); + } else if (element !== null) { + componentStackInfo = ReactComponentTreeHook.getCurrentStackAddendum(element); + } + } + + process.env.NODE_ENV !== 'production' ? warning(false, 'Failed %s type: %s%s', location, error.message, componentStackInfo) : void 0; + } + } + } +} + +module.exports = checkReactTypeSpec; +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) + +/***/ }), +/* 170 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(process) {/** + * 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 ReactPropTypeLocationNames = {}; + +if (process.env.NODE_ENV !== 'production') { + ReactPropTypeLocationNames = { + prop: 'prop', + context: 'context', + childContext: 'child context' + }; +} + +module.exports = ReactPropTypeLocationNames; +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) + +/***/ }), +/* 171 */ +/***/ (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 nextDebugID = 1; + +function getNextDebugID() { + return nextDebugID++; +} + +module.exports = getNextDebugID; + +/***/ }), +/* 172 */ +/***/ (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. + * + * + */ + + + +// The Symbol used to tag the ReactElement type. If there is no native Symbol +// nor polyfill, then a plain number is used for performance. + +var REACT_ELEMENT_TYPE = typeof Symbol === 'function' && Symbol['for'] && Symbol['for']('react.element') || 0xeac7; + +module.exports = REACT_ELEMENT_TYPE; + +/***/ }), +/* 173 */ +/***/ (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. + * + * + */ + + + +/* global Symbol */ + +var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator; +var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec. + +/** + * Returns the iterator method function contained on the iterable object. + * + * Be sure to invoke the function with the iterable as context: + * + * var iteratorFn = getIteratorFn(myIterable); + * if (iteratorFn) { + * var iterator = iteratorFn.call(myIterable); + * ... + * } + * + * @param {?object} maybeIterable + * @return {?function} + */ +function getIteratorFn(maybeIterable) { + var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]); + if (typeof iteratorFn === 'function') { + return iteratorFn; + } +} + +module.exports = getIteratorFn; + +/***/ }), +/* 174 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(process) {/** + * 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 KeyEscapeUtils = __webpack_require__(54); +var traverseAllChildren = __webpack_require__(89); +var warning = __webpack_require__(3); + +var ReactComponentTreeHook; + +if (typeof process !== 'undefined' && process.env && process.env.NODE_ENV === 'test') { + // Temporary hack. + // Inline requires don't work well with Jest: + // https://github.com/facebook/react/issues/7240 + // Remove the inline requires when we don't need them anymore: + // https://github.com/facebook/react/pull/7178 + ReactComponentTreeHook = __webpack_require__(11); +} + +/** + * @param {function} traverseContext Context passed through traversal. + * @param {?ReactComponent} child React child component. + * @param {!string} name String name of key path to child. + * @param {number=} selfDebugID Optional debugID of the current internal instance. + */ +function flattenSingleChildIntoContext(traverseContext, child, name, selfDebugID) { + // We found a component instance. + if (traverseContext && typeof traverseContext === 'object') { + var result = traverseContext; + var keyUnique = result[name] === undefined; + if (process.env.NODE_ENV !== 'production') { + if (!ReactComponentTreeHook) { + ReactComponentTreeHook = __webpack_require__(11); + } + if (!keyUnique) { + process.env.NODE_ENV !== 'production' ? warning(false, 'flattenChildren(...): Encountered two children with the same key, ' + '`%s`. Child keys must be unique; when two children share a key, only ' + 'the first child will be used.%s', KeyEscapeUtils.unescape(name), ReactComponentTreeHook.getStackAddendumByID(selfDebugID)) : void 0; + } + } + if (keyUnique && child != null) { + result[name] = child; + } + } +} + +/** + * Flattens children that are typically specified as `props.children`. Any null + * children will not be included in the resulting object. + * @return {!object} flattened children keyed by name. + */ +function flattenChildren(children, selfDebugID) { + if (children == null) { + return children; + } + var result = {}; + + if (process.env.NODE_ENV !== 'production') { + traverseAllChildren(children, function (traverseContext, child, name) { + return flattenSingleChildIntoContext(traverseContext, child, name, selfDebugID); + }, result); + } else { + traverseAllChildren(children, flattenSingleChildIntoContext, result); + } + return result; +} + +module.exports = flattenChildren; +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) + +/***/ }), +/* 175 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(process) {/** + * 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__(8); + +var PooledClass = __webpack_require__(20); +var Transaction = __webpack_require__(34); +var ReactInstrumentation = __webpack_require__(13); +var ReactServerUpdateQueue = __webpack_require__(176); + +/** + * Executed within the scope of the `Transaction` instance. Consider these as + * being member methods, but with an implied ordering while being isolated from + * each other. + */ +var TRANSACTION_WRAPPERS = []; + +if (process.env.NODE_ENV !== 'production') { + TRANSACTION_WRAPPERS.push({ + initialize: ReactInstrumentation.debugTool.onBeginFlush, + close: ReactInstrumentation.debugTool.onEndFlush + }); +} + +var noopCallbackQueue = { + enqueue: function () {} +}; + +/** + * @class ReactServerRenderingTransaction + * @param {boolean} renderToStaticMarkup + */ +function ReactServerRenderingTransaction(renderToStaticMarkup) { + this.reinitializeTransaction(); + this.renderToStaticMarkup = renderToStaticMarkup; + this.useCreateElement = false; + this.updateQueue = new ReactServerUpdateQueue(this); +} + +var Mixin = { + /** + * @see Transaction + * @abstract + * @final + * @return {array} Empty list of operation wrap procedures. + */ + getTransactionWrappers: function () { + return TRANSACTION_WRAPPERS; + }, + + /** + * @return {object} The queue to collect `onDOMReady` callbacks with. + */ + getReactMountReady: function () { + return noopCallbackQueue; + }, + + /** + * @return {object} The queue to collect React async events. + */ + getUpdateQueue: function () { + return this.updateQueue; + }, + + /** + * `PooledClass` looks for this, and will invoke this before allowing this + * instance to be reused. + */ + destructor: function () {}, + + checkpoint: function () {}, + + rollback: function () {} +}; + +_assign(ReactServerRenderingTransaction.prototype, Transaction, Mixin); + +PooledClass.addPoolingTo(ReactServerRenderingTransaction); + +module.exports = ReactServerRenderingTransaction; +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) + +/***/ }), +/* 176 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(process) {/** + * 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. + * + * + */ + + + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +var ReactUpdateQueue = __webpack_require__(55); + +var warning = __webpack_require__(3); + +function warnNoop(publicInstance, callerName) { + if (process.env.NODE_ENV !== 'production') { + var constructor = publicInstance.constructor; + process.env.NODE_ENV !== 'production' ? warning(false, '%s(...): Can only update a mounting component. ' + 'This usually means you called %s() outside componentWillMount() on the server. ' + 'This is a no-op. Please check the code for the %s component.', callerName, callerName, constructor && (constructor.displayName || constructor.name) || 'ReactClass') : void 0; + } +} + +/** + * This is the update queue used for server rendering. + * It delegates to ReactUpdateQueue while server rendering is in progress and + * switches to ReactNoopUpdateQueue after the transaction has completed. + * @class ReactServerUpdateQueue + * @param {Transaction} transaction + */ + +var ReactServerUpdateQueue = function () { + function ReactServerUpdateQueue(transaction) { + _classCallCheck(this, ReactServerUpdateQueue); + + this.transaction = transaction; + } + + /** + * Checks whether or not this composite component is mounted. + * @param {ReactClass} publicInstance The instance we want to test. + * @return {boolean} True if mounted, false otherwise. + * @protected + * @final + */ + + + ReactServerUpdateQueue.prototype.isMounted = function isMounted(publicInstance) { + return false; + }; + + /** + * Enqueue a callback that will be executed after all the pending updates + * have processed. + * + * @param {ReactClass} publicInstance The instance to use as `this` context. + * @param {?function} callback Called after state is updated. + * @internal + */ + + + ReactServerUpdateQueue.prototype.enqueueCallback = function enqueueCallback(publicInstance, callback, callerName) { + if (this.transaction.isInTransaction()) { + ReactUpdateQueue.enqueueCallback(publicInstance, callback, callerName); + } + }; + + /** + * Forces an update. This should only be invoked when it is known with + * certainty that we are **not** in a DOM transaction. + * + * You may want to call this when you know that some deeper aspect of the + * component's state has changed but `setState` was not called. + * + * This will not invoke `shouldComponentUpdate`, but it will invoke + * `componentWillUpdate` and `componentDidUpdate`. + * + * @param {ReactClass} publicInstance The instance that should rerender. + * @internal + */ + + + ReactServerUpdateQueue.prototype.enqueueForceUpdate = function enqueueForceUpdate(publicInstance) { + if (this.transaction.isInTransaction()) { + ReactUpdateQueue.enqueueForceUpdate(publicInstance); + } else { + warnNoop(publicInstance, 'forceUpdate'); + } + }; + + /** + * Replaces all of the state. Always use this or `setState` to mutate state. + * You should treat `this.state` as immutable. + * + * There is no guarantee that `this.state` will be immediately updated, so + * accessing `this.state` after calling this method may return the old value. + * + * @param {ReactClass} publicInstance The instance that should rerender. + * @param {object|function} completeState Next state. + * @internal + */ + + + ReactServerUpdateQueue.prototype.enqueueReplaceState = function enqueueReplaceState(publicInstance, completeState) { + if (this.transaction.isInTransaction()) { + ReactUpdateQueue.enqueueReplaceState(publicInstance, completeState); + } else { + warnNoop(publicInstance, 'replaceState'); + } + }; + + /** + * Sets a subset of the state. This only exists because _pendingState is + * internal. This provides a merging strategy that is not available to deep + * properties which is confusing. TODO: Expose pendingState or don't use it + * during the merge. + * + * @param {ReactClass} publicInstance The instance that should rerender. + * @param {object|function} partialState Next partial state to be merged with state. + * @internal + */ + + + ReactServerUpdateQueue.prototype.enqueueSetState = function enqueueSetState(publicInstance, partialState) { + if (this.transaction.isInTransaction()) { + ReactUpdateQueue.enqueueSetState(publicInstance, partialState); + } else { + warnNoop(publicInstance, 'setState'); + } + }; + + return ReactServerUpdateQueue; +}(); + +module.exports = ReactServerUpdateQueue; +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) + +/***/ }), +/* 177 */ +/***/ (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__(8); + +var DOMLazyTree = __webpack_require__(24); +var ReactDOMComponentTree = __webpack_require__(7); + +var ReactDOMEmptyComponent = function (instantiate) { + // ReactCompositeComponent uses this: + this._currentElement = null; + // ReactDOMComponentTree uses these: + this._hostNode = null; + this._hostParent = null; + this._hostContainerInfo = null; + this._domID = 0; +}; +_assign(ReactDOMEmptyComponent.prototype, { + mountComponent: function (transaction, hostParent, hostContainerInfo, context) { + var domID = hostContainerInfo._idCounter++; + this._domID = domID; + this._hostParent = hostParent; + this._hostContainerInfo = hostContainerInfo; + + var nodeValue = ' react-empty: ' + this._domID + ' '; + if (transaction.useCreateElement) { + var ownerDocument = hostContainerInfo._ownerDocument; + var node = ownerDocument.createComment(nodeValue); + ReactDOMComponentTree.precacheNode(this, node); + return DOMLazyTree(node); + } else { + if (transaction.renderToStaticMarkup) { + // Normally we'd insert a comment node, but since this is a situation + // where React won't take over (static pages), we can simply return + // nothing. + return ''; + } + return '<!--' + nodeValue + '-->'; + } + }, + receiveComponent: function () {}, + getHostNode: function () { + return ReactDOMComponentTree.getNodeFromInstance(this); + }, + unmountComponent: function () { + ReactDOMComponentTree.uncacheNode(this); + } +}); + +module.exports = ReactDOMEmptyComponent; + +/***/ }), +/* 178 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(process) {/** + * 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 _prodInvariant = __webpack_require__(4); + +var invariant = __webpack_require__(1); + +/** + * Return the lowest common ancestor of A and B, or null if they are in + * different trees. + */ +function getLowestCommonAncestor(instA, instB) { + !('_hostNode' in instA) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'getNodeFromInstance: Invalid argument.') : _prodInvariant('33') : void 0; + !('_hostNode' in instB) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'getNodeFromInstance: Invalid argument.') : _prodInvariant('33') : void 0; + + var depthA = 0; + for (var tempA = instA; tempA; tempA = tempA._hostParent) { + depthA++; + } + var depthB = 0; + for (var tempB = instB; tempB; tempB = tempB._hostParent) { + depthB++; + } + + // If A is deeper, crawl up. + while (depthA - depthB > 0) { + instA = instA._hostParent; + depthA--; + } + + // If B is deeper, crawl up. + while (depthB - depthA > 0) { + instB = instB._hostParent; + depthB--; + } + + // Walk in lockstep until we find a match. + var depth = depthA; + while (depth--) { + if (instA === instB) { + return instA; + } + instA = instA._hostParent; + instB = instB._hostParent; + } + return null; +} + +/** + * Return if A is an ancestor of B. + */ +function isAncestor(instA, instB) { + !('_hostNode' in instA) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'isAncestor: Invalid argument.') : _prodInvariant('35') : void 0; + !('_hostNode' in instB) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'isAncestor: Invalid argument.') : _prodInvariant('35') : void 0; + + while (instB) { + if (instB === instA) { + return true; + } + instB = instB._hostParent; + } + return false; +} + +/** + * Return the parent instance of the passed-in instance. + */ +function getParentInstance(inst) { + !('_hostNode' in inst) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'getParentInstance: Invalid argument.') : _prodInvariant('36') : void 0; + + return inst._hostParent; +} + +/** + * Simulates the traversal of a two-phase, capture/bubble event dispatch. + */ +function traverseTwoPhase(inst, fn, arg) { + var path = []; + while (inst) { + path.push(inst); + inst = inst._hostParent; + } + var i; + for (i = path.length; i-- > 0;) { + fn(path[i], 'captured', arg); + } + for (i = 0; i < path.length; i++) { + fn(path[i], 'bubbled', arg); + } +} + +/** + * Traverses the ID hierarchy and invokes the supplied `cb` on any IDs that + * should would receive a `mouseEnter` or `mouseLeave` event. + * + * Does not invoke the callback on the nearest common ancestor because nothing + * "entered" or "left" that element. + */ +function traverseEnterLeave(from, to, fn, argFrom, argTo) { + var common = from && to ? getLowestCommonAncestor(from, to) : null; + var pathFrom = []; + while (from && from !== common) { + pathFrom.push(from); + from = from._hostParent; + } + var pathTo = []; + while (to && to !== common) { + pathTo.push(to); + to = to._hostParent; + } + var i; + for (i = 0; i < pathFrom.length; i++) { + fn(pathFrom[i], 'bubbled', argFrom); + } + for (i = pathTo.length; i-- > 0;) { + fn(pathTo[i], 'captured', argTo); + } +} + +module.exports = { + isAncestor: isAncestor, + getLowestCommonAncestor: getLowestCommonAncestor, + getParentInstance: getParentInstance, + traverseTwoPhase: traverseTwoPhase, + traverseEnterLeave: traverseEnterLeave +}; +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) + +/***/ }), +/* 179 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(process) {/** + * 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__(4), + _assign = __webpack_require__(8); + +var DOMChildrenOperations = __webpack_require__(47); +var DOMLazyTree = __webpack_require__(24); +var ReactDOMComponentTree = __webpack_require__(7); + +var escapeTextContentForBrowser = __webpack_require__(37); +var invariant = __webpack_require__(1); +var validateDOMNesting = __webpack_require__(56); + +/** + * Text nodes violate a couple assumptions that React makes about components: + * + * - When mounting text into the DOM, adjacent text nodes are merged. + * - Text nodes cannot be assigned a React root ID. + * + * This component is used to wrap strings between comment nodes so that they + * can undergo the same reconciliation that is applied to elements. + * + * TODO: Investigate representing React components in the DOM with text nodes. + * + * @class ReactDOMTextComponent + * @extends ReactComponent + * @internal + */ +var ReactDOMTextComponent = function (text) { + // TODO: This is really a ReactText (ReactNode), not a ReactElement + this._currentElement = text; + this._stringText = '' + text; + // ReactDOMComponentTree uses these: + this._hostNode = null; + this._hostParent = null; + + // Properties + this._domID = 0; + this._mountIndex = 0; + this._closingComment = null; + this._commentNodes = null; +}; + +_assign(ReactDOMTextComponent.prototype, { + /** + * Creates the markup for this text node. This node is not intended to have + * any features besides containing text content. + * + * @param {ReactReconcileTransaction|ReactServerRenderingTransaction} transaction + * @return {string} Markup for this text node. + * @internal + */ + mountComponent: function (transaction, hostParent, hostContainerInfo, context) { + if (process.env.NODE_ENV !== 'production') { + var parentInfo; + if (hostParent != null) { + parentInfo = hostParent._ancestorInfo; + } else if (hostContainerInfo != null) { + parentInfo = hostContainerInfo._ancestorInfo; + } + if (parentInfo) { + // parentInfo should always be present except for the top-level + // component when server rendering + validateDOMNesting(null, this._stringText, this, parentInfo); + } + } + + var domID = hostContainerInfo._idCounter++; + var openingValue = ' react-text: ' + domID + ' '; + var closingValue = ' /react-text '; + this._domID = domID; + this._hostParent = hostParent; + if (transaction.useCreateElement) { + var ownerDocument = hostContainerInfo._ownerDocument; + var openingComment = ownerDocument.createComment(openingValue); + var closingComment = ownerDocument.createComment(closingValue); + var lazyTree = DOMLazyTree(ownerDocument.createDocumentFragment()); + DOMLazyTree.queueChild(lazyTree, DOMLazyTree(openingComment)); + if (this._stringText) { + DOMLazyTree.queueChild(lazyTree, DOMLazyTree(ownerDocument.createTextNode(this._stringText))); + } + DOMLazyTree.queueChild(lazyTree, DOMLazyTree(closingComment)); + ReactDOMComponentTree.precacheNode(this, openingComment); + this._closingComment = closingComment; + return lazyTree; + } else { + var escapedText = escapeTextContentForBrowser(this._stringText); + + if (transaction.renderToStaticMarkup) { + // Normally we'd wrap this between comment nodes for the reasons stated + // above, but since this is a situation where React won't take over + // (static pages), we can simply return the text as it is. + return escapedText; + } + + return '<!--' + openingValue + '-->' + escapedText + '<!--' + closingValue + '-->'; + } + }, + + /** + * Updates this component by updating the text content. + * + * @param {ReactText} nextText The next text content + * @param {ReactReconcileTransaction} transaction + * @internal + */ + receiveComponent: function (nextText, transaction) { + if (nextText !== this._currentElement) { + this._currentElement = nextText; + var nextStringText = '' + nextText; + if (nextStringText !== this._stringText) { + // TODO: Save this as pending props and use performUpdateIfNecessary + // and/or updateComponent to do the actual update for consistency with + // other component types? + this._stringText = nextStringText; + var commentNodes = this.getHostNode(); + DOMChildrenOperations.replaceDelimitedText(commentNodes[0], commentNodes[1], nextStringText); + } + } + }, + + getHostNode: function () { + var hostNode = this._commentNodes; + if (hostNode) { + return hostNode; + } + if (!this._closingComment) { + var openingComment = ReactDOMComponentTree.getNodeFromInstance(this); + var node = openingComment.nextSibling; + while (true) { + !(node != null) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Missing closing comment for text component %s', this._domID) : _prodInvariant('67', this._domID) : void 0; + if (node.nodeType === 8 && node.nodeValue === ' /react-text ') { + this._closingComment = node; + break; + } + node = node.nextSibling; + } + } + hostNode = [this._hostNode, this._closingComment]; + this._commentNodes = hostNode; + return hostNode; + }, + + unmountComponent: function () { + this._closingComment = null; + this._commentNodes = null; + ReactDOMComponentTree.uncacheNode(this); + } +}); + +module.exports = ReactDOMTextComponent; +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) + +/***/ }), +/* 180 */ +/***/ (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__(8); + +var ReactUpdates = __webpack_require__(15); +var Transaction = __webpack_require__(34); + +var emptyFunction = __webpack_require__(12); + +var RESET_BATCHED_UPDATES = { + initialize: emptyFunction, + close: function () { + ReactDefaultBatchingStrategy.isBatchingUpdates = false; + } +}; + +var FLUSH_BATCHED_UPDATES = { + initialize: emptyFunction, + close: ReactUpdates.flushBatchedUpdates.bind(ReactUpdates) +}; + +var TRANSACTION_WRAPPERS = [FLUSH_BATCHED_UPDATES, RESET_BATCHED_UPDATES]; + +function ReactDefaultBatchingStrategyTransaction() { + this.reinitializeTransaction(); +} + +_assign(ReactDefaultBatchingStrategyTransaction.prototype, Transaction, { + getTransactionWrappers: function () { + return TRANSACTION_WRAPPERS; + } +}); + +var transaction = new ReactDefaultBatchingStrategyTransaction(); + +var ReactDefaultBatchingStrategy = { + isBatchingUpdates: false, + + /** + * Call the provided function in a context within which calls to `setState` + * and friends are batched such that components aren't updated unnecessarily. + */ + batchedUpdates: function (callback, a, b, c, d, e) { + var alreadyBatchingUpdates = ReactDefaultBatchingStrategy.isBatchingUpdates; + + ReactDefaultBatchingStrategy.isBatchingUpdates = true; + + // The code is written this way to avoid extra allocations + if (alreadyBatchingUpdates) { + return callback(a, b, c, d, e); + } else { + return transaction.perform(callback, null, a, b, c, d, e); + } + } +}; + +module.exports = ReactDefaultBatchingStrategy; + +/***/ }), +/* 181 */ +/***/ (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__(8); + +var EventListener = __webpack_require__(90); +var ExecutionEnvironment = __webpack_require__(9); +var PooledClass = __webpack_require__(20); +var ReactDOMComponentTree = __webpack_require__(7); +var ReactUpdates = __webpack_require__(15); + +var getEventTarget = __webpack_require__(44); +var getUnboundedScrollPosition = __webpack_require__(182); + +/** + * Find the deepest React component completely containing the root of the + * passed-in instance (for use when entire React trees are nested within each + * other). If React trees are not nested, returns null. + */ +function findParent(inst) { + // TODO: It may be a good idea to cache this to prevent unnecessary DOM + // traversal, but caching is difficult to do correctly without using a + // mutation observer to listen for all DOM changes. + while (inst._hostParent) { + inst = inst._hostParent; + } + var rootNode = ReactDOMComponentTree.getNodeFromInstance(inst); + var container = rootNode.parentNode; + return ReactDOMComponentTree.getClosestInstanceFromNode(container); +} + +// Used to store ancestor hierarchy in top level callback +function TopLevelCallbackBookKeeping(topLevelType, nativeEvent) { + this.topLevelType = topLevelType; + this.nativeEvent = nativeEvent; + this.ancestors = []; +} +_assign(TopLevelCallbackBookKeeping.prototype, { + destructor: function () { + this.topLevelType = null; + this.nativeEvent = null; + this.ancestors.length = 0; + } +}); +PooledClass.addPoolingTo(TopLevelCallbackBookKeeping, PooledClass.twoArgumentPooler); + +function handleTopLevelImpl(bookKeeping) { + var nativeEventTarget = getEventTarget(bookKeeping.nativeEvent); + var targetInst = ReactDOMComponentTree.getClosestInstanceFromNode(nativeEventTarget); + + // Loop through the hierarchy, in case there's any nested components. + // It's important that we build the array of ancestors before calling any + // event handlers, because event handlers can modify the DOM, leading to + // inconsistencies with ReactMount's node cache. See #1105. + var ancestor = targetInst; + do { + bookKeeping.ancestors.push(ancestor); + ancestor = ancestor && findParent(ancestor); + } while (ancestor); + + for (var i = 0; i < bookKeeping.ancestors.length; i++) { + targetInst = bookKeeping.ancestors[i]; + ReactEventListener._handleTopLevel(bookKeeping.topLevelType, targetInst, bookKeeping.nativeEvent, getEventTarget(bookKeeping.nativeEvent)); + } +} + +function scrollValueMonitor(cb) { + var scrollPosition = getUnboundedScrollPosition(window); + cb(scrollPosition); +} + +var ReactEventListener = { + _enabled: true, + _handleTopLevel: null, + + WINDOW_HANDLE: ExecutionEnvironment.canUseDOM ? window : null, + + setHandleTopLevel: function (handleTopLevel) { + ReactEventListener._handleTopLevel = handleTopLevel; + }, + + setEnabled: function (enabled) { + ReactEventListener._enabled = !!enabled; + }, + + isEnabled: function () { + return ReactEventListener._enabled; + }, + + /** + * Traps top-level events by using event bubbling. + * + * @param {string} topLevelType Record from `EventConstants`. + * @param {string} handlerBaseName Event name (e.g. "click"). + * @param {object} element Element on which to attach listener. + * @return {?object} An object with a remove function which will forcefully + * remove the listener. + * @internal + */ + trapBubbledEvent: function (topLevelType, handlerBaseName, element) { + if (!element) { + return null; + } + return EventListener.listen(element, handlerBaseName, ReactEventListener.dispatchEvent.bind(null, topLevelType)); + }, + + /** + * Traps a top-level event by using event capturing. + * + * @param {string} topLevelType Record from `EventConstants`. + * @param {string} handlerBaseName Event name (e.g. "click"). + * @param {object} element Element on which to attach listener. + * @return {?object} An object with a remove function which will forcefully + * remove the listener. + * @internal + */ + trapCapturedEvent: function (topLevelType, handlerBaseName, element) { + if (!element) { + return null; + } + return EventListener.capture(element, handlerBaseName, ReactEventListener.dispatchEvent.bind(null, topLevelType)); + }, + + monitorScrollValue: function (refresh) { + var callback = scrollValueMonitor.bind(null, refresh); + EventListener.listen(window, 'scroll', callback); + }, + + dispatchEvent: function (topLevelType, nativeEvent) { + if (!ReactEventListener._enabled) { + return; + } + + var bookKeeping = TopLevelCallbackBookKeeping.getPooled(topLevelType, nativeEvent); + try { + // Event queue being processed in the same cycle allows + // `preventDefault`. + ReactUpdates.batchedUpdates(handleTopLevelImpl, bookKeeping); + } finally { + TopLevelCallbackBookKeeping.release(bookKeeping); + } + } +}; + +module.exports = ReactEventListener; + +/***/ }), +/* 182 */ +/***/ (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. + * + * @typechecks + */ + + + +/** + * Gets the scroll position of the supplied element or window. + * + * The return values are unbounded, unlike `getScrollPosition`. This means they + * may be negative or exceed the element boundaries (which is possible using + * inertial scrolling). + * + * @param {DOMWindow|DOMElement} scrollable + * @return {object} Map with `x` and `y` keys. + */ + +function getUnboundedScrollPosition(scrollable) { + if (scrollable.Window && scrollable instanceof scrollable.Window) { + return { + x: scrollable.pageXOffset || scrollable.document.documentElement.scrollLeft, + y: scrollable.pageYOffset || scrollable.document.documentElement.scrollTop + }; + } + return { + x: scrollable.scrollLeft, + y: scrollable.scrollTop + }; +} + +module.exports = getUnboundedScrollPosition; + +/***/ }), +/* 183 */ +/***/ (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 DOMProperty = __webpack_require__(17); +var EventPluginHub = __webpack_require__(27); +var EventPluginUtils = __webpack_require__(42); +var ReactComponentEnvironment = __webpack_require__(51); +var ReactEmptyComponent = __webpack_require__(87); +var ReactBrowserEventEmitter = __webpack_require__(38); +var ReactHostComponent = __webpack_require__(88); +var ReactUpdates = __webpack_require__(15); + +var ReactInjection = { + Component: ReactComponentEnvironment.injection, + DOMProperty: DOMProperty.injection, + EmptyComponent: ReactEmptyComponent.injection, + EventPluginHub: EventPluginHub.injection, + EventPluginUtils: EventPluginUtils.injection, + EventEmitter: ReactBrowserEventEmitter.injection, + HostComponent: ReactHostComponent.injection, + Updates: ReactUpdates.injection +}; + +module.exports = ReactInjection; + +/***/ }), +/* 184 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(process) {/** + * 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__(8); + +var CallbackQueue = __webpack_require__(74); +var PooledClass = __webpack_require__(20); +var ReactBrowserEventEmitter = __webpack_require__(38); +var ReactInputSelection = __webpack_require__(91); +var ReactInstrumentation = __webpack_require__(13); +var Transaction = __webpack_require__(34); +var ReactUpdateQueue = __webpack_require__(55); + +/** + * Ensures that, when possible, the selection range (currently selected text + * input) is not disturbed by performing the transaction. + */ +var SELECTION_RESTORATION = { + /** + * @return {Selection} Selection information. + */ + initialize: ReactInputSelection.getSelectionInformation, + /** + * @param {Selection} sel Selection information returned from `initialize`. + */ + close: ReactInputSelection.restoreSelection +}; + +/** + * Suppresses events (blur/focus) that could be inadvertently dispatched due to + * high level DOM manipulations (like temporarily removing a text input from the + * DOM). + */ +var EVENT_SUPPRESSION = { + /** + * @return {boolean} The enabled status of `ReactBrowserEventEmitter` before + * the reconciliation. + */ + initialize: function () { + var currentlyEnabled = ReactBrowserEventEmitter.isEnabled(); + ReactBrowserEventEmitter.setEnabled(false); + return currentlyEnabled; + }, + + /** + * @param {boolean} previouslyEnabled Enabled status of + * `ReactBrowserEventEmitter` before the reconciliation occurred. `close` + * restores the previous value. + */ + close: function (previouslyEnabled) { + ReactBrowserEventEmitter.setEnabled(previouslyEnabled); + } +}; + +/** + * Provides a queue for collecting `componentDidMount` and + * `componentDidUpdate` callbacks during the transaction. + */ +var ON_DOM_READY_QUEUEING = { + /** + * Initializes the internal `onDOMReady` queue. + */ + initialize: function () { + this.reactMountReady.reset(); + }, + + /** + * After DOM is flushed, invoke all registered `onDOMReady` callbacks. + */ + close: function () { + this.reactMountReady.notifyAll(); + } +}; + +/** + * Executed within the scope of the `Transaction` instance. Consider these as + * being member methods, but with an implied ordering while being isolated from + * each other. + */ +var TRANSACTION_WRAPPERS = [SELECTION_RESTORATION, EVENT_SUPPRESSION, ON_DOM_READY_QUEUEING]; + +if (process.env.NODE_ENV !== 'production') { + TRANSACTION_WRAPPERS.push({ + initialize: ReactInstrumentation.debugTool.onBeginFlush, + close: ReactInstrumentation.debugTool.onEndFlush + }); +} + +/** + * Currently: + * - The order that these are listed in the transaction is critical: + * - Suppresses events. + * - Restores selection range. + * + * Future: + * - Restore document/overflow scroll positions that were unintentionally + * modified via DOM insertions above the top viewport boundary. + * - Implement/integrate with customized constraint based layout system and keep + * track of which dimensions must be remeasured. + * + * @class ReactReconcileTransaction + */ +function ReactReconcileTransaction(useCreateElement) { + this.reinitializeTransaction(); + // Only server-side rendering really needs this option (see + // `ReactServerRendering`), but server-side uses + // `ReactServerRenderingTransaction` instead. This option is here so that it's + // accessible and defaults to false when `ReactDOMComponent` and + // `ReactDOMTextComponent` checks it in `mountComponent`.` + this.renderToStaticMarkup = false; + this.reactMountReady = CallbackQueue.getPooled(null); + this.useCreateElement = useCreateElement; +} + +var Mixin = { + /** + * @see Transaction + * @abstract + * @final + * @return {array<object>} List of operation wrap procedures. + * TODO: convert to array<TransactionWrapper> + */ + getTransactionWrappers: function () { + return TRANSACTION_WRAPPERS; + }, + + /** + * @return {object} The queue to collect `onDOMReady` callbacks with. + */ + getReactMountReady: function () { + return this.reactMountReady; + }, + + /** + * @return {object} The queue to collect React async events. + */ + getUpdateQueue: function () { + return ReactUpdateQueue; + }, + + /** + * Save current transaction state -- if the return value from this method is + * passed to `rollback`, the transaction will be reset to that state. + */ + checkpoint: function () { + // reactMountReady is the our only stateful wrapper + return this.reactMountReady.checkpoint(); + }, + + rollback: function (checkpoint) { + this.reactMountReady.rollback(checkpoint); + }, + + /** + * `PooledClass` looks for this, and will invoke this before allowing this + * instance to be reused. + */ + destructor: function () { + CallbackQueue.release(this.reactMountReady); + this.reactMountReady = null; + } +}; + +_assign(ReactReconcileTransaction.prototype, Transaction, Mixin); + +PooledClass.addPoolingTo(ReactReconcileTransaction); + +module.exports = ReactReconcileTransaction; +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) + +/***/ }), +/* 185 */ +/***/ (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 ExecutionEnvironment = __webpack_require__(9); + +var getNodeForCharacterOffset = __webpack_require__(186); +var getTextContentAccessor = __webpack_require__(73); + +/** + * While `isCollapsed` is available on the Selection object and `collapsed` + * is available on the Range object, IE11 sometimes gets them wrong. + * If the anchor/focus nodes and offsets are the same, the range is collapsed. + */ +function isCollapsed(anchorNode, anchorOffset, focusNode, focusOffset) { + return anchorNode === focusNode && anchorOffset === focusOffset; +} + +/** + * Get the appropriate anchor and focus node/offset pairs for IE. + * + * The catch here is that IE's selection API doesn't provide information + * about whether the selection is forward or backward, so we have to + * behave as though it's always forward. + * + * IE text differs from modern selection in that it behaves as though + * block elements end with a new line. This means character offsets will + * differ between the two APIs. + * + * @param {DOMElement} node + * @return {object} + */ +function getIEOffsets(node) { + var selection = document.selection; + var selectedRange = selection.createRange(); + var selectedLength = selectedRange.text.length; + + // Duplicate selection so we can move range without breaking user selection. + var fromStart = selectedRange.duplicate(); + fromStart.moveToElementText(node); + fromStart.setEndPoint('EndToStart', selectedRange); + + var startOffset = fromStart.text.length; + var endOffset = startOffset + selectedLength; + + return { + start: startOffset, + end: endOffset + }; +} + +/** + * @param {DOMElement} node + * @return {?object} + */ +function getModernOffsets(node) { + var selection = window.getSelection && window.getSelection(); + + if (!selection || selection.rangeCount === 0) { + return null; + } + + var anchorNode = selection.anchorNode; + var anchorOffset = selection.anchorOffset; + var focusNode = selection.focusNode; + var focusOffset = selection.focusOffset; + + var currentRange = selection.getRangeAt(0); + + // In Firefox, range.startContainer and range.endContainer can be "anonymous + // divs", e.g. the up/down buttons on an <input type="number">. Anonymous + // divs do not seem to expose properties, triggering a "Permission denied + // error" if any of its properties are accessed. The only seemingly possible + // way to avoid erroring is to access a property that typically works for + // non-anonymous divs and catch any error that may otherwise arise. See + // https://bugzilla.mozilla.org/show_bug.cgi?id=208427 + try { + /* eslint-disable no-unused-expressions */ + currentRange.startContainer.nodeType; + currentRange.endContainer.nodeType; + /* eslint-enable no-unused-expressions */ + } catch (e) { + return null; + } + + // If the node and offset values are the same, the selection is collapsed. + // `Selection.isCollapsed` is available natively, but IE sometimes gets + // this value wrong. + var isSelectionCollapsed = isCollapsed(selection.anchorNode, selection.anchorOffset, selection.focusNode, selection.focusOffset); + + var rangeLength = isSelectionCollapsed ? 0 : currentRange.toString().length; + + var tempRange = currentRange.cloneRange(); + tempRange.selectNodeContents(node); + tempRange.setEnd(currentRange.startContainer, currentRange.startOffset); + + var isTempRangeCollapsed = isCollapsed(tempRange.startContainer, tempRange.startOffset, tempRange.endContainer, tempRange.endOffset); + + var start = isTempRangeCollapsed ? 0 : tempRange.toString().length; + var end = start + rangeLength; + + // Detect whether the selection is backward. + var detectionRange = document.createRange(); + detectionRange.setStart(anchorNode, anchorOffset); + detectionRange.setEnd(focusNode, focusOffset); + var isBackward = detectionRange.collapsed; + + return { + start: isBackward ? end : start, + end: isBackward ? start : end + }; +} + +/** + * @param {DOMElement|DOMTextNode} node + * @param {object} offsets + */ +function setIEOffsets(node, offsets) { + var range = document.selection.createRange().duplicate(); + var start, end; + + if (offsets.end === undefined) { + start = offsets.start; + end = start; + } else if (offsets.start > offsets.end) { + start = offsets.end; + end = offsets.start; + } else { + start = offsets.start; + end = offsets.end; + } + + range.moveToElementText(node); + range.moveStart('character', start); + range.setEndPoint('EndToStart', range); + range.moveEnd('character', end - start); + range.select(); +} + +/** + * In modern non-IE browsers, we can support both forward and backward + * selections. + * + * Note: IE10+ supports the Selection object, but it does not support + * the `extend` method, which means that even in modern IE, it's not possible + * to programmatically create a backward selection. Thus, for all IE + * versions, we use the old IE API to create our selections. + * + * @param {DOMElement|DOMTextNode} node + * @param {object} offsets + */ +function setModernOffsets(node, offsets) { + if (!window.getSelection) { + return; + } + + var selection = window.getSelection(); + var length = node[getTextContentAccessor()].length; + var start = Math.min(offsets.start, length); + var end = offsets.end === undefined ? start : Math.min(offsets.end, length); + + // IE 11 uses modern selection, but doesn't support the extend method. + // Flip backward selections, so we can set with a single range. + if (!selection.extend && start > end) { + var temp = end; + end = start; + start = temp; + } + + var startMarker = getNodeForCharacterOffset(node, start); + var endMarker = getNodeForCharacterOffset(node, end); + + if (startMarker && endMarker) { + var range = document.createRange(); + range.setStart(startMarker.node, startMarker.offset); + selection.removeAllRanges(); + + if (start > end) { + selection.addRange(range); + selection.extend(endMarker.node, endMarker.offset); + } else { + range.setEnd(endMarker.node, endMarker.offset); + selection.addRange(range); + } + } +} + +var useIEOffsets = ExecutionEnvironment.canUseDOM && 'selection' in document && !('getSelection' in window); + +var ReactDOMSelection = { + /** + * @param {DOMElement} node + */ + getOffsets: useIEOffsets ? getIEOffsets : getModernOffsets, + + /** + * @param {DOMElement|DOMTextNode} node + * @param {object} offsets + */ + setOffsets: useIEOffsets ? setIEOffsets : setModernOffsets +}; + +module.exports = ReactDOMSelection; + +/***/ }), +/* 186 */ +/***/ (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. + * + */ + + + +/** + * Given any node return the first leaf node without children. + * + * @param {DOMElement|DOMTextNode} node + * @return {DOMElement|DOMTextNode} + */ + +function getLeafNode(node) { + while (node && node.firstChild) { + node = node.firstChild; + } + return node; +} + +/** + * Get the next sibling within a container. This will walk up the + * DOM if a node's siblings have been exhausted. + * + * @param {DOMElement|DOMTextNode} node + * @return {?DOMElement|DOMTextNode} + */ +function getSiblingNode(node) { + while (node) { + if (node.nextSibling) { + return node.nextSibling; + } + node = node.parentNode; + } +} + +/** + * Get object describing the nodes which contain characters at offset. + * + * @param {DOMElement|DOMTextNode} root + * @param {number} offset + * @return {?object} + */ +function getNodeForCharacterOffset(root, offset) { + var node = getLeafNode(root); + var nodeStart = 0; + var nodeEnd = 0; + + while (node) { + if (node.nodeType === 3) { + nodeEnd = nodeStart + node.textContent.length; + + if (nodeStart <= offset && nodeEnd >= offset) { + return { + node: node, + offset: offset - nodeStart + }; + } + + nodeStart = nodeEnd; + } + + node = getLeafNode(getSiblingNode(node)); + } +} + +module.exports = getNodeForCharacterOffset; + +/***/ }), +/* 187 */ +/***/ (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 isTextNode = __webpack_require__(188); + +/*eslint-disable no-bitwise */ + +/** + * Checks if a given DOM node contains or is another DOM node. + */ +function containsNode(outerNode, innerNode) { + if (!outerNode || !innerNode) { + return false; + } else if (outerNode === innerNode) { + return true; + } else if (isTextNode(outerNode)) { + return false; + } else if (isTextNode(innerNode)) { + return containsNode(outerNode, innerNode.parentNode); + } else if ('contains' in outerNode) { + return outerNode.contains(innerNode); + } else if (outerNode.compareDocumentPosition) { + return !!(outerNode.compareDocumentPosition(innerNode) & 16); + } else { + return false; + } +} + +module.exports = containsNode; + +/***/ }), +/* 188 */ +/***/ (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. + * + * @typechecks + */ + +var isNode = __webpack_require__(189); + +/** + * @param {*} object The object to check. + * @return {boolean} Whether or not the object is a DOM text node. + */ +function isTextNode(object) { + return isNode(object) && object.nodeType == 3; +} + +module.exports = isTextNode; + +/***/ }), +/* 189 */ +/***/ (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. + * + * @typechecks + */ + +/** + * @param {*} object The object to check. + * @return {boolean} Whether or not the object is a DOM node. + */ +function isNode(object) { + var doc = object ? object.ownerDocument || object : document; + var defaultView = doc.defaultView || window; + return !!(object && (typeof defaultView.Node === 'function' ? object instanceof defaultView.Node : typeof object === 'object' && typeof object.nodeType === 'number' && typeof object.nodeName === 'string')); +} + +module.exports = isNode; + +/***/ }), +/* 190 */ +/***/ (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 NS = { + xlink: 'http://www.w3.org/1999/xlink', + xml: 'http://www.w3.org/XML/1998/namespace' +}; + +// We use attributes for everything SVG so let's avoid some duplication and run +// code instead. +// The following are all specified in the HTML config already so we exclude here. +// - class (as className) +// - color +// - height +// - id +// - lang +// - max +// - media +// - method +// - min +// - name +// - style +// - target +// - type +// - width +var ATTRS = { + accentHeight: 'accent-height', + accumulate: 0, + additive: 0, + alignmentBaseline: 'alignment-baseline', + allowReorder: 'allowReorder', + alphabetic: 0, + amplitude: 0, + arabicForm: 'arabic-form', + ascent: 0, + attributeName: 'attributeName', + attributeType: 'attributeType', + autoReverse: 'autoReverse', + azimuth: 0, + baseFrequency: 'baseFrequency', + baseProfile: 'baseProfile', + baselineShift: 'baseline-shift', + bbox: 0, + begin: 0, + bias: 0, + by: 0, + calcMode: 'calcMode', + capHeight: 'cap-height', + clip: 0, + clipPath: 'clip-path', + clipRule: 'clip-rule', + clipPathUnits: 'clipPathUnits', + colorInterpolation: 'color-interpolation', + colorInterpolationFilters: 'color-interpolation-filters', + colorProfile: 'color-profile', + colorRendering: 'color-rendering', + contentScriptType: 'contentScriptType', + contentStyleType: 'contentStyleType', + cursor: 0, + cx: 0, + cy: 0, + d: 0, + decelerate: 0, + descent: 0, + diffuseConstant: 'diffuseConstant', + direction: 0, + display: 0, + divisor: 0, + dominantBaseline: 'dominant-baseline', + dur: 0, + dx: 0, + dy: 0, + edgeMode: 'edgeMode', + elevation: 0, + enableBackground: 'enable-background', + end: 0, + exponent: 0, + externalResourcesRequired: 'externalResourcesRequired', + fill: 0, + fillOpacity: 'fill-opacity', + fillRule: 'fill-rule', + filter: 0, + filterRes: 'filterRes', + filterUnits: 'filterUnits', + floodColor: 'flood-color', + floodOpacity: 'flood-opacity', + focusable: 0, + fontFamily: 'font-family', + fontSize: 'font-size', + fontSizeAdjust: 'font-size-adjust', + fontStretch: 'font-stretch', + fontStyle: 'font-style', + fontVariant: 'font-variant', + fontWeight: 'font-weight', + format: 0, + from: 0, + fx: 0, + fy: 0, + g1: 0, + g2: 0, + glyphName: 'glyph-name', + glyphOrientationHorizontal: 'glyph-orientation-horizontal', + glyphOrientationVertical: 'glyph-orientation-vertical', + glyphRef: 'glyphRef', + gradientTransform: 'gradientTransform', + gradientUnits: 'gradientUnits', + hanging: 0, + horizAdvX: 'horiz-adv-x', + horizOriginX: 'horiz-origin-x', + ideographic: 0, + imageRendering: 'image-rendering', + 'in': 0, + in2: 0, + intercept: 0, + k: 0, + k1: 0, + k2: 0, + k3: 0, + k4: 0, + kernelMatrix: 'kernelMatrix', + kernelUnitLength: 'kernelUnitLength', + kerning: 0, + keyPoints: 'keyPoints', + keySplines: 'keySplines', + keyTimes: 'keyTimes', + lengthAdjust: 'lengthAdjust', + letterSpacing: 'letter-spacing', + lightingColor: 'lighting-color', + limitingConeAngle: 'limitingConeAngle', + local: 0, + markerEnd: 'marker-end', + markerMid: 'marker-mid', + markerStart: 'marker-start', + markerHeight: 'markerHeight', + markerUnits: 'markerUnits', + markerWidth: 'markerWidth', + mask: 0, + maskContentUnits: 'maskContentUnits', + maskUnits: 'maskUnits', + mathematical: 0, + mode: 0, + numOctaves: 'numOctaves', + offset: 0, + opacity: 0, + operator: 0, + order: 0, + orient: 0, + orientation: 0, + origin: 0, + overflow: 0, + overlinePosition: 'overline-position', + overlineThickness: 'overline-thickness', + paintOrder: 'paint-order', + panose1: 'panose-1', + pathLength: 'pathLength', + patternContentUnits: 'patternContentUnits', + patternTransform: 'patternTransform', + patternUnits: 'patternUnits', + pointerEvents: 'pointer-events', + points: 0, + pointsAtX: 'pointsAtX', + pointsAtY: 'pointsAtY', + pointsAtZ: 'pointsAtZ', + preserveAlpha: 'preserveAlpha', + preserveAspectRatio: 'preserveAspectRatio', + primitiveUnits: 'primitiveUnits', + r: 0, + radius: 0, + refX: 'refX', + refY: 'refY', + renderingIntent: 'rendering-intent', + repeatCount: 'repeatCount', + repeatDur: 'repeatDur', + requiredExtensions: 'requiredExtensions', + requiredFeatures: 'requiredFeatures', + restart: 0, + result: 0, + rotate: 0, + rx: 0, + ry: 0, + scale: 0, + seed: 0, + shapeRendering: 'shape-rendering', + slope: 0, + spacing: 0, + specularConstant: 'specularConstant', + specularExponent: 'specularExponent', + speed: 0, + spreadMethod: 'spreadMethod', + startOffset: 'startOffset', + stdDeviation: 'stdDeviation', + stemh: 0, + stemv: 0, + stitchTiles: 'stitchTiles', + stopColor: 'stop-color', + stopOpacity: 'stop-opacity', + strikethroughPosition: 'strikethrough-position', + strikethroughThickness: 'strikethrough-thickness', + string: 0, + stroke: 0, + strokeDasharray: 'stroke-dasharray', + strokeDashoffset: 'stroke-dashoffset', + strokeLinecap: 'stroke-linecap', + strokeLinejoin: 'stroke-linejoin', + strokeMiterlimit: 'stroke-miterlimit', + strokeOpacity: 'stroke-opacity', + strokeWidth: 'stroke-width', + surfaceScale: 'surfaceScale', + systemLanguage: 'systemLanguage', + tableValues: 'tableValues', + targetX: 'targetX', + targetY: 'targetY', + textAnchor: 'text-anchor', + textDecoration: 'text-decoration', + textRendering: 'text-rendering', + textLength: 'textLength', + to: 0, + transform: 0, + u1: 0, + u2: 0, + underlinePosition: 'underline-position', + underlineThickness: 'underline-thickness', + unicode: 0, + unicodeBidi: 'unicode-bidi', + unicodeRange: 'unicode-range', + unitsPerEm: 'units-per-em', + vAlphabetic: 'v-alphabetic', + vHanging: 'v-hanging', + vIdeographic: 'v-ideographic', + vMathematical: 'v-mathematical', + values: 0, + vectorEffect: 'vector-effect', + version: 0, + vertAdvY: 'vert-adv-y', + vertOriginX: 'vert-origin-x', + vertOriginY: 'vert-origin-y', + viewBox: 'viewBox', + viewTarget: 'viewTarget', + visibility: 0, + widths: 0, + wordSpacing: 'word-spacing', + writingMode: 'writing-mode', + x: 0, + xHeight: 'x-height', + x1: 0, + x2: 0, + xChannelSelector: 'xChannelSelector', + xlinkActuate: 'xlink:actuate', + xlinkArcrole: 'xlink:arcrole', + xlinkHref: 'xlink:href', + xlinkRole: 'xlink:role', + xlinkShow: 'xlink:show', + xlinkTitle: 'xlink:title', + xlinkType: 'xlink:type', + xmlBase: 'xml:base', + xmlns: 0, + xmlnsXlink: 'xmlns:xlink', + xmlLang: 'xml:lang', + xmlSpace: 'xml:space', + y: 0, + y1: 0, + y2: 0, + yChannelSelector: 'yChannelSelector', + z: 0, + zoomAndPan: 'zoomAndPan' +}; + +var SVGDOMPropertyConfig = { + Properties: {}, + DOMAttributeNamespaces: { + xlinkActuate: NS.xlink, + xlinkArcrole: NS.xlink, + xlinkHref: NS.xlink, + xlinkRole: NS.xlink, + xlinkShow: NS.xlink, + xlinkTitle: NS.xlink, + xlinkType: NS.xlink, + xmlBase: NS.xml, + xmlLang: NS.xml, + xmlSpace: NS.xml + }, + DOMAttributeNames: {} +}; + +Object.keys(ATTRS).forEach(function (key) { + SVGDOMPropertyConfig.Properties[key] = 0; + if (ATTRS[key]) { + SVGDOMPropertyConfig.DOMAttributeNames[key] = ATTRS[key]; + } +}); + +module.exports = SVGDOMPropertyConfig; + +/***/ }), +/* 191 */ +/***/ (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 EventPropagators = __webpack_require__(26); +var ExecutionEnvironment = __webpack_require__(9); +var ReactDOMComponentTree = __webpack_require__(7); +var ReactInputSelection = __webpack_require__(91); +var SyntheticEvent = __webpack_require__(16); + +var getActiveElement = __webpack_require__(92); +var isTextInputElement = __webpack_require__(77); +var shallowEqual = __webpack_require__(52); + +var skipSelectionChangeEvent = ExecutionEnvironment.canUseDOM && 'documentMode' in document && document.documentMode <= 11; + +var eventTypes = { + select: { + phasedRegistrationNames: { + bubbled: 'onSelect', + captured: 'onSelectCapture' + }, + dependencies: ['topBlur', 'topContextMenu', 'topFocus', 'topKeyDown', 'topKeyUp', 'topMouseDown', 'topMouseUp', 'topSelectionChange'] + } +}; + +var activeElement = null; +var activeElementInst = null; +var lastSelection = null; +var mouseDown = false; + +// Track whether a listener exists for this plugin. If none exist, we do +// not extract events. See #3639. +var hasListener = false; + +/** + * Get an object which is a unique representation of the current selection. + * + * The return value will not be consistent across nodes or browsers, but + * two identical selections on the same node will return identical objects. + * + * @param {DOMElement} node + * @return {object} + */ +function getSelection(node) { + if ('selectionStart' in node && ReactInputSelection.hasSelectionCapabilities(node)) { + return { + start: node.selectionStart, + end: node.selectionEnd + }; + } else if (window.getSelection) { + var selection = window.getSelection(); + return { + anchorNode: selection.anchorNode, + anchorOffset: selection.anchorOffset, + focusNode: selection.focusNode, + focusOffset: selection.focusOffset + }; + } else if (document.selection) { + var range = document.selection.createRange(); + return { + parentElement: range.parentElement(), + text: range.text, + top: range.boundingTop, + left: range.boundingLeft + }; + } +} + +/** + * Poll selection to see whether it's changed. + * + * @param {object} nativeEvent + * @return {?SyntheticEvent} + */ +function constructSelectEvent(nativeEvent, nativeEventTarget) { + // Ensure we have the right element, and that the user is not dragging a + // selection (this matches native `select` event behavior). In HTML5, select + // fires only on input and textarea thus if there's no focused element we + // won't dispatch. + if (mouseDown || activeElement == null || activeElement !== getActiveElement()) { + return null; + } + + // Only fire when selection has actually changed. + var currentSelection = getSelection(activeElement); + if (!lastSelection || !shallowEqual(lastSelection, currentSelection)) { + lastSelection = currentSelection; + + var syntheticEvent = SyntheticEvent.getPooled(eventTypes.select, activeElementInst, nativeEvent, nativeEventTarget); + + syntheticEvent.type = 'select'; + syntheticEvent.target = activeElement; + + EventPropagators.accumulateTwoPhaseDispatches(syntheticEvent); + + return syntheticEvent; + } + + return null; +} + +/** + * This plugin creates an `onSelect` event that normalizes select events + * across form elements. + * + * Supported elements are: + * - input (see `isTextInputElement`) + * - textarea + * - contentEditable + * + * This differs from native browser implementations in the following ways: + * - Fires on contentEditable fields as well as inputs. + * - Fires for collapsed selection. + * - Fires after user input. + */ +var SelectEventPlugin = { + eventTypes: eventTypes, + + extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget) { + if (!hasListener) { + return null; + } + + var targetNode = targetInst ? ReactDOMComponentTree.getNodeFromInstance(targetInst) : window; + + switch (topLevelType) { + // Track the input node that has focus. + case 'topFocus': + if (isTextInputElement(targetNode) || targetNode.contentEditable === 'true') { + activeElement = targetNode; + activeElementInst = targetInst; + lastSelection = null; + } + break; + case 'topBlur': + activeElement = null; + activeElementInst = null; + lastSelection = null; + break; + // Don't fire the event while the user is dragging. This matches the + // semantics of the native select event. + case 'topMouseDown': + mouseDown = true; + break; + case 'topContextMenu': + case 'topMouseUp': + mouseDown = false; + return constructSelectEvent(nativeEvent, nativeEventTarget); + // Chrome and IE fire non-standard event when selection is changed (and + // sometimes when it hasn't). IE's event fires out of order with respect + // to key and input events on deletion, so we discard it. + // + // Firefox doesn't support selectionchange, so check selection status + // after each key entry. The selection changes after keydown and before + // keyup, but we check on keydown as well in the case of holding down a + // key, when multiple keydown events are fired but only one keyup is. + // This is also our approach for IE handling, for the reason above. + case 'topSelectionChange': + if (skipSelectionChangeEvent) { + break; + } + // falls through + case 'topKeyDown': + case 'topKeyUp': + return constructSelectEvent(nativeEvent, nativeEventTarget); + } + + return null; + }, + + didPutListener: function (inst, registrationName, listener) { + if (registrationName === 'onSelect') { + hasListener = true; + } + } +}; + +module.exports = SelectEventPlugin; + +/***/ }), +/* 192 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(process) {/** + * 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__(4); + +var EventListener = __webpack_require__(90); +var EventPropagators = __webpack_require__(26); +var ReactDOMComponentTree = __webpack_require__(7); +var SyntheticAnimationEvent = __webpack_require__(193); +var SyntheticClipboardEvent = __webpack_require__(194); +var SyntheticEvent = __webpack_require__(16); +var SyntheticFocusEvent = __webpack_require__(195); +var SyntheticKeyboardEvent = __webpack_require__(196); +var SyntheticMouseEvent = __webpack_require__(35); +var SyntheticDragEvent = __webpack_require__(198); +var SyntheticTouchEvent = __webpack_require__(199); +var SyntheticTransitionEvent = __webpack_require__(200); +var SyntheticUIEvent = __webpack_require__(28); +var SyntheticWheelEvent = __webpack_require__(201); + +var emptyFunction = __webpack_require__(12); +var getEventCharCode = __webpack_require__(57); +var invariant = __webpack_require__(1); + +/** + * Turns + * ['abort', ...] + * into + * eventTypes = { + * 'abort': { + * phasedRegistrationNames: { + * bubbled: 'onAbort', + * captured: 'onAbortCapture', + * }, + * dependencies: ['topAbort'], + * }, + * ... + * }; + * topLevelEventsToDispatchConfig = { + * 'topAbort': { sameConfig } + * }; + */ +var eventTypes = {}; +var topLevelEventsToDispatchConfig = {}; +['abort', 'animationEnd', 'animationIteration', 'animationStart', 'blur', 'canPlay', 'canPlayThrough', 'click', 'contextMenu', 'copy', 'cut', 'doubleClick', 'drag', 'dragEnd', 'dragEnter', 'dragExit', 'dragLeave', 'dragOver', 'dragStart', 'drop', 'durationChange', 'emptied', 'encrypted', 'ended', 'error', 'focus', 'input', 'invalid', 'keyDown', 'keyPress', 'keyUp', 'load', 'loadedData', 'loadedMetadata', 'loadStart', 'mouseDown', 'mouseMove', 'mouseOut', 'mouseOver', 'mouseUp', 'paste', 'pause', 'play', 'playing', 'progress', 'rateChange', 'reset', 'scroll', 'seeked', 'seeking', 'stalled', 'submit', 'suspend', 'timeUpdate', 'touchCancel', 'touchEnd', 'touchMove', 'touchStart', 'transitionEnd', 'volumeChange', 'waiting', 'wheel'].forEach(function (event) { + var capitalizedEvent = event[0].toUpperCase() + event.slice(1); + var onEvent = 'on' + capitalizedEvent; + var topEvent = 'top' + capitalizedEvent; + + var type = { + phasedRegistrationNames: { + bubbled: onEvent, + captured: onEvent + 'Capture' + }, + dependencies: [topEvent] + }; + eventTypes[event] = type; + topLevelEventsToDispatchConfig[topEvent] = type; +}); + +var onClickListeners = {}; + +function getDictionaryKey(inst) { + // Prevents V8 performance issue: + // https://github.com/facebook/react/pull/7232 + return '.' + inst._rootNodeID; +} + +function isInteractive(tag) { + return tag === 'button' || tag === 'input' || tag === 'select' || tag === 'textarea'; +} + +var SimpleEventPlugin = { + eventTypes: eventTypes, + + extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget) { + var dispatchConfig = topLevelEventsToDispatchConfig[topLevelType]; + if (!dispatchConfig) { + return null; + } + var EventConstructor; + switch (topLevelType) { + case 'topAbort': + case 'topCanPlay': + case 'topCanPlayThrough': + case 'topDurationChange': + case 'topEmptied': + case 'topEncrypted': + case 'topEnded': + case 'topError': + case 'topInput': + case 'topInvalid': + case 'topLoad': + case 'topLoadedData': + case 'topLoadedMetadata': + case 'topLoadStart': + case 'topPause': + case 'topPlay': + case 'topPlaying': + case 'topProgress': + case 'topRateChange': + case 'topReset': + case 'topSeeked': + case 'topSeeking': + case 'topStalled': + case 'topSubmit': + case 'topSuspend': + case 'topTimeUpdate': + case 'topVolumeChange': + case 'topWaiting': + // HTML Events + // @see http://www.w3.org/TR/html5/index.html#events-0 + EventConstructor = SyntheticEvent; + break; + case 'topKeyPress': + // Firefox creates a keypress event for function keys too. This removes + // the unwanted keypress events. Enter is however both printable and + // non-printable. One would expect Tab to be as well (but it isn't). + if (getEventCharCode(nativeEvent) === 0) { + return null; + } + /* falls through */ + case 'topKeyDown': + case 'topKeyUp': + EventConstructor = SyntheticKeyboardEvent; + break; + case 'topBlur': + case 'topFocus': + EventConstructor = SyntheticFocusEvent; + break; + case 'topClick': + // Firefox creates a click event on right mouse clicks. This removes the + // unwanted click events. + if (nativeEvent.button === 2) { + return null; + } + /* falls through */ + case 'topDoubleClick': + case 'topMouseDown': + case 'topMouseMove': + case 'topMouseUp': + // TODO: Disabled elements should not respond to mouse events + /* falls through */ + case 'topMouseOut': + case 'topMouseOver': + case 'topContextMenu': + EventConstructor = SyntheticMouseEvent; + break; + case 'topDrag': + case 'topDragEnd': + case 'topDragEnter': + case 'topDragExit': + case 'topDragLeave': + case 'topDragOver': + case 'topDragStart': + case 'topDrop': + EventConstructor = SyntheticDragEvent; + break; + case 'topTouchCancel': + case 'topTouchEnd': + case 'topTouchMove': + case 'topTouchStart': + EventConstructor = SyntheticTouchEvent; + break; + case 'topAnimationEnd': + case 'topAnimationIteration': + case 'topAnimationStart': + EventConstructor = SyntheticAnimationEvent; + break; + case 'topTransitionEnd': + EventConstructor = SyntheticTransitionEvent; + break; + case 'topScroll': + EventConstructor = SyntheticUIEvent; + break; + case 'topWheel': + EventConstructor = SyntheticWheelEvent; + break; + case 'topCopy': + case 'topCut': + case 'topPaste': + EventConstructor = SyntheticClipboardEvent; + break; + } + !EventConstructor ? process.env.NODE_ENV !== 'production' ? invariant(false, 'SimpleEventPlugin: Unhandled event type, `%s`.', topLevelType) : _prodInvariant('86', topLevelType) : void 0; + var event = EventConstructor.getPooled(dispatchConfig, targetInst, nativeEvent, nativeEventTarget); + EventPropagators.accumulateTwoPhaseDispatches(event); + return event; + }, + + didPutListener: function (inst, registrationName, listener) { + // Mobile Safari does not fire properly bubble click events on + // non-interactive elements, which means delegated click listeners do not + // fire. The workaround for this bug involves attaching an empty click + // listener on the target node. + // http://www.quirksmode.org/blog/archives/2010/09/click_event_del.html + if (registrationName === 'onClick' && !isInteractive(inst._tag)) { + var key = getDictionaryKey(inst); + var node = ReactDOMComponentTree.getNodeFromInstance(inst); + if (!onClickListeners[key]) { + onClickListeners[key] = EventListener.listen(node, 'click', emptyFunction); + } + } + }, + + willDeleteListener: function (inst, registrationName) { + if (registrationName === 'onClick' && !isInteractive(inst._tag)) { + var key = getDictionaryKey(inst); + onClickListeners[key].remove(); + delete onClickListeners[key]; + } + } +}; + +module.exports = SimpleEventPlugin; +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) + +/***/ }), +/* 193 */ +/***/ (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 SyntheticEvent = __webpack_require__(16); + +/** + * @interface Event + * @see http://www.w3.org/TR/css3-animations/#AnimationEvent-interface + * @see https://developer.mozilla.org/en-US/docs/Web/API/AnimationEvent + */ +var AnimationEventInterface = { + animationName: null, + elapsedTime: null, + pseudoElement: null +}; + +/** + * @param {object} dispatchConfig Configuration used to dispatch this event. + * @param {string} dispatchMarker Marker identifying the event target. + * @param {object} nativeEvent Native browser event. + * @extends {SyntheticEvent} + */ +function SyntheticAnimationEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) { + return SyntheticEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget); +} + +SyntheticEvent.augmentClass(SyntheticAnimationEvent, AnimationEventInterface); + +module.exports = SyntheticAnimationEvent; + +/***/ }), +/* 194 */ +/***/ (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 SyntheticEvent = __webpack_require__(16); + +/** + * @interface Event + * @see http://www.w3.org/TR/clipboard-apis/ + */ +var ClipboardEventInterface = { + clipboardData: function (event) { + return 'clipboardData' in event ? event.clipboardData : window.clipboardData; + } +}; + +/** + * @param {object} dispatchConfig Configuration used to dispatch this event. + * @param {string} dispatchMarker Marker identifying the event target. + * @param {object} nativeEvent Native browser event. + * @extends {SyntheticUIEvent} + */ +function SyntheticClipboardEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) { + return SyntheticEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget); +} + +SyntheticEvent.augmentClass(SyntheticClipboardEvent, ClipboardEventInterface); + +module.exports = SyntheticClipboardEvent; + +/***/ }), +/* 195 */ +/***/ (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 SyntheticUIEvent = __webpack_require__(28); + +/** + * @interface FocusEvent + * @see http://www.w3.org/TR/DOM-Level-3-Events/ + */ +var FocusEventInterface = { + relatedTarget: null +}; + +/** + * @param {object} dispatchConfig Configuration used to dispatch this event. + * @param {string} dispatchMarker Marker identifying the event target. + * @param {object} nativeEvent Native browser event. + * @extends {SyntheticUIEvent} + */ +function SyntheticFocusEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) { + return SyntheticUIEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget); +} + +SyntheticUIEvent.augmentClass(SyntheticFocusEvent, FocusEventInterface); + +module.exports = SyntheticFocusEvent; + +/***/ }), +/* 196 */ +/***/ (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 SyntheticUIEvent = __webpack_require__(28); + +var getEventCharCode = __webpack_require__(57); +var getEventKey = __webpack_require__(197); +var getEventModifierState = __webpack_require__(46); + +/** + * @interface KeyboardEvent + * @see http://www.w3.org/TR/DOM-Level-3-Events/ + */ +var KeyboardEventInterface = { + key: getEventKey, + location: null, + ctrlKey: null, + shiftKey: null, + altKey: null, + metaKey: null, + repeat: null, + locale: null, + getModifierState: getEventModifierState, + // Legacy Interface + charCode: function (event) { + // `charCode` is the result of a KeyPress event and represents the value of + // the actual printable character. + + // KeyPress is deprecated, but its replacement is not yet final and not + // implemented in any major browser. Only KeyPress has charCode. + if (event.type === 'keypress') { + return getEventCharCode(event); + } + return 0; + }, + keyCode: function (event) { + // `keyCode` is the result of a KeyDown/Up event and represents the value of + // physical keyboard key. + + // The actual meaning of the value depends on the users' keyboard layout + // which cannot be detected. Assuming that it is a US keyboard layout + // provides a surprisingly accurate mapping for US and European users. + // Due to this, it is left to the user to implement at this time. + if (event.type === 'keydown' || event.type === 'keyup') { + return event.keyCode; + } + return 0; + }, + which: function (event) { + // `which` is an alias for either `keyCode` or `charCode` depending on the + // type of the event. + if (event.type === 'keypress') { + return getEventCharCode(event); + } + if (event.type === 'keydown' || event.type === 'keyup') { + return event.keyCode; + } + return 0; + } +}; + +/** + * @param {object} dispatchConfig Configuration used to dispatch this event. + * @param {string} dispatchMarker Marker identifying the event target. + * @param {object} nativeEvent Native browser event. + * @extends {SyntheticUIEvent} + */ +function SyntheticKeyboardEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) { + return SyntheticUIEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget); +} + +SyntheticUIEvent.augmentClass(SyntheticKeyboardEvent, KeyboardEventInterface); + +module.exports = SyntheticKeyboardEvent; + +/***/ }), +/* 197 */ +/***/ (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 getEventCharCode = __webpack_require__(57); + +/** + * Normalization of deprecated HTML5 `key` values + * @see https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent#Key_names + */ +var normalizeKey = { + Esc: 'Escape', + Spacebar: ' ', + Left: 'ArrowLeft', + Up: 'ArrowUp', + Right: 'ArrowRight', + Down: 'ArrowDown', + Del: 'Delete', + Win: 'OS', + Menu: 'ContextMenu', + Apps: 'ContextMenu', + Scroll: 'ScrollLock', + MozPrintableKey: 'Unidentified' +}; + +/** + * Translation from legacy `keyCode` to HTML5 `key` + * Only special keys supported, all others depend on keyboard layout or browser + * @see https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent#Key_names + */ +var translateToKey = { + 8: 'Backspace', + 9: 'Tab', + 12: 'Clear', + 13: 'Enter', + 16: 'Shift', + 17: 'Control', + 18: 'Alt', + 19: 'Pause', + 20: 'CapsLock', + 27: 'Escape', + 32: ' ', + 33: 'PageUp', + 34: 'PageDown', + 35: 'End', + 36: 'Home', + 37: 'ArrowLeft', + 38: 'ArrowUp', + 39: 'ArrowRight', + 40: 'ArrowDown', + 45: 'Insert', + 46: 'Delete', + 112: 'F1', + 113: 'F2', + 114: 'F3', + 115: 'F4', + 116: 'F5', + 117: 'F6', + 118: 'F7', + 119: 'F8', + 120: 'F9', + 121: 'F10', + 122: 'F11', + 123: 'F12', + 144: 'NumLock', + 145: 'ScrollLock', + 224: 'Meta' +}; + +/** + * @param {object} nativeEvent Native browser event. + * @return {string} Normalized `key` property. + */ +function getEventKey(nativeEvent) { + if (nativeEvent.key) { + // Normalize inconsistent values reported by browsers due to + // implementations of a working draft specification. + + // FireFox implements `key` but returns `MozPrintableKey` for all + // printable characters (normalized to `Unidentified`), ignore it. + var key = normalizeKey[nativeEvent.key] || nativeEvent.key; + if (key !== 'Unidentified') { + return key; + } + } + + // Browser does not implement `key`, polyfill as much of it as we can. + if (nativeEvent.type === 'keypress') { + var charCode = getEventCharCode(nativeEvent); + + // The enter-key is technically both printable and non-printable and can + // thus be captured by `keypress`, no other non-printable key should. + return charCode === 13 ? 'Enter' : String.fromCharCode(charCode); + } + if (nativeEvent.type === 'keydown' || nativeEvent.type === 'keyup') { + // While user keyboard layout determines the actual meaning of each + // `keyCode` value, almost all function keys have a universal value. + return translateToKey[nativeEvent.keyCode] || 'Unidentified'; + } + return ''; +} + +module.exports = getEventKey; + +/***/ }), +/* 198 */ +/***/ (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 SyntheticMouseEvent = __webpack_require__(35); + +/** + * @interface DragEvent + * @see http://www.w3.org/TR/DOM-Level-3-Events/ + */ +var DragEventInterface = { + dataTransfer: null +}; + +/** + * @param {object} dispatchConfig Configuration used to dispatch this event. + * @param {string} dispatchMarker Marker identifying the event target. + * @param {object} nativeEvent Native browser event. + * @extends {SyntheticUIEvent} + */ +function SyntheticDragEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) { + return SyntheticMouseEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget); +} + +SyntheticMouseEvent.augmentClass(SyntheticDragEvent, DragEventInterface); + +module.exports = SyntheticDragEvent; + +/***/ }), +/* 199 */ +/***/ (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 SyntheticUIEvent = __webpack_require__(28); + +var getEventModifierState = __webpack_require__(46); + +/** + * @interface TouchEvent + * @see http://www.w3.org/TR/touch-events/ + */ +var TouchEventInterface = { + touches: null, + targetTouches: null, + changedTouches: null, + altKey: null, + metaKey: null, + ctrlKey: null, + shiftKey: null, + getModifierState: getEventModifierState +}; + +/** + * @param {object} dispatchConfig Configuration used to dispatch this event. + * @param {string} dispatchMarker Marker identifying the event target. + * @param {object} nativeEvent Native browser event. + * @extends {SyntheticUIEvent} + */ +function SyntheticTouchEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) { + return SyntheticUIEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget); +} + +SyntheticUIEvent.augmentClass(SyntheticTouchEvent, TouchEventInterface); + +module.exports = SyntheticTouchEvent; + +/***/ }), +/* 200 */ +/***/ (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 SyntheticEvent = __webpack_require__(16); + +/** + * @interface Event + * @see http://www.w3.org/TR/2009/WD-css3-transitions-20090320/#transition-events- + * @see https://developer.mozilla.org/en-US/docs/Web/API/TransitionEvent + */ +var TransitionEventInterface = { + propertyName: null, + elapsedTime: null, + pseudoElement: null +}; + +/** + * @param {object} dispatchConfig Configuration used to dispatch this event. + * @param {string} dispatchMarker Marker identifying the event target. + * @param {object} nativeEvent Native browser event. + * @extends {SyntheticEvent} + */ +function SyntheticTransitionEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) { + return SyntheticEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget); +} + +SyntheticEvent.augmentClass(SyntheticTransitionEvent, TransitionEventInterface); + +module.exports = SyntheticTransitionEvent; + +/***/ }), +/* 201 */ +/***/ (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 SyntheticMouseEvent = __webpack_require__(35); + +/** + * @interface WheelEvent + * @see http://www.w3.org/TR/DOM-Level-3-Events/ + */ +var WheelEventInterface = { + deltaX: function (event) { + return 'deltaX' in event ? event.deltaX : // Fallback to `wheelDeltaX` for Webkit and normalize (right is positive). + 'wheelDeltaX' in event ? -event.wheelDeltaX : 0; + }, + deltaY: function (event) { + return 'deltaY' in event ? event.deltaY : // Fallback to `wheelDeltaY` for Webkit and normalize (down is positive). + 'wheelDeltaY' in event ? -event.wheelDeltaY : // Fallback to `wheelDelta` for IE<9 and normalize (down is positive). + 'wheelDelta' in event ? -event.wheelDelta : 0; + }, + deltaZ: null, + + // Browsers without "deltaMode" is reporting in raw wheel delta where one + // notch on the scroll is always +/- 120, roughly equivalent to pixels. + // A good approximation of DOM_DELTA_LINE (1) is 5% of viewport size or + // ~40 pixels, for DOM_DELTA_SCREEN (2) it is 87.5% of viewport size. + deltaMode: null +}; + +/** + * @param {object} dispatchConfig Configuration used to dispatch this event. + * @param {string} dispatchMarker Marker identifying the event target. + * @param {object} nativeEvent Native browser event. + * @extends {SyntheticMouseEvent} + */ +function SyntheticWheelEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) { + return SyntheticMouseEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget); +} + +SyntheticMouseEvent.augmentClass(SyntheticWheelEvent, WheelEventInterface); + +module.exports = SyntheticWheelEvent; + +/***/ }), +/* 202 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(process) {/** + * 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 validateDOMNesting = __webpack_require__(56); + +var DOC_NODE_TYPE = 9; + +function ReactDOMContainerInfo(topLevelWrapper, node) { + var info = { + _topLevelWrapper: topLevelWrapper, + _idCounter: 1, + _ownerDocument: node ? node.nodeType === DOC_NODE_TYPE ? node : node.ownerDocument : null, + _node: node, + _tag: node ? node.nodeName.toLowerCase() : null, + _namespaceURI: node ? node.namespaceURI : null + }; + if (process.env.NODE_ENV !== 'production') { + info._ancestorInfo = node ? validateDOMNesting.updatedAncestorInfo(null, info._tag, null) : null; + } + return info; +} + +module.exports = ReactDOMContainerInfo; +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) + +/***/ }), +/* 203 */ +/***/ (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 ReactDOMFeatureFlags = { + useCreateElement: true, + useFiber: false +}; + +module.exports = ReactDOMFeatureFlags; + +/***/ }), +/* 204 */ +/***/ (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 adler32 = __webpack_require__(205); + +var TAG_END = /\/?>/; +var COMMENT_START = /^<\!\-\-/; + +var ReactMarkupChecksum = { + CHECKSUM_ATTR_NAME: 'data-react-checksum', + + /** + * @param {string} markup Markup string + * @return {string} Markup string with checksum attribute attached + */ + addChecksumToMarkup: function (markup) { + var checksum = adler32(markup); + + // Add checksum (handle both parent tags, comments and self-closing tags) + if (COMMENT_START.test(markup)) { + return markup; + } else { + return markup.replace(TAG_END, ' ' + ReactMarkupChecksum.CHECKSUM_ATTR_NAME + '="' + checksum + '"$&'); + } + }, + + /** + * @param {string} markup to use + * @param {DOMElement} element root React element + * @returns {boolean} whether or not the markup is the same + */ + canReuseMarkup: function (markup, element) { + var existingChecksum = element.getAttribute(ReactMarkupChecksum.CHECKSUM_ATTR_NAME); + existingChecksum = existingChecksum && parseInt(existingChecksum, 10); + var markupChecksum = adler32(markup); + return markupChecksum === existingChecksum; + } +}; + +module.exports = ReactMarkupChecksum; + +/***/ }), +/* 205 */ +/***/ (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 MOD = 65521; + +// adler32 is not cryptographically strong, and is only used to sanity check that +// markup generated on the server matches the markup generated on the client. +// This implementation (a modified version of the SheetJS version) has been optimized +// for our use case, at the expense of conforming to the adler32 specification +// for non-ascii inputs. +function adler32(data) { + var a = 1; + var b = 0; + var i = 0; + var l = data.length; + var m = l & ~0x3; + while (i < m) { + var n = Math.min(i + 4096, m); + for (; i < n; i += 4) { + b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3)); + } + a %= MOD; + b %= MOD; + } + for (; i < l; i++) { + b += a += data.charCodeAt(i); + } + a %= MOD; + b %= MOD; + return a | b << 16; +} + +module.exports = adler32; + +/***/ }), +/* 206 */ +/***/ (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. + * + */ + + + +module.exports = '15.6.2'; + +/***/ }), +/* 207 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(process) {/** + * 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__(4); + +var ReactCurrentOwner = __webpack_require__(14); +var ReactDOMComponentTree = __webpack_require__(7); +var ReactInstanceMap = __webpack_require__(29); + +var getHostComponentFromComposite = __webpack_require__(94); +var invariant = __webpack_require__(1); +var warning = __webpack_require__(3); + +/** + * Returns the DOM node rendered by this element. + * + * See https://facebook.github.io/react/docs/top-level-api.html#reactdom.finddomnode + * + * @param {ReactComponent|DOMElement} componentOrElement + * @return {?DOMElement} The root node of this element. + */ +function findDOMNode(componentOrElement) { + if (process.env.NODE_ENV !== 'production') { + var owner = ReactCurrentOwner.current; + if (owner !== null) { + process.env.NODE_ENV !== 'production' ? warning(owner._warnedAboutRefsInRender, '%s is accessing findDOMNode inside its render(). ' + 'render() should be a pure function of props and state. It should ' + 'never access something that requires stale data from the previous ' + 'render, such as refs. Move this logic to componentDidMount and ' + 'componentDidUpdate instead.', owner.getName() || 'A component') : void 0; + owner._warnedAboutRefsInRender = true; + } + } + if (componentOrElement == null) { + return null; + } + if (componentOrElement.nodeType === 1) { + return componentOrElement; + } + + var inst = ReactInstanceMap.get(componentOrElement); + if (inst) { + inst = getHostComponentFromComposite(inst); + return inst ? ReactDOMComponentTree.getNodeFromInstance(inst) : null; + } + + if (typeof componentOrElement.render === 'function') { + true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'findDOMNode was called on an unmounted component.') : _prodInvariant('44') : void 0; + } else { + true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Element appears to be neither ReactComponent nor DOMNode (keys: %s)', Object.keys(componentOrElement)) : _prodInvariant('45', Object.keys(componentOrElement)) : void 0; + } +} + +module.exports = findDOMNode; +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) + +/***/ }), +/* 208 */ +/***/ (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 ReactMount = __webpack_require__(93); + +module.exports = ReactMount.renderSubtreeIntoContainer; + +/***/ }), +/* 209 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(process) {/** + * 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 DOMProperty = __webpack_require__(17); +var EventPluginRegistry = __webpack_require__(33); +var ReactComponentTreeHook = __webpack_require__(11); + +var warning = __webpack_require__(3); + +if (process.env.NODE_ENV !== 'production') { + var reactProps = { + children: true, + dangerouslySetInnerHTML: true, + key: true, + ref: true, + + autoFocus: true, + defaultValue: true, + valueLink: true, + defaultChecked: true, + checkedLink: true, + innerHTML: true, + suppressContentEditableWarning: true, + onFocusIn: true, + onFocusOut: true + }; + var warnedProperties = {}; + + var validateProperty = function (tagName, name, debugID) { + if (DOMProperty.properties.hasOwnProperty(name) || DOMProperty.isCustomAttribute(name)) { + return true; + } + if (reactProps.hasOwnProperty(name) && reactProps[name] || warnedProperties.hasOwnProperty(name) && warnedProperties[name]) { + return true; + } + if (EventPluginRegistry.registrationNameModules.hasOwnProperty(name)) { + return true; + } + warnedProperties[name] = true; + var lowerCasedName = name.toLowerCase(); + + // data-* attributes should be lowercase; suggest the lowercase version + var standardName = DOMProperty.isCustomAttribute(lowerCasedName) ? lowerCasedName : DOMProperty.getPossibleStandardName.hasOwnProperty(lowerCasedName) ? DOMProperty.getPossibleStandardName[lowerCasedName] : null; + + var registrationName = EventPluginRegistry.possibleRegistrationNames.hasOwnProperty(lowerCasedName) ? EventPluginRegistry.possibleRegistrationNames[lowerCasedName] : null; + + if (standardName != null) { + process.env.NODE_ENV !== 'production' ? warning(false, 'Unknown DOM property %s. Did you mean %s?%s', name, standardName, ReactComponentTreeHook.getStackAddendumByID(debugID)) : void 0; + return true; + } else if (registrationName != null) { + process.env.NODE_ENV !== 'production' ? warning(false, 'Unknown event handler property %s. Did you mean `%s`?%s', name, registrationName, ReactComponentTreeHook.getStackAddendumByID(debugID)) : void 0; + return true; + } else { + // We were unable to guess which prop the user intended. + // It is likely that the user was just blindly spreading/forwarding props + // Components should be careful to only render valid props/attributes. + // Warning will be invoked in warnUnknownProperties to allow grouping. + return false; + } + }; +} + +var warnUnknownProperties = function (debugID, element) { + var unknownProps = []; + for (var key in element.props) { + var isValid = validateProperty(element.type, key, debugID); + if (!isValid) { + unknownProps.push(key); + } + } + + var unknownPropString = unknownProps.map(function (prop) { + return '`' + prop + '`'; + }).join(', '); + + if (unknownProps.length === 1) { + process.env.NODE_ENV !== 'production' ? warning(false, 'Unknown prop %s on <%s> tag. Remove this prop from the element. ' + 'For details, see https://fb.me/react-unknown-prop%s', unknownPropString, element.type, ReactComponentTreeHook.getStackAddendumByID(debugID)) : void 0; + } else if (unknownProps.length > 1) { + process.env.NODE_ENV !== 'production' ? warning(false, 'Unknown props %s on <%s> tag. Remove these props from the element. ' + 'For details, see https://fb.me/react-unknown-prop%s', unknownPropString, element.type, ReactComponentTreeHook.getStackAddendumByID(debugID)) : void 0; + } +}; + +function handleElement(debugID, element) { + if (element == null || typeof element.type !== 'string') { + return; + } + if (element.type.indexOf('-') >= 0 || element.props.is) { + return; + } + warnUnknownProperties(debugID, element); +} + +var ReactDOMUnknownPropertyHook = { + onBeforeMountComponent: function (debugID, element) { + handleElement(debugID, element); + }, + onBeforeUpdateComponent: function (debugID, element) { + handleElement(debugID, element); + } +}; + +module.exports = ReactDOMUnknownPropertyHook; +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) + +/***/ }), +/* 210 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(process) {/** + * 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 ReactComponentTreeHook = __webpack_require__(11); + +var warning = __webpack_require__(3); + +var didWarnValueNull = false; + +function handleElement(debugID, element) { + if (element == null) { + return; + } + if (element.type !== 'input' && element.type !== 'textarea' && element.type !== 'select') { + return; + } + if (element.props != null && element.props.value === null && !didWarnValueNull) { + process.env.NODE_ENV !== 'production' ? warning(false, '`value` prop on `%s` should not be null. ' + 'Consider using the empty string to clear the component or `undefined` ' + 'for uncontrolled components.%s', element.type, ReactComponentTreeHook.getStackAddendumByID(debugID)) : void 0; + + didWarnValueNull = true; + } +} + +var ReactDOMNullInputValuePropHook = { + onBeforeMountComponent: function (debugID, element) { + handleElement(debugID, element); + }, + onBeforeUpdateComponent: function (debugID, element) { + handleElement(debugID, element); + } +}; + +module.exports = ReactDOMNullInputValuePropHook; +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) + +/***/ }), +/* 211 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(process) {/** + * 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 DOMProperty = __webpack_require__(17); +var ReactComponentTreeHook = __webpack_require__(11); + +var warning = __webpack_require__(3); + +var warnedProperties = {}; +var rARIA = new RegExp('^(aria)-[' + DOMProperty.ATTRIBUTE_NAME_CHAR + ']*$'); + +function validateProperty(tagName, name, debugID) { + if (warnedProperties.hasOwnProperty(name) && warnedProperties[name]) { + return true; + } + + if (rARIA.test(name)) { + var lowerCasedName = name.toLowerCase(); + var standardName = DOMProperty.getPossibleStandardName.hasOwnProperty(lowerCasedName) ? DOMProperty.getPossibleStandardName[lowerCasedName] : null; + + // If this is an aria-* attribute, but is not listed in the known DOM + // DOM properties, then it is an invalid aria-* attribute. + if (standardName == null) { + warnedProperties[name] = true; + return false; + } + // aria-* attributes should be lowercase; suggest the lowercase version. + if (name !== standardName) { + process.env.NODE_ENV !== 'production' ? warning(false, 'Unknown ARIA attribute %s. Did you mean %s?%s', name, standardName, ReactComponentTreeHook.getStackAddendumByID(debugID)) : void 0; + warnedProperties[name] = true; + return true; + } + } + + return true; +} + +function warnInvalidARIAProps(debugID, element) { + var invalidProps = []; + + for (var key in element.props) { + var isValid = validateProperty(element.type, key, debugID); + if (!isValid) { + invalidProps.push(key); + } + } + + var unknownPropString = invalidProps.map(function (prop) { + return '`' + prop + '`'; + }).join(', '); + + if (invalidProps.length === 1) { + process.env.NODE_ENV !== 'production' ? warning(false, 'Invalid aria prop %s on <%s> tag. ' + 'For details, see https://fb.me/invalid-aria-prop%s', unknownPropString, element.type, ReactComponentTreeHook.getStackAddendumByID(debugID)) : void 0; + } else if (invalidProps.length > 1) { + process.env.NODE_ENV !== 'production' ? warning(false, 'Invalid aria props %s on <%s> tag. ' + 'For details, see https://fb.me/invalid-aria-prop%s', unknownPropString, element.type, ReactComponentTreeHook.getStackAddendumByID(debugID)) : void 0; + } +} + +function handleElement(debugID, element) { + if (element == null || typeof element.type !== 'string') { + return; + } + if (element.type.indexOf('-') >= 0 || element.props.is) { + return; + } + + warnInvalidARIAProps(debugID, element); +} + +var ReactDOMInvalidARIAHook = { + onBeforeMountComponent: function (debugID, element) { + if (process.env.NODE_ENV !== 'production') { + handleElement(debugID, element); + } + }, + onBeforeUpdateComponent: function (debugID, element) { + if (process.env.NODE_ENV !== 'production') { + handleElement(debugID, element); + } + } +}; + +module.exports = ReactDOMInvalidARIAHook; +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) + +/***/ }), +/* 212 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(process) {/* harmony export (immutable) */ __webpack_exports__["a"] = createProvider; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react__ = __webpack_require__(2); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_react__); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_prop_types__ = __webpack_require__(18); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_prop_types__); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__utils_PropTypes__ = __webpack_require__(95); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__utils_warning__ = __webpack_require__(58); +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + + + + + + +var didWarnAboutReceivingStore = false; +function warnAboutReceivingStore() { + if (didWarnAboutReceivingStore) { + return; + } + didWarnAboutReceivingStore = true; + + Object(__WEBPACK_IMPORTED_MODULE_3__utils_warning__["a" /* default */])('<Provider> does not support changing `store` on the fly. ' + 'It is most likely that you see this error because you updated to ' + 'Redux 2.x and React Redux 2.x which no longer hot reload reducers ' + 'automatically. See https://github.com/reactjs/react-redux/releases/' + 'tag/v2.0.0 for the migration instructions.'); +} + +function createProvider() { + var _Provider$childContex; + + var storeKey = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'store'; + var subKey = arguments[1]; + + var subscriptionKey = subKey || storeKey + 'Subscription'; + + var Provider = function (_Component) { + _inherits(Provider, _Component); + + Provider.prototype.getChildContext = function getChildContext() { + var _ref; + + return _ref = {}, _ref[storeKey] = this[storeKey], _ref[subscriptionKey] = null, _ref; + }; + + function Provider(props, context) { + _classCallCheck(this, Provider); + + var _this = _possibleConstructorReturn(this, _Component.call(this, props, context)); + + _this[storeKey] = props.store; + return _this; + } + + Provider.prototype.render = function render() { + return __WEBPACK_IMPORTED_MODULE_0_react__["Children"].only(this.props.children); + }; + + return Provider; + }(__WEBPACK_IMPORTED_MODULE_0_react__["Component"]); + + if (process.env.NODE_ENV !== 'production') { + Provider.prototype.componentWillReceiveProps = function (nextProps) { + if (this[storeKey] !== nextProps.store) { + warnAboutReceivingStore(); + } + }; + } + + Provider.propTypes = { + store: __WEBPACK_IMPORTED_MODULE_2__utils_PropTypes__["a" /* storeShape */].isRequired, + children: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.element.isRequired + }; + Provider.childContextTypes = (_Provider$childContex = {}, _Provider$childContex[storeKey] = __WEBPACK_IMPORTED_MODULE_2__utils_PropTypes__["a" /* storeShape */].isRequired, _Provider$childContex[subscriptionKey] = __WEBPACK_IMPORTED_MODULE_2__utils_PropTypes__["b" /* subscriptionShape */], _Provider$childContex); + + return Provider; +} + +/* harmony default export */ __webpack_exports__["b"] = (createProvider()); +/* WEBPACK VAR INJECTION */}.call(__webpack_exports__, __webpack_require__(0))) + +/***/ }), +/* 213 */ +/***/ (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 emptyFunction = __webpack_require__(12); +var invariant = __webpack_require__(1); +var ReactPropTypesSecret = __webpack_require__(41); + +module.exports = function() { + function shim(props, propName, componentName, location, propFullName, secret) { + if (secret === ReactPropTypesSecret) { + // It is still safe when called from React. + return; + } + invariant( + false, + 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' + + 'Use PropTypes.checkPropTypes() to call them. ' + + 'Read more at http://fb.me/use-check-prop-types' + ); + }; + shim.isRequired = shim; + function getShim() { + return shim; + }; + // Important! + // Keep this list in sync with production version in `./factoryWithTypeCheckers.js`. + var ReactPropTypes = { + array: shim, + bool: shim, + func: shim, + number: shim, + object: shim, + string: shim, + symbol: shim, + + any: shim, + arrayOf: getShim, + element: shim, + instanceOf: getShim, + node: shim, + objectOf: getShim, + oneOf: getShim, + oneOfType: getShim, + shape: getShim, + exact: getShim + }; + + ReactPropTypes.checkPropTypes = emptyFunction; + ReactPropTypes.PropTypes = ReactPropTypes; + + return ReactPropTypes; +}; + + +/***/ }), +/* 214 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/** + * Copyright 2015, Yahoo! Inc. + * Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms. + */ + + +var REACT_STATICS = { + childContextTypes: true, + contextTypes: true, + defaultProps: true, + displayName: true, + getDefaultProps: true, + mixins: true, + propTypes: true, + type: true +}; + +var KNOWN_STATICS = { + name: true, + length: true, + prototype: true, + caller: true, + callee: true, + arguments: true, + arity: true +}; + +var defineProperty = Object.defineProperty; +var getOwnPropertyNames = Object.getOwnPropertyNames; +var getOwnPropertySymbols = Object.getOwnPropertySymbols; +var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor; +var getPrototypeOf = Object.getPrototypeOf; +var objectPrototype = getPrototypeOf && getPrototypeOf(Object); + +module.exports = function hoistNonReactStatics(targetComponent, sourceComponent, blacklist) { + if (typeof sourceComponent !== 'string') { // don't hoist over string (html) components + + if (objectPrototype) { + var inheritedComponent = getPrototypeOf(sourceComponent); + if (inheritedComponent && inheritedComponent !== objectPrototype) { + hoistNonReactStatics(targetComponent, inheritedComponent, blacklist); + } + } + + var keys = getOwnPropertyNames(sourceComponent); + + if (getOwnPropertySymbols) { + keys = keys.concat(getOwnPropertySymbols(sourceComponent)); + } + + for (var i = 0; i < keys.length; ++i) { + var key = keys[i]; + if (!REACT_STATICS[key] && !KNOWN_STATICS[key] && (!blacklist || !blacklist[key])) { + var descriptor = getOwnPropertyDescriptor(sourceComponent, key); + try { // Avoid failures from read-only properties + defineProperty(targetComponent, key, descriptor); + } catch (e) {} + } + } + + return targetComponent; + } + + return targetComponent; +}; + + +/***/ }), +/* 215 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(process) {/** + * Copyright 2013-2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + */ + + + +/** + * 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 invariant = function(condition, format, a, b, c, d, e, f) { + if (process.env.NODE_ENV !== 'production') { + if (format === undefined) { + throw new Error('invariant requires an error message argument'); + } + } + + 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; + +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) + +/***/ }), +/* 216 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Subscription; }); +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +// encapsulates the subscription logic for connecting a component to the redux store, as +// well as nesting subscriptions of descendant components, so that we can ensure the +// ancestor components re-render before descendants + +var CLEARED = null; +var nullListeners = { + notify: function notify() {} +}; + +function createListenerCollection() { + // the current/next pattern is copied from redux's createStore code. + // TODO: refactor+expose that code to be reusable here? + var current = []; + var next = []; + + return { + clear: function clear() { + next = CLEARED; + current = CLEARED; + }, + notify: function notify() { + var listeners = current = next; + for (var i = 0; i < listeners.length; i++) { + listeners[i](); + } + }, + get: function get() { + return next; + }, + subscribe: function subscribe(listener) { + var isSubscribed = true; + if (next === current) next = current.slice(); + next.push(listener); + + return function unsubscribe() { + if (!isSubscribed || current === CLEARED) return; + isSubscribed = false; + + if (next === current) next = current.slice(); + next.splice(next.indexOf(listener), 1); + }; + } + }; +} + +var Subscription = function () { + function Subscription(store, parentSub, onStateChange) { + _classCallCheck(this, Subscription); + + this.store = store; + this.parentSub = parentSub; + this.onStateChange = onStateChange; + this.unsubscribe = null; + this.listeners = nullListeners; + } + + Subscription.prototype.addNestedSub = function addNestedSub(listener) { + this.trySubscribe(); + return this.listeners.subscribe(listener); + }; + + Subscription.prototype.notifyNestedSubs = function notifyNestedSubs() { + this.listeners.notify(); + }; + + Subscription.prototype.isSubscribed = function isSubscribed() { + return Boolean(this.unsubscribe); + }; + + Subscription.prototype.trySubscribe = function trySubscribe() { + if (!this.unsubscribe) { + this.unsubscribe = this.parentSub ? this.parentSub.addNestedSub(this.onStateChange) : this.store.subscribe(this.onStateChange); + + this.listeners = createListenerCollection(); + } + }; + + Subscription.prototype.tryUnsubscribe = function tryUnsubscribe() { + if (this.unsubscribe) { + this.unsubscribe(); + this.unsubscribe = null; + this.listeners.clear(); + this.listeners = nullListeners; + } + }; + + return Subscription; +}(); + + + +/***/ }), +/* 217 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* unused harmony export createConnect */ +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__components_connectAdvanced__ = __webpack_require__(96); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__ = __webpack_require__(218); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__mapDispatchToProps__ = __webpack_require__(219); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__mapStateToProps__ = __webpack_require__(233); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__mergeProps__ = __webpack_require__(234); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__selectorFactory__ = __webpack_require__(235); +var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; + +function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; } + + + + + + + + +/* + connect is a facade over connectAdvanced. It turns its args into a compatible + selectorFactory, which has the signature: + + (dispatch, options) => (nextState, nextOwnProps) => nextFinalProps + + connect passes its args to connectAdvanced as options, which will in turn pass them to + selectorFactory each time a Connect component instance is instantiated or hot reloaded. + + selectorFactory returns a final props selector from its mapStateToProps, + mapStateToPropsFactories, mapDispatchToProps, mapDispatchToPropsFactories, mergeProps, + mergePropsFactories, and pure args. + + The resulting final props selector is called by the Connect component instance whenever + it receives new props or store state. + */ + +function match(arg, factories, name) { + for (var i = factories.length - 1; i >= 0; i--) { + var result = factories[i](arg); + if (result) return result; + } + + return function (dispatch, options) { + throw new Error('Invalid value of type ' + typeof arg + ' for ' + name + ' argument when connecting component ' + options.wrappedComponentName + '.'); + }; +} + +function strictEqual(a, b) { + return a === b; +} + +// createConnect with default args builds the 'official' connect behavior. Calling it with +// different options opens up some testing and extensibility scenarios +function createConnect() { + var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}, + _ref$connectHOC = _ref.connectHOC, + connectHOC = _ref$connectHOC === undefined ? __WEBPACK_IMPORTED_MODULE_0__components_connectAdvanced__["a" /* default */] : _ref$connectHOC, + _ref$mapStateToPropsF = _ref.mapStateToPropsFactories, + mapStateToPropsFactories = _ref$mapStateToPropsF === undefined ? __WEBPACK_IMPORTED_MODULE_3__mapStateToProps__["a" /* default */] : _ref$mapStateToPropsF, + _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories, + mapDispatchToPropsFactories = _ref$mapDispatchToPro === undefined ? __WEBPACK_IMPORTED_MODULE_2__mapDispatchToProps__["a" /* default */] : _ref$mapDispatchToPro, + _ref$mergePropsFactor = _ref.mergePropsFactories, + mergePropsFactories = _ref$mergePropsFactor === undefined ? __WEBPACK_IMPORTED_MODULE_4__mergeProps__["a" /* default */] : _ref$mergePropsFactor, + _ref$selectorFactory = _ref.selectorFactory, + selectorFactory = _ref$selectorFactory === undefined ? __WEBPACK_IMPORTED_MODULE_5__selectorFactory__["a" /* default */] : _ref$selectorFactory; + + return function connect(mapStateToProps, mapDispatchToProps, mergeProps) { + var _ref2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {}, + _ref2$pure = _ref2.pure, + pure = _ref2$pure === undefined ? true : _ref2$pure, + _ref2$areStatesEqual = _ref2.areStatesEqual, + areStatesEqual = _ref2$areStatesEqual === undefined ? strictEqual : _ref2$areStatesEqual, + _ref2$areOwnPropsEqua = _ref2.areOwnPropsEqual, + areOwnPropsEqual = _ref2$areOwnPropsEqua === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__["a" /* default */] : _ref2$areOwnPropsEqua, + _ref2$areStatePropsEq = _ref2.areStatePropsEqual, + areStatePropsEqual = _ref2$areStatePropsEq === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__["a" /* default */] : _ref2$areStatePropsEq, + _ref2$areMergedPropsE = _ref2.areMergedPropsEqual, + areMergedPropsEqual = _ref2$areMergedPropsE === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__["a" /* default */] : _ref2$areMergedPropsE, + extraOptions = _objectWithoutProperties(_ref2, ['pure', 'areStatesEqual', 'areOwnPropsEqual', 'areStatePropsEqual', 'areMergedPropsEqual']); + + var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps'); + var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps'); + var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps'); + + return connectHOC(selectorFactory, _extends({ + // used in error messages + methodName: 'connect', + + // used to compute Connect's displayName from the wrapped component's displayName. + getDisplayName: function getDisplayName(name) { + return 'Connect(' + name + ')'; + }, + + // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes + shouldHandleStateChanges: Boolean(mapStateToProps), + + // passed through to selectorFactory + initMapStateToProps: initMapStateToProps, + initMapDispatchToProps: initMapDispatchToProps, + initMergeProps: initMergeProps, + pure: pure, + areStatesEqual: areStatesEqual, + areOwnPropsEqual: areOwnPropsEqual, + areStatePropsEqual: areStatePropsEqual, + areMergedPropsEqual: areMergedPropsEqual + + }, extraOptions)); + }; +} + +/* harmony default export */ __webpack_exports__["a"] = (createConnect()); + +/***/ }), +/* 218 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export (immutable) */ __webpack_exports__["a"] = shallowEqual; +var hasOwn = Object.prototype.hasOwnProperty; + +function is(x, y) { + if (x === y) { + return x !== 0 || y !== 0 || 1 / x === 1 / y; + } else { + return x !== x && y !== y; + } +} + +function shallowEqual(objA, objB) { + if (is(objA, objB)) return true; + + if (typeof objA !== 'object' || objA === null || typeof objB !== 'object' || objB === null) { + return false; + } + + var keysA = Object.keys(objA); + var keysB = Object.keys(objB); + + if (keysA.length !== keysB.length) return false; + + for (var i = 0; i < keysA.length; i++) { + if (!hasOwn.call(objB, keysA[i]) || !is(objA[keysA[i]], objB[keysA[i]])) { + return false; + } + } + + return true; +} + +/***/ }), +/* 219 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* unused harmony export whenMapDispatchToPropsIsFunction */ +/* unused harmony export whenMapDispatchToPropsIsMissing */ +/* unused harmony export whenMapDispatchToPropsIsObject */ +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_redux__ = __webpack_require__(59); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__wrapMapToProps__ = __webpack_require__(102); + + + +function whenMapDispatchToPropsIsFunction(mapDispatchToProps) { + return typeof mapDispatchToProps === 'function' ? Object(__WEBPACK_IMPORTED_MODULE_1__wrapMapToProps__["b" /* wrapMapToPropsFunc */])(mapDispatchToProps, 'mapDispatchToProps') : undefined; +} + +function whenMapDispatchToPropsIsMissing(mapDispatchToProps) { + return !mapDispatchToProps ? Object(__WEBPACK_IMPORTED_MODULE_1__wrapMapToProps__["a" /* wrapMapToPropsConstant */])(function (dispatch) { + return { dispatch: dispatch }; + }) : undefined; +} + +function whenMapDispatchToPropsIsObject(mapDispatchToProps) { + return mapDispatchToProps && typeof mapDispatchToProps === 'object' ? Object(__WEBPACK_IMPORTED_MODULE_1__wrapMapToProps__["a" /* wrapMapToPropsConstant */])(function (dispatch) { + return Object(__WEBPACK_IMPORTED_MODULE_0_redux__["bindActionCreators"])(mapDispatchToProps, dispatch); + }) : undefined; +} + +/* harmony default export */ __webpack_exports__["a"] = ([whenMapDispatchToPropsIsFunction, whenMapDispatchToPropsIsMissing, whenMapDispatchToPropsIsObject]); + +/***/ }), +/* 220 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__Symbol_js__ = __webpack_require__(98); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__getRawTag_js__ = __webpack_require__(223); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__objectToString_js__ = __webpack_require__(224); + + + + +/** `Object#toString` result references. */ +var nullTag = '[object Null]', + undefinedTag = '[object Undefined]'; + +/** Built-in value references. */ +var symToStringTag = __WEBPACK_IMPORTED_MODULE_0__Symbol_js__["a" /* default */] ? __WEBPACK_IMPORTED_MODULE_0__Symbol_js__["a" /* default */].toStringTag : undefined; + +/** + * The base implementation of `getTag` without fallbacks for buggy environments. + * + * @private + * @param {*} value The value to query. + * @returns {string} Returns the `toStringTag`. + */ +function baseGetTag(value) { + if (value == null) { + return value === undefined ? undefinedTag : nullTag; + } + return (symToStringTag && symToStringTag in Object(value)) + ? Object(__WEBPACK_IMPORTED_MODULE_1__getRawTag_js__["a" /* default */])(value) + : Object(__WEBPACK_IMPORTED_MODULE_2__objectToString_js__["a" /* default */])(value); +} + +/* harmony default export */ __webpack_exports__["a"] = (baseGetTag); + + +/***/ }), +/* 221 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__freeGlobal_js__ = __webpack_require__(222); + + +/** Detect free variable `self`. */ +var freeSelf = typeof self == 'object' && self && self.Object === Object && self; + +/** Used as a reference to the global object. */ +var root = __WEBPACK_IMPORTED_MODULE_0__freeGlobal_js__["a" /* default */] || freeSelf || Function('return this')(); + +/* harmony default export */ __webpack_exports__["a"] = (root); + + +/***/ }), +/* 222 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(global) {/** Detect free variable `global` from Node.js. */ +var freeGlobal = typeof global == 'object' && global && global.Object === Object && global; + +/* harmony default export */ __webpack_exports__["a"] = (freeGlobal); + +/* WEBPACK VAR INJECTION */}.call(__webpack_exports__, __webpack_require__(61))) + +/***/ }), +/* 223 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__Symbol_js__ = __webpack_require__(98); + + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** + * Used to resolve the + * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) + * of values. + */ +var nativeObjectToString = objectProto.toString; + +/** Built-in value references. */ +var symToStringTag = __WEBPACK_IMPORTED_MODULE_0__Symbol_js__["a" /* default */] ? __WEBPACK_IMPORTED_MODULE_0__Symbol_js__["a" /* default */].toStringTag : undefined; + +/** + * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values. + * + * @private + * @param {*} value The value to query. + * @returns {string} Returns the raw `toStringTag`. + */ +function getRawTag(value) { + var isOwn = hasOwnProperty.call(value, symToStringTag), + tag = value[symToStringTag]; + + try { + value[symToStringTag] = undefined; + var unmasked = true; + } catch (e) {} + + var result = nativeObjectToString.call(value); + if (unmasked) { + if (isOwn) { + value[symToStringTag] = tag; + } else { + delete value[symToStringTag]; + } + } + return result; +} + +/* harmony default export */ __webpack_exports__["a"] = (getRawTag); + + +/***/ }), +/* 224 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** + * Used to resolve the + * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) + * of values. + */ +var nativeObjectToString = objectProto.toString; + +/** + * Converts `value` to a string using `Object.prototype.toString`. + * + * @private + * @param {*} value The value to convert. + * @returns {string} Returns the converted string. + */ +function objectToString(value) { + return nativeObjectToString.call(value); +} + +/* harmony default export */ __webpack_exports__["a"] = (objectToString); + + +/***/ }), +/* 225 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__overArg_js__ = __webpack_require__(226); + + +/** Built-in value references. */ +var getPrototype = Object(__WEBPACK_IMPORTED_MODULE_0__overArg_js__["a" /* default */])(Object.getPrototypeOf, Object); + +/* harmony default export */ __webpack_exports__["a"] = (getPrototype); + + +/***/ }), +/* 226 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/** + * Creates a unary function that invokes `func` with its argument transformed. + * + * @private + * @param {Function} func The function to wrap. + * @param {Function} transform The argument transform. + * @returns {Function} Returns the new function. + */ +function overArg(func, transform) { + return function(arg) { + return func(transform(arg)); + }; +} + +/* harmony default export */ __webpack_exports__["a"] = (overArg); + + +/***/ }), +/* 227 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/** + * Checks if `value` is object-like. A value is object-like if it's not `null` + * and has a `typeof` result of "object". + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is object-like, else `false`. + * @example + * + * _.isObjectLike({}); + * // => true + * + * _.isObjectLike([1, 2, 3]); + * // => true + * + * _.isObjectLike(_.noop); + * // => false + * + * _.isObjectLike(null); + * // => false + */ +function isObjectLike(value) { + return value != null && typeof value == 'object'; +} + +/* harmony default export */ __webpack_exports__["a"] = (isObjectLike); + + +/***/ }), +/* 228 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(global, module) {/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__ponyfill_js__ = __webpack_require__(229); +/* global window */ + + +var root; + +if (typeof self !== 'undefined') { + root = self; +} else if (typeof window !== 'undefined') { + root = window; +} else if (typeof global !== 'undefined') { + root = global; +} else if (true) { + root = module; +} else { + root = Function('return this')(); +} + +var result = Object(__WEBPACK_IMPORTED_MODULE_0__ponyfill_js__["a" /* default */])(root); +/* harmony default export */ __webpack_exports__["a"] = (result); + +/* WEBPACK VAR INJECTION */}.call(__webpack_exports__, __webpack_require__(61), __webpack_require__(99)(module))) + +/***/ }), +/* 229 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export (immutable) */ __webpack_exports__["a"] = symbolObservablePonyfill; +function symbolObservablePonyfill(root) { + var result; + var Symbol = root.Symbol; + + if (typeof Symbol === 'function') { + if (Symbol.observable) { + result = Symbol.observable; + } else { + result = Symbol('observable'); + Symbol.observable = result; + } + } else { + result = '@@observable'; + } + + return result; +}; + + +/***/ }), +/* 230 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(process) {/* harmony export (immutable) */ __webpack_exports__["a"] = combineReducers; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__createStore__ = __webpack_require__(97); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_lodash_es_isPlainObject__ = __webpack_require__(60); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__utils_warning__ = __webpack_require__(100); + + + + +function getUndefinedStateErrorMessage(key, action) { + var actionType = action && action.type; + var actionName = actionType && '"' + actionType.toString() + '"' || 'an action'; + + return 'Given action ' + actionName + ', reducer "' + key + '" returned undefined. ' + 'To ignore an action, you must explicitly return the previous state. ' + 'If you want this reducer to hold no value, you can return null instead of undefined.'; +} + +function getUnexpectedStateShapeWarningMessage(inputState, reducers, action, unexpectedKeyCache) { + var reducerKeys = Object.keys(reducers); + var argumentName = action && action.type === __WEBPACK_IMPORTED_MODULE_0__createStore__["a" /* ActionTypes */].INIT ? 'preloadedState argument passed to createStore' : 'previous state received by the reducer'; + + if (reducerKeys.length === 0) { + return 'Store does not have a valid reducer. Make sure the argument passed ' + 'to combineReducers is an object whose values are reducers.'; + } + + if (!Object(__WEBPACK_IMPORTED_MODULE_1_lodash_es_isPlainObject__["a" /* default */])(inputState)) { + return 'The ' + argumentName + ' has unexpected type of "' + {}.toString.call(inputState).match(/\s([a-z|A-Z]+)/)[1] + '". Expected argument to be an object with the following ' + ('keys: "' + reducerKeys.join('", "') + '"'); + } + + var unexpectedKeys = Object.keys(inputState).filter(function (key) { + return !reducers.hasOwnProperty(key) && !unexpectedKeyCache[key]; + }); + + unexpectedKeys.forEach(function (key) { + unexpectedKeyCache[key] = true; + }); + + if (unexpectedKeys.length > 0) { + return 'Unexpected ' + (unexpectedKeys.length > 1 ? 'keys' : 'key') + ' ' + ('"' + unexpectedKeys.join('", "') + '" found in ' + argumentName + '. ') + 'Expected to find one of the known reducer keys instead: ' + ('"' + reducerKeys.join('", "') + '". Unexpected keys will be ignored.'); + } +} + +function assertReducerShape(reducers) { + Object.keys(reducers).forEach(function (key) { + var reducer = reducers[key]; + var initialState = reducer(undefined, { type: __WEBPACK_IMPORTED_MODULE_0__createStore__["a" /* ActionTypes */].INIT }); + + if (typeof initialState === 'undefined') { + throw new Error('Reducer "' + key + '" returned undefined during initialization. ' + 'If the state passed to the reducer is undefined, you must ' + 'explicitly return the initial state. The initial state may ' + 'not be undefined. If you don\'t want to set a value for this reducer, ' + 'you can use null instead of undefined.'); + } + + var type = '@@redux/PROBE_UNKNOWN_ACTION_' + Math.random().toString(36).substring(7).split('').join('.'); + if (typeof reducer(undefined, { type: type }) === 'undefined') { + throw new Error('Reducer "' + key + '" returned undefined when probed with a random type. ' + ('Don\'t try to handle ' + __WEBPACK_IMPORTED_MODULE_0__createStore__["a" /* ActionTypes */].INIT + ' or other actions in "redux/*" ') + 'namespace. They are considered private. Instead, you must return the ' + 'current state for any unknown actions, unless it is undefined, ' + 'in which case you must return the initial state, regardless of the ' + 'action type. The initial state may not be undefined, but can be null.'); + } + }); +} + +/** + * Turns an object whose values are different reducer functions, into a single + * reducer function. It will call every child reducer, and gather their results + * into a single state object, whose keys correspond to the keys of the passed + * reducer functions. + * + * @param {Object} reducers An object whose values correspond to different + * reducer functions that need to be combined into one. One handy way to obtain + * it is to use ES6 `import * as reducers` syntax. The reducers may never return + * undefined for any action. Instead, they should return their initial state + * if the state passed to them was undefined, and the current state for any + * unrecognized action. + * + * @returns {Function} A reducer function that invokes every reducer inside the + * passed object, and builds a state object with the same shape. + */ +function combineReducers(reducers) { + var reducerKeys = Object.keys(reducers); + var finalReducers = {}; + for (var i = 0; i < reducerKeys.length; i++) { + var key = reducerKeys[i]; + + if (process.env.NODE_ENV !== 'production') { + if (typeof reducers[key] === 'undefined') { + Object(__WEBPACK_IMPORTED_MODULE_2__utils_warning__["a" /* default */])('No reducer provided for key "' + key + '"'); + } + } + + if (typeof reducers[key] === 'function') { + finalReducers[key] = reducers[key]; + } + } + var finalReducerKeys = Object.keys(finalReducers); + + var unexpectedKeyCache = void 0; + if (process.env.NODE_ENV !== 'production') { + unexpectedKeyCache = {}; + } + + var shapeAssertionError = void 0; + try { + assertReducerShape(finalReducers); + } catch (e) { + shapeAssertionError = e; + } + + return function combination() { + var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + var action = arguments[1]; + + if (shapeAssertionError) { + throw shapeAssertionError; + } + + if (process.env.NODE_ENV !== 'production') { + var warningMessage = getUnexpectedStateShapeWarningMessage(state, finalReducers, action, unexpectedKeyCache); + if (warningMessage) { + Object(__WEBPACK_IMPORTED_MODULE_2__utils_warning__["a" /* default */])(warningMessage); + } + } + + var hasChanged = false; + var nextState = {}; + for (var _i = 0; _i < finalReducerKeys.length; _i++) { + var _key = finalReducerKeys[_i]; + var reducer = finalReducers[_key]; + var previousStateForKey = state[_key]; + var nextStateForKey = reducer(previousStateForKey, action); + if (typeof nextStateForKey === 'undefined') { + var errorMessage = getUndefinedStateErrorMessage(_key, action); + throw new Error(errorMessage); + } + nextState[_key] = nextStateForKey; + hasChanged = hasChanged || nextStateForKey !== previousStateForKey; + } + return hasChanged ? nextState : state; + }; +} +/* WEBPACK VAR INJECTION */}.call(__webpack_exports__, __webpack_require__(0))) + +/***/ }), +/* 231 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export (immutable) */ __webpack_exports__["a"] = bindActionCreators; +function bindActionCreator(actionCreator, dispatch) { + return function () { + return dispatch(actionCreator.apply(undefined, arguments)); + }; +} + +/** + * Turns an object whose values are action creators, into an object with the + * same keys, but with every function wrapped into a `dispatch` call so they + * may be invoked directly. This is just a convenience method, as you can call + * `store.dispatch(MyActionCreators.doSomething())` yourself just fine. + * + * For convenience, you can also pass a single function as the first argument, + * and get a function in return. + * + * @param {Function|Object} actionCreators An object whose values are action + * creator functions. One handy way to obtain it is to use ES6 `import * as` + * syntax. You may also pass a single function. + * + * @param {Function} dispatch The `dispatch` function available on your Redux + * store. + * + * @returns {Function|Object} The object mimicking the original object, but with + * every action creator wrapped into the `dispatch` call. If you passed a + * function as `actionCreators`, the return value will also be a single + * function. + */ +function bindActionCreators(actionCreators, dispatch) { + if (typeof actionCreators === 'function') { + return bindActionCreator(actionCreators, dispatch); + } + + if (typeof actionCreators !== 'object' || actionCreators === null) { + throw new Error('bindActionCreators expected an object or a function, instead received ' + (actionCreators === null ? 'null' : typeof actionCreators) + '. ' + 'Did you write "import ActionCreators from" instead of "import * as ActionCreators from"?'); + } + + var keys = Object.keys(actionCreators); + var boundActionCreators = {}; + for (var i = 0; i < keys.length; i++) { + var key = keys[i]; + var actionCreator = actionCreators[key]; + if (typeof actionCreator === 'function') { + boundActionCreators[key] = bindActionCreator(actionCreator, dispatch); + } + } + return boundActionCreators; +} + +/***/ }), +/* 232 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export (immutable) */ __webpack_exports__["a"] = applyMiddleware; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__compose__ = __webpack_require__(101); +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; }; + + + +/** + * Creates a store enhancer that applies middleware to the dispatch method + * of the Redux store. This is handy for a variety of tasks, such as expressing + * asynchronous actions in a concise manner, or logging every action payload. + * + * See `redux-thunk` package as an example of the Redux middleware. + * + * Because middleware is potentially asynchronous, this should be the first + * store enhancer in the composition chain. + * + * Note that each middleware will be given the `dispatch` and `getState` functions + * as named arguments. + * + * @param {...Function} middlewares The middleware chain to be applied. + * @returns {Function} A store enhancer applying the middleware. + */ +function applyMiddleware() { + for (var _len = arguments.length, middlewares = Array(_len), _key = 0; _key < _len; _key++) { + middlewares[_key] = arguments[_key]; + } + + return function (createStore) { + return function (reducer, preloadedState, enhancer) { + var store = createStore(reducer, preloadedState, enhancer); + var _dispatch = store.dispatch; + var chain = []; + + var middlewareAPI = { + getState: store.getState, + dispatch: function dispatch(action) { + return _dispatch(action); + } + }; + chain = middlewares.map(function (middleware) { + return middleware(middlewareAPI); + }); + _dispatch = __WEBPACK_IMPORTED_MODULE_0__compose__["a" /* default */].apply(undefined, chain)(store.dispatch); + + return _extends({}, store, { + dispatch: _dispatch + }); + }; + }; +} + +/***/ }), +/* 233 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* unused harmony export whenMapStateToPropsIsFunction */ +/* unused harmony export whenMapStateToPropsIsMissing */ +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__wrapMapToProps__ = __webpack_require__(102); + + +function whenMapStateToPropsIsFunction(mapStateToProps) { + return typeof mapStateToProps === 'function' ? Object(__WEBPACK_IMPORTED_MODULE_0__wrapMapToProps__["b" /* wrapMapToPropsFunc */])(mapStateToProps, 'mapStateToProps') : undefined; +} + +function whenMapStateToPropsIsMissing(mapStateToProps) { + return !mapStateToProps ? Object(__WEBPACK_IMPORTED_MODULE_0__wrapMapToProps__["a" /* wrapMapToPropsConstant */])(function () { + return {}; + }) : undefined; +} + +/* harmony default export */ __webpack_exports__["a"] = ([whenMapStateToPropsIsFunction, whenMapStateToPropsIsMissing]); + +/***/ }), +/* 234 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(process) {/* unused harmony export defaultMergeProps */ +/* unused harmony export wrapMergePropsFunc */ +/* unused harmony export whenMergePropsIsFunction */ +/* unused harmony export whenMergePropsIsOmitted */ +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__utils_verifyPlainObject__ = __webpack_require__(103); +var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; + + + +function defaultMergeProps(stateProps, dispatchProps, ownProps) { + return _extends({}, ownProps, stateProps, dispatchProps); +} + +function wrapMergePropsFunc(mergeProps) { + return function initMergePropsProxy(dispatch, _ref) { + var displayName = _ref.displayName, + pure = _ref.pure, + areMergedPropsEqual = _ref.areMergedPropsEqual; + + var hasRunOnce = false; + var mergedProps = void 0; + + return function mergePropsProxy(stateProps, dispatchProps, ownProps) { + var nextMergedProps = mergeProps(stateProps, dispatchProps, ownProps); + + if (hasRunOnce) { + if (!pure || !areMergedPropsEqual(nextMergedProps, mergedProps)) mergedProps = nextMergedProps; + } else { + hasRunOnce = true; + mergedProps = nextMergedProps; + + if (process.env.NODE_ENV !== 'production') Object(__WEBPACK_IMPORTED_MODULE_0__utils_verifyPlainObject__["a" /* default */])(mergedProps, displayName, 'mergeProps'); + } + + return mergedProps; + }; + }; +} + +function whenMergePropsIsFunction(mergeProps) { + return typeof mergeProps === 'function' ? wrapMergePropsFunc(mergeProps) : undefined; +} + +function whenMergePropsIsOmitted(mergeProps) { + return !mergeProps ? function () { + return defaultMergeProps; + } : undefined; +} + +/* harmony default export */ __webpack_exports__["a"] = ([whenMergePropsIsFunction, whenMergePropsIsOmitted]); +/* WEBPACK VAR INJECTION */}.call(__webpack_exports__, __webpack_require__(0))) + +/***/ }), +/* 235 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(process) {/* unused harmony export impureFinalPropsSelectorFactory */ +/* unused harmony export pureFinalPropsSelectorFactory */ +/* harmony export (immutable) */ __webpack_exports__["a"] = finalPropsSelectorFactory; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__verifySubselectors__ = __webpack_require__(236); +function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; } + + + +function impureFinalPropsSelectorFactory(mapStateToProps, mapDispatchToProps, mergeProps, dispatch) { + return function impureFinalPropsSelector(state, ownProps) { + return mergeProps(mapStateToProps(state, ownProps), mapDispatchToProps(dispatch, ownProps), ownProps); + }; +} + +function pureFinalPropsSelectorFactory(mapStateToProps, mapDispatchToProps, mergeProps, dispatch, _ref) { + var areStatesEqual = _ref.areStatesEqual, + areOwnPropsEqual = _ref.areOwnPropsEqual, + areStatePropsEqual = _ref.areStatePropsEqual; + + var hasRunAtLeastOnce = false; + var state = void 0; + var ownProps = void 0; + var stateProps = void 0; + var dispatchProps = void 0; + var mergedProps = void 0; + + function handleFirstCall(firstState, firstOwnProps) { + state = firstState; + ownProps = firstOwnProps; + stateProps = mapStateToProps(state, ownProps); + dispatchProps = mapDispatchToProps(dispatch, ownProps); + mergedProps = mergeProps(stateProps, dispatchProps, ownProps); + hasRunAtLeastOnce = true; + return mergedProps; + } + + function handleNewPropsAndNewState() { + stateProps = mapStateToProps(state, ownProps); + + if (mapDispatchToProps.dependsOnOwnProps) dispatchProps = mapDispatchToProps(dispatch, ownProps); + + mergedProps = mergeProps(stateProps, dispatchProps, ownProps); + return mergedProps; + } + + function handleNewProps() { + if (mapStateToProps.dependsOnOwnProps) stateProps = mapStateToProps(state, ownProps); + + if (mapDispatchToProps.dependsOnOwnProps) dispatchProps = mapDispatchToProps(dispatch, ownProps); + + mergedProps = mergeProps(stateProps, dispatchProps, ownProps); + return mergedProps; + } + + function handleNewState() { + var nextStateProps = mapStateToProps(state, ownProps); + var statePropsChanged = !areStatePropsEqual(nextStateProps, stateProps); + stateProps = nextStateProps; + + if (statePropsChanged) mergedProps = mergeProps(stateProps, dispatchProps, ownProps); + + return mergedProps; + } + + function handleSubsequentCalls(nextState, nextOwnProps) { + var propsChanged = !areOwnPropsEqual(nextOwnProps, ownProps); + var stateChanged = !areStatesEqual(nextState, state); + state = nextState; + ownProps = nextOwnProps; + + if (propsChanged && stateChanged) return handleNewPropsAndNewState(); + if (propsChanged) return handleNewProps(); + if (stateChanged) return handleNewState(); + return mergedProps; + } + + return function pureFinalPropsSelector(nextState, nextOwnProps) { + return hasRunAtLeastOnce ? handleSubsequentCalls(nextState, nextOwnProps) : handleFirstCall(nextState, nextOwnProps); + }; +} + +// TODO: Add more comments + +// If pure is true, the selector returned by selectorFactory will memoize its results, +// allowing connectAdvanced's shouldComponentUpdate to return false if final +// props have not changed. If false, the selector will always return a new +// object and shouldComponentUpdate will always return true. + +function finalPropsSelectorFactory(dispatch, _ref2) { + var initMapStateToProps = _ref2.initMapStateToProps, + initMapDispatchToProps = _ref2.initMapDispatchToProps, + initMergeProps = _ref2.initMergeProps, + options = _objectWithoutProperties(_ref2, ['initMapStateToProps', 'initMapDispatchToProps', 'initMergeProps']); + + var mapStateToProps = initMapStateToProps(dispatch, options); + var mapDispatchToProps = initMapDispatchToProps(dispatch, options); + var mergeProps = initMergeProps(dispatch, options); + + if (process.env.NODE_ENV !== 'production') { + Object(__WEBPACK_IMPORTED_MODULE_0__verifySubselectors__["a" /* default */])(mapStateToProps, mapDispatchToProps, mergeProps, options.displayName); + } + + var selectorFactory = options.pure ? pureFinalPropsSelectorFactory : impureFinalPropsSelectorFactory; + + return selectorFactory(mapStateToProps, mapDispatchToProps, mergeProps, dispatch, options); +} +/* WEBPACK VAR INJECTION */}.call(__webpack_exports__, __webpack_require__(0))) + +/***/ }), +/* 236 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export (immutable) */ __webpack_exports__["a"] = verifySubselectors; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__utils_warning__ = __webpack_require__(58); + + +function verify(selector, methodName, displayName) { + if (!selector) { + throw new Error('Unexpected value for ' + methodName + ' in ' + displayName + '.'); + } else if (methodName === 'mapStateToProps' || methodName === 'mapDispatchToProps') { + if (!selector.hasOwnProperty('dependsOnOwnProps')) { + Object(__WEBPACK_IMPORTED_MODULE_0__utils_warning__["a" /* default */])('The selector for ' + methodName + ' of ' + displayName + ' did not specify a value for dependsOnOwnProps.'); + } + } +} + +function verifySubselectors(mapStateToProps, mapDispatchToProps, mergeProps, displayName) { + verify(mapStateToProps, 'mapStateToProps', displayName); + verify(mapDispatchToProps, 'mapDispatchToProps', displayName); + verify(mergeProps, 'mergeProps', displayName); +} + +/***/ }), +/* 237 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _redux = __webpack_require__(59); + +var _reducers = __webpack_require__(238); + +var _reducers2 = _interopRequireDefault(_reducers); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +var defaultState = { + suiteInfo: { + testSuiteName: window.tests.testSuite, + idConfig: window.tests.id + }, + tests: { + all: window.tests.tests, + filtered: window.tests.tests, + filterStatus: 'all' + }, + availableStatus: [{ + id: 'all', + label: 'all', + count: window.tests.tests.length + }, { + id: 'pass', + label: 'passed', + count: window.tests.tests.filter(function (e) { + return e.status === 'pass'; + }).length + }, { + id: 'fail', + label: 'failed', + count: window.tests.tests.filter(function (e) { + return e.status === 'fail'; + }).length + }], + scrubber: { + visible: false, + mode: 'scrub', + test: {} + }, + layoutSettings: { + textInfo: false, + refImage: true, + testImage: true, + diffImage: true + } +}; + +var store = (0, _redux.createStore)(_reducers2.default, defaultState, window.__REDUX_DEVTOOLS_EXTENSION__ && window.__REDUX_DEVTOOLS_EXTENSION__()); + +exports.default = store; + +/***/ }), +/* 238 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _redux = __webpack_require__(59); + +var _tests = __webpack_require__(239); + +var _tests2 = _interopRequireDefault(_tests); + +var _suiteInfo = __webpack_require__(240); + +var _suiteInfo2 = _interopRequireDefault(_suiteInfo); + +var _layoutSettings = __webpack_require__(241); + +var _layoutSettings2 = _interopRequireDefault(_layoutSettings); + +var _availableStatus = __webpack_require__(242); + +var _availableStatus2 = _interopRequireDefault(_availableStatus); + +var _scrubber = __webpack_require__(243); + +var _scrubber2 = _interopRequireDefault(_scrubber); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +var rootReducer = (0, _redux.combineReducers)({ + suiteInfo: _suiteInfo2.default, + tests: _tests2.default, + availableStatus: _availableStatus2.default, + scrubber: _scrubber2.default, + layoutSettings: _layoutSettings2.default +}); + +exports.default = rootReducer; + +/***/ }), +/* 239 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +var tests = function tests() { + var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + var action = arguments[1]; + + switch (action.type) { + case 'FILTER_TESTS': + if (action.status !== 'all') { + return Object.assign({}, state, { + filtered: state.all.filter(function (e) { + return e.status === action.status; + }), + filterStatus: action.status + }); + } else { + return Object.assign({}, state, { + filtered: state.all, + filterStatus: action.status + }); + } + + // @TODO: to optimize + case 'SEARCH_TESTS': + if (action.value.length > 0) { + return Object.assign({}, state, { + filtered: state.all.filter(function (e) { + var fileName = e.pair.fileName.toLowerCase(); + var label = e.pair.label.toLowerCase(); + + if (state.filterStatus !== 'all') { + if (e.status === state.filterStatus && (label.indexOf(action.value.toLowerCase()) !== -1 || fileName.indexOf(action.value.toLowerCase()) !== -1)) { + return true; + } + } else { + if (label.indexOf(action.value.toLowerCase()) !== -1 || fileName.indexOf(action.value.toLowerCase()) !== -1) { + return true; + } + } + }) + }); + } + return state; + + default: + return state; + } +}; + +exports.default = tests; + +/***/ }), +/* 240 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +var suiteInfo = function suiteInfo() { + var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + var action = arguments[1]; + + switch (action.type) { + case 'SET_VISIBILITY_FILTER': + return action.filter; + default: + return state; + } +}; + +exports.default = suiteInfo; + +/***/ }), +/* 241 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + +var visibilityFilter = function visibilityFilter() { + var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + var action = arguments[1]; + + switch (action.type) { + case 'UPDATE_SETTINGS': + return Object.assign({}, state, _defineProperty({}, action.id, !state[action.id])); + + case 'TOGGLE_ALL_IMAGES': + return Object.assign({}, state, { + refImage: action.value, + testImage: action.value, + diffImage: action.value + }); + + default: + return state; + } +}; + +exports.default = visibilityFilter; + +/***/ }), +/* 242 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +var suiteInfo = function suiteInfo() { + var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []; + var action = arguments[1]; + + switch (action.type) { + default: + return state; + } +}; + +exports.default = suiteInfo; + +/***/ }), +/* 243 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +function getPosFromImgId(imgId) { + switch (imgId) { + case 'refImage': + return 105; //just passed the right border + case 'testImage': + return -1; //just passed the left border + case 'diffImage': + return -1; //just passed the left border + default: + return 50; //in the middle + } +} + +function getModeFromImgId(imgId) { + switch (imgId) { + case 'refImage': + return 'SHOW_SCRUBBER_REF_IMAGE'; + case 'testImage': + return 'SHOW_SCRUBBER_TEST_IMAGE'; + case 'diffImage': + return 'SHOW_SCRUBBER_DIFF_IMAGE'; + default: + return 'SCRUB'; + } +} + +var scrubber = function scrubber() { + var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + var action = arguments[1]; + + switch (action.type) { + case 'OPEN_SCRUBBER_MODAL': + var targetImgId = ''; + try { + targetImgId = action.value.targetImg.id; + } catch (err) {} + + var scrubberModalMode = ''; + try { + scrubberModalMode = action.value.targetImg.id; + } catch (err) {} + + return Object.assign({}, state, { + position: getPosFromImgId(targetImgId), + visible: true, + test: action.value, + testImageType: targetImgId, + scrubberModalMode: getModeFromImgId(targetImgId) + }); + + case 'CLOSE_SCRUBBER_MODAL': + return Object.assign({}, state, { + visible: false, + test: {} + }); + + case 'SHOW_SCRUBBER_TEST_IMAGE': + return Object.assign({}, state, { + position: getPosFromImgId('testImage'), + scrubberModalMode: action.type, + testImageType: 'testImage' + }); + + case 'SHOW_SCRUBBER_REF_IMAGE': + return Object.assign({}, state, { + position: getPosFromImgId('refImage'), + scrubberModalMode: action.type + }); + + case 'SHOW_SCRUBBER_DIFF_IMAGE': + return Object.assign({}, state, { + position: getPosFromImgId('diffImage'), + scrubberModalMode: action.type, + testImageType: 'diffImage' + }); + + case 'SHOW_SCRUBBER_DIVERGED_IMAGE': + return Object.assign({}, state, { + position: getPosFromImgId('diffImage'), + scrubberModalMode: action.type, + testImageType: 'divergedImage', + test: Object.assign({}, state.test, { divergedImage: action.value }) + }); + + case 'SHOW_SCRUBBER': + return Object.assign({}, state, { + position: getPosFromImgId(), + scrubberModalMode: 'SCRUB' + }); + + default: + return state; + } +}; + +exports.default = scrubber; + +/***/ }), +/* 244 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _templateObject = _taggedTemplateLiteral(['\n padding: 0 30px;\n'], ['\n padding: 0 30px;\n']); + +var _react = __webpack_require__(2); + +var _react2 = _interopRequireDefault(_react); + +var _styledComponents = __webpack_require__(5); + +var _styledComponents2 = _interopRequireDefault(_styledComponents); + +var _reactSticky = __webpack_require__(104); + +var _Header = __webpack_require__(253); + +var _Header2 = _interopRequireDefault(_Header); + +var _List = __webpack_require__(270); + +var _List2 = _interopRequireDefault(_List); + +var _ScrubberModal = __webpack_require__(284); + +var _ScrubberModal2 = _interopRequireDefault(_ScrubberModal); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +function _taggedTemplateLiteral(strings, raw) { return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); } +// ESLint +/* eslint-disable no-unused-vars */ + + +var Wrapper = _styledComponents2.default.section(_templateObject); + +var App = function (_React$Component) { + _inherits(App, _React$Component); + + function App() { + _classCallCheck(this, App); + + return _possibleConstructorReturn(this, (App.__proto__ || Object.getPrototypeOf(App)).apply(this, arguments)); + } + + _createClass(App, [{ + key: 'render', + value: function render() { + return _react2.default.createElement( + _reactSticky.StickyContainer, + null, + _react2.default.createElement(_Header2.default, null), + _react2.default.createElement( + Wrapper, + null, + _react2.default.createElement(_List2.default, null) + ), + _react2.default.createElement(_ScrubberModal2.default, null) + ); + } + }]); + + return App; +}(_react2.default.Component); + +exports.default = App; + +/***/ }), +/* 245 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/*! + * is-plain-object <https://github.com/jonschlinkert/is-plain-object> + * + * Copyright (c) 2014-2017, Jon Schlinkert. + * Released under the MIT License. + */ + + + +var isObject = __webpack_require__(246); + +function isObjectObject(o) { + return isObject(o) === true + && Object.prototype.toString.call(o) === '[object Object]'; +} + +module.exports = function isPlainObject(o) { + var ctor,prot; + + if (isObjectObject(o) === false) return false; + + // If has modified constructor + ctor = o.constructor; + if (typeof ctor !== 'function') return false; + + // If has modified prototype + prot = ctor.prototype; + if (isObjectObject(prot) === false) return false; + + // If constructor does not have an Object-specific method + if (prot.hasOwnProperty('isPrototypeOf') === false) { + return false; + } + + // Most likely a plain Object + return true; +}; + + +/***/ }), +/* 246 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/*! + * isobject <https://github.com/jonschlinkert/isobject> + * + * Copyright (c) 2014-2017, Jon Schlinkert. + * Released under the MIT License. + */ + + + +module.exports = function isObject(val) { + return val != null && typeof val === 'object' && Array.isArray(val) === false; +}; + + +/***/ }), +/* 247 */ +/***/ (function(module, exports, __webpack_require__) { + +/* + * __ ___ + * _____/ /___ __/ (_)____ + * / ___/ __/ / / / / / ___/ + * (__ ) /_/ /_/ / / (__ ) + * /____/\__/\__, /_/_/____/ + * /____/ + * + * light - weight css preprocessor @licence MIT + */ +(function (factory) {/* eslint-disable */ + true ? (module['exports'] = factory(null)) : + typeof define === 'function' && define['amd'] ? define(factory(null)) : + (window['stylis'] = factory(null)) +}(/** @param {*=} options */function factory (options) {/* eslint-disable */ + + 'use strict' + + /** + * Notes + * + * The ['<method name>'] pattern is used to support closure compiler + * the jsdoc signatures are also used to the same effect + * + * ---- + * + * int + int + int === n4 [faster] + * + * vs + * + * int === n1 && int === n2 && int === n3 + * + * ---- + * + * switch (int) { case ints...} [faster] + * + * vs + * + * if (int == 1 && int === 2 ...) + * + * ---- + * + * The (first*n1 + second*n2 + third*n3) format used in the property parser + * is a simple way to hash the sequence of characters + * taking into account the index they occur in + * since any number of 3 character sequences could produce duplicates. + * + * On the other hand sequences that are directly tied to the index of the character + * resolve a far more accurate measure, it's also faster + * to evaluate one condition in a switch statement + * than three in an if statement regardless of the added math. + * + * This allows the vendor prefixer to be both small and fast. + */ + + var nullptn = /^\0+/g /* matches leading null characters */ + var formatptn = /[\0\r\f]/g /* matches new line, null and formfeed characters */ + var colonptn = /: */g /* splits animation rules */ + var cursorptn = /zoo|gra/ /* assert cursor varient */ + var transformptn = /([,: ])(transform)/g /* vendor prefix transform, older webkit */ + var animationptn = /,+\s*(?![^(]*[)])/g /* splits multiple shorthand notation animations */ + var propertiesptn = / +\s*(?![^(]*[)])/g /* animation properties */ + var elementptn = / *[\0] */g /* selector elements */ + var selectorptn = /,\r+?/g /* splits selectors */ + var andptn = /([\t\r\n ])*\f?&/g /* match & */ + var escapeptn = /:global\(((?:[^\(\)\[\]]*|\[.*\]|\([^\(\)]*\))*)\)/g /* matches :global(.*) */ + var invalidptn = /\W+/g /* removes invalid characters from keyframes */ + var keyframeptn = /@(k\w+)\s*(\S*)\s*/ /* matches @keyframes $1 */ + var plcholdrptn = /::(place)/g /* match ::placeholder varient */ + var readonlyptn = /:(read-only)/g /* match :read-only varient */ + var beforeptn = /\s+(?=[{\];=:>])/g /* matches \s before ] ; = : */ + var afterptn = /([[}=:>])\s+/g /* matches \s after characters [ } = : */ + var tailptn = /(\{[^{]+?);(?=\})/g /* matches tail semi-colons ;} */ + var whiteptn = /\s{2,}/g /* matches repeating whitespace */ + var pseudoptn = /([^\(])(:+) */g /* pseudo element */ + var writingptn = /[svh]\w+-[tblr]{2}/ /* match writing mode property values */ + var gradientptn = /([\w-]+t\()/g /* match *gradient property */ + var supportsptn = /\(\s*(.*)\s*\)/g /* match supports (groups) */ + var propertyptn = /([\s\S]*?);/g /* match properties leading semicolon */ + var selfptn = /-self|flex-/g /* match flex- and -self in align-self: flex-*; */ + var pseudofmt = /[^]*?(:[rp][el]a[\w-]+)[^]*/ /* extrats :readonly or :placholder from selector */ + var trimptn = /[ \t]+$/ /* match tail whitspace */ + + /* vendors */ + var webkit = '-webkit-' + var moz = '-moz-' + var ms = '-ms-' + + /* character codes */ + var SEMICOLON = 59 /* ; */ + var CLOSEBRACES = 125 /* } */ + var OPENBRACES = 123 /* { */ + var OPENPARENTHESES = 40 /* ( */ + var CLOSEPARENTHESES = 41 /* ) */ + var OPENBRACKET = 91 /* [ */ + var CLOSEBRACKET = 93 /* ] */ + var NEWLINE = 10 /* \n */ + var CARRIAGE = 13 /* \r */ + var TAB = 9 /* \t */ + var AT = 64 /* @ */ + var SPACE = 32 /* */ + var AND = 38 /* & */ + var DASH = 45 /* - */ + var UNDERSCORE = 95 /* _ */ + var STAR = 42 /* * */ + var COMMA = 44 /* , */ + var COLON = 58 /* : */ + var SINGLEQUOTE = 39 /* ' */ + var DOUBLEQUOTE = 34 /* " */ + var FOWARDSLASH = 47 /* / */ + var GREATERTHAN = 62 /* > */ + var PLUS = 43 /* + */ + var TILDE = 126 /* ~ */ + var NULL = 0 /* \0 */ + var FORMFEED = 12 /* \f */ + var VERTICALTAB = 11 /* \v */ + + /* special identifiers */ + var KEYFRAME = 107 /* k */ + var MEDIA = 109 /* m */ + var SUPPORTS = 115 /* s */ + var PLACEHOLDER = 112 /* p */ + var READONLY = 111 /* o */ + var IMPORT = 169 /* <at>i */ + var CHARSET = 163 /* <at>c */ + var DOCUMENT = 100 /* <at>d */ + var PAGE = 112 /* <at>p */ + + var column = 1 /* current column */ + var line = 1 /* current line numebr */ + var pattern = 0 /* :pattern */ + + var cascade = 1 /* #id h1 h2 vs h1#id h2#id */ + var prefix = 1 /* vendor prefix */ + var escape = 1 /* escape :global() pattern */ + var compress = 0 /* compress output */ + var semicolon = 0 /* no/semicolon option */ + var preserve = 0 /* preserve empty selectors */ + + /* empty reference */ + var array = [] + + /* plugins */ + var plugins = [] + var plugged = 0 + var should = null + + /* plugin context */ + var POSTS = -2 + var PREPS = -1 + var UNKWN = 0 + var PROPS = 1 + var BLCKS = 2 + var ATRUL = 3 + + /* plugin newline context */ + var unkwn = 0 + + /* keyframe animation */ + var keyed = 1 + var key = '' + + /* selector namespace */ + var nscopealt = '' + var nscope = '' + + /** + * Compile + * + * @param {Array<string>} parent + * @param {Array<string>} current + * @param {string} body + * @param {number} id + * @param {number} depth + * @return {string} + */ + function compile (parent, current, body, id, depth) { + var bracket = 0 /* brackets [] */ + var comment = 0 /* comments /* // or /* */ + var parentheses = 0 /* functions () */ + var quote = 0 /* quotes '', "" */ + + var first = 0 /* first character code */ + var second = 0 /* second character code */ + var code = 0 /* current character code */ + var tail = 0 /* previous character code */ + var trail = 0 /* character before previous code */ + var peak = 0 /* previous non-whitespace code */ + + var counter = 0 /* count sequence termination */ + var context = 0 /* track current context */ + var atrule = 0 /* track @at-rule context */ + var pseudo = 0 /* track pseudo token index */ + var caret = 0 /* current character index */ + var format = 0 /* control character formating context */ + var insert = 0 /* auto semicolon insertion */ + var invert = 0 /* inverted selector pattern */ + var length = 0 /* generic length address */ + var eof = body.length /* end of file(length) */ + var eol = eof - 1 /* end of file(characters) */ + + var char = '' /* current character */ + var chars = '' /* current buffer of characters */ + var child = '' /* next buffer of characters */ + var out = '' /* compiled body */ + var children = '' /* compiled children */ + var flat = '' /* compiled leafs */ + var selector /* generic selector address */ + var result /* generic address */ + + // ...build body + while (caret < eof) { + code = body.charCodeAt(caret) + + // eof varient + if (caret === eol) { + // last character + noop context, add synthetic padding for noop context to terminate + if (comment + quote + parentheses + bracket !== 0) { + if (comment !== 0) { + code = comment === FOWARDSLASH ? NEWLINE : FOWARDSLASH + } + + quote = parentheses = bracket = 0 + eof++ + eol++ + } + } + + if (comment + quote + parentheses + bracket === 0) { + // eof varient + if (caret === eol) { + if (format > 0) { + chars = chars.replace(formatptn, '') + } + + if (chars.trim().length > 0) { + switch (code) { + case SPACE: + case TAB: + case SEMICOLON: + case CARRIAGE: + case NEWLINE: { + break + } + default: { + chars += body.charAt(caret) + } + } + + code = SEMICOLON + } + } + + // auto semicolon insertion + if (insert === 1) { + switch (code) { + // false flags + case OPENBRACES: + case CLOSEBRACES: + case SEMICOLON: + case DOUBLEQUOTE: + case SINGLEQUOTE: + case OPENPARENTHESES: + case CLOSEPARENTHESES: + case COMMA: { + insert = 0 + } + // ignore + case TAB: + case CARRIAGE: + case NEWLINE: + case SPACE: { + break + } + // valid + default: { + insert = 0 + length = caret + first = code + caret-- + code = SEMICOLON + + while (length < eof) { + switch (body.charCodeAt(++length)) { + case NEWLINE: + case CARRIAGE: + case SEMICOLON: { + caret++ + code = first + } + case COLON: + case OPENBRACES: { + length = eof + } + } + } + } + } + } + + // token varient + switch (code) { + case OPENBRACES: { + chars = chars.trim() + first = chars.charCodeAt(0) + counter = 1 + length = ++caret + + while (caret < eof) { + code = body.charCodeAt(caret) + + switch (code) { + case OPENBRACES: { + counter++ + break + } + case CLOSEBRACES: { + counter-- + break + } + } + + if (counter === 0) { + break + } + + caret++ + } + + child = body.substring(length, caret) + + if (first === NULL) { + first = (chars = chars.replace(nullptn, '').trim()).charCodeAt(0) + } + + switch (first) { + // @at-rule + case AT: { + if (format > 0) { + chars = chars.replace(formatptn, '') + } + + second = chars.charCodeAt(1) + + switch (second) { + case DOCUMENT: + case MEDIA: + case SUPPORTS: + case DASH: { + selector = current + break + } + default: { + selector = array + } + } + + child = compile(current, selector, child, second, depth+1) + length = child.length + + // preserve empty @at-rule + if (preserve > 0 && length === 0) { + length = chars.length + } + + // execute plugins, @at-rule context + if (plugged > 0) { + selector = select(array, chars, invert) + result = proxy(ATRUL, child, selector, current, line, column, length, second, depth) + chars = selector.join('') + + if (result !== void 0) { + if ((length = (child = result.trim()).length) === 0) { + second = 0 + child = '' + } + } + } + + if (length > 0) { + switch (second) { + case SUPPORTS: { + chars = chars.replace(supportsptn, supports) + } + case DOCUMENT: + case MEDIA: + case DASH: { + child = chars + '{' + child + '}' + break + } + case KEYFRAME: { + chars = chars.replace(keyframeptn, '$1 $2' + (keyed > 0 ? key : '')) + child = chars + '{' + child + '}' + + if (prefix === 1 || (prefix === 2 && vendor('@'+child, 3))) { + child = '@' + webkit + child + '@' + child + } else { + child = '@' + child + } + break + } + default: { + child = chars + child + + if (id === PAGE) { + child = (out += child, '') + } + } + } + } else { + child = '' + } + + break + } + // selector + default: { + child = compile(current, select(current, chars, invert), child, id, depth+1) + } + } + + children += child + + // reset + context = 0 + insert = 0 + pseudo = 0 + format = 0 + invert = 0 + atrule = 0 + chars = '' + child = '' + code = body.charCodeAt(++caret) + break + } + case CLOSEBRACES: + case SEMICOLON: { + chars = (format > 0 ? chars.replace(formatptn, '') : chars).trim() + + if ((length = chars.length) > 1) { + // monkey-patch missing colon + if (pseudo === 0) { + first = chars.charCodeAt(0) + + // first character is a letter or dash, buffer has a space character + if ((first === DASH || first > 96 && first < 123)) { + length = (chars = chars.replace(' ', ':')).length + } + } + + // execute plugins, property context + if (plugged > 0) { + if ((result = proxy(PROPS, chars, current, parent, line, column, out.length, id, depth)) !== void 0) { + if ((length = (chars = result.trim()).length) === 0) { + chars = '\0\0' + } + } + } + + first = chars.charCodeAt(0) + second = chars.charCodeAt(1) + + switch (first + second) { + case NULL: { + break + } + case IMPORT: + case CHARSET: { + flat += chars + body.charAt(caret) + break + } + default: { + if (chars.charCodeAt(length-1) === COLON) + break + + out += property(chars, first, second, chars.charCodeAt(2)) + } + } + } + + // reset + context = 0 + insert = 0 + pseudo = 0 + format = 0 + invert = 0 + chars = '' + code = body.charCodeAt(++caret) + break + } + } + } + + // parse characters + switch (code) { + case CARRIAGE: + case NEWLINE: { + // auto insert semicolon + if (comment + quote + parentheses + bracket + semicolon === 0) { + // valid non-whitespace characters that + // may precede a newline + switch (peak) { + case CLOSEPARENTHESES: + case SINGLEQUOTE: + case DOUBLEQUOTE: + case AT: + case TILDE: + case GREATERTHAN: + case STAR: + case PLUS: + case FOWARDSLASH: + case DASH: + case COLON: + case COMMA: + case SEMICOLON: + case OPENBRACES: + case CLOSEBRACES: { + break + } + default: { + // current buffer has a colon + if (pseudo > 0) { + insert = 1 + } + } + } + } + + // terminate line comment + if (comment === FOWARDSLASH) { + comment = 0 + } else if (cascade + context === 0) { + format = 1 + chars += '\0' + } + + // execute plugins, newline context + if (plugged * unkwn > 0) { + proxy(UNKWN, chars, current, parent, line, column, out.length, id, depth) + } + + // next line, reset column position + column = 1 + line++ + break + } + case SEMICOLON: + case CLOSEBRACES: { + if (comment + quote + parentheses + bracket === 0) { + column++ + break + } + } + default: { + // increment column position + column++ + + // current character + char = body.charAt(caret) + + // remove comments, escape functions, strings, attributes and prepare selectors + switch (code) { + case TAB: + case SPACE: { + if (quote + bracket + comment === 0) { + switch (tail) { + case COMMA: + case COLON: + case TAB: + case SPACE: { + char = '' + break + } + default: { + if (code !== SPACE) { + char = ' ' + } + } + } + } + break + } + // escape breaking control characters + case NULL: { + char = '\\0' + break + } + case FORMFEED: { + char = '\\f' + break + } + case VERTICALTAB: { + char = '\\v' + break + } + // & + case AND: { + // inverted selector pattern i.e html & + if (quote + comment + bracket === 0 && cascade > 0) { + invert = 1 + format = 1 + char = '\f' + char + } + break + } + // ::p<l>aceholder, l + // :read-on<l>y, l + case 108: { + if (quote + comment + bracket + pattern === 0 && pseudo > 0) { + switch (caret - pseudo) { + // ::placeholder + case 2: { + if (tail === PLACEHOLDER && body.charCodeAt(caret-3) === COLON) { + pattern = tail + } + } + // :read-only + case 8: { + if (trail === READONLY) { + pattern = trail + } + } + } + } + break + } + // :<pattern> + case COLON: { + if (quote + comment + bracket === 0) { + pseudo = caret + } + break + } + // selectors + case COMMA: { + if (comment + parentheses + quote + bracket === 0) { + format = 1 + char += '\r' + } + break + } + // quotes + case DOUBLEQUOTE: { + if (comment === 0) { + quote = quote === code ? 0 : (quote === 0 ? code : quote) + } + break + } + case SINGLEQUOTE: { + if (comment === 0) { + quote = quote === code ? 0 : (quote === 0 ? code : quote) + } + break + } + // attributes + case OPENBRACKET: { + if (quote + comment + parentheses === 0) { + bracket++ + } + break + } + case CLOSEBRACKET: { + if (quote + comment + parentheses === 0) { + bracket-- + } + break + } + // functions + case CLOSEPARENTHESES: { + if (quote + comment + bracket === 0) { + parentheses-- + } + break + } + case OPENPARENTHESES: { + if (quote + comment + bracket === 0) { + if (context === 0) { + switch (tail*2 + trail*3) { + // :matches + case 533: { + break + } + // :global, :not, :nth-child etc... + default: { + counter = 0 + context = 1 + } + } + } + + parentheses++ + } + break + } + case AT: { + if (comment + parentheses + quote + bracket + pseudo + atrule === 0) { + atrule = 1 + } + break + } + // block/line comments + case STAR: + case FOWARDSLASH: { + if (quote + bracket + parentheses > 0) { + break + } + + switch (comment) { + // initialize line/block comment context + case 0: { + switch (code*2 + body.charCodeAt(caret+1)*3) { + // // + case 235: { + comment = FOWARDSLASH + break + } + // /* + case 220: { + length = caret + comment = STAR + break + } + } + break + } + // end block comment context + case STAR: { + if (code === FOWARDSLASH && tail === STAR) { + // /*<!> ... */, ! + if (body.charCodeAt(length+2) === 33) { + out += body.substring(length, caret+1) + } + char = '' + comment = 0 + } + } + } + } + } + + // ignore comment blocks + if (comment === 0) { + // aggressive isolation mode, divide each individual selector + // including selectors in :not function but excluding selectors in :global function + if (cascade + quote + bracket + atrule === 0 && id !== KEYFRAME && code !== SEMICOLON) { + switch (code) { + case COMMA: + case TILDE: + case GREATERTHAN: + case PLUS: + case CLOSEPARENTHESES: + case OPENPARENTHESES: { + if (context === 0) { + // outside of an isolated context i.e nth-child(<...>) + switch (tail) { + case TAB: + case SPACE: + case NEWLINE: + case CARRIAGE: { + char = char + '\0' + break + } + default: { + char = '\0' + char + (code === COMMA ? '' : '\0') + } + } + format = 1 + } else { + // within an isolated context, sleep untill it's terminated + switch (code) { + case OPENPARENTHESES: { + context = ++counter + break + } + case CLOSEPARENTHESES: { + if ((context = --counter) === 0) { + format = 1 + char += '\0' + } + break + } + } + } + break + } + case TAB: + case SPACE: { + switch (tail) { + case NULL: + case OPENBRACES: + case CLOSEBRACES: + case SEMICOLON: + case COMMA: + case FORMFEED: + case TAB: + case SPACE: + case NEWLINE: + case CARRIAGE: { + break + } + default: { + // ignore in isolated contexts + if (context === 0) { + format = 1 + char += '\0' + } + } + } + } + } + } + + // concat buffer of characters + chars += char + + // previous non-whitespace character code + if (code !== SPACE && code !== TAB) { + peak = code + } + } + } + } + + // tail character codes + trail = tail + tail = code + + // visit every character + caret++ + } + + length = out.length + + // preserve empty selector + if (preserve > 0) { + if (length === 0 && children.length === 0 && (current[0].length === 0) === false) { + if (id !== MEDIA || (current.length === 1 && (cascade > 0 ? nscopealt : nscope) === current[0])) { + length = current.join(',').length + 2 + } + } + } + + if (length > 0) { + // cascade isolation mode? + selector = cascade === 0 && id !== KEYFRAME ? isolate(current) : current + + // execute plugins, block context + if (plugged > 0) { + result = proxy(BLCKS, out, selector, parent, line, column, length, id, depth) + + if (result !== void 0 && (out = result).length === 0) { + return flat + out + children + } + } + + out = selector.join(',') + '{' + out + '}' + + if (prefix*pattern !== 0) { + if (prefix === 2 && !vendor(out, 2)) + pattern = 0 + + switch (pattern) { + // ::read-only + case READONLY: { + out = out.replace(readonlyptn, ':'+moz+'$1')+out + break + } + // ::placeholder + case PLACEHOLDER: { + out = ( + out.replace(plcholdrptn, '::' + webkit + 'input-$1') + + out.replace(plcholdrptn, '::' + moz + '$1') + + out.replace(plcholdrptn, ':' + ms + 'input-$1') + out + ) + break + } + } + + pattern = 0 + } + } + + return flat + out + children + } + + /** + * Select + * + * @param {Array<string>} parent + * @param {string} current + * @param {number} invert + * @return {Array<string>} + */ + function select (parent, current, invert) { + var selectors = current.trim().split(selectorptn) + var out = selectors + + var length = selectors.length + var l = parent.length + + switch (l) { + // 0-1 parent selectors + case 0: + case 1: { + for (var i = 0, selector = l === 0 ? '' : parent[0] + ' '; i < length; ++i) { + out[i] = scope(selector, out[i], invert, l).trim() + } + break + } + // >2 parent selectors, nested + default: { + for (var i = 0, j = 0, out = []; i < length; ++i) { + for (var k = 0; k < l; ++k) { + out[j++] = scope(parent[k] + ' ', selectors[i], invert, l).trim() + } + } + } + } + + return out + } + + /** + * Scope + * + * @param {string} parent + * @param {string} current + * @param {number} invert + * @param {number} level + * @return {string} + */ + function scope (parent, current, invert, level) { + var selector = current + var code = selector.charCodeAt(0) + + // trim leading whitespace + if (code < 33) { + code = (selector = selector.trim()).charCodeAt(0) + } + + switch (code) { + // & + case AND: { + switch (cascade + level) { + case 0: + case 1: { + if (parent.trim().length === 0) { + break + } + } + default: { + return selector.replace(andptn, '$1'+parent.trim()) + } + } + break + } + // : + case COLON: { + switch (selector.charCodeAt(1)) { + // g in :global + case 103: { + if (escape > 0 && cascade > 0) { + return selector.replace(escapeptn, '$1').replace(andptn, '$1'+nscope) + } + break + } + default: { + // :hover + return parent.trim() + selector.replace(andptn, '$1'+parent.trim()) + } + } + } + default: { + // html & + if (invert*cascade > 0 && selector.indexOf('\f') > 0) { + return selector.replace(andptn, (parent.charCodeAt(0) === COLON ? '' : '$1')+parent.trim()) + } + } + } + + return parent + selector + } + + /** + * Property + * + * @param {string} input + * @param {number} first + * @param {number} second + * @param {number} third + * @return {string} + */ + function property (input, first, second, third) { + var index = 0 + var out = input + ';' + var hash = (first*2) + (second*3) + (third*4) + var cache + + // animation: a, n, i characters + if (hash === 944) { + return animation(out) + } else if (prefix === 0 || (prefix === 2 && !vendor(out, 1))) { + return out + } + + // vendor prefix + switch (hash) { + // text-decoration/text-size-adjust: t, e, x + case 1015: { + // text-size-adjust, - + return out.charCodeAt(9) === DASH ? webkit + out + out : out + } + // filter/fill f, i, l + case 951: { + // filter, t + return out.charCodeAt(3) === 116 ? webkit + out + out : out + } + // color/column, c, o, l + case 963: { + // column, n + return out.charCodeAt(5) === 110 ? webkit + out + out : out + } + // box-decoration-break, b, o, x + case 1009: { + if (out.charCodeAt(4) !== 100) { + break + } + } + // mask, m, a, s + // clip-path, c, l, i + case 969: + case 942: { + return webkit + out + out + } + // appearance: a, p, p + case 978: { + return webkit + out + moz + out + out + } + // hyphens: h, y, p + // user-select: u, s, e + case 1019: + case 983: { + return webkit + out + moz + out + ms + out + out + } + // background/backface-visibility, b, a, c + case 883: { + // backface-visibility, - + return out.charCodeAt(8) === DASH ? webkit + out + out : out + } + // flex: f, l, e + case 932: { + if (out.charCodeAt(4) === DASH) { + switch (out.charCodeAt(5)) { + // flex-grow, g + case 103: { + return webkit + 'box-' + out.replace('-grow', '') + webkit + out + ms + out.replace('grow', 'positive') + out + } + // flex-shrink, s + case 115: { + return webkit + out + ms + out.replace('shrink', 'negative') + out + } + // flex-basis, b + case 98: { + return webkit + out + ms + out.replace('basis', 'preferred-size') + out + } + } + } + + return webkit + out + ms + out + out + } + // order: o, r, d + case 964: { + return webkit + out + ms + 'flex' + '-' + out + out + } + // justify-items/justify-content, j, u, s + case 1023: { + // justify-content, c + if (out.charCodeAt(8) !== 99) { + break + } + + cache = out.substring(out.indexOf(':', 15)).replace('flex-', '').replace('space-between', 'justify') + return webkit + 'box-pack' + cache + webkit + out + ms + 'flex-pack' + cache + out + } + // cursor, c, u, r + case 1005: { + return cursorptn.test(out) ? out.replace(colonptn, ':' + webkit) + out.replace(colonptn, ':' + moz) + out : out + } + // writing-mode, w, r, i + case 1000: { + cache = out.substring(13).trim() + index = cache.indexOf('-') + 1 + + switch (cache.charCodeAt(0)+cache.charCodeAt(index)) { + // vertical-lr + case 226: { + cache = out.replace(writingptn, 'tb') + break + } + // vertical-rl + case 232: { + cache = out.replace(writingptn, 'tb-rl') + break + } + // horizontal-tb + case 220: { + cache = out.replace(writingptn, 'lr') + break + } + default: { + return out + } + } + + return webkit + out + ms + cache + out + } + // position: sticky + case 1017: { + if (out.indexOf('sticky', 9) === -1) { + return out + } + } + // display(flex/inline-flex/inline-box): d, i, s + case 975: { + index = (out = input).length - 10 + cache = (out.charCodeAt(index) === 33 ? out.substring(0, index) : out).substring(input.indexOf(':', 7) + 1).trim() + + switch (hash = cache.charCodeAt(0) + (cache.charCodeAt(7)|0)) { + // inline- + case 203: { + // inline-box + if (cache.charCodeAt(8) < 111) { + break + } + } + // inline-box/sticky + case 115: { + out = out.replace(cache, webkit+cache)+';'+out + break + } + // inline-flex + // flex + case 207: + case 102: { + out = ( + out.replace(cache, webkit+(hash > 102 ? 'inline-' : '')+'box')+';'+ + out.replace(cache, webkit+cache)+';'+ + out.replace(cache, ms+cache+'box')+';'+ + out + ) + } + } + + return out + ';' + } + // align-items, align-center, align-self: a, l, i, - + case 938: { + if (out.charCodeAt(5) === DASH) { + switch (out.charCodeAt(6)) { + // align-items, i + case 105: { + cache = out.replace('-items', '') + return webkit + out + webkit + 'box-' + cache + ms + 'flex-' + cache + out + } + // align-self, s + case 115: { + return webkit + out + ms + 'flex-item-' + out.replace(selfptn, '') + out + } + // align-content + default: { + return webkit + out + ms + 'flex-line-pack' + out.replace('align-content', '').replace(selfptn, '') + out + } + } + } + break + } + // width: min-content / width: max-content + case 953: { + if ((index = out.indexOf('-content', 9)) > 0) { + // width: min-content / width: max-content + if (out.charCodeAt(index - 3) === 109 && out.charCodeAt(index - 4) !== 45) { + cache = out.substring(index - 3) + return 'width:' + webkit + cache + 'width:' + moz + cache + 'width:' + cache + } + } + break + } + // transform, transition: t, r, a + case 962: { + out = webkit + out + (out.charCodeAt(5) === 102 ? ms + out : '') + out + + // transitions + if (second + third === 211 && out.charCodeAt(13) === 105 && out.indexOf('transform', 10) > 0) { + return out.substring(0, out.indexOf(';', 27) + 1).replace(transformptn, '$1' + webkit + '$2') + out + } + + break + } + } + + return out + } + + var i = 0 + + /** + * Vendor + * + * @param {string} content + * @param {number} context + * @return {boolean} + */ + function vendor (content, context) { + var index = content.indexOf(context === 1 ? ':' : '{') + var key = content.substring(0, context !== 3 ? index : 10) + var value = content.substring(index + 1, content.length - 1) + + return should(context !== 2 ? key : key.replace(pseudofmt, '$1'), value, context) + } + + /** + * Supports + * + * @param {string} match + * @param {string} group + * @return {string} + */ + function supports (match, group) { + var out = property(group, group.charCodeAt(0), group.charCodeAt(1), group.charCodeAt(2)) + + return out !== group+';' ? out.replace(propertyptn, ' or ($1)').substring(4) : '('+group+')' + } + + /** + * Animation + * + * @param {string} input + * @return {string} + */ + function animation (input) { + var length = input.length + var index = input.indexOf(':', 9) + 1 + var declare = input.substring(0, index).trim() + var out = input.substring(index, length-1).trim() + + switch (input.charCodeAt(9)*keyed) { + case 0: { + break + } + // animation-*, - + case DASH: { + // animation-name, n + if (input.charCodeAt(10) !== 110) { + break + } + } + // animation/animation-name + default: { + // split in case of multiple animations + var list = out.split((out = '', animationptn)) + + for (var i = 0, index = 0, length = list.length; i < length; index = 0, ++i) { + var value = list[i] + var items = value.split(propertiesptn) + + while (value = items[index]) { + var peak = value.charCodeAt(0) + + if (keyed === 1 && ( + // letters + (peak > AT && peak < 90) || (peak > 96 && peak < 123) || peak === UNDERSCORE || + // dash but not in sequence i.e -- + (peak === DASH && value.charCodeAt(1) !== DASH) + )) { + // not a number/function + switch (isNaN(parseFloat(value)) + (value.indexOf('(') !== -1)) { + case 1: { + switch (value) { + // not a valid reserved keyword + case 'infinite': case 'alternate': case 'backwards': case 'running': + case 'normal': case 'forwards': case 'both': case 'none': case 'linear': + case 'ease': case 'ease-in': case 'ease-out': case 'ease-in-out': + case 'paused': case 'reverse': case 'alternate-reverse': case 'inherit': + case 'initial': case 'unset': case 'step-start': case 'step-end': { + break + } + default: { + value += key + } + } + } + } + } + + items[index++] = value + } + + out += (i === 0 ? '' : ',') + items.join(' ') + } + } + } + + out = declare + out + ';' + + if (prefix === 1 || (prefix === 2 && vendor(out, 1))) + return webkit + out + out + + return out + } + + /** + * Isolate + * + * @param {Array<string>} current + */ + function isolate (current) { + for (var i = 0, length = current.length, selector = Array(length), padding, element; i < length; ++i) { + // split individual elements in a selector i.e h1 h2 === [h1, h2] + var elements = current[i].split(elementptn) + var out = '' + + for (var j = 0, size = 0, tail = 0, code = 0, l = elements.length; j < l; ++j) { + // empty element + if ((size = (element = elements[j]).length) === 0 && l > 1) { + continue + } + + tail = out.charCodeAt(out.length-1) + code = element.charCodeAt(0) + padding = '' + + if (j !== 0) { + // determine if we need padding + switch (tail) { + case STAR: + case TILDE: + case GREATERTHAN: + case PLUS: + case SPACE: + case OPENPARENTHESES: { + break + } + default: { + padding = ' ' + } + } + } + + switch (code) { + case AND: { + element = padding + nscopealt + } + case TILDE: + case GREATERTHAN: + case PLUS: + case SPACE: + case CLOSEPARENTHESES: + case OPENPARENTHESES: { + break + } + case OPENBRACKET: { + element = padding + element + nscopealt + break + } + case COLON: { + switch (element.charCodeAt(1)*2 + element.charCodeAt(2)*3) { + // :global + case 530: { + if (escape > 0) { + element = padding + element.substring(8, size - 1) + break + } + } + // :hover, :nth-child(), ... + default: { + if (j < 1 || elements[j-1].length < 1) { + element = padding + nscopealt + element + } + } + } + break + } + case COMMA: { + padding = '' + } + default: { + if (size > 1 && element.indexOf(':') > 0) { + element = padding + element.replace(pseudoptn, '$1' + nscopealt + '$2') + } else { + element = padding + element + nscopealt + } + } + } + + out += element + } + + selector[i] = out.replace(formatptn, '').trim() + } + + return selector + } + + /** + * Proxy + * + * @param {number} context + * @param {string} content + * @param {Array<string>} selectors + * @param {Array<string>} parents + * @param {number} line + * @param {number} column + * @param {number} length + * @param {number} id + * @param {number} depth + * @return {(string|void|*)} + */ + function proxy (context, content, selectors, parents, line, column, length, id, depth) { + for (var i = 0, out = content, next; i < plugged; ++i) { + switch (next = plugins[i].call(stylis, context, out, selectors, parents, line, column, length, id, depth)) { + case void 0: + case false: + case true: + case null: { + break + } + default: { + out = next + } + } + } + + switch (out) { + case void 0: + case false: + case true: + case null: + case content: { + break + } + default: { + return out + } + } + } + + /** + * Minify + * + * @param {(string|*)} output + * @return {string} + */ + function minify (output) { + return output + .replace(formatptn, '') + .replace(beforeptn, '') + .replace(afterptn, '$1') + .replace(tailptn, '$1') + .replace(whiteptn, ' ') + } + + /** + * Use + * + * @param {(Array<function(...?)>|function(...?)|number|void)?} plugin + */ + function use (plugin) { + switch (plugin) { + case void 0: + case null: { + plugged = plugins.length = 0 + break + } + default: { + switch (plugin.constructor) { + case Array: { + for (var i = 0, length = plugin.length; i < length; ++i) { + use(plugin[i]) + } + break + } + case Function: { + plugins[plugged++] = plugin + break + } + case Boolean: { + unkwn = !!plugin|0 + } + } + } + } + + return use + } + + /** + * Set + * + * @param {*} options + */ + function set (options) { + for (var name in options) { + var value = options[name] + switch (name) { + case 'keyframe': keyed = value|0; break + case 'global': escape = value|0; break + case 'cascade': cascade = value|0; break + case 'compress': compress = value|0; break + case 'semicolon': semicolon = value|0; break + case 'preserve': preserve = value|0; break + case 'prefix': + should = null + + if (!value) { + prefix = 0 + } else if (typeof value !== 'function') { + prefix = 1 + } else { + prefix = 2 + should = value + } + } + } + + return set + } + + /** + * Stylis + * + * @param {string} selector + * @param {string} input + * @return {*} + */ + function stylis (selector, input) { + if (this !== void 0 && this.constructor === stylis) { + return factory(selector) + } + + // setup + var ns = selector + var code = ns.charCodeAt(0) + + // trim leading whitespace + if (code < 33) { + code = (ns = ns.trim()).charCodeAt(0) + } + + // keyframe/animation namespace + if (keyed > 0) { + key = ns.replace(invalidptn, code === OPENBRACKET ? '' : '-') + } + + // reset, used to assert if a plugin is moneky-patching the return value + code = 1 + + // cascade/isolate + if (cascade === 1) { + nscope = ns + } else { + nscopealt = ns + } + + var selectors = [nscope] + var result + + // execute plugins, pre-process context + if (plugged > 0) { + result = proxy(PREPS, input, selectors, selectors, line, column, 0, 0, 0) + + if (result !== void 0 && typeof result === 'string') { + input = result + } + } + + // build + var output = compile(array, selectors, input, 0, 0) + + // execute plugins, post-process context + if (plugged > 0) { + result = proxy(POSTS, output, selectors, selectors, line, column, output.length, 0, 0) + + // bypass minification + if (result !== void 0 && typeof(output = result) !== 'string') { + code = 0 + } + } + + // reset + key = '' + nscope = '' + nscopealt = '' + pattern = 0 + line = 1 + column = 1 + + return compress*code === 0 ? output : minify(output) + } + + stylis['use'] = use + stylis['set'] = set + + if (options !== void 0) { + set(options) + } + + return stylis +})); + + +/***/ }), +/* 248 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/** + * Copyright 2015, Yahoo! Inc. + * Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms. + */ + + +var REACT_STATICS = { + childContextTypes: true, + contextTypes: true, + defaultProps: true, + displayName: true, + getDefaultProps: true, + mixins: true, + propTypes: true, + type: true +}; + +var KNOWN_STATICS = { + name: true, + length: true, + prototype: true, + caller: true, + arguments: true, + arity: true +}; + +var isGetOwnPropertySymbolsAvailable = typeof Object.getOwnPropertySymbols === 'function'; + +module.exports = function hoistNonReactStatics(targetComponent, sourceComponent, customStatics) { + if (typeof sourceComponent !== 'string') { // don't hoist over string (html) components + var keys = Object.getOwnPropertyNames(sourceComponent); + + /* istanbul ignore else */ + if (isGetOwnPropertySymbolsAvailable) { + keys = keys.concat(Object.getOwnPropertySymbols(sourceComponent)); + } + + for (var i = 0; i < keys.length; ++i) { + if (!REACT_STATICS[keys[i]] && !KNOWN_STATICS[keys[i]] && (!customStatics || !customStatics[keys[i]])) { + try { + targetComponent[keys[i]] = sourceComponent[keys[i]]; + } catch (error) { + + } + } + } + } + + return targetComponent; +}; + + +/***/ }), +/* 249 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _react = __webpack_require__(2); + +var _react2 = _interopRequireDefault(_react); + +var _reactDom = __webpack_require__(32); + +var _reactDom2 = _interopRequireDefault(_reactDom); + +var _propTypes = __webpack_require__(18); + +var _propTypes2 = _interopRequireDefault(_propTypes); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var Sticky = function (_Component) { + _inherits(Sticky, _Component); + + function Sticky() { + var _ref; + + var _temp, _this, _ret; + + _classCallCheck(this, Sticky); + + for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = Sticky.__proto__ || Object.getPrototypeOf(Sticky)).call.apply(_ref, [this].concat(args))), _this), _this.state = { + isSticky: false, + wasSticky: false, + style: {} + }, _this.handleContainerEvent = function (_ref2) { + var distanceFromTop = _ref2.distanceFromTop, + distanceFromBottom = _ref2.distanceFromBottom, + eventSource = _ref2.eventSource; + + var parent = _this.context.getParent(); + + var preventingStickyStateChanges = false; + if (_this.props.relative) { + preventingStickyStateChanges = eventSource !== parent; + distanceFromTop = -(eventSource.scrollTop + eventSource.offsetTop) + _this.placeholder.offsetTop; + } + + var placeholderClientRect = _this.placeholder.getBoundingClientRect(); + var contentClientRect = _this.content.getBoundingClientRect(); + var calculatedHeight = contentClientRect.height; + + var bottomDifference = distanceFromBottom - _this.props.bottomOffset - calculatedHeight; + + var wasSticky = !!_this.state.isSticky; + var isSticky = preventingStickyStateChanges ? wasSticky : distanceFromTop <= -_this.props.topOffset && distanceFromBottom > -_this.props.bottomOffset; + + distanceFromBottom = (_this.props.relative ? parent.scrollHeight - parent.scrollTop : distanceFromBottom) - calculatedHeight; + + var style = !isSticky ? {} : { + position: 'fixed', + top: bottomDifference > 0 ? _this.props.relative ? parent.offsetTop - parent.offsetParent.scrollTop : 0 : bottomDifference, + left: placeholderClientRect.left, + width: placeholderClientRect.width + }; + + if (!_this.props.disableHardwareAcceleration) { + style.transform = 'translateZ(0)'; + } + + _this.setState({ + isSticky: isSticky, + wasSticky: wasSticky, + distanceFromTop: distanceFromTop, + distanceFromBottom: distanceFromBottom, + calculatedHeight: calculatedHeight, + style: style + }); + }, _temp), _possibleConstructorReturn(_this, _ret); + } + + _createClass(Sticky, [{ + key: 'componentWillMount', + value: function componentWillMount() { + if (!this.context.subscribe) throw new TypeError("Expected Sticky to be mounted within StickyContainer"); + + this.context.subscribe(this.handleContainerEvent); + } + }, { + key: 'componentWillUnmount', + value: function componentWillUnmount() { + this.context.unsubscribe(this.handleContainerEvent); + } + }, { + key: 'componentDidUpdate', + value: function componentDidUpdate() { + this.placeholder.style.paddingBottom = this.props.disableCompensation ? 0 : (this.state.isSticky ? this.state.calculatedHeight : 0) + 'px'; + } + }, { + key: 'render', + value: function render() { + var _this2 = this; + + var element = _react2.default.cloneElement(this.props.children({ + isSticky: this.state.isSticky, + wasSticky: this.state.wasSticky, + distanceFromTop: this.state.distanceFromTop, + distanceFromBottom: this.state.distanceFromBottom, + calculatedHeight: this.state.calculatedHeight, + style: this.state.style + }), { ref: function ref(content) { + _this2.content = _reactDom2.default.findDOMNode(content); + } }); + + return _react2.default.createElement( + 'div', + null, + _react2.default.createElement('div', { ref: function ref(placeholder) { + return _this2.placeholder = placeholder; + } }), + element + ); + } + }]); + + return Sticky; +}(_react.Component); + +Sticky.propTypes = { + topOffset: _propTypes2.default.number, + bottomOffset: _propTypes2.default.number, + relative: _propTypes2.default.bool, + children: _propTypes2.default.func.isRequired +}; +Sticky.defaultProps = { + relative: false, + topOffset: 0, + bottomOffset: 0, + disableCompensation: false, + disableHardwareAcceleration: false +}; +Sticky.contextTypes = { + subscribe: _propTypes2.default.func, + unsubscribe: _propTypes2.default.func, + getParent: _propTypes2.default.func +}; +exports.default = Sticky; + +/***/ }), +/* 250 */ +/***/ (function(module, exports, __webpack_require__) { + +"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 _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _react = __webpack_require__(2); + +var _react2 = _interopRequireDefault(_react); + +var _propTypes = __webpack_require__(18); + +var _propTypes2 = _interopRequireDefault(_propTypes); + +var _raf = __webpack_require__(251); + +var _raf2 = _interopRequireDefault(_raf); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var Container = function (_PureComponent) { + _inherits(Container, _PureComponent); + + function Container() { + var _ref; + + var _temp, _this, _ret; + + _classCallCheck(this, Container); + + for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = Container.__proto__ || Object.getPrototypeOf(Container)).call.apply(_ref, [this].concat(args))), _this), _this.events = ['resize', 'scroll', 'touchstart', 'touchmove', 'touchend', 'pageshow', 'load'], _this.subscribers = [], _this.subscribe = function (handler) { + _this.subscribers = _this.subscribers.concat(handler); + }, _this.unsubscribe = function (handler) { + _this.subscribers = _this.subscribers.filter(function (current) { + return current !== handler; + }); + }, _this.notifySubscribers = function (evt) { + if (!_this.framePending) { + var currentTarget = evt.currentTarget; + + + (0, _raf2.default)(function () { + _this.framePending = false; + + var _this$node$getBoundin = _this.node.getBoundingClientRect(), + top = _this$node$getBoundin.top, + bottom = _this$node$getBoundin.bottom; + + _this.subscribers.forEach(function (handler) { + return handler({ + distanceFromTop: top, + distanceFromBottom: bottom, + eventSource: currentTarget === window ? document.body : _this.node + }); + }); + }); + _this.framePending = true; + } + }, _this.getParent = function () { + return _this.node; + }, _temp), _possibleConstructorReturn(_this, _ret); + } + + _createClass(Container, [{ + key: 'getChildContext', + value: function getChildContext() { + return { + subscribe: this.subscribe, + unsubscribe: this.unsubscribe, + getParent: this.getParent + }; + } + }, { + key: 'componentDidMount', + value: function componentDidMount() { + var _this2 = this; + + this.events.forEach(function (event) { + return window.addEventListener(event, _this2.notifySubscribers); + }); + } + }, { + key: 'componentWillUnmount', + value: function componentWillUnmount() { + var _this3 = this; + + this.events.forEach(function (event) { + return window.removeEventListener(event, _this3.notifySubscribers); + }); + } + }, { + key: 'render', + value: function render() { + var _this4 = this; + + return _react2.default.createElement('div', _extends({}, this.props, { + ref: function ref(node) { + return _this4.node = node; + }, + onScroll: this.notifySubscribers, + onTouchStart: this.notifySubscribers, + onTouchMove: this.notifySubscribers, + onTouchEnd: this.notifySubscribers + })); + } + }]); + + return Container; +}(_react.PureComponent); + +Container.childContextTypes = { + subscribe: _propTypes2.default.func, + unsubscribe: _propTypes2.default.func, + getParent: _propTypes2.default.func +}; +exports.default = Container; + +/***/ }), +/* 251 */ +/***/ (function(module, exports, __webpack_require__) { + +/* WEBPACK VAR INJECTION */(function(global) {var now = __webpack_require__(252) + , root = typeof window === 'undefined' ? global : window + , vendors = ['moz', 'webkit'] + , suffix = 'AnimationFrame' + , raf = root['request' + suffix] + , caf = root['cancel' + suffix] || root['cancelRequest' + suffix] + +for(var i = 0; !raf && i < vendors.length; i++) { + raf = root[vendors[i] + 'Request' + suffix] + caf = root[vendors[i] + 'Cancel' + suffix] + || root[vendors[i] + 'CancelRequest' + suffix] +} + +// Some versions of FF have rAF but not cAF +if(!raf || !caf) { + var last = 0 + , id = 0 + , queue = [] + , frameDuration = 1000 / 60 + + raf = function(callback) { + if(queue.length === 0) { + var _now = now() + , next = Math.max(0, frameDuration - (_now - last)) + last = next + _now + setTimeout(function() { + var cp = queue.slice(0) + // Clear queue here to prevent + // callbacks from appending listeners + // to the current frame's queue + queue.length = 0 + for(var i = 0; i < cp.length; i++) { + if(!cp[i].cancelled) { + try{ + cp[i].callback(last) + } catch(e) { + setTimeout(function() { throw e }, 0) + } + } + } + }, Math.round(next)) + } + queue.push({ + handle: ++id, + callback: callback, + cancelled: false + }) + return id + } + + caf = function(handle) { + for(var i = 0; i < queue.length; i++) { + if(queue[i].handle === handle) { + queue[i].cancelled = true + } + } + } +} + +module.exports = function(fn) { + // Wrap in a new function to prevent + // `cancel` potentially being assigned + // to the native rAF function + return raf.call(root, fn) +} +module.exports.cancel = function() { + caf.apply(root, arguments) +} +module.exports.polyfill = function(object) { + if (!object) { + object = root; + } + object.requestAnimationFrame = raf + object.cancelAnimationFrame = caf +} + +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(61))) + +/***/ }), +/* 252 */ +/***/ (function(module, exports, __webpack_require__) { + +/* WEBPACK VAR INJECTION */(function(process) {// Generated by CoffeeScript 1.12.2 +(function() { + var getNanoSeconds, hrtime, loadTime, moduleLoadTime, nodeLoadTime, upTime; + + if ((typeof performance !== "undefined" && performance !== null) && performance.now) { + module.exports = function() { + return performance.now(); + }; + } else if ((typeof process !== "undefined" && process !== null) && process.hrtime) { + module.exports = function() { + return (getNanoSeconds() - nodeLoadTime) / 1e6; + }; + hrtime = process.hrtime; + getNanoSeconds = function() { + var hr; + hr = hrtime(); + return hr[0] * 1e9 + hr[1]; + }; + moduleLoadTime = getNanoSeconds(); + upTime = process.uptime() * 1e9; + nodeLoadTime = moduleLoadTime - upTime; + } else if (Date.now) { + module.exports = function() { + return Date.now() - loadTime; + }; + loadTime = Date.now(); + } else { + module.exports = function() { + return new Date().getTime() - loadTime; + }; + loadTime = new Date().getTime(); + } + +}).call(this); + +//# sourceMappingURL=performance-now.js.map + +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) + +/***/ }), +/* 253 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _templateObject = _taggedTemplateLiteral(['\n width: 100%;\n margin: 0 auto;\n padding: 15px 0;\n z-index: 999;\n box-sizing: border-box;\n position: relative;\n'], ['\n width: 100%;\n margin: 0 auto;\n padding: 15px 0;\n z-index: 999;\n box-sizing: border-box;\n position: relative;\n']); + +var _react = __webpack_require__(2); + +var _react2 = _interopRequireDefault(_react); + +var _styledComponents = __webpack_require__(5); + +var _styledComponents2 = _interopRequireDefault(_styledComponents); + +var _reactSticky = __webpack_require__(104); + +var _topbar = __webpack_require__(254); + +var _topbar2 = _interopRequireDefault(_topbar); + +var _Toolbar = __webpack_require__(258); + +var _Toolbar2 = _interopRequireDefault(_Toolbar); + +var _styles = __webpack_require__(6); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +function _taggedTemplateLiteral(strings, raw) { return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); } + +var HeaderWrapper = _styledComponents2.default.section(_templateObject); + +var Header = function (_React$Component) { + _inherits(Header, _React$Component); + + function Header() { + _classCallCheck(this, Header); + + return _possibleConstructorReturn(this, (Header.__proto__ || Object.getPrototypeOf(Header)).apply(this, arguments)); + } + + _createClass(Header, [{ + key: 'render', + value: function render() { + return _react2.default.createElement( + HeaderWrapper, + { className: 'header' }, + _react2.default.createElement(_topbar2.default, null), + _react2.default.createElement( + _reactSticky.Sticky, + { topOffset: 72 }, + function (_ref) { + var isSticky = _ref.isSticky, + wasSticky = _ref.wasSticky, + style = _ref.style, + distanceFromTop = _ref.distanceFromTop, + distanceFromBottom = _ref.distanceFromBottom, + calculatedHeight = _ref.calculatedHeight; + + return _react2.default.createElement(_Toolbar2.default, { style: style }); + } + ) + ); + } + }]); + + return Header; +}(_react2.default.Component); + +exports.default = Header; + +/***/ }), +/* 254 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _templateObject = _taggedTemplateLiteral(['\n width: 100%;\n margin: 0 auto;\n display: flex;\n padding: 0 30px;\n align-items: center;\n box-sizing: border-box;\n flex-wrap: wrap;\n'], ['\n width: 100%;\n margin: 0 auto;\n display: flex;\n padding: 0 30px;\n align-items: center;\n box-sizing: border-box;\n flex-wrap: wrap;\n']), + _templateObject2 = _taggedTemplateLiteral(['\n width: 100%;\n height: 3px;\n background: ', ';\n flex-basis: 100%;\n margin: 10px 0;\n'], ['\n width: 100%;\n height: 3px;\n background: ', ';\n flex-basis: 100%;\n margin: 10px 0;\n']); + +var _react = __webpack_require__(2); + +var _react2 = _interopRequireDefault(_react); + +var _styledComponents = __webpack_require__(5); + +var _styledComponents2 = _interopRequireDefault(_styledComponents); + +var _styles = __webpack_require__(6); + +var _SuiteName = __webpack_require__(255); + +var _SuiteName2 = _interopRequireDefault(_SuiteName); + +var _IdContainer = __webpack_require__(256); + +var _IdContainer2 = _interopRequireDefault(_IdContainer); + +var _Logo = __webpack_require__(105); + +var _Logo2 = _interopRequireDefault(_Logo); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +function _taggedTemplateLiteral(strings, raw) { return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); } + +var TopbarWrapper = _styledComponents2.default.section(_templateObject); + +var Separator = _styledComponents2.default.div(_templateObject2, _styles.colors.borderGray); + +var Topbar = function (_React$Component) { + _inherits(Topbar, _React$Component); + + function Topbar() { + _classCallCheck(this, Topbar); + + return _possibleConstructorReturn(this, (Topbar.__proto__ || Object.getPrototypeOf(Topbar)).apply(this, arguments)); + } + + _createClass(Topbar, [{ + key: 'render', + value: function render() { + return _react2.default.createElement( + TopbarWrapper, + null, + _react2.default.createElement(_SuiteName2.default, null), + _react2.default.createElement(_IdContainer2.default, null), + _react2.default.createElement(_Logo2.default, null), + _react2.default.createElement(Separator, null) + ); + } + }]); + + return Topbar; +}(_react2.default.Component); + +exports.default = Topbar; + +/***/ }), +/* 255 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _templateObject = _taggedTemplateLiteral(['\n font-size: 26px;\n font-family: ', ';\n flex: 0 0 auto;\n margin: 0;\n color: ', ';\n'], ['\n font-size: 26px;\n font-family: ', ';\n flex: 0 0 auto;\n margin: 0;\n color: ', ';\n']); + +var _react = __webpack_require__(2); + +var _react2 = _interopRequireDefault(_react); + +var _reactRedux = __webpack_require__(10); + +var _styledComponents = __webpack_require__(5); + +var _styledComponents2 = _interopRequireDefault(_styledComponents); + +var _styles = __webpack_require__(6); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +function _taggedTemplateLiteral(strings, raw) { return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); } + +var SuiteNameTitle = _styledComponents2.default.h1(_templateObject, _styles.fonts.latoRegular, _styles.colors.primaryText); + +var SuiteName = function (_React$Component) { + _inherits(SuiteName, _React$Component); + + function SuiteName() { + _classCallCheck(this, SuiteName); + + return _possibleConstructorReturn(this, (SuiteName.__proto__ || Object.getPrototypeOf(SuiteName)).apply(this, arguments)); + } + + _createClass(SuiteName, [{ + key: 'render', + value: function render() { + return _react2.default.createElement( + SuiteNameTitle, + null, + this.props.suiteName, + ' Report' + ); + } + }]); + + return SuiteName; +}(_react2.default.Component); + +var mapStateToProps = function mapStateToProps(state) { + return { + suiteName: state.suiteInfo.testSuiteName + }; +}; + +var SuiteNameContainer = (0, _reactRedux.connect)(mapStateToProps)(SuiteName); + +exports.default = SuiteNameContainer; + +/***/ }), +/* 256 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _templateObject = _taggedTemplateLiteral(['\n font-size: 14px;\n font-family: ', ';\n font-weight: normal;\n font-style: normal;\n margin: 0;\n color: ', ';\n flex: 1 0 auto;\n padding-left: 15px;\n margin-left: 15px;\n margin-top: 7px;\n position: relative;\n\n :before {\n content: \'\';\n width: 2px;\n height: 35px;\n background: ', ';\n display: block;\n position: absolute;\n left: 0;\n top: -10px;\n }\n'], ['\n font-size: 14px;\n font-family: ', ';\n font-weight: normal;\n font-style: normal;\n margin: 0;\n color: ', ';\n flex: 1 0 auto;\n padding-left: 15px;\n margin-left: 15px;\n margin-top: 7px;\n position: relative;\n\n :before {\n content: \'\';\n width: 2px;\n height: 35px;\n background: ', ';\n display: block;\n position: absolute;\n left: 0;\n top: -10px;\n }\n']); + +var _react = __webpack_require__(2); + +var _react2 = _interopRequireDefault(_react); + +var _reactRedux = __webpack_require__(10); + +var _styledComponents = __webpack_require__(5); + +var _styledComponents2 = _interopRequireDefault(_styledComponents); + +var _styles = __webpack_require__(6); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +function _taggedTemplateLiteral(strings, raw) { return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); } + +var IdTitle = _styledComponents2.default.h3(_templateObject, _styles.fonts.arial, _styles.colors.secondaryText, _styles.colors.borderGray); + +var IdConfig = function (_React$Component) { + _inherits(IdConfig, _React$Component); + + function IdConfig() { + _classCallCheck(this, IdConfig); + + return _possibleConstructorReturn(this, (IdConfig.__proto__ || Object.getPrototypeOf(IdConfig)).apply(this, arguments)); + } + + _createClass(IdConfig, [{ + key: 'render', + value: function render() { + return _react2.default.createElement( + IdTitle, + null, + this.props.idConfig + ); + } + }]); + + return IdConfig; +}(_react2.default.Component); + +var mapStateToProps = function mapStateToProps(state) { + return { + idConfig: state.suiteInfo.idConfig + }; +}; + +var IdContainer = (0, _reactRedux.connect)(mapStateToProps)(IdConfig); + +exports.default = IdContainer; + +/***/ }), +/* 257 */ +/***/ (function(module, exports, __webpack_require__) { + +module.exports = __webpack_require__.p + "b815e28b1e230cff6e9d7b749edcd562.png"; + +/***/ }), +/* 258 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _templateObject = _taggedTemplateLiteral(['\n width: 100%;\n padding: 10px 30px;\n background: ', ';\n height: 70px;\n display: flex;\n box-sizing: border-box;\n \n @media print {\n display: none;\n }\n'], ['\n width: 100%;\n padding: 10px 30px;\n background: ', ';\n height: 70px;\n display: flex;\n box-sizing: border-box;\n \n @media print {\n display: none;\n }\n']); + +var _react = __webpack_require__(2); + +var _react2 = _interopRequireDefault(_react); + +var _styledComponents = __webpack_require__(5); + +var _styledComponents2 = _interopRequireDefault(_styledComponents); + +var _FiltersSwitch = __webpack_require__(259); + +var _FiltersSwitch2 = _interopRequireDefault(_FiltersSwitch); + +var _TextSearch = __webpack_require__(261); + +var _TextSearch2 = _interopRequireDefault(_TextSearch); + +var _SettingsContainer = __webpack_require__(264); + +var _SettingsContainer2 = _interopRequireDefault(_SettingsContainer); + +var _styles = __webpack_require__(6); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +function _taggedTemplateLiteral(strings, raw) { return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); } + +var ToolbarWrapper = _styledComponents2.default.section(_templateObject, _styles.colors.bodyColor); + +var Toolbar = function (_React$Component) { + _inherits(Toolbar, _React$Component); + + function Toolbar() { + _classCallCheck(this, Toolbar); + + return _possibleConstructorReturn(this, (Toolbar.__proto__ || Object.getPrototypeOf(Toolbar)).apply(this, arguments)); + } + + _createClass(Toolbar, [{ + key: 'render', + value: function render() { + return _react2.default.createElement( + ToolbarWrapper, + { style: this.props.style }, + _react2.default.createElement(_FiltersSwitch2.default, null), + _react2.default.createElement(_TextSearch2.default, null), + _react2.default.createElement(_SettingsContainer2.default, null) + ); + } + }]); + + return Toolbar; +}(_react2.default.Component); + +exports.default = Toolbar; + +/***/ }), +/* 259 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _templateObject = _taggedTemplateLiteral(['\n display: flex;\n flex: 0 0 auto;\n height: 100%;\n'], ['\n display: flex;\n flex: 0 0 auto;\n height: 100%;\n']); + +var _react = __webpack_require__(2); + +var _react2 = _interopRequireDefault(_react); + +var _reactRedux = __webpack_require__(10); + +var _styledComponents = __webpack_require__(5); + +var _styledComponents2 = _interopRequireDefault(_styledComponents); + +var _actions = __webpack_require__(25); + +var _ButtonFilter = __webpack_require__(260); + +var _ButtonFilter2 = _interopRequireDefault(_ButtonFilter); + +var _styles = __webpack_require__(6); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +function _taggedTemplateLiteral(strings, raw) { return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); } + +var ButtonsWrapper = _styledComponents2.default.div(_templateObject); + +function ButtonsFilter(props) { + var availableStatus = props.availableStatus; + + var ListButton = availableStatus.map(function (status) { + return _react2.default.createElement(_ButtonFilter2.default, { + status: status.id, + key: status.id, + label: status.label, + selected: props.filterStatus === status.id, + count: status.count, + onClick: function onClick() { + return props.onClick(status.id); + } + }); + }); + + return ( + // change this with React16 + _react2.default.createElement( + 'div', + { style: { height: '100%' } }, + ListButton + ) + ); +} + +var FiltersSwitch = function (_React$Component) { + _inherits(FiltersSwitch, _React$Component); + + function FiltersSwitch(props) { + _classCallCheck(this, FiltersSwitch); + + return _possibleConstructorReturn(this, (FiltersSwitch.__proto__ || Object.getPrototypeOf(FiltersSwitch)).call(this, props)); + } + + _createClass(FiltersSwitch, [{ + key: 'render', + value: function render() { + var tests = this.props.tests; + var availableStatus = this.props.availableStatus; + + return _react2.default.createElement( + ButtonsWrapper, + null, + _react2.default.createElement(ButtonsFilter, { + availableStatus: availableStatus, + onClick: this.props.onButtonClick, + filterStatus: tests.filterStatus + }) + ); + } + }]); + + return FiltersSwitch; +}(_react2.default.Component); + +var mapStateToProps = function mapStateToProps(state) { + return { + tests: state.tests, + availableStatus: state.availableStatus + }; +}; + +var mapDispatchToProps = function mapDispatchToProps(dispatch) { + return { + onButtonClick: function onButtonClick(status) { + dispatch((0, _actions.filterTests)(status)); + } + }; +}; + +var FiltersSwitchContainer = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)(FiltersSwitch); + +exports.default = FiltersSwitchContainer; + +/***/ }), +/* 260 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _templateObject = _taggedTemplateLiteral(['\n font-size: 20px;\n font-family: ', ';\n flex: 0 0 auto;\n margin: 0;\n background-color: ', ';\n border: none;\n border-radius: 3px;\n box-shadow: ', ';\n color: ', ';\n margin-right: 15px;\n padding: 0px 30px;\n opacity: ', ';\n outline: none;\n height: 100%;\n transition: all 0.3s ease-in-out;\n\n &:hover {\n cursor: pointer;\n box-shadow: ', ';\n }\n\n &.pass {\n background-color: ', ';\n color: ', ';\n }\n\n &.fail {\n background-color: ', ';\n color: ', ';\n }\n'], ['\n font-size: 20px;\n font-family: ', ';\n flex: 0 0 auto;\n margin: 0;\n background-color: ', ';\n border: none;\n border-radius: 3px;\n box-shadow: ', ';\n color: ', ';\n margin-right: 15px;\n padding: 0px 30px;\n opacity: ', ';\n outline: none;\n height: 100%;\n transition: all 0.3s ease-in-out;\n\n &:hover {\n cursor: pointer;\n box-shadow: ', ';\n }\n\n &.pass {\n background-color: ', ';\n color: ', ';\n }\n\n &.fail {\n background-color: ', ';\n color: ', ';\n }\n']); + +var _react = __webpack_require__(2); + +var _react2 = _interopRequireDefault(_react); + +var _styledComponents = __webpack_require__(5); + +var _styledComponents2 = _interopRequireDefault(_styledComponents); + +var _styles = __webpack_require__(6); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +function _taggedTemplateLiteral(strings, raw) { return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); } + +var Button = _styledComponents2.default.button(_templateObject, _styles.fonts.latoRegular, _styles.colors.white, function (props) { + return props.selected ? 'none' : _styles.shadows.shadow01; +}, _styles.colors.primaryText, function (props) { + return props.selected ? '1' : '0.5'; +}, function (props) { + return !props.selected ? _styles.shadows.shadow02 : ''; +}, _styles.colors.green, _styles.colors.white, _styles.colors.red, _styles.colors.white); + +var ButtonFilter = function (_React$Component) { + _inherits(ButtonFilter, _React$Component); + + function ButtonFilter() { + _classCallCheck(this, ButtonFilter); + + return _possibleConstructorReturn(this, (ButtonFilter.__proto__ || Object.getPrototypeOf(ButtonFilter)).apply(this, arguments)); + } + + _createClass(ButtonFilter, [{ + key: 'render', + value: function render() { + var _props = this.props, + count = _props.count, + label = _props.label, + status = _props.status; + + + return _react2.default.createElement( + Button, + { + onClick: this.props.onClick, + selected: this.props.selected, + className: status + }, + status !== 'all' ? count : '', + ' ', + label + ); + } + }]); + + return ButtonFilter; +}(_react2.default.Component); + +exports.default = ButtonFilter; + +/***/ }), +/* 261 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _templateObject = _taggedTemplateLiteral(['\n flex: 1 1 auto;\n height: 100%;\n'], ['\n flex: 1 1 auto;\n height: 100%;\n']); + +var _react = __webpack_require__(2); + +var _react2 = _interopRequireDefault(_react); + +var _reactRedux = __webpack_require__(10); + +var _styledComponents = __webpack_require__(5); + +var _styledComponents2 = _interopRequireDefault(_styledComponents); + +var _actions = __webpack_require__(25); + +var _InputTextSearch = __webpack_require__(262); + +var _InputTextSearch2 = _interopRequireDefault(_InputTextSearch); + +var _styles = __webpack_require__(6); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +function _taggedTemplateLiteral(strings, raw) { return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); } + +var InputWrapper = _styledComponents2.default.div(_templateObject); + +var TextSearch = function (_React$Component) { + _inherits(TextSearch, _React$Component); + + function TextSearch(props) { + _classCallCheck(this, TextSearch); + + return _possibleConstructorReturn(this, (TextSearch.__proto__ || Object.getPrototypeOf(TextSearch)).call(this, props)); + } + + _createClass(TextSearch, [{ + key: 'onChange', + value: function onChange(event) { + var value = event.target.value; + + if (value.length > 0) { + this.props.findTest(value); + } else { + this.props.filterTests(this.props.tests.filterStatus); + } + } + }, { + key: 'render', + value: function render() { + return _react2.default.createElement( + InputWrapper, + null, + _react2.default.createElement(_InputTextSearch2.default, { onChange: this.onChange.bind(this) }) + ); + } + }]); + + return TextSearch; +}(_react2.default.Component); + +var mapStateToProps = function mapStateToProps(state) { + return { + tests: state.tests + }; +}; + +var mapDispatchToProps = function mapDispatchToProps(dispatch) { + return { + findTest: function findTest(value) { + dispatch((0, _actions.findTests)(value)); + }, + filterTests: function filterTests(status) { + dispatch((0, _actions.filterTests)(status)); + } + }; +}; + +var TextSearchContainer = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)(TextSearch); + +exports.default = TextSearchContainer; + +/***/ }), +/* 262 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _templateObject = _taggedTemplateLiteral(['\n display: block;\n height: 100%;\n border: none;\n font-size: 16px;\n background-color: ', ';\n padding: 0 10px 0 55px;\n font-family: ', ';\n width: 100%;\n box-sizing: border-box;\n border-radius: 3px;\n background-image: url(', ');\n background-repeat: no-repeat;\n background-position-x: 15px;\n background-position-y: calc(100% / 2);\n background-size: 22px;\n\n &:focus {\n outline: none;\n }\n\n &::placeholder {\n font-family: ', ';\n font-weight: 400;\n font-style: italic;\n color: ', ';\n }\n'], ['\n display: block;\n height: 100%;\n border: none;\n font-size: 16px;\n background-color: ', ';\n padding: 0 10px 0 55px;\n font-family: ', ';\n width: 100%;\n box-sizing: border-box;\n border-radius: 3px;\n background-image: url(', ');\n background-repeat: no-repeat;\n background-position-x: 15px;\n background-position-y: calc(100% / 2);\n background-size: 22px;\n\n &:focus {\n outline: none;\n }\n\n &::placeholder {\n font-family: ', ';\n font-weight: 400;\n font-style: italic;\n color: ', ';\n }\n']); + +var _react = __webpack_require__(2); + +var _react2 = _interopRequireDefault(_react); + +var _reactRedux = __webpack_require__(10); + +var _styledComponents = __webpack_require__(5); + +var _styledComponents2 = _interopRequireDefault(_styledComponents); + +var _styles = __webpack_require__(6); + +var _search = __webpack_require__(263); + +var _search2 = _interopRequireDefault(_search); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +function _taggedTemplateLiteral(strings, raw) { return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); } + +var Input = _styledComponents2.default.input(_templateObject, _styles.colors.lightGray, _styles.fonts.latoRegular, _search2.default, _styles.fonts.arial, _styles.colors.secondaryText); + +var ButtonFilter = function (_React$Component) { + _inherits(ButtonFilter, _React$Component); + + function ButtonFilter() { + _classCallCheck(this, ButtonFilter); + + return _possibleConstructorReturn(this, (ButtonFilter.__proto__ || Object.getPrototypeOf(ButtonFilter)).apply(this, arguments)); + } + + _createClass(ButtonFilter, [{ + key: 'render', + value: function render() { + return _react2.default.createElement(Input, { + placeholder: 'Filter tests with search...', + onChange: this.props.onChange.bind(this) + }); + } + }]); + + return ButtonFilter; +}(_react2.default.Component); + +exports.default = ButtonFilter; + +/***/ }), +/* 263 */ +/***/ (function(module, exports) { + +module.exports = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAC4AAAAsCAYAAAAacYo8AAAABGdBTUEAALGPC/xhBQAABf5JREFUWAnVmVlMXFUYx52hgFJZ22ihiAaiVYyJqcaWBzBlp2QolWBilcCb0WhsE2ONdUHTaGLsi74YTJTE5UGaWkDKjiTIA2lMTVVqSzSxGGrbyCJb2Wb8fZd7bi6XWe7QmUk5yZmzfd//+5/vnHu2cdwWhlBYWPgQsAc8Hs8eYqrD4UijfDdxkjhG3RjpMPUtubm5g/X19W7KQQVHUNJ+hKurq++cmJg4DKka4gN+RK1N1+nAKeL7PT09l62NvspRvhrs1u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67GXreF1Mk58Vti2PizBH2U/x9r+SB+xZ7obGEVPqQh0YVdmxlYM8LMuG58WWbeJylMXrR3SCckJr4sCTqZdDmpSVlcmoyrTYIcA47Guzt6XONnERRvlLkm8kjze2sUy18FRxl5RDFeRQB+kvwN8rmJC+FB8f/7IVXzvbWiv9lSH6IJfXYcEUOYAvMxIHrB7xh+Grjdt8CtgnIa2m4SQPTHs7OjouWnWCejsEOBVgWRrVm4rgJRJrePebrK2tPdff3++WymADz3nFnPzkOW+36OKQWRxSxSOTvOGsC7Y9LqR5U5FlcZeOchHwcQyZdzXZYY9xQ2+Wy+46a14qGME9ED4Ojnlj+wvsCp4pzntR0apsEfdGOjo6el9CQsI1lqy3QTqGYfPoTWK4DY+1QeoPXnOvJCYmXp2amkpCLo26e2gvIC9XwjV7AvU9TI9DPDLJGclnCEjcF+nOzk7jjJy/+gBaD5Eyn5YCN8jt6nW8/H1gUf0D8yVoh7RZl2F/jG9Ans+kA+bvwCxm5CE6S2c7SZv4Z+JbVhTb34dPjwdL2mBDBgLOwcHB3SyXT0JsJ1VyZ5WOTDJ95DwtcTg9Pb1XdmXyQQevxG+GdNAMNqiwjvhmIC19XUN8s5BeQ3wzkTaIbzbSQtxZWVmZZN0RZXMxr9MieKsF5/T0dBWkjG18M5AWJ25h8ZfzxwXW2zFI19zqnhbSEv4HOhR+tKGIkEUAAAAASUVORK5CYII=" + +/***/ }), +/* 264 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _templateObject = _taggedTemplateLiteral(['\n flex: 0 0 auto;\n height: 100%;\n'], ['\n flex: 0 0 auto;\n height: 100%;\n']); + +var _react = __webpack_require__(2); + +var _react2 = _interopRequireDefault(_react); + +var _reactRedux = __webpack_require__(10); + +var _styledComponents = __webpack_require__(5); + +var _styledComponents2 = _interopRequireDefault(_styledComponents); + +var _ButtonSettings = __webpack_require__(265); + +var _ButtonSettings2 = _interopRequireDefault(_ButtonSettings); + +var _SettingsPopup = __webpack_require__(267); + +var _SettingsPopup2 = _interopRequireDefault(_SettingsPopup); + +var _styles = __webpack_require__(6); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +function _taggedTemplateLiteral(strings, raw) { return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); } +// import { findTests } from '../../actions' + +// atoms + + +// molecules + + +var SettingsWrapper = _styledComponents2.default.div(_templateObject); + +var SettingsPanel = function (_React$Component) { + _inherits(SettingsPanel, _React$Component); + + function SettingsPanel(props) { + _classCallCheck(this, SettingsPanel); + + var _this = _possibleConstructorReturn(this, (SettingsPanel.__proto__ || Object.getPrototypeOf(SettingsPanel)).call(this, props)); + + _this.state = { + popup: false + }; + return _this; + } + + _createClass(SettingsPanel, [{ + key: 'onButtonClick', + value: function onButtonClick() { + this.setState({ + popup: !this.state.popup + }); + } + }, { + key: 'render', + value: function render() { + var popupVisible = this.state.popup; + + return _react2.default.createElement( + SettingsWrapper, + null, + _react2.default.createElement(_ButtonSettings2.default, { + onClick: this.onButtonClick.bind(this), + active: this.state.popup + }), + popupVisible && _react2.default.createElement(_SettingsPopup2.default, null) + ); + } + }]); + + return SettingsPanel; +}(_react2.default.Component); + +var mapStateToProps = function mapStateToProps(state) { + return {}; +}; + +var mapDispatchToProps = function mapDispatchToProps(dispatch) { + return { + // onChange: value => { + // dispatch(findTests(value)) + // } + }; +}; + +var SettingsContainer = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)(SettingsPanel); + +exports.default = SettingsContainer; + +/***/ }), +/* 265 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _templateObject = _taggedTemplateLiteral(['\n border: none;\n height: 100%;\n border-radius: 3px;\n background: ', ';\n margin-left: 15px;\n padding: 0 20px;\n box-shadow: ', ';\n transition: all 0.3s ease-in-out;\n\n &.active {\n box-shadow: none;\n opacity: 0.6;\n }\n\n &:hover {\n cursor: pointer;\n box-shadow: ', ';\n }\n\n &:focus {\n outline: none;\n }\n\n .icon {\n height: 18px;\n width: 18px;\n display: block;\n background-image: url(', ');\n background-size: 100%;\n background-repeat: no-repeat;\n background-position: center;\n margin: 0 auto;\n padding-bottom: 5px;\n }\n\n .label {\n font-family: ', ';\n color: ', ';\n }\n'], ['\n border: none;\n height: 100%;\n border-radius: 3px;\n background: ', ';\n margin-left: 15px;\n padding: 0 20px;\n box-shadow: ', ';\n transition: all 0.3s ease-in-out;\n\n &.active {\n box-shadow: none;\n opacity: 0.6;\n }\n\n &:hover {\n cursor: pointer;\n box-shadow: ', ';\n }\n\n &:focus {\n outline: none;\n }\n\n .icon {\n height: 18px;\n width: 18px;\n display: block;\n background-image: url(', ');\n background-size: 100%;\n background-repeat: no-repeat;\n background-position: center;\n margin: 0 auto;\n padding-bottom: 5px;\n }\n\n .label {\n font-family: ', ';\n color: ', ';\n }\n']); + +var _react = __webpack_require__(2); + +var _react2 = _interopRequireDefault(_react); + +var _styledComponents = __webpack_require__(5); + +var _styledComponents2 = _interopRequireDefault(_styledComponents); + +var _styles = __webpack_require__(6); + +var _settings = __webpack_require__(266); + +var _settings2 = _interopRequireDefault(_settings); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +function _taggedTemplateLiteral(strings, raw) { return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); } + +var Button = _styledComponents2.default.button(_templateObject, _styles.colors.lightGray, _styles.shadows.shadow01, function (props) { + return !props.selected ? _styles.shadows.shadow02 : ''; +}, _settings2.default, _styles.fonts.latoRegular, _styles.colors.secondaryText); + +var ButtonSettings = function (_React$Component) { + _inherits(ButtonSettings, _React$Component); + + function ButtonSettings() { + _classCallCheck(this, ButtonSettings); + + return _possibleConstructorReturn(this, (ButtonSettings.__proto__ || Object.getPrototypeOf(ButtonSettings)).apply(this, arguments)); + } + + _createClass(ButtonSettings, [{ + key: 'render', + value: function render() { + var isActive = this.props.active ? 'active' : ''; + + return _react2.default.createElement( + Button, + { onClick: this.props.onClick, className: isActive }, + _react2.default.createElement('span', { className: 'icon' }) + ); + } + }]); + + return ButtonSettings; +}(_react2.default.Component); + +exports.default = ButtonSettings; + +/***/ }), +/* 266 */ +/***/ (function(module, exports) { + +module.exports = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABGdBTUEAALGPC/xhBQAAAQZJREFUWAndVEESgyAMLB1fxrF9bznyNQudsSq62QZisfWiZiEkm2XdBTze+0eCbgAOMcY7wFThq7AaHZ63SJiQcgsN29A6kjp1y0hiZlz+t35LDLTm/mj/QGYNkxgxEboy4JwbB6Rm1mGpDUgVAboykGujt4AxQRqksMRAQLvT7LJJ/cezMpmWlsh1htYtjUBbj2TPEKMi1FZRXk8mYksGtLW+1ldbsfY0wMSJrdiow3eaUhsT0F8DUyVWbzBrmN6Sgd+0bmjFtdYKuQaANAJonymXhIGj9sPUisvroxXZ/rFzVGJgXnXgV7UVGzFxYitmHZbaqJ1Sfw2wyhkTbD/DJQa+Yq1PGOtJ/BpD3bUAAAAASUVORK5CYII=" + +/***/ }), +/* 267 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _templateObject = _taggedTemplateLiteral(['\n display: block;\n position: absolute;\n width: auto;\n min-height: 100px;\n background-color: ', ';\n box-shadow: ', ';\n right: 38px;\n margin-top: 20px;\n border-radius: 3px;\n padding: 10px 25px;\n z-index: 10;\n\n /* @TODO: shadow on arrow */\n &:before {\n content: \'\';\n display: block;\n width: 0;\n height: 0;\n position: absolute;\n\n border-top: 8px solid transparent;\n border-bottom: 8px solid ', ';\n border-right: 8px solid transparent;\n border-left: 8px solid transparent;\n right: 30px;\n top: -16px;\n }\n'], ['\n display: block;\n position: absolute;\n width: auto;\n min-height: 100px;\n background-color: ', ';\n box-shadow: ', ';\n right: 38px;\n margin-top: 20px;\n border-radius: 3px;\n padding: 10px 25px;\n z-index: 10;\n\n /* @TODO: shadow on arrow */\n &:before {\n content: \'\';\n display: block;\n width: 0;\n height: 0;\n position: absolute;\n\n border-top: 8px solid transparent;\n border-bottom: 8px solid ', ';\n border-right: 8px solid transparent;\n border-left: 8px solid transparent;\n right: 30px;\n top: -16px;\n }\n']); + +var _react = __webpack_require__(2); + +var _react2 = _interopRequireDefault(_react); + +var _reactRedux = __webpack_require__(10); + +var _styledComponents = __webpack_require__(5); + +var _styledComponents2 = _interopRequireDefault(_styledComponents); + +var _actions = __webpack_require__(25); + +var _styles = __webpack_require__(6); + +var _SettingOption = __webpack_require__(268); + +var _SettingOption2 = _interopRequireDefault(_SettingOption); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +function _taggedTemplateLiteral(strings, raw) { return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); } + +var PopupWrapper = _styledComponents2.default.div(_templateObject, _styles.colors.lightGray, _styles.shadows.shadow01, _styles.colors.lightGray); + +var SettingsPopup = function (_React$Component) { + _inherits(SettingsPopup, _React$Component); + + function SettingsPopup(props) { + _classCallCheck(this, SettingsPopup); + + var _this = _possibleConstructorReturn(this, (SettingsPopup.__proto__ || Object.getPrototypeOf(SettingsPopup)).call(this, props)); + + _this.state = { + hideAll: false + }; + return _this; + } + + _createClass(SettingsPopup, [{ + key: 'toggleAll', + value: function toggleAll(val) { + this.setState({ + hideAll: !val + }); + + this.props.toggleAll(val); + } + }, { + key: 'onToggle', + value: function onToggle(id, val) { + if (!val) { + this.setState({ + hideAll: false + }); + } + + this.props.onToggle(id); + } + }, { + key: 'render', + value: function render() { + var _props = this.props, + onToggle = _props.onToggle, + settings = _props.settings; + + + return _react2.default.createElement( + PopupWrapper, + null, + _react2.default.createElement(_SettingOption2.default, { + id: 'textInfo', + label: 'Text info', + value: settings.textInfo, + onToggle: this.onToggle.bind(this, 'textInfo') + }), + _react2.default.createElement(_SettingOption2.default, { + id: 'hideAll', + label: 'Hide all images', + value: this.state.hideAll, + onToggle: this.toggleAll.bind(this) + }), + _react2.default.createElement(_SettingOption2.default, { + id: 'refImage', + label: 'Reference image', + value: settings.refImage, + onToggle: this.onToggle.bind(this, 'refImage') + }), + _react2.default.createElement(_SettingOption2.default, { + id: 'testImage', + label: 'Test image', + value: settings.testImage, + onToggle: this.onToggle.bind(this, 'testImage') + }), + _react2.default.createElement(_SettingOption2.default, { + id: 'diffImage', + label: 'Diff image', + value: settings.diffImage, + onToggle: this.onToggle.bind(this, 'diffImage') + }) + ); + } + }]); + + return SettingsPopup; +}(_react2.default.Component); + +var mapStateToProps = function mapStateToProps(state) { + return { + settings: state.layoutSettings + }; +}; + +var mapDispatchToProps = function mapDispatchToProps(dispatch) { + return { + onToggle: function onToggle(id) { + dispatch((0, _actions.updateSettings)(id)); + }, + toggleAll: function toggleAll(value) { + dispatch((0, _actions.toggleAllImages)(value)); + }, + toogleTextInfo: function toogleTextInfo(value) { + dispatch((0, _actions.toggleTextInfo)(value)); + } + }; +}; + +var PopupContainer = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)(SettingsPopup); + +exports.default = PopupContainer; + +/***/ }), +/* 268 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _templateObject = _taggedTemplateLiteral(['\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: 10px 0;\n\n span {\n padding-right: 10px;\n text-align: left;\n font-family: ', ';\n color: ', ';\n font-size: 14px;\n }\n'], ['\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: 10px 0;\n\n span {\n padding-right: 10px;\n text-align: left;\n font-family: ', ';\n color: ', ';\n font-size: 14px;\n }\n']); + +var _react = __webpack_require__(2); + +var _react2 = _interopRequireDefault(_react); + +var _reactRedux = __webpack_require__(10); + +var _styledComponents = __webpack_require__(5); + +var _styledComponents2 = _interopRequireDefault(_styledComponents); + +var _reactToggleButton = __webpack_require__(269); + +var _reactToggleButton2 = _interopRequireDefault(_reactToggleButton); + +var _styles = __webpack_require__(6); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +function _taggedTemplateLiteral(strings, raw) { return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); } + +var WrapperOption = _styledComponents2.default.div(_templateObject, _styles.fonts.latoRegular, _styles.colors.primaryText); + +var SettingOption = function (_React$Component) { + _inherits(SettingOption, _React$Component); + + function SettingOption() { + _classCallCheck(this, SettingOption); + + return _possibleConstructorReturn(this, (SettingOption.__proto__ || Object.getPrototypeOf(SettingOption)).apply(this, arguments)); + } + + _createClass(SettingOption, [{ + key: 'render', + value: function render() { + var _props = this.props, + label = _props.label, + value = _props.value, + onToggle = _props.onToggle; + + + return _react2.default.createElement( + WrapperOption, + null, + _react2.default.createElement( + 'span', + null, + label + ), + _react2.default.createElement(_reactToggleButton2.default, { value: value || false, onToggle: onToggle }) + ); + } + }]); + + return SettingOption; +}(_react2.default.Component); + +exports.default = SettingOption; + +/***/ }), +/* 269 */ +/***/ (function(module, exports, __webpack_require__) { + +!function(e,t){ true?module.exports=t(__webpack_require__(2)):"function"==typeof define&&define.amd?define(["react"],t):"object"==typeof exports?exports["react-toggle-button"]=t(require("react")):e["react-toggle-button"]=t(e.React)}(this,function(e){return function(e){function t(r){if(n[r])return n[r].exports;var a=n[r]={exports:{},id:r,loaded:!1};return e[r].call(a.exports,a,a.exports,t),a.loaded=!0,a.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){e.exports=n(12)},function(e,t,n){e.exports=n(17)()},function(e,t){"use strict";function n(e){var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]="number"==typeof e[n]?e[n]:e[n].val);return t}t.__esModule=!0,t.default=n,e.exports=t.default},function(t,n){t.exports=e},function(e,t,n){(function(t){(function(){var n,r,a;"undefined"!=typeof performance&&null!==performance&&performance.now?e.exports=function(){return performance.now()}:"undefined"!=typeof t&&null!==t&&t.hrtime?(e.exports=function(){return(n()-a)/1e6},r=t.hrtime,n=function(){var e;return e=r(),1e9*e[0]+e[1]},a=n()):Date.now?(e.exports=function(){return Date.now()-a},a=Date.now()):(e.exports=function(){return(new Date).getTime()-a},a=(new Date).getTime())}).call(this)}).call(t,n(9))},function(e,t,n){(function(t){for(var r=n(19),a="undefined"==typeof window?t:window,o=["moz","webkit"],i="AnimationFrame",l=a["request"+i],u=a["cancel"+i]||a["cancelRequest"+i],s=0;!l&&s<o.length;s++)l=a[o[s]+"Request"+i],u=a[o[s]+"Cancel"+i]||a[o[s]+"CancelRequest"+i];if(!l||!u){var c=0,f=0,p=[],d=1e3/60;l=function(e){if(0===p.length){var t=r(),n=Math.max(0,d-(t-c));c=n+t,setTimeout(function(){var e=p.slice(0);p.length=0;for(var t=0;t<e.length;t++)if(!e[t].cancelled)try{e[t].callback(c)}catch(e){setTimeout(function(){throw e},0)}},Math.round(n))}return p.push({handle:++f,callback:e,cancelled:!1}),f},u=function(e){for(var t=0;t<p.length;t++)p[t].handle===e&&(p[t].cancelled=!0)}}e.exports=function(e){return l.call(a,e)},e.exports.cancel=function(){u.apply(a,arguments)},e.exports.polyfill=function(e){e||(e=a),e.requestAnimationFrame=l,e.cancelAnimationFrame=u}}).call(t,function(){return this}())},function(e,t){"use strict";function n(e){var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=0);return t}t.__esModule=!0,t.default=n,e.exports=t.default},function(e,t){"use strict";function n(e,t,n){for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){if(0!==n[r])return!1;var a="number"==typeof t[r]?t[r]:t[r].val;if(e[r]!==a)return!1}return!0}t.__esModule=!0,t.default=n,e.exports=t.default},function(e,t){"use strict";function n(e,t,n,a,o,i,l){var u=-o*(t-a),s=-i*n,c=u+s,f=n+c*e,p=t+f*e;return Math.abs(f)<l&&Math.abs(p-a)<l?(r[0]=a,r[1]=0,r):(r[0]=p,r[1]=f,r)}t.__esModule=!0,t.default=n;var r=[0,0];e.exports=t.default},function(e,t){function n(){throw new Error("setTimeout has not been defined")}function r(){throw new Error("clearTimeout has not been defined")}function a(e){if(c===setTimeout)return setTimeout(e,0);if((c===n||!c)&&setTimeout)return c=setTimeout,setTimeout(e,0);try{return c(e,0)}catch(t){try{return c.call(null,e,0)}catch(t){return c.call(this,e,0)}}}function o(e){if(f===clearTimeout)return clearTimeout(e);if((f===r||!f)&&clearTimeout)return f=clearTimeout,clearTimeout(e);try{return f(e)}catch(t){try{return f.call(null,e)}catch(t){return f.call(this,e)}}}function i(){h&&d&&(h=!1,d.length?y=d.concat(y):m=-1,y.length&&l())}function l(){if(!h){var e=a(i);h=!0;for(var t=y.length;t;){for(d=y,y=[];++m<t;)d&&d[m].run();m=-1,t=y.length}d=null,h=!1,o(e)}}function u(e,t){this.fun=e,this.array=t}function s(){}var c,f,p=e.exports={};!function(){try{c="function"==typeof setTimeout?setTimeout:n}catch(e){c=n}try{f="function"==typeof clearTimeout?clearTimeout:r}catch(e){f=r}}();var d,y=[],h=!1,m=-1;p.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];y.push(new u(e,t)),1!==y.length||h||a(l)},u.prototype.run=function(){this.fun.apply(null,this.array)},p.title="browser",p.browser=!0,p.env={},p.argv=[],p.version="",p.versions={},p.on=s,p.addListener=s,p.once=s,p.off=s,p.removeListener=s,p.removeAllListeners=s,p.emit=s,p.prependListener=s,p.prependOnceListener=s,p.listeners=function(e){return[]},p.binding=function(e){throw new Error("process.binding is not supported")},p.cwd=function(){return"/"},p.chdir=function(e){throw new Error("process.chdir is not supported")},p.umask=function(){return 0}},function(e,t){"use strict";t.__esModule=!0,t.default={noWobble:{stiffness:170,damping:26},gentle:{stiffness:120,damping:14},wobbly:{stiffness:180,damping:12},stiff:{stiffness:210,damping:20}},e.exports=t.default},function(e,t){"use strict";function n(e){var t=e;if(l[t])return l[t];t=t.replace("#",""),3===t.length&&(t=t[0]+t[0]+t[1]+t[1]+t[2]+t[2]);var n=t.match(/.{2}/g),r={r:parseInt(n[0],16),g:parseInt(n[1],16),b:parseInt(n[2],16)};return l[t]=r,r}function r(e){var t=e.indexOf("rgb")!=-1,n=e.indexOf("rgba")!=-1,r=e.match(/\d+/g);if(t&&!n)return{r:parseInt(r[0]),g:parseInt(r[1]),b:parseInt(r[2])};if(t&&n){var a="0"==r[3]?"0."+r[4]:r[3];return{r:parseInt(r[0]),g:parseInt(r[1]),b:parseInt(r[2]),a:parseFloat(a)}}return null}function a(e,t,n){var r=e.toString(16),a=t.toString(16),o=n.toString(16);return r=r.length<2?"0"+r:r,a=a.length<2?"0"+a:a,o=o.length<2?"0"+o:o,"#"+r+a+o}function o(e,t,n,r,a){var o=n-t,i=a-r,l=(e-t)/o;return r+l*i}function i(e,t,n,a,i,l){var u=void 0===a?0:a,s=void 0===i?1:i,c=r(t),f=r(n),p=Math.floor(o(e,u,s,c.r,f.r)),d=Math.floor(o(e,u,s,c.g,f.g)),y=Math.floor(o(e,u,s,c.b,f.b)),h=!1,m=null;return c.a&&f.a&&(h=!0,m=o(e,u,s,c.a,f.a)),m?"rgb("+p+","+d+","+y+","+m+")":"rgb("+p+","+d+","+y+")"}Object.defineProperty(t,"__esModule",{value:!0}),t.hexToRGB=n,t.rgbToObj=r,t.rgbToHex=a,t.mapValueInRange=o,t.interpolateColor=i;var l={}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}var a=n(13),o=r(a);e.exports=o.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var l=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},u=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=n(3),c=r(s),f=n(24),p=n(1),d=r(p),y=n(14),h=n(11),m={active:{base:"rgb(1,124,66)",hover:"rgb(1,124,66)"},inactive:{base:"rgb(65,66,68)",hover:"rgb(65,66,68)"},activeThumb:{base:"rgb(250,250,250)",hover:"rgb(250,250,250)"},inactiveThumb:{base:"rgb(250,250,250)",hover:"rgb(250,250,250)"}},v={},b=function(e){function t(e){a(this,t);var n=o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.state={isHover:!1},n}return i(t,e),u(t,[{key:"onMouseOver",value:function(){this.setState({isHover:!0})}},{key:"onMouseOut",value:function(){this.setState({isHover:!1})}},{key:"_convertToRgb",value:function(e,t){if(e.indexOf("#")!=-1){var n=(0,h.hexToRGB)(e);return"rgb("+n.r+", "+n.g+", "+n.b+")"}return e.indexOf("rgb")==-1?t:e}},{key:"checkAllColors",value:function(e){var t=this;return Object.keys(e).forEach(function(n){t.checkColors(e,n)}),e}},{key:"checkColors",value:function(e,t){e[t]?e[t].hover?(e[t].base=this._convertToRgb(e[t].base,m[t].base),e[t].hover=this._convertToRgb(e[t].hover,m[t].hover)):e[t].base?(e[t].base=this._convertToRgb(e[t].base,m[t].base),e[t].hover=e[t].base):(console.warn('Color prop should have a "base" style and a "hover" style!'),e[t]=m[t]):e[t]=m[t]}},{key:"interpolateColorWithHover",value:function(e,t,n){var r=this.props.colors;return this.checkColors(r,t),this.checkColors(r,n),this.state.isHover?{backgroundColor:(0,h.interpolateColor)(e,r[t].hover,r[n].hover,0,400)}:{backgroundColor:(0,h.interpolateColor)(e,r[t].base,r[n].base,0,400)}}},{key:"makeStyle",value:function(e,t){return this.state.isHover?l({},e,t):e}},{key:"handleClick",value:function(e){e.target!==this._input&&(e.preventDefault(),this._input.focus(),this._input.click())}},{key:"render",value:function(){var e=this,t=this.props,n=t.internalSpringSetting,r=t.internalHoverSpringSetting,a=t.value,o=t.thumbAnimateRange,i=(t.isHover,t.containerStyle),u=t.trackStyle,s=t.animateTrackStyleToggle,p=t.animateTrackStyleHover,d=t.thumbStyleHover,h=t.trackStyleHover,m=t.activeLabelStyle,v=t.activeLabelStyleHover,b=t.activeLabel,g=t.inactiveLabelStyle,S=t.inactiveLabelStyleHover,T=t.inactiveLabel,O=t.thumbStyle,k=t.animateThumbStyleHover,w=t.animateThumbStyleToggle,I=t.thumbIcon,P=t.onClick,j=t.onToggle,_=t.passThroughInputProps,x=n,M=r;return c.default.createElement(f.Motion,{style:{opacity:(0,f.spring)(a?1:0,x),left:(0,f.spring)(a?10*o[1]:10*o[0],x),colorNumber:(0,f.spring)(a?0:400,x),toggleNumber:(0,f.spring)(a?400:0,x),hoverNumber:(0,f.spring)(this.state.isHover?400:0,M)}},function(t){var n=t.opacity,r=t.left,o=t.colorNumber,f=t.hoverNumber,x=t.toggleNumber;return c.default.createElement("div",{style:l({},e.makeStyle(l({},y.reactToggle,i))),onMouseOver:e.onMouseOver.bind(e),onMouseOut:e.onMouseOut.bind(e),onClick:e.handleClick.bind(e)},c.default.createElement("div",{style:l({},e.makeStyle(l({},y.reactToggleTrack,u,e.interpolateColorWithHover(o,"active","inactive"),s(x/400)),l({},h,p(f/400))))},c.default.createElement("div",{style:l({},e.makeStyle(l({},y.reactToggleOn,m),v),{opacity:n})},b),c.default.createElement("div",{style:l({},e.makeStyle(l({},y.reactToggleOff,g),S),{opacity:1-n})},T)),c.default.createElement("div",{style:y.reactThumbCenteringContainer},c.default.createElement("div",{style:l({},e.makeStyle(l({},y.reactToggleThumb,O,e.interpolateColorWithHover(o,"activeThumb","inactiveThumb"),w(x/400)),l({},d,k(f/400))),{position:"relative",left:Math.round(r/10)})},I)),c.default.createElement("input",l({ref:function(t){e._input=t},type:"checkbox",style:y.reactToggleScreenReaderOnly,onClick:function(e){P&&P(e),j(a)},value:a},_)))})}}]),t}(s.Component);b.defaultProps={value:!1,onToggle:function(){},colors:m,passThroughInputProps:{},activeLabel:"ON",containerStyle:v,activeLabelStyle:v,activeLabelStyleHover:v,inactiveLabel:"OFF",inactiveLabelStyle:v,inactiveLabelStyleHover:v,thumbStyle:v,thumbStyleHover:v,animateThumbStyleHover:function(){return{}},animateThumbStyleToggle:function(){return{}},trackStyle:v,trackStyleHover:v,animateTrackStyleHover:function(){return{}},animateTrackStyleToggle:function(){return{}},thumbAnimateRange:[1,33],internalSpringSetting:{stiffness:180,damping:22},internalHoverSpringSetting:{stiffness:180,damping:20}},b.displayName="Toggle",t.default=b,b.propTypes={value:d.default.bool.isRequired,onToggle:d.default.func.isRequired,passThroughInputProps:d.default.object,onClick:d.default.func,colors:d.default.object,activeLabel:d.default.oneOfType([d.default.string,d.default.object]),containerStyle:d.default.object,activeLabelStyle:d.default.object,activeLabelStyleHover:d.default.object,activeThumbStyle:d.default.object,activeThumbStyleHover:d.default.object,inactiveLabel:d.default.oneOfType([d.default.string,d.default.object]),inactiveLabelStyle:d.default.object,inactiveLabelStyleHover:d.default.object,thumbStyle:d.default.object,thumbStyleHover:d.default.object,trackStyle:d.default.object,trackStyleHover:d.default.object,animateThumbStyleHover:d.default.func,animateTrackStyleHover:d.default.func,animateTrackStyleToggle:d.default.func,animateThumbStyleToggle:d.default.func,internalSpringSetting:d.default.object,internalHoverSpringSetting:d.default.object,thumbIcon:d.default.oneOfType([d.default.string,d.default.object]),thumbAnimateRange:d.default.array}},function(e,t){"use strict";function n(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}Object.defineProperty(t,"__esModule",{value:!0});var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},a=(t.reactToggle=n({display:"flex",width:52,alignItems:"center",justifyContent:"flex-start",position:"relative",cursor:"pointer",backgroundColor:"transparent",border:0,padding:0,WebkitTouchCallout:"none",WebkitUserSelect:"none",KhtmlUserSelect:"none",MozUserSelect:"none",msUserSelect:"none",userSelect:"none",WebkitTapHighlightColor:"rgba(0,0,0,0)"},"WebkitTapHighlightColor","transparent"),{fontSize:11,display:"flex",alignItems:"center",justifyContent:"center",fontFamily:"'Helvetica Neue', Helvetica, sans-serif"});t.reactToggleScreenReaderOnly={border:0,clip:"rect(0 0 0 0)",height:1,margin:-1,overflow:"hidden",padding:0,position:"absolute",width:1},t.reactToggleTrack={width:"52px",height:"20px",padding:0,borderRadius:"26px",display:"flex",alignItems:"center",justifyContent:"center"},t.reactToggleOn=r({},a,{position:"relative",color:"#FAFAFA",marginTop:"auto",marginBottom:"auto",lineHeight:0,opacity:0,width:26,height:20,left:4}),t.reactToggleOff=r({},a,{position:"relative",color:"rgba(255,255,255,0.6)",bottom:"0px",marginTop:"auto",marginBottom:"auto",paddingRight:5,lineHeight:0,width:26,height:20}),t.reactToggleThumb={width:"18px",height:"18px",display:"flex",alignSelf:"center",boxShadow:"0 0 0 1px rgba(0,0,0,0.3)",borderRadius:"50%",WebkitBoxSizing:"border-box",MozBoxSizing:"border-box",boxSizing:"border-box"},t.reactThumbCenteringContainer={position:"absolute",height:"100%",top:0,left:0,display:"flex",flex:1,alignSelf:"stretch",alignItems:"center",justifyContent:"flex-start"}},function(e,t){"use strict";function n(e){return function(){return e}}var r=function(){};r.thatReturns=n,r.thatReturnsFalse=n(!1),r.thatReturnsTrue=n(!0),r.thatReturnsNull=n(null),r.thatReturnsThis=function(){return this},r.thatReturnsArgument=function(e){return e},e.exports=r},function(e,t,n){"use strict";function r(e,t,n,r,o,i,l,u){if(a(t),!e){var s;if(void 0===t)s=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var c=[n,r,o,i,l,u],f=0;s=new Error(t.replace(/%s/g,function(){return c[f++]})),s.name="Invariant Violation"}throw s.framesToPop=1,s}}var a=function(e){};e.exports=r},function(e,t,n){"use strict";var r=n(15),a=n(16),o=n(18);e.exports=function(){function e(e,t,n,r,i,l){l!==o&&a(!1,"Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types")}function t(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t};return n.checkPropTypes=r,n.PropTypes=n,n}},function(e,t){"use strict";var n="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";e.exports=n},function(e,t,n){(function(t){(function(){var n,r,a,o,i,l;"undefined"!=typeof performance&&null!==performance&&performance.now?e.exports=function(){return performance.now()}:"undefined"!=typeof t&&null!==t&&t.hrtime?(e.exports=function(){return(n()-i)/1e6},r=t.hrtime,n=function(){var e;return e=r(),1e9*e[0]+e[1]},o=n(),l=1e9*t.uptime(),i=o-l):Date.now?(e.exports=function(){return Date.now()-a},a=Date.now()):(e.exports=function(){return(new Date).getTime()-a},a=(new Date).getTime())}).call(this)}).call(t,n(9))},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}t.__esModule=!0;var i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},l=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=n(6),s=r(u),c=n(2),f=r(c),p=n(8),d=r(p),y=n(4),h=r(y),m=n(5),v=r(m),b=n(7),g=r(b),S=n(3),T=r(S),O=n(1),k=r(O),w=1e3/60,I=function(e){function t(n){var r=this;a(this,t),e.call(this,n),this.wasAnimating=!1,this.animationID=null,this.prevTime=0,this.accumulatedTime=0,this.unreadPropStyle=null,this.clearUnreadPropStyle=function(e){var t=!1,n=r.state,a=n.currentStyle,o=n.currentVelocity,l=n.lastIdealStyle,u=n.lastIdealVelocity;for(var s in e)if(Object.prototype.hasOwnProperty.call(e,s)){var c=e[s];"number"==typeof c&&(t||(t=!0,a=i({},a),o=i({},o),l=i({},l),u=i({},u)),a[s]=c,o[s]=0,l[s]=c,u[s]=0)}t&&r.setState({currentStyle:a,currentVelocity:o,lastIdealStyle:l,lastIdealVelocity:u})},this.startAnimationIfNecessary=function(){r.animationID=v.default(function(e){var t=r.props.style;if(g.default(r.state.currentStyle,t,r.state.currentVelocity))return r.wasAnimating&&r.props.onRest&&r.props.onRest(),r.animationID=null,r.wasAnimating=!1,void(r.accumulatedTime=0);r.wasAnimating=!0;var n=e||h.default(),a=n-r.prevTime;if(r.prevTime=n,r.accumulatedTime=r.accumulatedTime+a,r.accumulatedTime>10*w&&(r.accumulatedTime=0),0===r.accumulatedTime)return r.animationID=null,void r.startAnimationIfNecessary();var o=(r.accumulatedTime-Math.floor(r.accumulatedTime/w)*w)/w,i=Math.floor(r.accumulatedTime/w),l={},u={},s={},c={};for(var f in t)if(Object.prototype.hasOwnProperty.call(t,f)){var p=t[f];if("number"==typeof p)s[f]=p,c[f]=0,l[f]=p,u[f]=0;else{for(var y=r.state.lastIdealStyle[f],m=r.state.lastIdealVelocity[f],v=0;v<i;v++){var b=d.default(w/1e3,y,m,p.val,p.stiffness,p.damping,p.precision);y=b[0],m=b[1]}var S=d.default(w/1e3,y,m,p.val,p.stiffness,p.damping,p.precision),T=S[0],O=S[1];s[f]=y+(T-y)*o,c[f]=m+(O-m)*o,l[f]=y,u[f]=m}}r.animationID=null,r.accumulatedTime-=i*w,r.setState({currentStyle:s,currentVelocity:c,lastIdealStyle:l,lastIdealVelocity:u}),r.unreadPropStyle=null,r.startAnimationIfNecessary()})},this.state=this.defaultState()}return o(t,e),l(t,null,[{key:"propTypes",value:{defaultStyle:k.default.objectOf(k.default.number),style:k.default.objectOf(k.default.oneOfType([k.default.number,k.default.object])).isRequired,children:k.default.func.isRequired,onRest:k.default.func},enumerable:!0}]),t.prototype.defaultState=function(){var e=this.props,t=e.defaultStyle,n=e.style,r=t||f.default(n),a=s.default(r);return{currentStyle:r,currentVelocity:a,lastIdealStyle:r,lastIdealVelocity:a}},t.prototype.componentDidMount=function(){this.prevTime=h.default(),this.startAnimationIfNecessary()},t.prototype.componentWillReceiveProps=function(e){null!=this.unreadPropStyle&&this.clearUnreadPropStyle(this.unreadPropStyle),this.unreadPropStyle=e.style,null==this.animationID&&(this.prevTime=h.default(),this.startAnimationIfNecessary())},t.prototype.componentWillUnmount=function(){null!=this.animationID&&(v.default.cancel(this.animationID),this.animationID=null)},t.prototype.render=function(){var e=this.props.children(this.state.currentStyle);return e&&T.default.Children.only(e)},t}(T.default.Component);t.default=I,e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function i(e,t,n){for(var r=0;r<e.length;r++)if(!S.default(e[r],t[r],n[r]))return!1;return!0}t.__esModule=!0;var l=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},u=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=n(6),c=r(s),f=n(2),p=r(f),d=n(8),y=r(d),h=n(4),m=r(h),v=n(5),b=r(v),g=n(7),S=r(g),T=n(3),O=r(T),k=n(1),w=r(k),I=1e3/60,P=function(e){function t(n){var r=this;a(this,t),e.call(this,n),this.animationID=null,this.prevTime=0,this.accumulatedTime=0,this.unreadPropStyles=null,this.clearUnreadPropStyle=function(e){for(var t=r.state,n=t.currentStyles,a=t.currentVelocities,o=t.lastIdealStyles,i=t.lastIdealVelocities,u=!1,s=0;s<e.length;s++){var c=e[s],f=!1;for(var p in c)if(Object.prototype.hasOwnProperty.call(c,p)){var d=c[p];"number"==typeof d&&(f||(f=!0,u=!0,n[s]=l({},n[s]),a[s]=l({},a[s]),o[s]=l({},o[s]),i[s]=l({},i[s])),n[s][p]=d,a[s][p]=0,o[s][p]=d,i[s][p]=0)}}u&&r.setState({currentStyles:n,currentVelocities:a,lastIdealStyles:o,lastIdealVelocities:i})},this.startAnimationIfNecessary=function(){r.animationID=b.default(function(e){var t=r.props.styles(r.state.lastIdealStyles);if(i(r.state.currentStyles,t,r.state.currentVelocities))return r.animationID=null,void(r.accumulatedTime=0);var n=e||m.default(),a=n-r.prevTime;if(r.prevTime=n,r.accumulatedTime=r.accumulatedTime+a,r.accumulatedTime>10*I&&(r.accumulatedTime=0),0===r.accumulatedTime)return r.animationID=null,void r.startAnimationIfNecessary();for(var o=(r.accumulatedTime-Math.floor(r.accumulatedTime/I)*I)/I,l=Math.floor(r.accumulatedTime/I),u=[],s=[],c=[],f=[],p=0;p<t.length;p++){var d=t[p],h={},v={},b={},g={};for(var S in d)if(Object.prototype.hasOwnProperty.call(d,S)){var T=d[S];if("number"==typeof T)h[S]=T,v[S]=0,b[S]=T,g[S]=0;else{for(var O=r.state.lastIdealStyles[p][S],k=r.state.lastIdealVelocities[p][S],w=0;w<l;w++){var P=y.default(I/1e3,O,k,T.val,T.stiffness,T.damping,T.precision);O=P[0],k=P[1]}var j=y.default(I/1e3,O,k,T.val,T.stiffness,T.damping,T.precision),_=j[0],x=j[1];h[S]=O+(_-O)*o,v[S]=k+(x-k)*o,b[S]=O,g[S]=k}}c[p]=h,f[p]=v,u[p]=b,s[p]=g}r.animationID=null,r.accumulatedTime-=l*I,r.setState({currentStyles:c,currentVelocities:f,lastIdealStyles:u,lastIdealVelocities:s}),r.unreadPropStyles=null,r.startAnimationIfNecessary()})},this.state=this.defaultState()}return o(t,e),u(t,null,[{key:"propTypes",value:{defaultStyles:w.default.arrayOf(w.default.objectOf(w.default.number)),styles:w.default.func.isRequired,children:w.default.func.isRequired},enumerable:!0}]),t.prototype.defaultState=function(){var e=this.props,t=e.defaultStyles,n=e.styles,r=t||n().map(p.default),a=r.map(function(e){return c.default(e)});return{currentStyles:r,currentVelocities:a,lastIdealStyles:r,lastIdealVelocities:a}},t.prototype.componentDidMount=function(){this.prevTime=m.default(),this.startAnimationIfNecessary()},t.prototype.componentWillReceiveProps=function(e){null!=this.unreadPropStyles&&this.clearUnreadPropStyle(this.unreadPropStyles),this.unreadPropStyles=e.styles(this.state.lastIdealStyles),null==this.animationID&&(this.prevTime=m.default(),this.startAnimationIfNecessary())},t.prototype.componentWillUnmount=function(){null!=this.animationID&&(b.default.cancel(this.animationID),this.animationID=null)},t.prototype.render=function(){var e=this.props.children(this.state.currentStyles);return e&&O.default.Children.only(e)},t}(O.default.Component);t.default=P,e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function i(e,t,n){var r=t;return null==r?e.map(function(e,t){return{key:e.key,data:e.data,style:n[t]}}):e.map(function(e,t){for(var a=0;a<r.length;a++)if(r[a].key===e.key)return{key:r[a].key,data:r[a].data,style:n[t]};return{key:e.key,data:e.data,style:n[t]}})}function l(e,t,n,r){if(r.length!==t.length)return!1;for(var a=0;a<r.length;a++)if(r[a].key!==t[a].key)return!1;for(var a=0;a<r.length;a++)if(!w.default(e[a],t[a].style,n[a]))return!1;return!0}function u(e,t,n,r,a,o,i,l,u){for(var s=b.default(r,a,function(e,r){var a=t(r);return null==a?(n({key:r.key,data:r.data}),null):w.default(o[e],a,i[e])?(n({key:r.key,data:r.data}),null):{key:r.key,data:r.data,style:a}}),c=[],f=[],d=[],y=[],h=0;h<s.length;h++){for(var m=s[h],v=null,g=0;g<r.length;g++)if(r[g].key===m.key){v=g;break}if(null==v){var S=e(m);c[h]=S,d[h]=S;var T=p.default(m.style);f[h]=T,y[h]=T}else c[h]=o[v],d[h]=l[v],f[h]=i[v],y[h]=u[v]}return[s,c,f,d,y]}t.__esModule=!0;var s=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},c=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),f=n(6),p=r(f),d=n(2),y=r(d),h=n(8),m=r(h),v=n(23),b=r(v),g=n(4),S=r(g),T=n(5),O=r(T),k=n(7),w=r(k),I=n(3),P=r(I),j=n(1),_=r(j),x=1e3/60,M=function(e){function t(n){var r=this;a(this,t),e.call(this,n),this.unmounting=!1,this.animationID=null,this.prevTime=0,this.accumulatedTime=0,this.unreadPropStyles=null,this.clearUnreadPropStyle=function(e){for(var t=u(r.props.willEnter,r.props.willLeave,r.props.didLeave,r.state.mergedPropsStyles,e,r.state.currentStyles,r.state.currentVelocities,r.state.lastIdealStyles,r.state.lastIdealVelocities),n=t[0],a=t[1],o=t[2],i=t[3],l=t[4],c=0;c<e.length;c++){var f=e[c].style,p=!1;for(var d in f)if(Object.prototype.hasOwnProperty.call(f,d)){var y=f[d];"number"==typeof y&&(p||(p=!0,a[c]=s({},a[c]),o[c]=s({},o[c]),i[c]=s({},i[c]),l[c]=s({},l[c]),n[c]={key:n[c].key,data:n[c].data,style:s({},n[c].style)}),a[c][d]=y,o[c][d]=0,i[c][d]=y,l[c][d]=0,n[c].style[d]=y)}}r.setState({currentStyles:a,currentVelocities:o,mergedPropsStyles:n,lastIdealStyles:i,lastIdealVelocities:l})},this.startAnimationIfNecessary=function(){r.unmounting||(r.animationID=O.default(function(e){if(!r.unmounting){var t=r.props.styles,n="function"==typeof t?t(i(r.state.mergedPropsStyles,r.unreadPropStyles,r.state.lastIdealStyles)):t;if(l(r.state.currentStyles,n,r.state.currentVelocities,r.state.mergedPropsStyles))return r.animationID=null,void(r.accumulatedTime=0);var a=e||S.default(),o=a-r.prevTime;if(r.prevTime=a,r.accumulatedTime=r.accumulatedTime+o,r.accumulatedTime>10*x&&(r.accumulatedTime=0),0===r.accumulatedTime)return r.animationID=null,void r.startAnimationIfNecessary();for(var s=(r.accumulatedTime-Math.floor(r.accumulatedTime/x)*x)/x,c=Math.floor(r.accumulatedTime/x),f=u(r.props.willEnter,r.props.willLeave,r.props.didLeave,r.state.mergedPropsStyles,n,r.state.currentStyles,r.state.currentVelocities,r.state.lastIdealStyles,r.state.lastIdealVelocities),p=f[0],d=f[1],y=f[2],h=f[3],v=f[4],b=0;b<p.length;b++){var g=p[b].style,T={},O={},k={},w={};for(var I in g)if(Object.prototype.hasOwnProperty.call(g,I)){var P=g[I];if("number"==typeof P)T[I]=P,O[I]=0,k[I]=P,w[I]=0;else{for(var j=h[b][I],_=v[b][I],M=0;M<c;M++){var R=m.default(x/1e3,j,_,P.val,P.stiffness,P.damping,P.precision);j=R[0],_=R[1]}var C=m.default(x/1e3,j,_,P.val,P.stiffness,P.damping,P.precision),D=C[0],H=C[1];T[I]=j+(D-j)*s,O[I]=_+(H-_)*s,k[I]=j,w[I]=_}}h[b]=k,v[b]=w,d[b]=T,y[b]=O}r.animationID=null,r.accumulatedTime-=c*x,r.setState({currentStyles:d,currentVelocities:y,lastIdealStyles:h,lastIdealVelocities:v,mergedPropsStyles:p}),r.unreadPropStyles=null,r.startAnimationIfNecessary()}}))},this.state=this.defaultState()}return o(t,e),c(t,null,[{key:"propTypes",value:{defaultStyles:_.default.arrayOf(_.default.shape({key:_.default.string.isRequired,data:_.default.any,style:_.default.objectOf(_.default.number).isRequired})),styles:_.default.oneOfType([_.default.func,_.default.arrayOf(_.default.shape({key:_.default.string.isRequired,data:_.default.any,style:_.default.objectOf(_.default.oneOfType([_.default.number,_.default.object])).isRequired}))]).isRequired,children:_.default.func.isRequired,willEnter:_.default.func,willLeave:_.default.func,didLeave:_.default.func},enumerable:!0},{key:"defaultProps",value:{willEnter:function(e){return y.default(e.style)},willLeave:function(){return null},didLeave:function(){}},enumerable:!0}]),t.prototype.defaultState=function(){var e=this.props,t=e.defaultStyles,n=e.styles,r=e.willEnter,a=e.willLeave,o=e.didLeave,i="function"==typeof n?n(t):n,l=void 0;l=null==t?i:t.map(function(e){for(var t=0;t<i.length;t++)if(i[t].key===e.key)return i[t];return e});var s=null==t?i.map(function(e){return y.default(e.style)}):t.map(function(e){return y.default(e.style)}),c=null==t?i.map(function(e){return p.default(e.style)}):t.map(function(e){return p.default(e.style)}),f=u(r,a,o,l,i,s,c,s,c),d=f[0],h=f[1],m=f[2],v=f[3],b=f[4];return{currentStyles:h,currentVelocities:m,lastIdealStyles:v,lastIdealVelocities:b,mergedPropsStyles:d}},t.prototype.componentDidMount=function(){this.prevTime=S.default(),this.startAnimationIfNecessary()},t.prototype.componentWillReceiveProps=function(e){this.unreadPropStyles&&this.clearUnreadPropStyle(this.unreadPropStyles);var t=e.styles;"function"==typeof t?this.unreadPropStyles=t(i(this.state.mergedPropsStyles,this.unreadPropStyles,this.state.lastIdealStyles)):this.unreadPropStyles=t,null==this.animationID&&(this.prevTime=S.default(),this.startAnimationIfNecessary())},t.prototype.componentWillUnmount=function(){this.unmounting=!0,null!=this.animationID&&(O.default.cancel(this.animationID),this.animationID=null)},t.prototype.render=function(){var e=i(this.state.mergedPropsStyles,this.unreadPropStyles,this.state.currentStyles),t=this.props.children(e);return t&&P.default.Children.only(t)},t}(P.default.Component);t.default=M,e.exports=t.default},function(e,t){"use strict";function n(e,t,n){for(var r={},a=0;a<e.length;a++)r[e[a].key]=a;for(var o={},a=0;a<t.length;a++)o[t[a].key]=a;for(var i=[],a=0;a<t.length;a++)i[a]=t[a];for(var a=0;a<e.length;a++)if(!Object.prototype.hasOwnProperty.call(o,e[a].key)){var l=n(a,e[a]);null!=l&&i.push(l)}return i.sort(function(e,n){var a=o[e.key],i=o[n.key],l=r[e.key],u=r[n.key];if(null!=a&&null!=i)return o[e.key]-o[n.key];if(null!=l&&null!=u)return r[e.key]-r[n.key];if(null!=a){for(var s=0;s<t.length;s++){var c=t[s].key;if(Object.prototype.hasOwnProperty.call(r,c)){if(a<o[c]&&u>r[c])return-1;if(a>o[c]&&u<r[c])return 1}}return 1}for(var s=0;s<t.length;s++){var c=t[s].key;if(Object.prototype.hasOwnProperty.call(r,c)){if(i<o[c]&&l>r[c])return 1;if(i>o[c]&&l<r[c])return-1}}return-1})}t.__esModule=!0,t.default=n,e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e.default:e}t.__esModule=!0;var a=n(20);t.Motion=r(a);var o=n(21);t.StaggeredMotion=r(o);var i=n(22);t.TransitionMotion=r(i);var l=n(26);t.spring=r(l);var u=n(10);t.presets=r(u);var s=n(2);t.stripStyle=r(s);var c=n(25); +t.reorderKeys=r(c)},function(e,t,n){"use strict";function r(){}t.__esModule=!0,t.default=r,e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function a(e,t){return o({},u,t,{val:e})}t.__esModule=!0;var o=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e};t.default=a;var i=n(10),l=r(i),u=o({},l.default.noWobble,{precision:.01});e.exports=t.default}])}); + +/***/ }), +/* 270 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _templateObject = _taggedTemplateLiteral(['\n width: 100%;\n margin: 0 auto;\n margin-top: 20px;\n z-index: 1;\n'], ['\n width: 100%;\n margin: 0 auto;\n margin-top: 20px;\n z-index: 1;\n']); + +var _react = __webpack_require__(2); + +var _react2 = _interopRequireDefault(_react); + +var _styledComponents = __webpack_require__(5); + +var _styledComponents2 = _interopRequireDefault(_styledComponents); + +var _reactRedux = __webpack_require__(10); + +var _TestCard = __webpack_require__(271); + +var _TestCard2 = _interopRequireDefault(_TestCard); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +function _taggedTemplateLiteral(strings, raw) { return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); } + +// organisms + + +var ListWrapper = _styledComponents2.default.section(_templateObject); + +var List = function (_React$Component) { + _inherits(List, _React$Component); + + function List() { + _classCallCheck(this, List); + + return _possibleConstructorReturn(this, (List.__proto__ || Object.getPrototypeOf(List)).apply(this, arguments)); + } + + _createClass(List, [{ + key: 'render', + value: function render() { + var _props = this.props, + tests = _props.tests, + settings = _props.settings; + + var onlyText = !settings.refImage && !settings.testImage && !settings.diffImage; + + return _react2.default.createElement( + ListWrapper, + null, + tests.map(function (test, i, arr) { + return _react2.default.createElement(_TestCard2.default, { + id: 'test' + i, + numId: i, + test: test, + key: i, + lastId: arr.length - 1, + onlyText: onlyText + }); + }) + ); + } + }]); + + return List; +}(_react2.default.Component); + +var mapStateToProps = function mapStateToProps(state) { + return { + tests: state.tests.filtered, + settings: state.layoutSettings + }; +}; + +var ListContainer = (0, _reactRedux.connect)(mapStateToProps)(List); + +exports.default = ListContainer; + +/***/ }), +/* 271 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _templateObject = _taggedTemplateLiteral(['\n position: relative;\n margin: 5px auto;\n padding: 10px 30px;\n background-color: ', ';\n box-shadow: ', ';\n min-height: 40px;\n break-inside: avoid;\n\n &:before {\n content: \'\';\n display: block;\n width: 8px;\n height: 100%;\n background-color: ', ';\n position: absolute;\n top: 0;\n left: 0;\n }\n @media print {\n box-shadow: none;\n }\n'], ['\n position: relative;\n margin: 5px auto;\n padding: 10px 30px;\n background-color: ', ';\n box-shadow: ', ';\n min-height: 40px;\n break-inside: avoid;\n\n &:before {\n content: \'\';\n display: block;\n width: 8px;\n height: 100%;\n background-color: ', ';\n position: absolute;\n top: 0;\n left: 0;\n }\n @media print {\n box-shadow: none;\n }\n']); + +var _react = __webpack_require__(2); + +var _react2 = _interopRequireDefault(_react); + +var _styledComponents = __webpack_require__(5); + +var _styledComponents2 = _interopRequireDefault(_styledComponents); + +var _styles = __webpack_require__(6); + +var _ErrorMessages = __webpack_require__(272); + +var _ErrorMessages2 = _interopRequireDefault(_ErrorMessages); + +var _TextDetails = __webpack_require__(106); + +var _TextDetails2 = _interopRequireDefault(_TextDetails); + +var _NavButtons = __webpack_require__(275); + +var _NavButtons2 = _interopRequireDefault(_NavButtons); + +var _TestImages = __webpack_require__(278); + +var _TestImages2 = _interopRequireDefault(_TestImages); + +var _ScrubberButton = __webpack_require__(283); + +var _ScrubberButton2 = _interopRequireDefault(_ScrubberButton); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +function _taggedTemplateLiteral(strings, raw) { return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); } + +// atoms + + +// molecules + + +var CardWrapper = _styledComponents2.default.div(_templateObject, _styles.colors.cardWhite, _styles.shadows.shadow01, function (props) { + return props.status === 'pass' ? _styles.colors.green : _styles.colors.red; +}); + +var TestCard = function (_React$Component) { + _inherits(TestCard, _React$Component); + + function TestCard() { + _classCallCheck(this, TestCard); + + return _possibleConstructorReturn(this, (TestCard.__proto__ || Object.getPrototypeOf(TestCard)).apply(this, arguments)); + } + + _createClass(TestCard, [{ + key: 'render', + value: function render() { + var _props$test = this.props.test, + info = _props$test.pair, + status = _props$test.status; + + var onlyText = this.props.onlyText; + + return _react2.default.createElement( + CardWrapper, + { id: this.props.id, status: status }, + !onlyText && _react2.default.createElement(_NavButtons2.default, { currentId: this.props.numId, lastId: this.props.lastId }), + _react2.default.createElement(_TextDetails2.default, { info: info }), + _react2.default.createElement(_TestImages2.default, { info: info, status: status }), + _react2.default.createElement(_ErrorMessages2.default, { info: info, status: status }) + ); + } + }]); + + return TestCard; +}(_react2.default.Component); + +exports.default = TestCard; + +/***/ }), +/* 272 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _templateObject = _taggedTemplateLiteral(['\n background: transparent;\n display: ', ';\n padding: 10px;\n font-family: ', ';\n color: ', ';\n'], ['\n background: transparent;\n display: ', ';\n padding: 10px;\n font-family: ', ';\n color: ', ';\n']), + _templateObject2 = _taggedTemplateLiteral(['\n word-wrap: break-word;\n font-family: monospace;\n background: rgb(251, 234, 234);\n padding: 2ex;\n color: brown;\n display: ', ';\n'], ['\n word-wrap: break-word;\n font-family: monospace;\n background: rgb(251, 234, 234);\n padding: 2ex;\n color: brown;\n display: ', ';\n']); + +var _react = __webpack_require__(2); + +var _react2 = _interopRequireDefault(_react); + +var _reactRedux = __webpack_require__(10); + +var _styledComponents = __webpack_require__(5); + +var _styledComponents2 = _interopRequireDefault(_styledComponents); + +var _styles = __webpack_require__(6); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +function _taggedTemplateLiteral(strings, raw) { return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); } + +var DetailsPanel = _styledComponents2.default.div(_templateObject, function (props) { + return !!props.display ? 'block' : 'none'; +}, _styles.fonts.latoRegular, _styles.colors.secondaryText); + +var ErrorMsg = _styledComponents2.default.p(_templateObject2, function (props) { + return !!props.display ? 'block' : 'none'; +}); + +var ErrorMessages = function (_React$Component) { + _inherits(ErrorMessages, _React$Component); + + function ErrorMessages(props) { + _classCallCheck(this, ErrorMessages); + + var _this = _possibleConstructorReturn(this, (ErrorMessages.__proto__ || Object.getPrototypeOf(ErrorMessages)).call(this, props)); + + _this.state = {}; + return _this; + } + + _createClass(ErrorMessages, [{ + key: 'render', + value: function render() { + var backstopError = this.props.info.error; + var engineError = this.props.info.engineErrorMsg; + var display = !!engineError || !!backstopError; + + return _react2.default.createElement( + DetailsPanel, + { display: display }, + _react2.default.createElement( + ErrorMsg, + { display: engineError }, + 'ENGINE ERROR: ', + engineError + ), + _react2.default.createElement( + ErrorMsg, + { display: backstopError }, + 'BACKSTOP ERROR: ', + backstopError + ) + ); + } + }]); + + return ErrorMessages; +}(_react2.default.Component); + +var mapStateToProps = function mapStateToProps(state) { + return { + settings: state.layoutSettings + }; +}; + +var ErrorMessagesContainer = (0, _reactRedux.connect)(mapStateToProps)(ErrorMessages); + +exports.default = ErrorMessagesContainer; + +/***/ }), +/* 273 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _templateObject = _taggedTemplateLiteral(['\n font-family: ', ';\n color: ', ';\n font-size: 14px;\n padding-right: 8px;\n'], ['\n font-family: ', ';\n color: ', ';\n font-size: 14px;\n padding-right: 8px;\n']), + _templateObject2 = _taggedTemplateLiteral(['\n font-family: ', ';\n color: ', ';\n font-size: 14px;\n padding-right: 20px;\n'], ['\n font-family: ', ';\n color: ', ';\n font-size: 14px;\n padding-right: 20px;\n']); + +var _react = __webpack_require__(2); + +var _react2 = _interopRequireDefault(_react); + +var _styledComponents = __webpack_require__(5); + +var _styledComponents2 = _interopRequireDefault(_styledComponents); + +var _styles = __webpack_require__(6); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +function _taggedTemplateLiteral(strings, raw) { return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); } + +var Label = _styledComponents2.default.span(_templateObject, _styles.fonts.latoRegular, _styles.colors.secondaryText); + +var Value = _styledComponents2.default.span(_templateObject2, _styles.fonts.latoBold, _styles.colors.primaryText); + +var DiffDetails = function (_React$Component) { + _inherits(DiffDetails, _React$Component); + + function DiffDetails() { + _classCallCheck(this, DiffDetails); + + return _possibleConstructorReturn(this, (DiffDetails.__proto__ || Object.getPrototypeOf(DiffDetails)).apply(this, arguments)); + } + + _createClass(DiffDetails, [{ + key: 'render', + value: function render() { + var _props = this.props, + diff = _props.diff, + suppress = _props.suppress; + + if (!diff || suppress) { + return null; + } + + return _react2.default.createElement( + 'span', + null, + _react2.default.createElement( + Label, + null, + 'diff%: ' + ), + _react2.default.createElement( + Value, + null, + diff.misMatchPercentage, + ' ' + ), + _react2.default.createElement( + Label, + null, + 'diff-x: ' + ), + _react2.default.createElement( + Value, + null, + diff.dimensionDifference.width, + ' ' + ), + _react2.default.createElement( + Label, + null, + 'diff-y: ' + ), + _react2.default.createElement( + Value, + null, + diff.dimensionDifference.height, + ' ' + ) + ); + } + }]); + + return DiffDetails; +}(_react2.default.Component); + +exports.default = DiffDetails; + +/***/ }), +/* 274 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _templateObject = _taggedTemplateLiteral(['\n font-family: ', ';\n color: ', ';\n font-size: 14px;\n padding-right: 8px;\n'], ['\n font-family: ', ';\n color: ', ';\n font-size: 14px;\n padding-right: 8px;\n']), + _templateObject2 = _taggedTemplateLiteral(['\n font-family: ', ';\n color: ', ';\n font-size: 14px;\n padding-right: 20px;\n'], ['\n font-family: ', ';\n color: ', ';\n font-size: 14px;\n padding-right: 20px;\n']), + _templateObject3 = _taggedTemplateLiteral(['\n &::before {\n content: ', ';\n margin: ', ';\n }\n'], ['\n &::before {\n content: ', ';\n margin: ', ';\n }\n']); + +var _react = __webpack_require__(2); + +var _react2 = _interopRequireDefault(_react); + +var _styledComponents = __webpack_require__(5); + +var _styledComponents2 = _interopRequireDefault(_styledComponents); + +var _styles = __webpack_require__(6); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +function _taggedTemplateLiteral(strings, raw) { return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); } + +var Label = _styledComponents2.default.span(_templateObject, _styles.fonts.latoRegular, _styles.colors.secondaryText); + +var Value = _styledComponents2.default.span(_templateObject2, _styles.fonts.latoBold, _styles.colors.primaryText); + +var Link = _styledComponents2.default.a(_templateObject3, function (props) { + return props.withSeperator ? '"|"' : ''; +}, function (props) { + return props.withSeperator ? '0 10px' : ''; +}); + +var DiffDetails = function (_React$Component) { + _inherits(DiffDetails, _React$Component); + + function DiffDetails() { + _classCallCheck(this, DiffDetails); + + return _possibleConstructorReturn(this, (DiffDetails.__proto__ || Object.getPrototypeOf(DiffDetails)).apply(this, arguments)); + } + + _createClass(DiffDetails, [{ + key: 'render', + value: function render() { + var _props = this.props, + url = _props.url, + referenceUrl = _props.referenceUrl; + + return _react2.default.createElement( + 'span', + null, + _react2.default.createElement( + Label, + null, + 'url: ' + ), + _react2.default.createElement( + Value, + null, + _react2.default.createElement( + Link, + { href: url, target: '_blank' }, + 'test' + ), + referenceUrl && _react2.default.createElement( + Link, + { withSeperator: true, href: referenceUrl, target: '_blank' }, + 'reference' + ) + ) + ); + } + }]); + + return DiffDetails; +}(_react2.default.Component); + +exports.default = DiffDetails; + +/***/ }), +/* 275 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _templateObject = _taggedTemplateLiteral(['\n display: flex;\n position: absolute;\n top: 15px;\n right: 10px;\n\n a {\n display: inline-block;\n }\n'], ['\n display: flex;\n position: absolute;\n top: 15px;\n right: 10px;\n\n a {\n display: inline-block;\n }\n']), + _templateObject2 = _taggedTemplateLiteral(['\n background-color: ', ';\n background-image: url(', ');\n background-repeat: no-repeat;\n background-position: center center;\n color: ', ';\n border-radius: 3px;\n height: 32px;\n width: 32px;\n margin: 0 5px;\n transform: ', ';\n\n &:hover {\n cursor: pointer;\n }\n'], ['\n background-color: ', ';\n background-image: url(', ');\n background-repeat: no-repeat;\n background-position: center center;\n color: ', ';\n border-radius: 3px;\n height: 32px;\n width: 32px;\n margin: 0 5px;\n transform: ', ';\n\n &:hover {\n cursor: pointer;\n }\n']); + +var _react = __webpack_require__(2); + +var _react2 = _interopRequireDefault(_react); + +var _styledComponents = __webpack_require__(5); + +var _styledComponents2 = _interopRequireDefault(_styledComponents); + +var _jump = __webpack_require__(276); + +var _jump2 = _interopRequireDefault(_jump); + +var _styles = __webpack_require__(6); + +var _iconDown = __webpack_require__(277); + +var _iconDown2 = _interopRequireDefault(_iconDown); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +function _taggedTemplateLiteral(strings, raw) { return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); } + +var Wrapper = _styledComponents2.default.div(_templateObject); + +var ButtonNav = _styledComponents2.default.div(_templateObject2, _styles.colors.lightGray, _iconDown2.default, _styles.colors.secondaryText, function (props) { + return props.prev ? 'rotate(0)' : 'rotate(180deg)'; +}); + +var NavButtons = function (_React$Component) { + _inherits(NavButtons, _React$Component); + + function NavButtons() { + _classCallCheck(this, NavButtons); + + return _possibleConstructorReturn(this, (NavButtons.__proto__ || Object.getPrototypeOf(NavButtons)).apply(this, arguments)); + } + + _createClass(NavButtons, [{ + key: 'nextTest', + value: function nextTest() { + var dest = '#test' + (this.props.currentId + 1); + this.jumpTo(dest); + } + }, { + key: 'prevTest', + value: function prevTest() { + var dest = '#test' + (this.props.currentId - 1); + this.jumpTo(dest); + } + }, { + key: 'jumpTo', + value: function jumpTo(dest) { + (0, _jump2.default)(dest, { + duration: 0, + offset: -100 + }); + } + }, { + key: 'render', + value: function render() { + var _props = this.props, + currentId = _props.currentId, + lastId = _props.lastId; + + + return _react2.default.createElement( + Wrapper, + null, + currentId !== 0 && _react2.default.createElement(ButtonNav, { onClick: this.prevTest.bind(this), prev: true }), + lastId !== currentId && _react2.default.createElement(ButtonNav, { onClick: this.nextTest.bind(this) }) + ); + } + }]); + + return NavButtons; +}(_react2.default.Component); + +exports.default = NavButtons; + +/***/ }), +/* 276 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); +// Robert Penner's easeInOutQuad + +// find the rest of his easing functions here: http://robertpenner.com/easing/ +// find them exported for ES6 consumption here: https://github.com/jaxgeller/ez.js + +var easeInOutQuad = function easeInOutQuad(t, b, c, d) { + t /= d / 2; + if (t < 1) return c / 2 * t * t + b; + t--; + return -c / 2 * (t * (t - 2) - 1) + b; +}; + +var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { + return typeof obj; +} : function (obj) { + return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; +}; + +var jumper = function jumper() { + // private variable cache + // no variables are created during a jump, preventing memory leaks + + var element = void 0; // element to scroll to (node) + + var start = void 0; // where scroll starts (px) + var stop = void 0; // where scroll stops (px) + + var offset = void 0; // adjustment from the stop position (px) + var easing = void 0; // easing function (function) + var a11y = void 0; // accessibility support flag (boolean) + + var distance = void 0; // distance of scroll (px) + var duration = void 0; // scroll duration (ms) + + var timeStart = void 0; // time scroll started (ms) + var timeElapsed = void 0; // time spent scrolling thus far (ms) + + var next = void 0; // next scroll position (px) + + var callback = void 0; // to call when done scrolling (function) + + // scroll position helper + + function location() { + return window.scrollY || window.pageYOffset; + } + + // element offset helper + + function top(element) { + return element.getBoundingClientRect().top + start; + } + + // rAF loop helper + + function loop(timeCurrent) { + // store time scroll started, if not started already + if (!timeStart) { + timeStart = timeCurrent; + } + + // determine time spent scrolling so far + timeElapsed = timeCurrent - timeStart; + + // calculate next scroll position + next = easing(timeElapsed, start, distance, duration); + + // scroll to it + window.scrollTo(0, next); + + // check progress + timeElapsed < duration ? window.requestAnimationFrame(loop) // continue scroll loop + : done(); // scrolling is done + } + + // scroll finished helper + + function done() { + // account for rAF time rounding inaccuracies + window.scrollTo(0, start + distance); + + // if scrolling to an element, and accessibility is enabled + if (element && a11y) { + // add tabindex indicating programmatic focus + element.setAttribute('tabindex', '-1'); + + // focus the element + element.focus(); + } + + // if it exists, fire the callback + if (typeof callback === 'function') { + callback(); + } + + // reset time for next jump + timeStart = false; + } + + // API + + function jump(target) { + var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + + // resolve options, or use defaults + duration = options.duration || 1000; + offset = options.offset || 0; + callback = options.callback; // "undefined" is a suitable default, and won't be called + easing = options.easing || easeInOutQuad; + a11y = options.a11y || false; + + // cache starting position + start = location(); + + // resolve target + switch (typeof target === 'undefined' ? 'undefined' : _typeof(target)) { + // scroll from current position + case 'number': + element = undefined; // no element to scroll to + a11y = false; // make sure accessibility is off + stop = start + target; + break; + + // scroll to element (node) + // bounding rect is relative to the viewport + case 'object': + element = target; + stop = top(element); + break; + + // scroll to element (selector) + // bounding rect is relative to the viewport + case 'string': + element = document.querySelector(target); + stop = top(element); + break; + } + + // resolve scroll distance, accounting for offset + distance = stop - start + offset; + + // resolve duration + switch (_typeof(options.duration)) { + // number in ms + case 'number': + duration = options.duration; + break; + + // function passed the distance of the scroll + case 'function': + duration = options.duration(distance); + break; + } + + // start the loop + window.requestAnimationFrame(loop); + } + + // expose only the jump method + return jump; +}; + +// export singleton + +var singleton = jumper(); + +/* harmony default export */ __webpack_exports__["default"] = (singleton); + + +/***/ }), +/* 277 */ +/***/ (function(module, exports) { + +module.exports = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAICAYAAADwdn+XAAAABGdBTUEAALGPC/xhBQAAAPdJREFUKBVjZMABEhISOB4/frwcJC0rKxu5YMGCH9iUMmIT9PPz4/369eum////P2NkZPwPVCPNzc3tt2nTps/o6pnQBXx9fUWAmvcBxa/t3bs3Zs+ePbEgNkgMJIeuHsUAJycn6W/fvh0C2roTqDkbZDsIQ9k7QXIgNciGMMM47u7uKkAn7wfyZwI1tMLEYfS9e/f2KSkpcQD5M9TU1LbevXv3HUgObICzs7Pev3//9gD5TUDNU0ES2MD9+/ePAw35AlS7CEjvAfJfMgI1WwIVrwfiHKDmNdg0oosB9YQAxaYAcSAoDKYxMTHFEasZZBhILUgPSC8A/Zdrp6hdBGQAAAAASUVORK5CYII=" + +/***/ }), +/* 278 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _templateObject = _taggedTemplateLiteral(['\n position: relative;\n display: flex;\n'], ['\n position: relative;\n display: flex;\n']); + +var _react = __webpack_require__(2); + +var _react2 = _interopRequireDefault(_react); + +var _styledComponents = __webpack_require__(5); + +var _styledComponents2 = _interopRequireDefault(_styledComponents); + +var _reactRedux = __webpack_require__(10); + +var _actions = __webpack_require__(25); + +var _styles = __webpack_require__(6); + +var _ImagePreview = __webpack_require__(279); + +var _ImagePreview2 = _interopRequireDefault(_ImagePreview); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +function _taggedTemplateLiteral(strings, raw) { return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); } + +// atoms + + +var ImagesWrapper = _styledComponents2.default.div(_templateObject); + +var TestImages = function (_React$Component) { + _inherits(TestImages, _React$Component); + + function TestImages(props) { + _classCallCheck(this, TestImages); + + var _this = _possibleConstructorReturn(this, (TestImages.__proto__ || Object.getPrototypeOf(TestImages)).call(this, props)); + + _this.state = { + images: [] + }; + return _this; + } + + _createClass(TestImages, [{ + key: 'onImageClick', + value: function onImageClick(img) { + var openModal = this.props.openModal; + + this.props.info.targetImg = img; + openModal(this.props.info); + } + }, { + key: 'render', + value: function render() { + var _this2 = this; + + var _props$info = this.props.info, + reference = _props$info.reference, + test = _props$info.test; + var _props = this.props, + status = _props.status, + settings = _props.settings; + + + this.state.images = [{ + id: 'refImage', + label: 'Reference', + src: reference, + visible: settings.refImage + }, { + id: 'testImage', + label: 'Test', + src: test, + visible: settings.testImage + }]; + + if (status !== 'pass') { + this.state.images.push({ + id: 'diffImage', + label: 'Diff', + src: this.props.info.diffImage, + visible: settings.diffImage + }); + } + + return _react2.default.createElement( + ImagesWrapper, + null, + this.state.images.map(function (img, i) { + return _react2.default.createElement(_ImagePreview2.default, { + src: img.src, + id: img.id, + label: img.label, + onClick: _this2.onImageClick.bind(_this2, img), + key: i, + hidden: !img.visible + }); + }) + ); + } + }]); + + return TestImages; +}(_react2.default.Component); + +var mapStateToProps = function mapStateToProps(state) { + return { + settings: state.layoutSettings + }; +}; + +var mapDispatchToProps = function mapDispatchToProps(dispatch) { + return { + openModal: function openModal(value) { + dispatch((0, _actions.openModal)(value)); + } + }; +}; + +var TestImagesContainer = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)(TestImages); + +exports.default = TestImagesContainer; + +/***/ }), +/* 279 */ +/***/ (function(module, exports, __webpack_require__) { + +"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 _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _templateObject = _taggedTemplateLiteral(['\n width: auto;\n max-width: 100%;\n max-height: ', ';\n\n &:hover {\n cursor: pointer;\n }\n'], ['\n width: auto;\n max-width: 100%;\n max-height: ', ';\n\n &:hover {\n cursor: pointer;\n }\n']), + _templateObject2 = _taggedTemplateLiteral(['\n flex: 1 1 auto;\n padding: 0 25px;\n padding-top: ', ';\n text-align: center;\n'], ['\n flex: 1 1 auto;\n padding: 0 25px;\n padding-top: ', ';\n text-align: center;\n']), + _templateObject3 = _taggedTemplateLiteral(['\n text-align: center;\n font-family: ', ';\n color: ', ';\n display: block;\n margin: 0 auto;\n text-transform: uppercase;\n padding: 5px 0;\n padding-bottom: 15px;\n font-size: 12px;\n'], ['\n text-align: center;\n font-family: ', ';\n color: ', ';\n display: block;\n margin: 0 auto;\n text-transform: uppercase;\n padding: 5px 0;\n padding-bottom: 15px;\n font-size: 12px;\n']); + +var _react = __webpack_require__(2); + +var _react2 = _interopRequireDefault(_react); + +var _reactRedux = __webpack_require__(10); + +var _reactVisibilitySensor = __webpack_require__(280); + +var _reactVisibilitySensor2 = _interopRequireDefault(_reactVisibilitySensor); + +var _styledComponents = __webpack_require__(5); + +var _styledComponents2 = _interopRequireDefault(_styledComponents); + +var _styles = __webpack_require__(6); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +function _taggedTemplateLiteral(strings, raw) { return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); } + +var BASE64_PNG_STUB = 'data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7'; + +var Image = _styledComponents2.default.img(_templateObject, function (props) { + return props.settings.textInfo ? '150px' : '400px'; +}); + +var Wrapper = _styledComponents2.default.div(_templateObject2, function (props) { + return props.withText ? '10px' : '20px'; +}); + +var Label = _styledComponents2.default.span(_templateObject3, _styles.fonts.latoRegular, _styles.colors.secondaryText); + +var visibilitySensorProps = { + offset: { + bottom: -400 + }, + partialVisibility: true +}; + +var ImagePreview = function (_React$Component) { + _inherits(ImagePreview, _React$Component); + + function ImagePreview(props) { + _classCallCheck(this, ImagePreview); + + var _this = _possibleConstructorReturn(this, (ImagePreview.__proto__ || Object.getPrototypeOf(ImagePreview)).call(this, props)); + + _this.state = { + isVisible: false + }; + _this.onLoadError = _this.onLoadError.bind(_this); + _this.onChange = _this.onChange.bind(_this); + return _this; + } + + _createClass(ImagePreview, [{ + key: 'onChange', + value: function onChange(isVisible) { + if (isVisible && !this.state.isVisible) { + console.log('setting state to visible'); + this.setState({ + isVisible: true + }); + } + } + }, { + key: 'onLoadError', + value: function onLoadError() { + this.setState({ + imgLoadError: true + }); + } + }, { + key: 'render', + value: function render() { + var _props = this.props, + hidden = _props.hidden, + settings = _props.settings, + label = _props.label, + src = _props.src; + + if (!src || src === '../..' || this.state.imgLoadError) { + src = BASE64_PNG_STUB; + } + if (this.state.isVisible) { + return _react2.default.createElement( + Wrapper, + { hidden: hidden, withText: settings.textInfo }, + _react2.default.createElement( + Label, + null, + label + ), + _react2.default.createElement(Image, _extends({}, this.props, { src: src, onError: this.onLoadError })) + ); + } + return _react2.default.createElement(_reactVisibilitySensor2.default, _extends({}, visibilitySensorProps, { onChange: this.onChange })); + } + }]); + + return ImagePreview; +}(_react2.default.Component); + +var mapStateToProps = function mapStateToProps(state) { + return { + settings: state.layoutSettings + }; +}; + +var ImagePreviewContainer = (0, _reactRedux.connect)(mapStateToProps)(ImagePreview); + +exports.default = ImagePreviewContainer; + +/***/ }), +/* 280 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var React = __webpack_require__(2); +var ReactDOM = __webpack_require__(32); +var PropTypes = __webpack_require__(18); +var createReactClass = __webpack_require__(281); +var isVisibleWithOffset = __webpack_require__(282) + +var containmentPropType = PropTypes.any; + +if (typeof window !== 'undefined') { + containmentPropType = PropTypes.instanceOf(window.Element); +} + +function throttle (callback, limit) { + var wait = false; + return function () { + if (!wait) { + wait = true; + setTimeout(function () { + callback(); + wait = false; + }, limit); + } + } +} + +function debounce(func, wait) { + var timeout; + return function() { + var context = this, args = arguments; + var later = function() { + timeout = null; + func.apply(context, args); + }; + clearTimeout(timeout); + timeout = setTimeout(later, wait); + }; +} + +module.exports = createReactClass({ + displayName: 'VisibilitySensor', + + propTypes: { + onChange: PropTypes.func, + active: PropTypes.bool, + partialVisibility: PropTypes.oneOfType([ + PropTypes.bool, + PropTypes.oneOf(['top', 'right', 'bottom', 'left']), + ]), + delayedCall: PropTypes.bool, + offset: PropTypes.oneOfType([ + PropTypes.shape({ + top: PropTypes.number, + left: PropTypes.number, + bottom: PropTypes.number, + right: PropTypes.number + }), + // deprecated offset property + PropTypes.shape({ + direction: PropTypes.oneOf(['top', 'right', 'bottom', 'left']), + value: PropTypes.number + }) + ]), + scrollCheck: PropTypes.bool, + scrollDelay: PropTypes.number, + scrollThrottle: PropTypes.number, + resizeCheck: PropTypes.bool, + resizeDelay: PropTypes.number, + resizeThrottle: PropTypes.number, + intervalCheck: PropTypes.bool, + intervalDelay: PropTypes.number, + containment: containmentPropType, + children: PropTypes.oneOfType([ + PropTypes.element, + PropTypes.func, + ]), + minTopValue: PropTypes.number, + }, + + getDefaultProps: function () { + return { + active: true, + partialVisibility: false, + minTopValue: 0, + scrollCheck: false, + scrollDelay: 250, + scrollThrottle: -1, + resizeCheck: false, + resizeDelay: 250, + resizeThrottle: -1, + intervalCheck: true, + intervalDelay: 100, + delayedCall: false, + offset: {}, + containment: null, + children: React.createElement('span') + }; + }, + + getInitialState: function () { + return { + isVisible: null, + visibilityRect: {} + }; + }, + + componentDidMount: function () { + this.node = ReactDOM.findDOMNode(this); + if (this.props.active) { + this.startWatching(); + } + }, + + componentWillUnmount: function () { + this.stopWatching(); + }, + + componentWillReceiveProps: function (nextProps) { + if (nextProps.active && !this.props.active) { + this.setState(this.getInitialState()); + this.startWatching(); + } else if (!nextProps.active) { + this.stopWatching(); + } + }, + + getContainer: function () { + return this.props.containment || window; + }, + + addEventListener: function (target, event, delay, throttle) { + if (!this.debounceCheck) { + this.debounceCheck = {}; + } + + var timeout; + var func; + + var later = function () { + timeout = null; + this.check(); + }.bind(this); + + if (throttle > -1) { + func = function () { + if (!timeout) { + timeout = setTimeout(later, throttle || 0); + } + }; + } else { + func = function () { + clearTimeout(timeout); + timeout = setTimeout(later, delay || 0); + }; + } + + var info = { + target: target, + fn: func, + getLastTimeout: function () { + return timeout; + }, + }; + + target.addEventListener(event, info.fn); + this.debounceCheck[event] = info; + }, + + startWatching: function () { + if (this.debounceCheck || this.interval) { return; } + + if (this.props.intervalCheck) { + this.interval = setInterval(this.check, this.props.intervalDelay); + } + + if (this.props.scrollCheck) { + this.addEventListener( + this.getContainer(), + 'scroll', + this.props.scrollDelay, + this.props.scrollThrottle + ); + } + + if (this.props.resizeCheck) { + this.addEventListener( + window, + 'resize', + this.props.resizeDelay, + this.props.resizeThrottle + ); + } + + // if dont need delayed call, check on load ( before the first interval fires ) + !this.props.delayedCall && this.check(); + }, + + stopWatching: function () { + if (this.debounceCheck) { + // clean up event listeners and their debounce callers + for (var debounceEvent in this.debounceCheck) { + if (this.debounceCheck.hasOwnProperty(debounceEvent)) { + var debounceInfo = this.debounceCheck[debounceEvent]; + + clearTimeout(debounceInfo.getLastTimeout()); + debounceInfo.target.removeEventListener( + debounceEvent, debounceInfo.fn + ); + + this.debounceCheck[debounceEvent] = null; + } + } + } + this.debounceCheck = null; + + if (this.interval) { this.interval = clearInterval(this.interval); } + }, + + /** + * Check if the element is within the visible viewport + */ + check: function () { + var el = this.node; + var rect; + var containmentRect; + // if the component has rendered to null, dont update visibility + if (!el) { + return this.state; + } + + rect = el.getBoundingClientRect(); + + if (this.props.containment) { + var containmentDOMRect = this.props.containment.getBoundingClientRect(); + containmentRect = { + top: containmentDOMRect.top, + left: containmentDOMRect.left, + bottom: containmentDOMRect.bottom, + right: containmentDOMRect.right, + } + } else { + containmentRect = { + top: 0, + left: 0, + bottom: window.innerHeight || document.documentElement.clientHeight, + right: window.innerWidth || document.documentElement.clientWidth + }; + } + + // Check if visibility is wanted via offset? + var offset = this.props.offset || {}; + var hasValidOffset = typeof offset === 'object'; + if (hasValidOffset) { + containmentRect.top += offset.top || 0; + containmentRect.left += offset.left || 0; + containmentRect.bottom -= offset.bottom || 0; + containmentRect.right -= offset.right || 0; + } + + var visibilityRect = { + top: rect.top >= containmentRect.top, + left: rect.left >= containmentRect.left, + bottom: rect.bottom <= containmentRect.bottom, + right: rect.right <= containmentRect.right + }; + + var isVisible = ( + visibilityRect.top && + visibilityRect.left && + visibilityRect.bottom && + visibilityRect.right + ); + + // check for partial visibility + if (this.props.partialVisibility) { + var partialVisible = + rect.top <= containmentRect.bottom && rect.bottom >= containmentRect.top && + rect.left <= containmentRect.right && rect.right >= containmentRect.left; + + // account for partial visibility on a single edge + if (typeof this.props.partialVisibility === 'string') { + partialVisible = visibilityRect[this.props.partialVisibility] + } + + // if we have minimum top visibility set by props, lets check, if it meets the passed value + // so if for instance element is at least 200px in viewport, then show it. + isVisible = this.props.minTopValue + ? partialVisible && rect.top <= (containmentRect.bottom - this.props.minTopValue) + : partialVisible + } + + // Deprecated options for calculating offset. + if (typeof offset.direction === 'string' && + typeof offset.value === 'number') { + console.warn('[notice] offset.direction and offset.value have been deprecated. They still work for now, but will be removed in next major version. Please upgrade to the new syntax: { %s: %d }', offset.direction, offset.value) + + isVisible = isVisibleWithOffset(offset, rect, containmentRect); + } + + var state = this.state; + // notify the parent when the value changes + if (this.state.isVisible !== isVisible) { + state = { + isVisible: isVisible, + visibilityRect: visibilityRect + }; + this.setState(state); + if (this.props.onChange) this.props.onChange(isVisible, visibilityRect); + } + + return state; + }, + + render: function () { + if (this.props.children instanceof Function) { + return this.props.children({ + isVisible: this.state.isVisible, + visibilityRect: this.state.visibilityRect, + }); + } + return React.Children.only(this.props.children); + } +}); + + +/***/ }), +/* 281 */ +/***/ (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 React = __webpack_require__(2); +var factory = __webpack_require__(69); + +if (typeof React === 'undefined') { + throw Error( + 'create-react-class could not find the React object. If you are using script tags, ' + + 'make sure that React is being loaded before create-react-class.' + ); +} + +// Hack to grab NoopUpdateQueue from isomorphic React +var ReactNoopUpdateQueue = new React.Component().updater; + +module.exports = factory( + React.Component, + React.isValidElement, + ReactNoopUpdateQueue +); + + +/***/ }), +/* 282 */ +/***/ (function(module, exports) { + +// Tell whether the rect is visible, given an offset +// +// return: boolean +module.exports = function (offset, rect, containmentRect) { + var offsetDir = offset.direction; + var offsetVal = offset.value; + + // Rules for checking different kind of offsets. In example if the element is + // 90px below viewport and offsetTop is 100, it is considered visible. + switch (offsetDir) { + case 'top': + return ((containmentRect.top + offsetVal) < rect.top) && + (containmentRect.bottom > rect.bottom) && + (containmentRect.left < rect.left) && + (containmentRect.right > rect.right); + + case 'left': + return ((containmentRect.left + offsetVal) < rect.left) && + (containmentRect.bottom > rect.bottom) && + (containmentRect.top < rect.top) && + (containmentRect.right > rect.right); + + case 'bottom': + return ((containmentRect.bottom - offsetVal) > rect.bottom) && + (containmentRect.left < rect.left) && + (containmentRect.right > rect.right) && + (containmentRect.top < rect.top); + + case 'right': + return ((containmentRect.right - offsetVal) > rect.right) && + (containmentRect.left < rect.left) && + (containmentRect.top < rect.top) && + (containmentRect.bottom > rect.bottom); + } +} + + +/***/ }), +/* 283 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _templateObject = _taggedTemplateLiteral(['\n display: block;\n'], ['\n display: block;\n']), + _templateObject2 = _taggedTemplateLiteral(['\n position: absolute;\n top: 15px;\n right: ', ';\n padding: 10px 20px;\n background-color: ', ';\n color: ', ';\n border-radius: 3px;\n text-transform: uppercase;\n font-family: ', ';\n text-align: center;\n font-size: 12px;\n border: none;\n\n &:focus {\n outline: none;\n }\n\n &:hover {\n cursor: pointer;\n }\n \n @media print {\n display: none;\n }\n'], ['\n position: absolute;\n top: 15px;\n right: ', ';\n padding: 10px 20px;\n background-color: ', ';\n color: ', ';\n border-radius: 3px;\n text-transform: uppercase;\n font-family: ', ';\n text-align: center;\n font-size: 12px;\n border: none;\n\n &:focus {\n outline: none;\n }\n\n &:hover {\n cursor: pointer;\n }\n \n @media print {\n display: none;\n }\n']); + +var _react = __webpack_require__(2); + +var _react2 = _interopRequireDefault(_react); + +var _reactRedux = __webpack_require__(10); + +var _styledComponents = __webpack_require__(5); + +var _styledComponents2 = _interopRequireDefault(_styledComponents); + +var _actions = __webpack_require__(25); + +var _styles = __webpack_require__(6); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +function _taggedTemplateLiteral(strings, raw) { return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); } + +// styles & icons + + +var Wrapper = _styledComponents2.default.div(_templateObject); + +var ButtonSD = _styledComponents2.default.button(_templateObject2, function (props) { + return props.onlyText ? '10px' : '115px'; +}, _styles.colors.lightGray, _styles.colors.secondaryText, _styles.fonts.latoRegular); + +var ScrubberButton = function (_React$Component) { + _inherits(ScrubberButton, _React$Component); + + function ScrubberButton(props) { + _classCallCheck(this, ScrubberButton); + + return _possibleConstructorReturn(this, (ScrubberButton.__proto__ || Object.getPrototypeOf(ScrubberButton)).call(this, props)); + } + + _createClass(ScrubberButton, [{ + key: 'onClick', + value: function onClick() { + var openModal = this.props.openModal; + + openModal(this.props.info); + } + }, { + key: 'render', + value: function render() { + return _react2.default.createElement( + Wrapper, + null, + _react2.default.createElement( + ButtonSD, + { + onClick: this.onClick.bind(this), + onlyText: this.props.onlyText + }, + 'SHOW DIFFS' + ) + ); + } + }]); + + return ScrubberButton; +}(_react2.default.Component); + +var mapStateToProps = function mapStateToProps(state) { + return { + scrubber: state.scrubber + }; +}; + +var mapDispatchToProps = function mapDispatchToProps(dispatch) { + return { + openModal: function openModal(value) { + dispatch((0, _actions.openModal)(value)); + } + }; +}; + +var ScrubberButtonContainer = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)(ScrubberButton); + +exports.default = ScrubberButtonContainer; + +/***/ }), +/* 284 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _templateObject = _taggedTemplateLiteral(['\n display: block;\n'], ['\n display: block;\n']), + _templateObject2 = _taggedTemplateLiteral(['\n display: flex;\n justify-content: space-between;\n position: relative;\n padding: 15px;\n align-items: center;\n'], ['\n display: flex;\n justify-content: space-between;\n position: relative;\n padding: 15px;\n align-items: center;\n']), + _templateObject3 = _taggedTemplateLiteral(['\n margin-right: 5px;\n width: 30px;\n height: 30px;\n background-image: url(', ');\n background-size: 100%;\n background-repeat: no-repeat;\n background-color: transparent;\n border: none;\n\n &:focus {\n outline: none;\n }\n\n &:hover {\n cursor: pointer;\n }\n'], ['\n margin-right: 5px;\n width: 30px;\n height: 30px;\n background-image: url(', ');\n background-size: 100%;\n background-repeat: no-repeat;\n background-color: transparent;\n border: none;\n\n &:focus {\n outline: none;\n }\n\n &:hover {\n cursor: pointer;\n }\n']); + +var _react = __webpack_require__(2); + +var _react2 = _interopRequireDefault(_react); + +var _reactRedux = __webpack_require__(10); + +var _styledComponents = __webpack_require__(5); + +var _styledComponents2 = _interopRequireDefault(_styledComponents); + +var _reactModal = __webpack_require__(285); + +var _reactModal2 = _interopRequireDefault(_reactModal); + +var _actions = __webpack_require__(25); + +var _styles = __webpack_require__(6); + +var _close = __webpack_require__(293); + +var _close2 = _interopRequireDefault(_close); + +var _Logo = __webpack_require__(105); + +var _Logo2 = _interopRequireDefault(_Logo); + +var _TextDetails = __webpack_require__(106); + +var _TextDetails2 = _interopRequireDefault(_TextDetails); + +var _ImageScrubber = __webpack_require__(294); + +var _ImageScrubber2 = _interopRequireDefault(_ImageScrubber); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +function _taggedTemplateLiteral(strings, raw) { return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); } + +// styles & icons + + +// atoms + + +var Wrapper = _styledComponents2.default.div(_templateObject); + +var ModalHeader = _styledComponents2.default.div(_templateObject2); + +var ButtonClose = _styledComponents2.default.button(_templateObject3, _close2.default); + +var customStyles = { + content: { + width: '100%', + height: '100%', + top: '0', + left: '0', + border: 'none', + borderRadius: 'none', + padding: '0px', + boxSizing: 'border-box' + } +}; + +var ScrubberModal = function (_React$Component) { + _inherits(ScrubberModal, _React$Component); + + function ScrubberModal(props) { + _classCallCheck(this, ScrubberModal); + + return _possibleConstructorReturn(this, (ScrubberModal.__proto__ || Object.getPrototypeOf(ScrubberModal)).call(this, props)); + } + + _createClass(ScrubberModal, [{ + key: 'render', + value: function render() { + var _props$scrubber$test = this.props.scrubber.test, + refImage = _props$scrubber$test.reference, + testImage = _props$scrubber$test.test, + diffImage = _props$scrubber$test.diffImage, + divergedImage = _props$scrubber$test.divergedImage; + var _props$scrubber = this.props.scrubber, + visible = _props$scrubber.visible, + mode = _props$scrubber.mode, + position = _props$scrubber.position, + testImageType = _props$scrubber.testImageType, + scrubberModalMode = _props$scrubber.scrubberModalMode; + var _props = this.props, + closeModal = _props.closeModal, + showScrubberTestImage = _props.showScrubberTestImage, + showScrubberRefImage = _props.showScrubberRefImage, + showScrubberDiffImage = _props.showScrubberDiffImage, + showScrubberDivergedImage = _props.showScrubberDivergedImage, + showScrubber = _props.showScrubber; + + + return _react2.default.createElement( + Wrapper, + null, + _react2.default.createElement( + _reactModal2.default, + { + isOpen: visible + /* onAfterOpen={this.afterOpenModal} */ + , onRequestClose: closeModal, + style: customStyles, + contentLabel: 'Example Modal' + }, + _react2.default.createElement( + ModalHeader, + null, + _react2.default.createElement(_Logo2.default, null), + _react2.default.createElement(ButtonClose, { onClick: closeModal }) + ), + _react2.default.createElement(_ImageScrubber2.default, { + scrubberModalMode: scrubberModalMode, + testImageType: testImageType, + testImage: testImage, + refImage: refImage, + diffImage: diffImage, + divergedImage: divergedImage, + position: position, + showButtons: diffImage && diffImage.length > 0, + showScrubberTestImage: showScrubberTestImage, + showScrubberRefImage: showScrubberRefImage, + showScrubberDiffImage: showScrubberDiffImage, + showScrubberDivergedImage: showScrubberDivergedImage, + showScrubber: showScrubber + }) + ) + ); + } + }]); + + return ScrubberModal; +}(_react2.default.Component); + +var mapStateToProps = function mapStateToProps(state) { + return { + scrubber: state.scrubber + }; +}; + +var mapDispatchToProps = function mapDispatchToProps(dispatch) { + return { + closeModal: function closeModal() { + dispatch((0, _actions.closeModal)(false)); + }, + showScrubberTestImage: function showScrubberTestImage(val) { + dispatch((0, _actions.showScrubberTestImage)(val)); + }, + showScrubberRefImage: function showScrubberRefImage(val) { + dispatch((0, _actions.showScrubberRefImage)(val)); + }, + showScrubberDiffImage: function showScrubberDiffImage(val) { + dispatch((0, _actions.showScrubberDiffImage)(val)); + }, + showScrubberDivergedImage: function showScrubberDivergedImage(val) { + dispatch((0, _actions.showScrubberDivergedImage)(val)); + }, + showScrubber: function showScrubber(val) { + dispatch((0, _actions.showScrubber)(val)); + } + }; +}; + +var ScrubberModalContainer = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)(ScrubberModal); + +exports.default = ScrubberModalContainer; + +/***/ }), +/* 285 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _Modal = __webpack_require__(286); + +var _Modal2 = _interopRequireDefault(_Modal); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +exports.default = _Modal2.default; +module.exports = exports["default"]; + +/***/ }), +/* 286 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.bodyOpenClassName = exports.portalClassName = undefined; + +var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _react = __webpack_require__(2); + +var _react2 = _interopRequireDefault(_react); + +var _reactDom = __webpack_require__(32); + +var _reactDom2 = _interopRequireDefault(_reactDom); + +var _propTypes = __webpack_require__(18); + +var _propTypes2 = _interopRequireDefault(_propTypes); + +var _ModalPortal = __webpack_require__(287); + +var _ModalPortal2 = _interopRequireDefault(_ModalPortal); + +var _ariaAppHider = __webpack_require__(108); + +var ariaAppHider = _interopRequireWildcard(_ariaAppHider); + +var _safeHTMLElement = __webpack_require__(110); + +var _safeHTMLElement2 = _interopRequireDefault(_safeHTMLElement); + +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 }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var portalClassName = exports.portalClassName = "ReactModalPortal"; +var bodyOpenClassName = exports.bodyOpenClassName = "ReactModal__Body--open"; + +var isReact16 = _reactDom2.default.createPortal !== undefined; +var createPortal = isReact16 ? _reactDom2.default.createPortal : _reactDom2.default.unstable_renderSubtreeIntoContainer; + +function getParentElement(parentSelector) { + return parentSelector(); +} + +var Modal = function (_Component) { + _inherits(Modal, _Component); + + function Modal() { + var _ref; + + var _temp, _this, _ret; + + _classCallCheck(this, Modal); + + for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = Modal.__proto__ || Object.getPrototypeOf(Modal)).call.apply(_ref, [this].concat(args))), _this), _this.removePortal = function () { + !isReact16 && _reactDom2.default.unmountComponentAtNode(_this.node); + var parent = getParentElement(_this.props.parentSelector); + parent.removeChild(_this.node); + }, _this.portalRef = function (ref) { + _this.portal = ref; + }, _this.renderPortal = function (props) { + var portal = createPortal(_this, _react2.default.createElement(_ModalPortal2.default, _extends({ defaultStyles: Modal.defaultStyles }, props)), _this.node); + _this.portalRef(portal); + }, _temp), _possibleConstructorReturn(_this, _ret); + } + + _createClass(Modal, [{ + key: "componentDidMount", + value: function componentDidMount() { + if (!_safeHTMLElement.canUseDOM) return; + + if (!isReact16) { + this.node = document.createElement("div"); + } + this.node.className = this.props.portalClassName; + + var parent = getParentElement(this.props.parentSelector); + parent.appendChild(this.node); + + !isReact16 && this.renderPortal(this.props); + } + }, { + key: "componentWillReceiveProps", + value: function componentWillReceiveProps(newProps) { + if (!_safeHTMLElement.canUseDOM) return; + var isOpen = newProps.isOpen; + // Stop unnecessary renders if modal is remaining closed + + if (!this.props.isOpen && !isOpen) return; + + var currentParent = getParentElement(this.props.parentSelector); + var newParent = getParentElement(newProps.parentSelector); + + if (newParent !== currentParent) { + currentParent.removeChild(this.node); + newParent.appendChild(this.node); + } + + !isReact16 && this.renderPortal(newProps); + } + }, { + key: "componentWillUpdate", + value: function componentWillUpdate(newProps) { + if (!_safeHTMLElement.canUseDOM) return; + if (newProps.portalClassName !== this.props.portalClassName) { + this.node.className = newProps.portalClassName; + } + } + }, { + key: "componentWillUnmount", + value: function componentWillUnmount() { + if (!_safeHTMLElement.canUseDOM || !this.node || !this.portal) return; + + var state = this.portal.state; + var now = Date.now(); + var closesAt = state.isOpen && this.props.closeTimeoutMS && (state.closesAt || now + this.props.closeTimeoutMS); + + if (closesAt) { + if (!state.beforeClose) { + this.portal.closeWithTimeout(); + } + + setTimeout(this.removePortal, closesAt - now); + } else { + this.removePortal(); + } + } + }, { + key: "render", + value: function render() { + if (!_safeHTMLElement.canUseDOM || !isReact16) { + return null; + } + + if (!this.node && isReact16) { + this.node = document.createElement("div"); + } + + return createPortal(_react2.default.createElement(_ModalPortal2.default, _extends({ + ref: this.portalRef, + defaultStyles: Modal.defaultStyles + }, this.props)), this.node); + } + }], [{ + key: "setAppElement", + value: function setAppElement(element) { + ariaAppHider.setElement(element); + } + + /* eslint-disable react/no-unused-prop-types */ + + /* eslint-enable react/no-unused-prop-types */ + + }]); + + return Modal; +}(_react.Component); + +Modal.propTypes = { + isOpen: _propTypes2.default.bool.isRequired, + style: _propTypes2.default.shape({ + content: _propTypes2.default.object, + overlay: _propTypes2.default.object + }), + portalClassName: _propTypes2.default.string, + bodyOpenClassName: _propTypes2.default.string, + className: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.shape({ + base: _propTypes2.default.string.isRequired, + afterOpen: _propTypes2.default.string.isRequired, + beforeClose: _propTypes2.default.string.isRequired + })]), + overlayClassName: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.shape({ + base: _propTypes2.default.string.isRequired, + afterOpen: _propTypes2.default.string.isRequired, + beforeClose: _propTypes2.default.string.isRequired + })]), + appElement: _propTypes2.default.instanceOf(_safeHTMLElement2.default), + onAfterOpen: _propTypes2.default.func, + onRequestClose: _propTypes2.default.func, + closeTimeoutMS: _propTypes2.default.number, + ariaHideApp: _propTypes2.default.bool, + shouldFocusAfterRender: _propTypes2.default.bool, + shouldCloseOnOverlayClick: _propTypes2.default.bool, + shouldReturnFocusAfterClose: _propTypes2.default.bool, + parentSelector: _propTypes2.default.func, + aria: _propTypes2.default.object, + role: _propTypes2.default.string, + contentLabel: _propTypes2.default.string, + shouldCloseOnEsc: _propTypes2.default.bool +}; +Modal.defaultProps = { + isOpen: false, + portalClassName: portalClassName, + bodyOpenClassName: bodyOpenClassName, + ariaHideApp: true, + closeTimeoutMS: 0, + shouldFocusAfterRender: true, + shouldCloseOnEsc: true, + shouldCloseOnOverlayClick: true, + shouldReturnFocusAfterClose: true, + parentSelector: function parentSelector() { + return document.body; + } +}; +Modal.defaultStyles = { + overlay: { + position: "fixed", + top: 0, + left: 0, + right: 0, + bottom: 0, + backgroundColor: "rgba(255, 255, 255, 0.75)" + }, + content: { + position: "absolute", + top: "40px", + left: "40px", + right: "40px", + bottom: "40px", + border: "1px solid #ccc", + background: "#fff", + overflow: "auto", + WebkitOverflowScrolling: "touch", + borderRadius: "4px", + outline: "none", + padding: "20px" + } +}; +exports.default = Modal; + +/***/ }), +/* 287 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(process) { + +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 _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _react = __webpack_require__(2); + +var _react2 = _interopRequireDefault(_react); + +var _propTypes = __webpack_require__(18); + +var _propTypes2 = _interopRequireDefault(_propTypes); + +var _focusManager = __webpack_require__(288); + +var focusManager = _interopRequireWildcard(_focusManager); + +var _scopeTab = __webpack_require__(289); + +var _scopeTab2 = _interopRequireDefault(_scopeTab); + +var _ariaAppHider = __webpack_require__(108); + +var ariaAppHider = _interopRequireWildcard(_ariaAppHider); + +var _refCount = __webpack_require__(109); + +var refCount = _interopRequireWildcard(_refCount); + +var _bodyClassList = __webpack_require__(291); + +var bodyClassList = _interopRequireWildcard(_bodyClassList); + +var _safeHTMLElement = __webpack_require__(110); + +var _safeHTMLElement2 = _interopRequireDefault(_safeHTMLElement); + +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 }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +// so that our CSS is statically analyzable +var CLASS_NAMES = { + overlay: "ReactModal__Overlay", + content: "ReactModal__Content" +}; + +var TAB_KEY = 9; +var ESC_KEY = 27; + +var ModalPortal = function (_Component) { + _inherits(ModalPortal, _Component); + + function ModalPortal(props) { + _classCallCheck(this, ModalPortal); + + var _this = _possibleConstructorReturn(this, (ModalPortal.__proto__ || Object.getPrototypeOf(ModalPortal)).call(this, props)); + + _this.setFocusAfterRender = function (focus) { + _this.focusAfterRender = _this.props.shouldFocusAfterRender && focus; + }; + + _this.setOverlayRef = function (overlay) { + _this.overlay = overlay; + }; + + _this.setContentRef = function (content) { + _this.content = content; + }; + + _this.afterClose = function () { + var _this$props = _this.props, + appElement = _this$props.appElement, + ariaHideApp = _this$props.ariaHideApp; + + // Remove body class + + bodyClassList.remove(_this.props.bodyOpenClassName); + + // Reset aria-hidden attribute if all modals have been removed + if (ariaHideApp && refCount.totalCount() < 1) { + ariaAppHider.show(appElement); + } + + if (_this.props.shouldFocusAfterRender) { + if (_this.props.shouldReturnFocusAfterClose) { + focusManager.returnFocus(); + focusManager.teardownScopedFocus(); + } else { + focusManager.popWithoutFocus(); + } + } + }; + + _this.open = function () { + _this.beforeOpen(); + if (_this.state.afterOpen && _this.state.beforeClose) { + clearTimeout(_this.closeTimer); + _this.setState({ beforeClose: false }); + } else { + if (_this.props.shouldFocusAfterRender) { + focusManager.setupScopedFocus(_this.node); + focusManager.markForFocusLater(); + } + + _this.setState({ isOpen: true }, function () { + _this.setState({ afterOpen: true }); + + if (_this.props.isOpen && _this.props.onAfterOpen) { + _this.props.onAfterOpen(); + } + }); + } + }; + + _this.close = function () { + if (_this.props.closeTimeoutMS > 0) { + _this.closeWithTimeout(); + } else { + _this.closeWithoutTimeout(); + } + }; + + _this.focusContent = function () { + return _this.content && !_this.contentHasFocus() && _this.content.focus(); + }; + + _this.closeWithTimeout = function () { + var closesAt = Date.now() + _this.props.closeTimeoutMS; + _this.setState({ beforeClose: true, closesAt: closesAt }, function () { + _this.closeTimer = setTimeout(_this.closeWithoutTimeout, _this.state.closesAt - Date.now()); + }); + }; + + _this.closeWithoutTimeout = function () { + _this.setState({ + beforeClose: false, + isOpen: false, + afterOpen: false, + closesAt: null + }, _this.afterClose); + }; + + _this.handleKeyDown = function (event) { + if (event.keyCode === TAB_KEY) { + (0, _scopeTab2.default)(_this.content, event); + } + + if (_this.props.shouldCloseOnEsc && event.keyCode === ESC_KEY) { + event.stopPropagation(); + _this.requestClose(event); + } + }; + + _this.handleOverlayOnClick = function (event) { + if (_this.shouldClose === null) { + _this.shouldClose = true; + } + + if (_this.shouldClose && _this.props.shouldCloseOnOverlayClick) { + if (_this.ownerHandlesClose()) { + _this.requestClose(event); + } else { + _this.focusContent(); + } + } + _this.shouldClose = null; + _this.moveFromContentToOverlay = null; + }; + + _this.handleOverlayOnMouseUp = function () { + if (_this.moveFromContentToOverlay === null) { + _this.shouldClose = false; + } + if (_this.props.shouldCloseOnOverlayClick) { + _this.shouldClose = true; + } + }; + + _this.handleContentOnMouseUp = function () { + _this.shouldClose = false; + }; + + _this.handleOverlayOnMouseDown = function (event) { + if (!_this.props.shouldCloseOnOverlayClick && event.target == _this.overlay) { + event.preventDefault(); + } + _this.moveFromContentToOverlay = false; + }; + + _this.handleContentOnClick = function () { + _this.shouldClose = false; + }; + + _this.handleContentOnMouseDown = function () { + _this.shouldClose = false; + _this.moveFromContentToOverlay = false; + }; + + _this.requestClose = function (event) { + return _this.ownerHandlesClose() && _this.props.onRequestClose(event); + }; + + _this.ownerHandlesClose = function () { + return _this.props.onRequestClose; + }; + + _this.shouldBeClosed = function () { + return !_this.state.isOpen && !_this.state.beforeClose; + }; + + _this.contentHasFocus = function () { + return document.activeElement === _this.content || _this.content.contains(document.activeElement); + }; + + _this.buildClassName = function (which, additional) { + var classNames = (typeof additional === "undefined" ? "undefined" : _typeof(additional)) === "object" ? additional : { + base: CLASS_NAMES[which], + afterOpen: CLASS_NAMES[which] + "--after-open", + beforeClose: CLASS_NAMES[which] + "--before-close" + }; + var className = classNames.base; + if (_this.state.afterOpen) { + className = className + " " + classNames.afterOpen; + } + if (_this.state.beforeClose) { + className = className + " " + classNames.beforeClose; + } + return typeof additional === "string" && additional ? className + " " + additional : className; + }; + + _this.ariaAttributes = function (items) { + return Object.keys(items).reduce(function (acc, name) { + acc["aria-" + name] = items[name]; + return acc; + }, {}); + }; + + _this.state = { + afterOpen: false, + beforeClose: false + }; + + _this.shouldClose = null; + _this.moveFromContentToOverlay = null; + return _this; + } + + _createClass(ModalPortal, [{ + key: "componentDidMount", + value: function componentDidMount() { + // Focus needs to be set when mounting and already open + if (this.props.isOpen) { + this.setFocusAfterRender(true); + this.open(); + } + } + }, { + key: "componentWillReceiveProps", + value: function componentWillReceiveProps(newProps) { + if (process.env.NODE_ENV !== "production") { + if (newProps.bodyOpenClassName !== this.props.bodyOpenClassName) { + // eslint-disable-next-line no-console + console.warn('React-Modal: "bodyOpenClassName" prop has been modified. ' + "This may cause unexpected behavior when multiple modals are open."); + } + } + // Focus only needs to be set once when the modal is being opened + if (!this.props.isOpen && newProps.isOpen) { + this.setFocusAfterRender(true); + this.open(); + } else if (this.props.isOpen && !newProps.isOpen) { + this.close(); + } + } + }, { + key: "componentDidUpdate", + value: function componentDidUpdate() { + if (this.focusAfterRender) { + this.focusContent(); + this.setFocusAfterRender(false); + } + } + }, { + key: "componentWillUnmount", + value: function componentWillUnmount() { + this.afterClose(); + clearTimeout(this.closeTimer); + } + }, { + key: "beforeOpen", + value: function beforeOpen() { + var _props = this.props, + appElement = _props.appElement, + ariaHideApp = _props.ariaHideApp, + bodyOpenClassName = _props.bodyOpenClassName; + // Add body class + + bodyClassList.add(bodyOpenClassName); + // Add aria-hidden to appElement + if (ariaHideApp) { + ariaAppHider.hide(appElement); + } + } + + // Don't steal focus from inner elements + + }, { + key: "render", + value: function render() { + var _props2 = this.props, + className = _props2.className, + overlayClassName = _props2.overlayClassName, + defaultStyles = _props2.defaultStyles; + + var contentStyles = className ? {} : defaultStyles.content; + var overlayStyles = overlayClassName ? {} : defaultStyles.overlay; + + return this.shouldBeClosed() ? null : _react2.default.createElement( + "div", + { + ref: this.setOverlayRef, + className: this.buildClassName("overlay", overlayClassName), + style: _extends({}, overlayStyles, this.props.style.overlay), + onClick: this.handleOverlayOnClick, + onMouseDown: this.handleOverlayOnMouseDown, + onMouseUp: this.handleOverlayOnMouseUp, + "aria-modal": "true" + }, + _react2.default.createElement( + "div", + _extends({ + ref: this.setContentRef, + style: _extends({}, contentStyles, this.props.style.content), + className: this.buildClassName("content", className), + tabIndex: "-1", + onKeyDown: this.handleKeyDown, + onMouseDown: this.handleContentOnMouseDown, + onMouseUp: this.handleContentOnMouseUp, + onClick: this.handleContentOnClick, + role: this.props.role, + "aria-label": this.props.contentLabel + }, this.ariaAttributes(this.props.aria || {})), + this.props.children + ) + ); + } + }]); + + return ModalPortal; +}(_react.Component); + +ModalPortal.defaultProps = { + style: { + overlay: {}, + content: {} + } +}; +ModalPortal.propTypes = { + isOpen: _propTypes2.default.bool.isRequired, + defaultStyles: _propTypes2.default.shape({ + content: _propTypes2.default.object, + overlay: _propTypes2.default.object + }), + style: _propTypes2.default.shape({ + content: _propTypes2.default.object, + overlay: _propTypes2.default.object + }), + className: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.object]), + overlayClassName: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.object]), + bodyOpenClassName: _propTypes2.default.string, + ariaHideApp: _propTypes2.default.bool, + appElement: _propTypes2.default.instanceOf(_safeHTMLElement2.default), + onAfterOpen: _propTypes2.default.func, + onRequestClose: _propTypes2.default.func, + closeTimeoutMS: _propTypes2.default.number, + shouldFocusAfterRender: _propTypes2.default.bool, + shouldCloseOnOverlayClick: _propTypes2.default.bool, + shouldReturnFocusAfterClose: _propTypes2.default.bool, + role: _propTypes2.default.string, + contentLabel: _propTypes2.default.string, + aria: _propTypes2.default.object, + children: _propTypes2.default.node, + shouldCloseOnEsc: _propTypes2.default.bool +}; +exports.default = ModalPortal; +module.exports = exports["default"]; +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) + +/***/ }), +/* 288 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.handleBlur = handleBlur; +exports.handleFocus = handleFocus; +exports.markForFocusLater = markForFocusLater; +exports.returnFocus = returnFocus; +exports.popWithoutFocus = popWithoutFocus; +exports.setupScopedFocus = setupScopedFocus; +exports.teardownScopedFocus = teardownScopedFocus; + +var _tabbable = __webpack_require__(107); + +var _tabbable2 = _interopRequireDefault(_tabbable); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +var focusLaterElements = []; +var modalElement = null; +var needToFocus = false; + +function handleBlur() { + needToFocus = true; +} + +function handleFocus() { + if (needToFocus) { + needToFocus = false; + if (!modalElement) { + return; + } + // need to see how jQuery shims document.on('focusin') so we don't need the + // setTimeout, firefox doesn't support focusin, if it did, we could focus + // the element outside of a setTimeout. Side-effect of this implementation + // is that the document.body gets focus, and then we focus our element right + // after, seems fine. + setTimeout(function () { + if (modalElement.contains(document.activeElement)) { + return; + } + var el = (0, _tabbable2.default)(modalElement)[0] || modalElement; + el.focus(); + }, 0); + } +} + +function markForFocusLater() { + focusLaterElements.push(document.activeElement); +} + +/* eslint-disable no-console */ +function returnFocus() { + var toFocus = null; + try { + if (focusLaterElements.length !== 0) { + toFocus = focusLaterElements.pop(); + toFocus.focus(); + } + return; + } catch (e) { + console.warn(["You tried to return focus to", toFocus, "but it is not in the DOM anymore"].join(" ")); + } +} +/* eslint-enable no-console */ + +function popWithoutFocus() { + focusLaterElements.length > 0 && focusLaterElements.pop(); +} + +function setupScopedFocus(element) { + modalElement = element; + + if (window.addEventListener) { + window.addEventListener("blur", handleBlur, false); + document.addEventListener("focus", handleFocus, true); + } else { + window.attachEvent("onBlur", handleBlur); + document.attachEvent("onFocus", handleFocus); + } +} + +function teardownScopedFocus() { + modalElement = null; + + if (window.addEventListener) { + window.removeEventListener("blur", handleBlur); + document.removeEventListener("focus", handleFocus); + } else { + window.detachEvent("onBlur", handleBlur); + document.detachEvent("onFocus", handleFocus); + } +} + +/***/ }), +/* 289 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = scopeTab; + +var _tabbable = __webpack_require__(107); + +var _tabbable2 = _interopRequireDefault(_tabbable); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function scopeTab(node, event) { + var tabbable = (0, _tabbable2.default)(node); + + if (!tabbable.length) { + // Do nothing, since there are no elements that can receive focus. + event.preventDefault(); + return; + } + + var shiftKey = event.shiftKey; + var head = tabbable[0]; + var tail = tabbable[tabbable.length - 1]; + + // proceed with default browser behavior + if (node === document.activeElement) { + return; + } + + var target; + if (tail === document.activeElement && !shiftKey) { + target = head; + } + + if (head === document.activeElement && shiftKey) { + target = tail; + } + + if (target) { + event.preventDefault(); + target.focus(); + return; + } + + // Safari radio issue. + // + // Safari does not move the focus to the radio button, + // so we need to force it to really walk through all elements. + // + // This is very error prune, since we are trying to guess + // if it is a safari browser from the first occurence between + // chrome or safari. + // + // The chrome user agent contains the first ocurrence + // as the 'chrome/version' and later the 'safari/version'. + var checkSafari = /(\bChrome\b|\bSafari\b)\//.exec(navigator.userAgent); + var isSafariDesktop = checkSafari != null && checkSafari[1] != "Chrome" && /\biPod\b|\biPad\b/g.exec(navigator.userAgent) == null; + + // If we are not in safari desktop, let the browser control + // the focus + if (!isSafariDesktop) return; + + var x = tabbable.indexOf(document.activeElement); + + if (x > -1) { + x += shiftKey ? -1 : 1; + } + + event.preventDefault(); + + tabbable[x].focus(); +} +module.exports = exports["default"]; + +/***/ }), +/* 290 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(process) {/** + * Copyright 2014-2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + */ + + + +/** + * 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 = function() {}; + +if (process.env.NODE_ENV !== 'production') { + warning = function(condition, format, args) { + var len = arguments.length; + args = new Array(len > 2 ? len - 2 : 0); + for (var key = 2; key < len; key++) { + args[key - 2] = arguments[key]; + } + if (format === undefined) { + throw new Error( + '`warning(condition, format, ...args)` requires a warning ' + + 'message argument' + ); + } + + if (format.length < 10 || (/^[s\W]*$/).test(format)) { + throw new Error( + 'The warning format should be able to uniquely identify this ' + + 'warning. Please, use a more descriptive format than: ' + format + ); + } + + if (!condition) { + var argIndex = 0; + var message = 'Warning: ' + + format.replace(/%s/g, function() { + return args[argIndex++]; + }); + if (typeof console !== 'undefined') { + console.error(message); + } + try { + // 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) {} + } + }; +} + +module.exports = warning; + +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) + +/***/ }), +/* 291 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.add = add; +exports.remove = remove; + +var _refCount = __webpack_require__(109); + +var refCount = _interopRequireWildcard(_refCount); + +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 add(bodyClass) { + // Increment class(es) on refCount tracker and add class(es) to body + bodyClass.split(" ").map(refCount.add).forEach(function (className) { + return document.body.classList.add(className); + }); +} + +function remove(bodyClass) { + var classListMap = refCount.get(); + // Decrement class(es) from the refCount tracker + // and remove unused class(es) from body + bodyClass.split(" ").map(refCount.remove).filter(function (className) { + return classListMap[className] === 0; + }).forEach(function (className) { + return document.body.classList.remove(className); + }); +} + +/***/ }), +/* 292 */ +/***/ (function(module, exports, __webpack_require__) { + +var __WEBPACK_AMD_DEFINE_RESULT__;/*! + Copyright (c) 2015 Jed Watson. + Based on code that is Copyright 2013-2015, Facebook, Inc. + All rights reserved. +*/ +/* global define */ + +(function () { + 'use strict'; + + var canUseDOM = !!( + typeof window !== 'undefined' && + window.document && + window.document.createElement + ); + + var ExecutionEnvironment = { + + canUseDOM: canUseDOM, + + canUseWorkers: typeof Worker !== 'undefined', + + canUseEventListeners: + canUseDOM && !!(window.addEventListener || window.attachEvent), + + canUseViewport: canUseDOM && !!window.screen + + }; + + if (true) { + !(__WEBPACK_AMD_DEFINE_RESULT__ = (function () { + return ExecutionEnvironment; + }).call(exports, __webpack_require__, exports, module), + __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); + } else if (typeof module !== 'undefined' && module.exports) { + module.exports = ExecutionEnvironment; + } else { + window.ExecutionEnvironment = ExecutionEnvironment; + } + +}()); + + +/***/ }), +/* 293 */ +/***/ (function(module, exports) { + +module.exports = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAABGdBTUEAALGPC/xhBQAAAzZJREFUeAHlm89q20AQhyv5lBAo+FJCn6GF3nostm+GkIv7kPEll1yMMbnm2pBHKL0ZAkkKubjzE96yUSxpZ2dm9ccLQmtpd2e+T5JtVmz2gcpisTjZbrc/qXq22+2uN5vNbxwfWplMJp+zLLskrqfxeHy1XC7/Znv4OwL/AmBq8IhG6/X6Fp+HUmaz2Q9cXNo+gokYf5GE7zmuvIPHCTSg7QYd8HkIZQ9/4+DBRPWvYM+pflaGpJOnQ5HgwZ+WOcGeE+g1bvvyySFIqIMHM9hzfOHhmaftZUgSGuBfwFywO+iADvO+fDFyWDInAHtOR79fl+pchjcC+i6BCw/edwL6KiEGvlJA3yTEwtcK6IsECXyjgK5LkMIHCeiqBA34YAFdk6AFzxLQFQma8GwBbUvQho8S0JYEC/hoAaklWMGLBKSSYAkvFmAtwRpeRYCVhBTwagK0JaSCVxWgJSElvLoAqYTU8CYCYiW0AW8mgCuhLXhTAaES0A7vIDANj7pfMFNNm+lk7MEpMT8Jab3p6mL8tuAR21wAgtRJwPlySXHlXcwkAhAsVEJKeOSVTECIhNTwyAkvR4+6JLsDjvoRCIV3t2LKR8H8EaiD34M+O3C3x88i/hugrztmtTd9BALg5wADbFv/BcwEhMC71+2cttp3gomAGKCYPhoy1AVIQCR9Y2WoCtAA0BiDI0NNgGbimmM1yVARYJGwxZiHZIgFWCZqObaTIRKQIkHrGNECrBNzVwh7y1hRAiwT8sH9ulVMtgCrRHzYqrpFbJYAiwSqYKuOa+cQLEA7cBVgyHHNXIIEaAYMAQxpo5VTowCtQCFQ3DYaudUK0AjAheK2l+ZYKUA6MBdE0l6S60EBkgElIJK+sTm/ExA7kCR5rb4xub8REDOAVvJa43AZ/gvgdtRK2GIcDkshgNPBImGLMZuYRqPRZLVa3WX75aQPNC1drKj0k0n5gsKPq1VvkPCH4nzLCfJyiPCQiGl34pvjQpalEvM5Hb/Am6Gn8kl0QEc3b18+36fPDRJec6yiJth7B0V1LJ4eBLxjggQ888SF274oVMfi6aviS/BYls9Pp9NPBH5Bt/8r4LF8/h8bZl9WdQoucwAAAABJRU5ErkJggg==" + +/***/ }), +/* 294 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _templateObject = _taggedTemplateLiteral(['\n margin: 1em;\n padding: 10px 16px;\n height: 32px;\n background-color: ', ';\n color: ', ';\n border-radius: 3px;\n text-transform: uppercase;\n font-family: ', ';\n text-align: center;\n font-size: 12px;\n border: none;\n box-shadow: ', ';\n\n transition: all 0.3s ease-in-out;\n\n &:focus {\n outline: none;\n }\n\n &:hover {\n cursor: pointer;\n box-shadow: ', ';\n }\n'], ['\n margin: 1em;\n padding: 10px 16px;\n height: 32px;\n background-color: ', ';\n color: ', ';\n border-radius: 3px;\n text-transform: uppercase;\n font-family: ', ';\n text-align: center;\n font-size: 12px;\n border: none;\n box-shadow: ', ';\n\n transition: all 0.3s ease-in-out;\n\n &:focus {\n outline: none;\n }\n\n &:hover {\n cursor: pointer;\n box-shadow: ', ';\n }\n']), + _templateObject2 = _taggedTemplateLiteral(['\n cursor: ew-resize;\n padding-bottom: 20px;\n overflow: hidden;\n\n .testImage {\n opacity: 1;\n }\n\n .testImage,\n .refImage {\n max-width: 100%;\n }\n'], ['\n cursor: ew-resize;\n padding-bottom: 20px;\n overflow: hidden;\n\n .testImage {\n opacity: 1;\n }\n\n .testImage,\n .refImage {\n max-width: 100%;\n }\n']), + _templateObject3 = _taggedTemplateLiteral(['\n display: flex;\n justify-content: center;\n padding-bottom: 20px;\n'], ['\n display: flex;\n justify-content: center;\n padding-bottom: 20px;\n']), + _templateObject4 = _taggedTemplateLiteral(['\n height: 100%;\n width: 5px;\n background: ', ';\n transform: translate(-2.5px, 0);\n'], ['\n height: 100%;\n width: 5px;\n background: ', ';\n transform: translate(-2.5px, 0);\n']); + +var _react = __webpack_require__(2); + +var _react2 = _interopRequireDefault(_react); + +var _reactRedux = __webpack_require__(10); + +var _styledComponents = __webpack_require__(5); + +var _styledComponents2 = _interopRequireDefault(_styledComponents); + +var _backstopTwentytwenty = __webpack_require__(295); + +var _backstopTwentytwenty2 = _interopRequireDefault(_backstopTwentytwenty); + +var _styles = __webpack_require__(6); + +var _diverged = __webpack_require__(296); + +var _diverged2 = _interopRequireDefault(_diverged); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +function _taggedTemplateLiteral(strings, raw) { return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); } + +var BASE64_PNG_STUB = 'data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7'; + +var ScrubberViewBtn = _styledComponents2.default.button(_templateObject, function (props) { + return props.selected ? _styles.colors.secondaryText : _styles.colors.lightGray; +}, function (props) { + return props.selected ? _styles.colors.lightGray : _styles.colors.secondaryText; +}, _styles.fonts.latoRegular, function (props) { + return props.selected ? 'none' : _styles.shadows.shadow01; +}, function (props) { + return !props.selected ? _styles.shadows.shadow02 : ''; +}); + +var Wrapper = _styledComponents2.default.div(_templateObject2); + +var WrapTitle = _styledComponents2.default.div(_templateObject3); + +var SliderBar = _styledComponents2.default.div(_templateObject4, _styles.colors.red); + +var ImageScrubber = function (_React$Component) { + _inherits(ImageScrubber, _React$Component); + + function ImageScrubber(props) { + _classCallCheck(this, ImageScrubber); + + var _this = _possibleConstructorReturn(this, (ImageScrubber.__proto__ || Object.getPrototypeOf(ImageScrubber)).call(this, props)); + + _this.state = { + dontUseScrubberView: false + }; + + _this.handleLoadingError = _this.handleLoadingError.bind(_this); + return _this; + } + + _createClass(ImageScrubber, [{ + key: 'handleLoadingError', + value: function handleLoadingError() { + this.setState({ + dontUseScrubberView: true + }); + } + }, { + key: 'render', + value: function render() { + console.log('ImageScrubber PROPS>>>', this.props); + var _props = this.props, + scrubberModalMode = _props.scrubberModalMode, + testImageType = _props.testImageType, + position = _props.position, + refImage = _props.refImage, + testImage = _props.testImage, + diffImage = _props.diffImage, + divergedImage = _props.divergedImage, + showButtons = _props.showButtons, + showScrubberTestImage = _props.showScrubberTestImage, + showScrubberRefImage = _props.showScrubberRefImage, + showScrubberDiffImage = _props.showScrubberDiffImage, + showScrubberDivergedImage = _props.showScrubberDivergedImage, + showScrubber = _props.showScrubber; + + + var scrubberTestImageSlug = this.props[testImageType]; + + function getDiverged(arg) { + if (divergedImage) { + showScrubberDivergedImage(divergedImage); + return; + } + + var refImg = document.images.scrubberRefImage; + var testImg = document.images.isolatedTestImage; + + var h = refImg.height; + var w = refImg.width; + var refCtx = imageToCanvasContext(refImg); + var testCtx = imageToCanvasContext(testImg); + + console.log('starting diverged>>', new Date()); + var divergedImgData = (0, _diverged2.default)(getImgDataDataFromContext(refCtx), getImgDataDataFromContext(testCtx), h, w); + + var clampedImgData = getEmptyImgData(h, w); + for (var i = divergedImgData.length - 1; i >= 0; i--) { + clampedImgData.data[i] = divergedImgData[i]; + } + var lcsDiffResult = imageToCanvasContext(null, w, h); + lcsDiffResult.putImageData(clampedImgData, 0, 0); + + var divergedImageResult = lcsDiffResult.canvas.toDataURL("image/png"); + showScrubberDivergedImage(divergedImageResult); + } + + var dontUseScrubberView = this.state.dontUseScrubberView || !showButtons; + return _react2.default.createElement( + Wrapper, + null, + _react2.default.createElement( + WrapTitle, + null, + showButtons && _react2.default.createElement( + 'div', + null, + _react2.default.createElement( + ScrubberViewBtn, + { + selected: scrubberModalMode === 'SHOW_SCRUBBER_REF_IMAGE', + onClick: showScrubberRefImage + }, + 'REFERENCE' + ), + _react2.default.createElement( + ScrubberViewBtn, + { + selected: scrubberModalMode === 'SHOW_SCRUBBER_TEST_IMAGE', + onClick: showScrubberTestImage + }, + 'TEST' + ), + _react2.default.createElement( + ScrubberViewBtn, + { + selected: scrubberModalMode === 'SHOW_SCRUBBER_DIFF_IMAGE', + onClick: showScrubberDiffImage + }, + 'DIFF' + ), + _react2.default.createElement( + ScrubberViewBtn, + { + selected: scrubberModalMode === 'SCRUB', + onClick: showScrubber + }, + 'SCRUBBER' + ) + ) + ), + _react2.default.createElement('img', { + id: 'isolatedTestImage', + className: 'testImage', + src: testImage, + style: { + margin: 'auto', + display: dontUseScrubberView ? 'block' : 'none' + } + }), + _react2.default.createElement('img', { + className: 'diffImage', + src: diffImage, + style: { + margin: 'auto', + display: dontUseScrubberView ? 'block' : 'none' + } + }), + _react2.default.createElement( + 'div', + { + style: { + display: dontUseScrubberView ? 'none' : 'block' + } + }, + _react2.default.createElement( + _backstopTwentytwenty2.default, + { + verticalAlign: 'top', + minDistanceToBeginInteraction: 0, + maxAngleToBeginInteraction: Infinity, + initialPosition: position, + newPosition: position + }, + _react2.default.createElement('img', { + id: 'scrubberRefImage', + className: 'refImage', + src: refImage, + onError: this.handleLoadingError + }), + _react2.default.createElement('img', { + id: 'scrubberTestImage', + className: 'testImage', + src: scrubberTestImageSlug + }), + _react2.default.createElement(SliderBar, { className: 'slider' }) + ) + ) + ); + } + }]); + + return ImageScrubber; +}(_react2.default.Component); + +/** + * ========= DIVERGED HELPERS ======== + */ + + +exports.default = ImageScrubber; +function getImgDataDataFromContext(context) { + return context.getImageData(0, 0, context.canvas.width, context.canvas.height).data; +} + +function getEmptyImgData(h, w) { + var o = imageToCanvasContext(null, h, w); + return o.createImageData(w, h); +} + +function imageToCanvasContext(_img, w, h) { + var img = _img; + if (!_img) { + img = { width: w, height: h }; + } + var canvas = document.createElement("canvas"); + canvas.width = img.width; + canvas.height = img.height; + var context = canvas.getContext("2d"); + if (_img) { + context.drawImage(img, 0, 0); + } + return context; +} + +/***/ }), +/* 295 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _react = __webpack_require__(2); + +var _react2 = _interopRequireDefault(_react); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var DEGREES_IN_RADIAN = 180 / Math.PI; + +var TwentyTwenty = function (_Component) { + _inherits(TwentyTwenty, _Component); + + function TwentyTwenty(props) { + _classCallCheck(this, TwentyTwenty); + + var _this = _possibleConstructorReturn(this, (TwentyTwenty.__proto__ || Object.getPrototypeOf(TwentyTwenty)).call(this, props)); + + _this.state = { + startX: NaN, + startY: NaN, + isDragging: false, + position: props.initialPosition + }; + + _this.beginDrag = _this.beginDrag.bind(_this); + _this.endDrag = _this.endDrag.bind(_this); + _this.onDragMove = _this.onDragMove.bind(_this); + return _this; + } + + _createClass(TwentyTwenty, [{ + key: 'componentWillUnmount', + value: function componentWillUnmount() { + this.endDrag(); + } + }, { + key: 'componentWillReceiveProps', + value: function componentWillReceiveProps(_ref) { + var newPosition = _ref.newPosition; + + this.setState({ position: newPosition }); + } + }, { + key: 'onDragMove', + value: function onDragMove(e) { + if (!this.props.isDraggingEnabled) return; + + var isDragging = this.state.isDragging; + + var isTouch = 'touches' in e; + + var _ref2 = isTouch ? e.touches[0] : e, + pageX = _ref2.pageX, + pageY = _ref2.pageY; + + if (!isDragging && isTouch) { + var _props = this.props, + maxAngleToBeginInteraction = _props.maxAngleToBeginInteraction, + minDistanceToBeginInteraction = _props.minDistanceToBeginInteraction; + var _state = this.state, + startX = _state.startX, + startY = _state.startY; + + + var dx = startX - pageX; + var dy = startY - pageY; + + var angle = Math.atan(dy / dx) * DEGREES_IN_RADIAN; + var distance = Math.sqrt(dx * dx + dy * dy); + isDragging = distance >= minDistanceToBeginInteraction; + + if (isDragging && Math.abs(angle) > maxAngleToBeginInteraction) { + // They're trying to scroll vertically + this.endDrag(); + return; + } else if (!isDragging) { + return; + } + } + + var _refs$component$getBo = this.refs.component.getBoundingClientRect(), + left = _refs$component$getBo.left, + width = _refs$component$getBo.width; + + var position = 100 * (pageX - left) / width; + position = Math.max(Math.min(position, 100), 0); + this.setState({ position: position, isDragging: isDragging }); + } + }, { + key: 'beginDrag', + value: function beginDrag(e) { + if (e) e.preventDefault(); + if (!this.props.isDraggingEnabled) return; + + var _ref3 = 'touches' in e ? e.touches[0] : e, + pageX = _ref3.pageX, + pageY = _ref3.pageY; + + this.setState({ startX: pageX, startY: pageY }); + + document.addEventListener('mousemove', this.onDragMove); + document.addEventListener('mouseup', this.endDrag); + document.addEventListener('touchmove', this.onDragMove); + document.addEventListener('touchend', this.endDrag); + } + }, { + key: 'endDrag', + value: function endDrag() { + document.removeEventListener('mousemove', this.onDragMove); + document.removeEventListener('mouseup', this.endDrag); + document.removeEventListener('touchmove', this.onDragMove); + document.removeEventListener('touchend', this.endDrag); + + this.setState({ isDragging: false, startY: NaN, endY: NaN }); + } + }, { + key: 'render', + value: function render() { + var position = this.state.position; + var _props2 = this.props, + children = _props2.children, + verticalAlign = _props2.verticalAlign, + leftHorizontalAlign = _props2.leftHorizontalAlign, + rightHorizontalAlign = _props2.rightHorizontalAlign; + + + if (children.length !== 2 && children.length !== 3) { + console.warn('Expected exactly two or three children'); // eslint-disable-line + return null; + } + + return _react2.default.createElement( + 'div', + { + ref: 'component', + style: { position: 'relative', overflow: 'hidden', whiteSpace: 'nowrap' }, + onMouseDown: this.beginDrag, + onTouchStart: this.beginDrag + }, + _react2.default.createElement( + 'div', + { + style: { + position: 'absolute', + left: position + '%', + height: '100%', + width: 0, + zIndex: 1 + } + }, + children[2] + ), + _react2.default.createElement( + 'div', + { + style: { + display: 'inline-block', + width: '100%', + position: 'relative', + verticalAlign: verticalAlign, + left: position - 100 + '%', + overflow: 'hidden' + } + }, + _react2.default.createElement( + 'div', + { + style: { + position: 'relative', + right: position - 100 + '%', + textAlign: leftHorizontalAlign + } + }, + children[0] + ) + ), + _react2.default.createElement( + 'div', + { + style: { + display: 'inline-block', + width: '100%', + position: 'relative', + verticalAlign: verticalAlign, + left: position - 100 + '%', + overflow: 'hidden' + } + }, + _react2.default.createElement( + 'div', + { + style: { + position: 'relative', + right: position + '%', + textAlign: rightHorizontalAlign + } + }, + children[1] + ) + ) + ); + } + }]); + + return TwentyTwenty; +}(_react.Component); + +exports.default = TwentyTwenty; + + +TwentyTwenty.propTypes = { + children: _react.PropTypes.array, + verticalAlign: _react.PropTypes.string, + leftHorizontalAlign: _react.PropTypes.string, + rightHorizontalAlign: _react.PropTypes.string, + minDistanceToBeginInteraction: _react.PropTypes.number, + maxAngleToBeginInteraction: _react.PropTypes.number, + initialPosition: _react.PropTypes.number, + isDraggingEnabled: _react.PropTypes.bool +}; + +TwentyTwenty.defaultProps = { + verticalAlign: 'middle', + leftHorizontalAlign: 'center', + rightHorizontalAlign: 'center', + minDistanceToBeginInteraction: 15, + maxAngleToBeginInteraction: 30, + initialPosition: 50, + isDraggingEnabled: true +}; + + +/***/ }), +/* 296 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +let MEYERS_DIFF_ARRAY_METHOD = undefined; +// debugger +if (true) { + MEYERS_DIFF_ARRAY_METHOD = __webpack_require__(297).diffArrays; +} else { + MEYERS_DIFF_ARRAY_METHOD = JsDiff.diffArrays; +} + +const spread = 50; // range of adjacent pixels to aggregate when calculating diff +const IS_ADDED_WORD = '0_255_0_255'; +const IS_REMOVED_WORD = '255_0_0_255'; +const IS_ADDED_AND_REMOVED_WORD = '0_255_255_255'; +const IS_SAME_WORD = '255_255_255_255'; + +/** + * Applies meyers-diff algorithm to imageData formatted arrays + * + * @param {Uint8ClampedArray} [reference] baseline image + * @param {Uint8ClampedArray} [test] test image + * + * @returns {Uint8ClampedArray} diff image + * + */ +if (true) { + module.exports = diverged; +} + +function diverged(reference, test, h, w) { + console.time("diverged_total_time"); + + const spread = Math.floor(h / 80); //override + + console.log('spread:', spread); + + console.time("imgDataToWords"); + const img1wordArr = imgDataToWords(reference); + const img2wordArr = imgDataToWords(test); + console.timeEnd("imgDataToWords"); + + console.time("imgDataWordArrToColsAndRows"); + let cols_rows_ref = imgDataWordArrToColsAndRows(img1wordArr, h, w); + let cols_rows_test = imgDataWordArrToColsAndRows(img2wordArr, h, w); + console.timeEnd("imgDataWordArrToColsAndRows"); + + console.time("groupAdjacent"); + const columnRef = groupAdjacent(cols_rows_ref.columns, spread, h, w); + const columnTest = groupAdjacent(cols_rows_test.columns, spread, h, w); + console.timeEnd("groupAdjacent"); + + console.time("columnDiffRaw"); + const columnDiffRaw = diffArr(columnRef, columnTest, h, w); + console.timeEnd("columnDiffRaw"); + + console.time("reduceColumnDiffRaw"); + const reducedColumnDiff = reduceColumnDiffRaw(columnDiffRaw, h, w); + console.timeEnd("reduceColumnDiffRaw"); + // console.log("reducedColumnDiff>>>", reducedColumnDiff); + + console.time("unGroupAdjacent"); + const expandedColumns = ungroupAdjacent(reducedColumnDiff, spread, h, w); + console.timeEnd("unGroupAdjacent"); + + console.time("columnWordDataToImgDataFormatAsWords"); + const convertedColumnDiffImgData = columnWordDataToImgDataFormatAsWords(expandedColumns, h, w); + console.timeEnd("columnWordDataToImgDataFormatAsWords"); + // console.log("convertedColumnDiffImgData>>>", convertedColumnDiffImgData); + + console.time("imgDataWordsToClampedImgData"); + const imgDataArr = convertImgDataWordsToClampedImgData(convertedColumnDiffImgData); + console.timeEnd("imgDataWordsToClampedImgData"); + // console.log("imgDataArr>>>", imgDataArr); + + console.timeEnd("diverged_total_time"); + return imgDataArr; +} + +/** + * ========= HELPERS ======== + */ + +function columnWordDataToImgDataFormatAsWords(columns, h, w) { + const imgDataWordsLength = w * h; + + let convertedArr = new Array(imgDataWordsLength); + for (var i = 0; i < imgDataWordsLength; i++) { + const {column, depth} = serialToColumnMap(i, h, w); + convertedArr[i] = columns[column][depth]; + } + return convertedArr; +} + +function convertImgDataWordsToClampedImgData(wordsArr) { + let convertedArr = new Uint8ClampedArray(wordsArr.length * 4); + for (var i = 0; i < wordsArr.length; i++) { + const convertedOffset = i * 4; + const segments = wordsArr[i].split('_'); + convertedArr[convertedOffset] = segments[0]; + convertedArr[convertedOffset+1] = segments[1]; + convertedArr[convertedOffset+2] = segments[2]; + convertedArr[convertedOffset+3] = segments[3]; + } + return convertedArr; +} + +function reduceColumnDiffRaw(columnDiffs, h, w) { + let reducedColumns = new Array(columnDiffs.length); + for (let columnIndex = 0; columnIndex < columnDiffs.length; columnIndex++) { + const columnDiff = columnDiffs[columnIndex]; + let resultColumn = new Array(); + let removedCounter = 0; + let resultClass = ''; + + for (let depthIndex = 0; depthIndex < h; depthIndex++) { + let segmentLength = 0; + + if (columnDiff[depthIndex].removed) { + segmentLength = columnDiff[depthIndex].count; + removedCounter += segmentLength; + resultClass = IS_REMOVED_WORD; + } else { + if (columnDiff[depthIndex].added) { + if (removedCounter) { + resultClass = IS_ADDED_AND_REMOVED_WORD; + } else { + resultClass = IS_ADDED_WORD; + } + } else { + resultClass = IS_SAME_WORD; + } + + + segmentLength = columnDiff[depthIndex].count; + + if (removedCounter > 0) { + if (segmentLength > removedCounter) { + segmentLength -= removedCounter; + removedCounter = 0; + } else { + removedCounter -= segmentLength; + segmentLength = 0; + } + } + } + + if (!segmentLength) { + continue; + } else { + segmentLength = Math.min(segmentLength, h - resultColumn.length); + } + + let segment = new Array(segmentLength).fill(resultClass); + + // // Uncomment this to see a rough image representation + // let segment = columnDiff[depthIndex].value.slice(0,segmentLength).map((value) => { + // if (/|/.test(value)) + // return value.split('|')[0]; + // return value; + // }); + + resultColumn = resultColumn.concat(segment); + + if (resultColumn.length > h) { + console.log('WARNING -- this value is out of bounds!') + } + + if (resultColumn.length === h) { + break; + } + } + + reducedColumns[columnIndex] = resultColumn; + } + + return reducedColumns; +} + +function diffArr(refArr, testArr, h, w) { + let rawResultArr = []; + for (let i = 0; i < refArr.length; i++) { + rawResultArr.push(MEYERS_DIFF_ARRAY_METHOD(refArr[i], testArr[i])); + } + return rawResultArr; +} + +function groupAdjacent(columns, spread, h, w) { + if (!spread) { + return columns; + } + /** + * [getAdjacentArrayBounds retuns existing adjacent lower and upper column bounds] + * @param {[int]} pointer [current index] + * @param {[int]} spread [distance from index] + * @param {[int]} length [total length] + * @return {[array]} [0] lower bound, [1] upper bound + */ + function getAdjacentArrayBounds(pointer, spread, length) { + return [ + // Math.max(0, pointer - spread), + Math.max(0, pointer), + Math.min(length - 1, pointer + spread) + ] + } + + function getInterpolatedSequence(beginning, end) { + const interpolated = []; + for (let step = beginning; step <= end; step++) { + interpolated.push(step); + } + return interpolated; + } + + function getCompositeColumnDepthValues(columns, range, depth) { + return range.reduce((acc, column) => { + return acc.concat(columns[column][depth]); + }, []) + } + + const interpolatedColumnsValues = new Array(); + let i = 0; + while (i < w) { + const adjacentBounds = getAdjacentArrayBounds(i, spread, w); + const interpolatedColumns = getInterpolatedSequence(...adjacentBounds); + + const columnComposite = new Array(h); + for (var depth = 0; depth < h; depth++) { + columnComposite[depth] = getCompositeColumnDepthValues(columns, interpolatedColumns, depth).join('|'); + } + interpolatedColumnsValues.push(columnComposite); + i += spread; + } + return interpolatedColumnsValues; +} + +function ungroupAdjacent(grouped, spread, h, w) { + if (!spread) { + return grouped; + } + + function mapUngroupedColumnIndexToGroupedIndex(index, spread) { + return Math.floor(index / spread); + } + + const ungrouped = new Array(w); + for (let i = 0; i < w; i++) { + if (!ungrouped[i]) { + ungrouped[i] = new Array(h); + } + + const groupedIndex = mapUngroupedColumnIndexToGroupedIndex(i, spread); + for (let j = 0; j < h; j++) { + ungrouped[i][j] = grouped[groupedIndex][j].split('|')[0]; + } + } + + return ungrouped +} + + + +function imgDataWordArrToColsAndRows(arr, h, w) { + let columns = new Array(w); + let rows = new Array(h); + + for (var i = 0; i < arr.length; i++) { + const word = arr[i]; + + var {column, depth} = serialToColumnMap(i, h, w); + if (!columns[column]) { + columns[column] = new Array(h); + } + columns[column][depth] = word; + + var {row, index} = serialToRowMap(i, h, w); + if (!rows[row]) { + rows[row] = new Array(w); + } + rows[row][index] = word; + } + return {columns, rows} +} + +function serialToColumnMap(index, h, w) { + return { + column: index % w, + depth: Math.floor(index / w) + } +} + +function serialToRowMap(index, h, w) { + return { + row: Math.floor(index / w), + index: index % w + } +} + +function imgDataToWords(arr) { + let result = []; + for (let i = 0; i < arr.length-1; i += 4) { + result.push(`${arr[i]}_${arr[i+1]}_${arr[i+2]}_${arr[i+3]}`) + } + return result; +} + + +/***/ }), +/* 297 */ +/***/ (function(module, exports, __webpack_require__) { + +/*! + + diff v3.5.0 + +Software License Agreement (BSD License) + +Copyright (c) 2009-2015, Kevin Decker <kpdecker@gmail.com> + +All rights reserved. + +Redistribution and use of this software in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above + copyright notice, this list of conditions and the + following disclaimer. + +* Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the + following disclaimer in the documentation and/or other + materials provided with the distribution. + +* Neither the name of Kevin Decker nor the names of its + contributors may be used to endorse or promote products + derived from this software without specific prior + written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR +CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER +IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT +OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +@license +*/ +(function webpackUniversalModuleDefinition(root, factory) { + if(true) + module.exports = factory(); + else if(typeof define === 'function' && define.amd) + define([], factory); + else if(typeof exports === 'object') + exports["JsDiff"] = factory(); + else + root["JsDiff"] = factory(); +})(this, function() { +return /******/ (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] = { +/******/ exports: {}, +/******/ id: moduleId, +/******/ loaded: false +/******/ }; + +/******/ // Execute the module function +/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); + +/******/ // Flag the module as loaded +/******/ module.loaded = 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; + +/******/ // __webpack_public_path__ +/******/ __webpack_require__.p = ""; + +/******/ // Load entry module and return exports +/******/ return __webpack_require__(0); +/******/ }) +/************************************************************************/ +/******/ ([ +/* 0 */ +/***/ (function(module, exports, __webpack_require__) { + + /*istanbul ignore start*/'use strict'; + + exports.__esModule = true; + exports.canonicalize = exports.convertChangesToXML = exports.convertChangesToDMP = exports.merge = exports.parsePatch = exports.applyPatches = exports.applyPatch = exports.createPatch = exports.createTwoFilesPatch = exports.structuredPatch = exports.diffArrays = exports.diffJson = exports.diffCss = exports.diffSentences = exports.diffTrimmedLines = exports.diffLines = exports.diffWordsWithSpace = exports.diffWords = exports.diffChars = exports.Diff = undefined; + + /*istanbul ignore end*/var /*istanbul ignore start*/_base = __webpack_require__(1) /*istanbul ignore end*/; + + /*istanbul ignore start*/var _base2 = _interopRequireDefault(_base); + + /*istanbul ignore end*/var /*istanbul ignore start*/_character = __webpack_require__(2) /*istanbul ignore end*/; + + var /*istanbul ignore start*/_word = __webpack_require__(3) /*istanbul ignore end*/; + + var /*istanbul ignore start*/_line = __webpack_require__(5) /*istanbul ignore end*/; + + var /*istanbul ignore start*/_sentence = __webpack_require__(6) /*istanbul ignore end*/; + + var /*istanbul ignore start*/_css = __webpack_require__(7) /*istanbul ignore end*/; + + var /*istanbul ignore start*/_json = __webpack_require__(8) /*istanbul ignore end*/; + + var /*istanbul ignore start*/_array = __webpack_require__(9) /*istanbul ignore end*/; + + var /*istanbul ignore start*/_apply = __webpack_require__(10) /*istanbul ignore end*/; + + var /*istanbul ignore start*/_parse = __webpack_require__(11) /*istanbul ignore end*/; + + var /*istanbul ignore start*/_merge = __webpack_require__(13) /*istanbul ignore end*/; + + var /*istanbul ignore start*/_create = __webpack_require__(14) /*istanbul ignore end*/; + + var /*istanbul ignore start*/_dmp = __webpack_require__(16) /*istanbul ignore end*/; + + var /*istanbul ignore start*/_xml = __webpack_require__(17) /*istanbul ignore end*/; + + /*istanbul ignore start*/function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } + + /* See LICENSE file for terms of use */ + + /* + * Text diff implementation. + * + * This library supports the following APIS: + * JsDiff.diffChars: Character by character diff + * JsDiff.diffWords: Word (as defined by \b regex) diff which ignores whitespace + * JsDiff.diffLines: Line based diff + * + * JsDiff.diffCss: Diff targeted at CSS content + * + * These methods are based on the implementation proposed in + * "An O(ND) Difference Algorithm and its Variations" (Myers, 1986). + * http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.4.6927 + */ + exports. /*istanbul ignore end*/Diff = _base2['default']; + /*istanbul ignore start*/exports. /*istanbul ignore end*/diffChars = _character.diffChars; + /*istanbul ignore start*/exports. /*istanbul ignore end*/diffWords = _word.diffWords; + /*istanbul ignore start*/exports. /*istanbul ignore end*/diffWordsWithSpace = _word.diffWordsWithSpace; + /*istanbul ignore start*/exports. /*istanbul ignore end*/diffLines = _line.diffLines; + /*istanbul ignore start*/exports. /*istanbul ignore end*/diffTrimmedLines = _line.diffTrimmedLines; + /*istanbul ignore start*/exports. /*istanbul ignore end*/diffSentences = _sentence.diffSentences; + /*istanbul ignore start*/exports. /*istanbul ignore end*/diffCss = _css.diffCss; + /*istanbul ignore start*/exports. /*istanbul ignore end*/diffJson = _json.diffJson; + /*istanbul ignore start*/exports. /*istanbul ignore end*/diffArrays = _array.diffArrays; + /*istanbul ignore start*/exports. /*istanbul ignore end*/structuredPatch = _create.structuredPatch; + /*istanbul ignore start*/exports. /*istanbul ignore end*/createTwoFilesPatch = _create.createTwoFilesPatch; + /*istanbul ignore start*/exports. /*istanbul ignore end*/createPatch = _create.createPatch; + /*istanbul ignore start*/exports. /*istanbul ignore end*/applyPatch = _apply.applyPatch; + /*istanbul ignore start*/exports. /*istanbul ignore end*/applyPatches = _apply.applyPatches; + /*istanbul ignore start*/exports. /*istanbul ignore end*/parsePatch = _parse.parsePatch; + /*istanbul ignore start*/exports. /*istanbul ignore end*/merge = _merge.merge; + /*istanbul ignore start*/exports. /*istanbul ignore end*/convertChangesToDMP = _dmp.convertChangesToDMP; + /*istanbul ignore start*/exports. /*istanbul ignore end*/convertChangesToXML = _xml.convertChangesToXML; + /*istanbul ignore start*/exports. /*istanbul ignore end*/canonicalize = _json.canonicalize; + //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9pbmRleC5qcyJdLCJuYW1lcyI6WyJEaWZmIiwiZGlmZkNoYXJzIiwiZGlmZldvcmRzIiwiZGlmZldvcmRzV2l0aFNwYWNlIiwiZGlmZkxpbmVzIiwiZGlmZlRyaW1tZWRMaW5lcyIsImRpZmZTZW50ZW5jZXMiLCJkaWZmQ3NzIiwiZGlmZkpzb24iLCJkaWZmQXJyYXlzIiwic3RydWN0dXJlZFBhdGNoIiwiY3JlYXRlVHdvRmlsZXNQYXRjaCIsImNyZWF0ZVBhdGNoIiwiYXBwbHlQYXRjaCIsImFwcGx5UGF0Y2hlcyIsInBhcnNlUGF0Y2giLCJtZXJnZSIsImNvbnZlcnRDaGFuZ2VzVG9ETVAiLCJjb252ZXJ0Q2hhbmdlc1RvWE1MIiwiY2Fub25pY2FsaXplIl0sIm1hcHBpbmdzIjoiOzs7Ozt1QkFnQkE7Ozs7dUJBQ0E7O0FBQ0E7O0FBQ0E7O0FBQ0E7O0FBRUE7O0FBQ0E7O0FBRUE7O0FBRUE7O0FBQ0E7O0FBQ0E7O0FBQ0E7O0FBRUE7O0FBQ0E7Ozs7QUFqQ0E7O0FBRUE7Ozs7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RpZmZUcmltbWVkTGluZXMsXG4gIGRpZmZTZW50ZW5jZXMsXG5cbiAgZGlmZkNzcyxcbiAgZGlmZkpzb24sXG5cbiAgZGlmZkFycmF5cyxcblxuICBzdHJ1Y3R1cmVkUGF0Y2gsXG4gIGNyZWF0ZVR3b0ZpbGVzUGF0Y2gsXG4gIGNyZWF0ZVBhdGNoLFxuICBhcHBseVBhdGNoLFxuICBhcHBseVBhdGNoZXMsXG4gIHBhcnNlUGF0Y2gsXG4gIG1lcmdlLFxuICBjb252ZXJ0Q2hhbmdlc1RvRE1QLFxuICBjb252ZXJ0Q2hhbmdlc1RvWE1MLFxuICBjYW5vbmljYWxpemVcbn07XG4iXX0= + + +/***/ }), +/* 1 */ +/***/ (function(module, exports) { + + /*istanbul ignore start*/'use strict'; + + exports.__esModule = true; + exports['default'] = /*istanbul ignore end*/Diff; + function Diff() {} + + Diff.prototype = { + /*istanbul ignore start*/ /*istanbul ignore end*/diff: function diff(oldString, newString) { + /*istanbul ignore start*/var /*istanbul ignore end*/options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; + + var callback = options.callback; + if (typeof options === 'function') { + callback = options; + options = {}; + } + this.options = options; + + var self = this; + + function done(value) { + if (callback) { + setTimeout(function () { + callback(undefined, value); + }, 0); + return true; + } else { + return value; + } + } + + // Allow subclasses to massage the input prior to running + oldString = this.castInput(oldString); + newString = this.castInput(newString); + + oldString = this.removeEmpty(this.tokenize(oldString)); + newString = this.removeEmpty(this.tokenize(newString)); + + var newLen = newString.length, + oldLen = oldString.length; + var editLength = 1; + var maxEditLength = newLen + oldLen; + var bestPath = [{ newPos: -1, components: [] }]; + + // Seed editLength = 0, i.e. the content starts with the same values + var oldPos = this.extractCommon(bestPath[0], newString, oldString, 0); + if (bestPath[0].newPos + 1 >= newLen && oldPos + 1 >= oldLen) { + // Identity per the equality and tokenizer + return done([{ value: this.join(newString), count: newString.length }]); + } + + // Main worker method. checks all permutations of a given edit length for acceptance. + function execEditLength() { + for (var diagonalPath = -1 * editLength; diagonalPath <= editLength; diagonalPath += 2) { + var basePath = /*istanbul ignore start*/void 0 /*istanbul ignore end*/; + var addPath = bestPath[diagonalPath - 1], + removePath = bestPath[diagonalPath + 1], + _oldPos = (removePath ? removePath.newPos : 0) - diagonalPath; + if (addPath) { + // No one else is going to attempt to use this value, clear it + bestPath[diagonalPath - 1] = undefined; + } + + var canAdd = addPath && addPath.newPos + 1 < newLen, + canRemove = removePath && 0 <= _oldPos && _oldPos < oldLen; + if (!canAdd && !canRemove) { + // If this path is a terminal then prune + bestPath[diagonalPath] = undefined; + continue; + } + + // Select the diagonal that we want to branch from. We select the prior + // path whose position in the new string is the farthest from the origin + // and does not pass the bounds of the diff graph + if (!canAdd || canRemove && addPath.newPos < removePath.newPos) { + basePath = clonePath(removePath); + self.pushComponent(basePath.components, undefined, true); + } else { + basePath = addPath; // No need to clone, we've pulled it from the list + basePath.newPos++; + self.pushComponent(basePath.components, true, undefined); + } + + _oldPos = self.extractCommon(basePath, newString, oldString, diagonalPath); + + // If we have hit the end of both strings, then we are done + if (basePath.newPos + 1 >= newLen && _oldPos + 1 >= oldLen) { + return done(buildValues(self, basePath.components, newString, oldString, self.useLongestToken)); + } else { + // Otherwise track this path as a potential candidate and continue. + bestPath[diagonalPath] = basePath; + } + } + + editLength++; + } + + // Performs the length of edit iteration. Is a bit fugly as this has to support the + // sync and async mode which is never fun. Loops over execEditLength until a value + // is produced. + if (callback) { + (function exec() { + setTimeout(function () { + // This should not happen, but we want to be safe. + /* istanbul ignore next */ + if (editLength > maxEditLength) { + return callback(); + } + + if (!execEditLength()) { + exec(); + } + }, 0); + })(); + } else { + while (editLength <= maxEditLength) { + var ret = execEditLength(); + if (ret) { + return ret; + } + } + } + }, + /*istanbul ignore start*/ /*istanbul ignore end*/pushComponent: function pushComponent(components, added, removed) { + var last = components[components.length - 1]; + if (last && last.added === added && last.removed === removed) { + // We need to clone here as the component clone operation is just + // as shallow array clone + components[components.length - 1] = { count: last.count + 1, added: added, removed: removed }; + } else { + components.push({ count: 1, added: added, removed: removed }); + } + }, + /*istanbul ignore start*/ /*istanbul ignore end*/extractCommon: function extractCommon(basePath, newString, oldString, diagonalPath) { + var newLen = newString.length, + oldLen = oldString.length, + newPos = basePath.newPos, + oldPos = newPos - diagonalPath, + commonCount = 0; + while (newPos + 1 < newLen && oldPos + 1 < oldLen && this.equals(newString[newPos + 1], oldString[oldPos + 1])) { + newPos++; + oldPos++; + commonCount++; + } + + if (commonCount) { + basePath.components.push({ count: commonCount }); + } + + basePath.newPos = newPos; + return oldPos; + }, + /*istanbul ignore start*/ /*istanbul ignore end*/equals: function equals(left, right) { + if (this.options.comparator) { + return this.options.comparator(left, right); + } else { + return left === right || this.options.ignoreCase && left.toLowerCase() === right.toLowerCase(); + } + }, + /*istanbul ignore start*/ /*istanbul ignore end*/removeEmpty: function removeEmpty(array) { + var ret = []; + for (var i = 0; i < array.length; i++) { + if (array[i]) { + ret.push(array[i]); + } + } + return ret; + }, + /*istanbul ignore start*/ /*istanbul ignore end*/castInput: function castInput(value) { + return value; + }, + /*istanbul ignore start*/ /*istanbul ignore end*/tokenize: function tokenize(value) { + return value.split(''); + }, + /*istanbul ignore start*/ /*istanbul ignore end*/join: function join(chars) { + return chars.join(''); + } + }; + + function buildValues(diff, components, newString, oldString, useLongestToken) { + var componentPos = 0, + componentLen = components.length, + newPos = 0, + oldPos = 0; + + for (; componentPos < componentLen; componentPos++) { + var component = components[componentPos]; + if (!component.removed) { + if (!component.added && useLongestToken) { + var value = newString.slice(newPos, newPos + component.count); + value = value.map(function (value, i) { + var oldValue = oldString[oldPos + i]; + return oldValue.length > value.length ? oldValue : value; + }); + + component.value = diff.join(value); + } else { + component.value = diff.join(newString.slice(newPos, newPos + component.count)); + } + newPos += component.count; + + // Common case + if (!component.added) { + oldPos += component.count; + } + } else { + component.value = diff.join(oldString.slice(oldPos, oldPos + component.count)); + oldPos += component.count; + + // Reverse add and remove so removes are output first to match common convention + // The diffing algorithm is tied to add then remove output and this is the simplest + // route to get the desired output with minimal overhead. + if (componentPos && components[componentPos - 1].added) { + var tmp = components[componentPos - 1]; + components[componentPos - 1] = components[componentPos]; + components[componentPos] = tmp; + } + } + } + + // Special case handle for when one terminal is ignored (i.e. whitespace). + // For this case we merge the terminal into the prior string and drop the change. + // This is only available for string mode. + var lastComponent = components[componentLen - 1]; + if (componentLen > 1 && typeof lastComponent.value === 'string' && (lastComponent.added || lastComponent.removed) && diff.equals('', lastComponent.value)) { + components[componentLen - 2].value += lastComponent.value; + components.pop(); + } + + return components; + } + + function clonePath(path) { + return { newPos: path.newPos, components: path.components.slice(0) }; + } + //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9kaWZmL2Jhc2UuanMiXSwibmFtZXMiOlsiRGlmZiIsInByb3RvdHlwZSIsImRpZmYiLCJvbGRTdHJpbmciLCJuZXdTdHJpbmciLCJvcHRpb25zIiwiY2FsbGJhY2siLCJzZWxmIiwiZG9uZSIsInZhbHVlIiwic2V0VGltZW91dCIsInVuZGVmaW5lZCIsImNhc3RJbnB1dCIsInJlbW92ZUVtcHR5IiwidG9rZW5pemUiLCJuZXdMZW4iLCJsZW5ndGgiLCJvbGRMZW4iLCJlZGl0TGVuZ3RoIiwibWF4RWRpdExlbmd0aCIsImJlc3RQYXRoIiwibmV3UG9zIiwiY29tcG9uZW50cyIsIm9sZFBvcyIsImV4dHJhY3RDb21tb24iLCJqb2luIiwiY291bnQiLCJleGVjRWRpdExlbmd0aCIsImRpYWdvbmFsUGF0aCIsImJhc2VQYXRoIiwiYWRkUGF0aCIsInJlbW92ZVBhdGgiLCJjYW5BZGQiLCJjYW5SZW1vdmUiLCJjbG9uZVBhdGgiLCJwdXNoQ29tcG9uZW50IiwiYnVpbGRWYWx1ZXMiLCJ1c2VMb25nZXN0VG9rZW4iLCJleGVjIiwicmV0IiwiYWRkZWQiLCJyZW1vdmVkIiwibGFzdCIsIn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 +/***/ (function(module, exports, __webpack_require__) { + + /*istanbul ignore start*/'use strict'; + + exports.__esModule = true; + exports.characterDiff = undefined; + exports. /*istanbul ignore end*/diffChars = diffChars; + + var /*istanbul ignore start*/_base = __webpack_require__(1) /*istanbul ignore end*/; + + /*istanbul ignore start*/var _base2 = _interopRequireDefault(_base); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } + + /*istanbul ignore end*/var characterDiff = /*istanbul ignore start*/exports. /*istanbul ignore end*/characterDiff = new /*istanbul ignore start*/_base2['default'] /*istanbul ignore end*/(); + function diffChars(oldStr, newStr, options) { + return characterDiff.diff(oldStr, newStr, options); + } + //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9kaWZmL2NoYXJhY3Rlci5qcyJdLCJuYW1lcyI6WyJkaWZmQ2hhcnMiLCJjaGFyYWN0ZXJEaWZmIiwib2xkU3RyIiwibmV3U3RyIiwib3B0aW9ucyIsImRpZmYiXSwibWFwcGluZ3MiOiI7Ozs7Z0NBR2dCQSxTLEdBQUFBLFM7O0FBSGhCOzs7Ozs7dUJBRU8sSUFBTUMseUZBQWdCLHdFQUF0QjtBQUNBLFNBQVNELFNBQVQsQ0FBbUJFLE1BQW5CLEVBQTJCQyxNQUEzQixFQUFtQ0MsT0FBbkMsRUFBNEM7QUFBRSxTQUFPSCxjQUFjSSxJQUFkLENBQW1CSCxNQUFuQixFQUEyQkMsTUFBM0IsRUFBbUNDLE9BQW5DLENBQVA7QUFBcUQiLCJmaWxlIjoiY2hhcmFjdGVyLmpzIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IERpZmYgZnJvbSAnLi9iYXNlJztcblxuZXhwb3J0IGNvbnN0IGNoYXJhY3RlckRpZmYgPSBuZXcgRGlmZigpO1xuZXhwb3J0IGZ1bmN0aW9uIGRpZmZDaGFycyhvbGRTdHIsIG5ld1N0ciwgb3B0aW9ucykgeyByZXR1cm4gY2hhcmFjdGVyRGlmZi5kaWZmKG9sZFN0ciwgbmV3U3RyLCBvcHRpb25zKTsgfVxuIl19 + + +/***/ }), +/* 3 */ +/***/ (function(module, exports, __webpack_require__) { + + /*istanbul ignore start*/'use strict'; + + exports.__esModule = true; + exports.wordDiff = undefined; + exports. /*istanbul ignore end*/diffWords = diffWords; + /*istanbul ignore start*/exports. /*istanbul ignore end*/diffWordsWithSpace = diffWordsWithSpace; + + var /*istanbul ignore start*/_base = __webpack_require__(1) /*istanbul ignore end*/; + + /*istanbul ignore start*/var _base2 = _interopRequireDefault(_base); + + /*istanbul ignore end*/var /*istanbul ignore start*/_params = __webpack_require__(4) /*istanbul ignore end*/; + + /*istanbul ignore start*/function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } + + /*istanbul ignore end*/ // Based on https://en.wikipedia.org/wiki/Latin_script_in_Unicode + // + // Ranges and exceptions: + // Latin-1 Supplement, 0080–00FF + // - U+00D7 × Multiplication sign + // - U+00F7 ÷ Division sign + // Latin Extended-A, 0100–017F + // Latin Extended-B, 0180–024F + // IPA Extensions, 0250–02AF + // Spacing Modifier Letters, 02B0–02FF + // - U+02C7 ˇ ˇ Caron + // - U+02D8 ˘ ˘ Breve + // - U+02D9 ˙ ˙ Dot Above + // - U+02DA ˚ ˚ Ring Above + // - U+02DB ˛ ˛ Ogonek + // - U+02DC ˜ ˜ Small Tilde + // - U+02DD ˝ ˝ Double Acute Accent + // Latin Extended Additional, 1E00–1EFF + var extendedWordChars = /^[A-Za-z\xC0-\u02C6\u02C8-\u02D7\u02DE-\u02FF\u1E00-\u1EFF]+$/; + + var reWhitespace = /\S/; + + var wordDiff = /*istanbul ignore start*/exports. /*istanbul ignore end*/wordDiff = new /*istanbul ignore start*/_base2['default'] /*istanbul ignore end*/(); + wordDiff.equals = function (left, right) { + if (this.options.ignoreCase) { + left = left.toLowerCase(); + right = right.toLowerCase(); + } + return left === right || this.options.ignoreWhitespace && !reWhitespace.test(left) && !reWhitespace.test(right); + }; + wordDiff.tokenize = function (value) { + var tokens = value.split(/(\s+|\b)/); + + // Join the boundary splits that we do not consider to be boundaries. This is primarily the extended Latin character set. + for (var i = 0; i < tokens.length - 1; i++) { + // If we have an empty string in the next field and we have only word chars before and after, merge + if (!tokens[i + 1] && tokens[i + 2] && extendedWordChars.test(tokens[i]) && extendedWordChars.test(tokens[i + 2])) { + tokens[i] += tokens[i + 2]; + tokens.splice(i + 1, 2); + i--; + } + } + + return tokens; + }; + + function diffWords(oldStr, newStr, options) { + options = /*istanbul ignore start*/(0, _params.generateOptions) /*istanbul ignore end*/(options, { ignoreWhitespace: true }); + return wordDiff.diff(oldStr, newStr, options); + } + + function diffWordsWithSpace(oldStr, newStr, options) { + return wordDiff.diff(oldStr, newStr, options); + } + //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9kaWZmL3dvcmQuanMiXSwibmFtZXMiOlsiZGlmZldvcmRzIiwiZGlmZldvcmRzV2l0aFNwYWNlIiwiZXh0ZW5kZWRXb3JkQ2hhcnMiLCJyZVdoaXRlc3BhY2UiLCJ3b3JkRGlmZiIsImVxdWFscyIsImxlZnQiLCJyaWdodCIsIm9wdGlvbnMiLCJpZ25vcmVDYXNlIiwidG9Mb3dlckNhc2UiLCJpZ25vcmVXaGl0ZXNwYWNlIiwidGVzdCIsInRva2VuaXplIiwidmFsdWUiLCJ0b2tlbnMiLCJzcGxpdCIsImkiLCJsZW5ndGgiLCJzcGxpY2UiLCJvbGRTdHIiLCJuZXdTdHIiLCJkaWZmIl0sIm1hcHBpbmdzIjoiOzs7O2dDQW1EZ0JBLFMsR0FBQUEsUzt5REFLQUMsa0IsR0FBQUEsa0I7O0FBeERoQjs7Ozt1QkFDQTs7Ozt3QkFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0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Z25vcmVXaGl0ZXNwYWNlOiB0cnVlfSk7XG4gIHJldHVybiB3b3JkRGlmZi5kaWZmKG9sZFN0ciwgbmV3U3RyLCBvcHRpb25zKTtcbn1cblxuZXhwb3J0IGZ1bmN0aW9uIGRpZmZXb3Jkc1dpdGhTcGFjZShvbGRTdHIsIG5ld1N0ciwgb3B0aW9ucykge1xuICByZXR1cm4gd29yZERpZmYuZGlmZihvbGRTdHIsIG5ld1N0ciwgb3B0aW9ucyk7XG59XG4iXX0= + + +/***/ }), +/* 4 */ +/***/ (function(module, exports) { + + /*istanbul ignore start*/'use strict'; + + exports.__esModule = true; + exports. /*istanbul ignore end*/generateOptions = generateOptions; + function generateOptions(options, defaults) { + if (typeof options === 'function') { + defaults.callback = options; + } else if (options) { + for (var name in options) { + /* istanbul ignore else */ + if (options.hasOwnProperty(name)) { + defaults[name] = options[name]; + } + } + } + return defaults; + } + //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy91dGlsL3BhcmFtcy5qcyJdLCJuYW1lcyI6WyJnZW5lcmF0ZU9wdGlvbnMiLCJvcHRpb25zIiwiZGVmYXVsdHMiLCJjYWxsYmFjayIsIm5hbWUiLCJoYXNPd25Qcm9wZXJ0eSJdLCJtYXBwaW5ncyI6Ijs7O2dDQUFnQkEsZSxHQUFBQSxlO0FBQVQsU0FBU0EsZUFBVCxDQUF5QkMsT0FBekIsRUFBa0NDLFFBQWxDLEVBQTRDO0FBQ2pELE1BQUksT0FBT0QsT0FBUCxLQUFtQixVQUF2QixFQUFtQztBQUNqQ0MsYUFBU0MsUUFBVCxHQUFvQkYsT0FBcEI7QUFDRCxHQUZELE1BRU8sSUFBSUEsT0FBSixFQUFhO0FBQ2xCLFNBQUssSUFBSUcsSUFBVCxJQUFpQkgsT0FBakIsRUFBMEI7QUFDeEI7QUFDQSxVQUFJQSxRQUFRSSxjQUFSLENBQXVCRCxJQUF2QixDQUFKLEVBQWtDO0FBQ2hDRixpQkFBU0UsSUFBVCxJQUFpQkgsUUFBUUcsSUFBUixDQUFqQjtBQUNEO0FBQ0Y7QUFDRjtBQUNELFNBQU9GLFFBQVA7QUFDRCIsImZpbGUiOiJwYXJhbXMuanMiLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnQgZnVuY3Rpb24gZ2VuZXJhdGVPcHRpb25zKG9wdGlvbnMsIGRlZmF1bHRzKSB7XG4gIGlmICh0eXBlb2Ygb3B0aW9ucyA9PT0gJ2Z1bmN0aW9uJykge1xuICAgIGRlZmF1bHRzLmNhbGxiYWNrID0gb3B0aW9ucztcbiAgfSBlbHNlIGlmIChvcHRpb25zKSB7XG4gICAgZm9yIChsZXQgbmFtZSBpbiBvcHRpb25zKSB7XG4gICAgICAvKiBpc3RhbmJ1bCBpZ25vcmUgZWxzZSAqL1xuICAgICAgaWYgKG9wdGlvbnMuaGFzT3duUHJvcGVydHkobmFtZSkpIHtcbiAgICAgICAgZGVmYXVsdHNbbmFtZV0gPSBvcHRpb25zW25hbWVdO1xuICAgICAgfVxuICAgIH1cbiAgfVxuICByZXR1cm4gZGVmYXVsdHM7XG59XG4iXX0= + + +/***/ }), +/* 5 */ +/***/ (function(module, exports, __webpack_require__) { + + /*istanbul ignore start*/'use strict'; + + exports.__esModule = true; + exports.lineDiff = undefined; + exports. /*istanbul ignore end*/diffLines = diffLines; + /*istanbul ignore start*/exports. /*istanbul ignore end*/diffTrimmedLines = diffTrimmedLines; + + var /*istanbul ignore start*/_base = __webpack_require__(1) /*istanbul ignore end*/; + + /*istanbul ignore start*/var _base2 = _interopRequireDefault(_base); + + /*istanbul ignore end*/var /*istanbul ignore start*/_params = __webpack_require__(4) /*istanbul ignore end*/; + + /*istanbul ignore start*/function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } + + /*istanbul ignore end*/var lineDiff = /*istanbul ignore start*/exports. /*istanbul ignore end*/lineDiff = new /*istanbul ignore start*/_base2['default'] /*istanbul ignore end*/(); + lineDiff.tokenize = function (value) { + var retLines = [], + linesAndNewlines = value.split(/(\n|\r\n)/); + + // Ignore the final empty token that occurs if the string ends with a new line + if (!linesAndNewlines[linesAndNewlines.length - 1]) { + linesAndNewlines.pop(); + } + + // Merge the content and line separators into single tokens + for (var i = 0; i < linesAndNewlines.length; i++) { + var line = linesAndNewlines[i]; + + if (i % 2 && !this.options.newlineIsToken) { + retLines[retLines.length - 1] += line; + } else { + if (this.options.ignoreWhitespace) { + line = line.trim(); + } + retLines.push(line); + } + } + + return retLines; + }; + + function diffLines(oldStr, newStr, callback) { + return lineDiff.diff(oldStr, newStr, callback); + } + function diffTrimmedLines(oldStr, newStr, callback) { + var options = /*istanbul ignore start*/(0, _params.generateOptions) /*istanbul ignore end*/(callback, { ignoreWhitespace: true }); + return lineDiff.diff(oldStr, newStr, options); + } + //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9kaWZmL2xpbmUuanMiXSwibmFtZXMiOlsiZGlmZkxpbmVzIiwiZGlmZlRyaW1tZWRMaW5lcyIsImxpbmVEaWZmIiwidG9rZW5pemUiLCJ2YWx1ZSIsInJldExpbmVzIiwibGluZXNBbmROZXdsaW5lcyIsInNwbGl0IiwibGVuZ3RoIiwicG9wIiwiaSIsImxpbmUiLCJvcHRpb25zIiwibmV3bGluZUlzVG9rZW4iLCJpZ25vcmVXaGl0ZXNwYWNlIiwidHJpbSIsInB1c2giLCJvbGRTdHIiLCJuZXdTdHIiLCJjYWxsYmFjayIsImRpZmYiXSwibWFwcGluZ3MiOiI7Ozs7Z0NBOEJnQkEsUyxHQUFBQSxTO3lEQUNBQyxnQixHQUFBQSxnQjs7QUEvQmhCOzs7O3VCQUNBOzs7O3VCQUVPLElBQU1DLCtFQUFXLHdFQUFqQjtBQUNQQSxTQUFTQyxRQUFULEdBQW9CLFVBQVNDLEtBQVQsRUFBZ0I7QUFDbEMsTUFBS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m9yZVdoaXRlc3BhY2UpIHtcbiAgICAgICAgbGluZSA9IGxpbmUudHJpbSgpO1xuICAgICAgfVxuICAgICAgcmV0TGluZXMucHVzaChsaW5lKTtcbiAgICB9XG4gIH1cblxuICByZXR1cm4gcmV0TGluZXM7XG59O1xuXG5leHBvcnQgZnVuY3Rpb24gZGlmZkxpbmVzKG9sZFN0ciwgbmV3U3RyLCBjYWxsYmFjaykgeyByZXR1cm4gbGluZURpZmYuZGlmZihvbGRTdHIsIG5ld1N0ciwgY2FsbGJhY2spOyB9XG5leHBvcnQgZnVuY3Rpb24gZGlmZlRyaW1tZWRMaW5lcyhvbGRTdHIsIG5ld1N0ciwgY2FsbGJhY2spIHtcbiAgbGV0IG9wdGlvbnMgPSBnZW5lcmF0ZU9wdGlvbnMoY2FsbGJhY2ssIHtpZ25vcmVXaGl0ZXNwYWNlOiB0cnVlfSk7XG4gIHJldHVybiBsaW5lRGlmZi5kaWZmKG9sZFN0ciwgbmV3U3RyLCBvcHRpb25zKTtcbn1cbiJdfQ== + + +/***/ }), +/* 6 */ +/***/ (function(module, exports, __webpack_require__) { + + /*istanbul ignore start*/'use strict'; + + exports.__esModule = true; + exports.sentenceDiff = undefined; + exports. /*istanbul ignore end*/diffSentences = diffSentences; + + var /*istanbul ignore start*/_base = __webpack_require__(1) /*istanbul ignore end*/; + + /*istanbul ignore start*/var _base2 = _interopRequireDefault(_base); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } + + /*istanbul ignore end*/var sentenceDiff = /*istanbul ignore start*/exports. /*istanbul ignore end*/sentenceDiff = new /*istanbul ignore start*/_base2['default'] /*istanbul ignore end*/(); + sentenceDiff.tokenize = function (value) { + return value.split(/(\S.+?[.!?])(?=\s+|$)/); + }; + + function diffSentences(oldStr, newStr, callback) { + return sentenceDiff.diff(oldStr, newStr, callback); + } + //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy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bul ignore start*/'use strict'; + + exports.__esModule = true; + exports.cssDiff = undefined; + exports. /*istanbul ignore end*/diffCss = diffCss; + + var /*istanbul ignore start*/_base = __webpack_require__(1) /*istanbul ignore end*/; + + /*istanbul ignore start*/var _base2 = _interopRequireDefault(_base); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } + + /*istanbul ignore end*/var cssDiff = /*istanbul ignore start*/exports. /*istanbul ignore end*/cssDiff = new /*istanbul ignore start*/_base2['default'] /*istanbul ignore end*/(); + cssDiff.tokenize = function (value) { + return value.split(/([{}:;,]|\s+)/); + }; + + function diffCss(oldStr, newStr, callback) { + return cssDiff.diff(oldStr, newStr, callback); + } + //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9kaWZmL2Nzcy5qcyJdLCJuYW1lcyI6WyJkaWZmQ3NzIiwiY3NzRGlmZiIsInRva2VuaXplIiwidmFsdWUiLCJzcGxpdCIsIm9sZFN0ciIsIm5ld1N0ciIsImNhbGxiYWNrIiwiZGlmZiJdLCJtYXBwaW5ncyI6Ijs7OztnQ0FPZ0JBLE8sR0FBQUEsTzs7QUFQaEI7Ozs7Ozt1QkFFTyxJQUFNQyw2RUFBVSx3RUFBaEI7QUFDUEEsUUFBUUMsUUFBUixHQUFtQixVQUFTQyxLQUFULEVBQWdCO0FBQ2pDLFNBQU9BLE1BQU1DLEtBQU4sQ0FBWSxlQUFaLENBQVA7QUFDRCxDQUZEOztBQUlPLFNBQVNKLE9BQVQsQ0FBaUJLLE1BQWpCLEVBQXlCQyxNQUF6QixFQUFpQ0MsUUFBakMsRUFBMkM7QUFBRSxTQUFPTixRQUFRTyxJQUFSLENBQWFILE1BQWIsRUFBcUJDLE1BQXJCLEVBQTZCQyxRQUE3QixDQUFQO0FBQWdEIiwiZmlsZSI6ImNzcy5qcyIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCBEaWZmIGZyb20gJy4vYmFzZSc7XG5cbmV4cG9ydCBjb25zdCBjc3NEaWZmID0gbmV3IERpZmYoKTtcbmNzc0RpZmYudG9rZW5pemUgPSBmdW5jdGlvbih2YWx1ZSkge1xuICByZXR1cm4gdmFsdWUuc3BsaXQoLyhbe306OyxdfFxccyspLyk7XG59O1xuXG5leHBvcnQgZnVuY3Rpb24gZGlmZkNzcyhvbGRTdHIsIG5ld1N0ciwgY2FsbGJhY2spIHsgcmV0dXJuIGNzc0RpZmYuZGlmZihvbGRTdHIsIG5ld1N0ciwgY2FsbGJhY2spOyB9XG4iXX0= + + +/***/ }), +/* 8 */ +/***/ (function(module, exports, __webpack_require__) { + + /*istanbul ignore start*/'use strict'; + + exports.__esModule = true; + exports.jsonDiff = undefined; + + var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; + + exports. /*istanbul ignore end*/diffJson = diffJson; + /*istanbul ignore start*/exports. /*istanbul ignore end*/canonicalize = canonicalize; + + var /*istanbul ignore start*/_base = __webpack_require__(1) /*istanbul ignore end*/; + + /*istanbul ignore start*/var _base2 = _interopRequireDefault(_base); + + /*istanbul ignore end*/var /*istanbul ignore start*/_line = __webpack_require__(5) /*istanbul ignore end*/; + + /*istanbul ignore start*/function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } + + /*istanbul ignore end*/var objectPrototypeToString = Object.prototype.toString; + + var jsonDiff = /*istanbul ignore start*/exports. /*istanbul ignore end*/jsonDiff = new /*istanbul ignore start*/_base2['default'] /*istanbul ignore end*/(); + // Discriminate between two lines of pretty-printed, serialized JSON where one of them has a + // dangling comma and the other doesn't. Turns out including the dangling comma yields the nicest output: + jsonDiff.useLongestToken = true; + + jsonDiff.tokenize = /*istanbul ignore start*/_line.lineDiff /*istanbul ignore end*/.tokenize; + jsonDiff.castInput = function (value) { + /*istanbul ignore start*/var _options = /*istanbul ignore end*/this.options, + undefinedReplacement = _options.undefinedReplacement, + _options$stringifyRep = _options.stringifyReplacer, + stringifyReplacer = _options$stringifyRep === undefined ? function (k, v) /*istanbul ignore start*/{ + return (/*istanbul ignore end*/typeof v === 'undefined' ? undefinedReplacement : v + ); + } : _options$stringifyRep; + + + return typeof value === 'string' ? value : JSON.stringify(canonicalize(value, null, null, stringifyReplacer), stringifyReplacer, ' '); + }; + jsonDiff.equals = function (left, right) { + return (/*istanbul ignore start*/_base2['default'] /*istanbul ignore end*/.prototype.equals.call(jsonDiff, left.replace(/,([\r\n])/g, '$1'), right.replace(/,([\r\n])/g, '$1')) + ); + }; + + function diffJson(oldObj, newObj, options) { + return jsonDiff.diff(oldObj, newObj, options); + } + + // This function handles the presence of circular references by bailing out when encountering an + // object that is already on the "stack" of items being processed. Accepts an optional replacer + function canonicalize(obj, stack, replacementStack, replacer, key) { + stack = stack || []; + replacementStack = replacementStack || []; + + if (replacer) { + obj = replacer(key, obj); + } + + var i = /*istanbul ignore start*/void 0 /*istanbul ignore end*/; + + for (i = 0; i < stack.length; i += 1) { + if (stack[i] === obj) { + return replacementStack[i]; + } + } + + var canonicalizedObj = /*istanbul ignore start*/void 0 /*istanbul ignore end*/; + + if ('[object Array]' === objectPrototypeToString.call(obj)) { + stack.push(obj); + canonicalizedObj = new Array(obj.length); + replacementStack.push(canonicalizedObj); + for (i = 0; i < obj.length; i += 1) { + canonicalizedObj[i] = canonicalize(obj[i], stack, replacementStack, replacer, key); + } + stack.pop(); + replacementStack.pop(); + return canonicalizedObj; + } + + if (obj && obj.toJSON) { + obj = obj.toJSON(); + } + + if ( /*istanbul ignore start*/(typeof /*istanbul ignore end*/obj === 'undefined' ? 'undefined' : _typeof(obj)) === 'object' && obj !== null) { + stack.push(obj); + canonicalizedObj = {}; + replacementStack.push(canonicalizedObj); + var sortedKeys = [], + _key = /*istanbul ignore start*/void 0 /*istanbul ignore end*/; + for (_key in obj) { + /* istanbul ignore else */ + if (obj.hasOwnProperty(_key)) { + sortedKeys.push(_key); + } + } + sortedKeys.sort(); + for (i = 0; i < sortedKeys.length; i += 1) { + _key = sortedKeys[i]; + canonicalizedObj[_key] = canonicalize(obj[_key], stack, replacementStack, replacer, _key); + } + stack.pop(); + replacementStack.pop(); + } else { + canonicalizedObj = obj; + } + return canonicalizedObj; + } + //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9kaWZmL2pzb24uanMiXSwibmFtZXMiOlsiZGlmZkpzb24iLCJjYW5vbmljYWxpemUiLCJvYmplY3RQcm90b3R5cGVUb1N0cmluZyIsIk9iamVjdCIsInByb3RvdHlwZSIsInRvU3RyaW5nIiwianNvbkRpZmYiLCJ1c2VMb25nZXN0VG9rZW4iLCJ0b2tlbml6ZSIsImNhc3RJbnB1dCIsInZhbHVlIiwib3B0aW9ucyIsInVuZGVmaW5lZFJlcGxhY2VtZW50Iiwic3RyaW5naWZ5UmVwbGFjZXIiLCJrIiwidiIsIkpTT04iLCJzdHJpbmdpZnkiLCJlcXVhbHMiLCJsZWZ0IiwicmlnaHQiLCJjYWxsIiwicmVwbGFjZSIsIm9sZE9iaiIsIm5ld09iaiIsImRpZmYiLCJvYmoiLCJzdGFjayIsInJlcGxhY2VtZW50U3RhY2siLCJyZXBsYWNlciIsImtleSIsImkiLCJsZW5ndGgiLCJjYW5vbmljYWxpemVkT2JqIiwicHVzaCIsIkFycmF5IiwicG9wIiwidG9KU09OIiwic29ydGVkS2V5cyIsImhhc093blByb3BlcnR5Iiwic29ydCJdLCJtYXBwaW5ncyI6Ijs7Ozs7OztnQ0FxQmdCQSxRLEdBQUFBLFE7eURBSUFDLFksR0FBQUEsWTs7QUF6QmhCOzs7O3VCQUNBOzs7O3VCQUVBLElBQU1DLDBCQUEwQkMsT0FBT0MsU0FBUCxDQUFpQkMsUUFBakQ7O0FBR08sSUFBTUMsK0VBQVcsd0VBQWpCO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gKGkgPSAwOyBpIDwgc29ydGVkS2V5cy5sZW5ndGg7IGkgKz0gMSkge1xuICAgICAga2V5ID0gc29ydGVkS2V5c1tpXTtcbiAgICAgIGNhbm9uaWNhbGl6ZWRPYmpba2V5XSA9IGNhbm9uaWNhbGl6ZShvYmpba2V5XSwgc3RhY2ssIHJlcGxhY2VtZW50U3RhY2ssIHJlcGxhY2VyLCBrZXkpO1xuICAgIH1cbiAgICBzdGFjay5wb3AoKTtcbiAgICByZXBsYWNlbWVudFN0YWNrLnBvcCgpO1xuICB9IGVsc2Uge1xuICAgIGNhbm9uaWNhbGl6ZWRPYmogPSBvYmo7XG4gIH1cbiAgcmV0dXJuIGNhbm9uaWNhbGl6ZWRPYmo7XG59XG4iXX0= + + +/***/ }), +/* 9 */ +/***/ (function(module, exports, __webpack_require__) { + + /*istanbul ignore start*/'use strict'; + + exports.__esModule = true; + exports.arrayDiff = undefined; + exports. /*istanbul ignore end*/diffArrays = diffArrays; + + var /*istanbul ignore start*/_base = __webpack_require__(1) /*istanbul ignore end*/; + + /*istanbul ignore start*/var _base2 = _interopRequireDefault(_base); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } + + /*istanbul ignore end*/var arrayDiff = /*istanbul ignore start*/exports. /*istanbul ignore end*/arrayDiff = new /*istanbul ignore start*/_base2['default'] /*istanbul ignore end*/(); + arrayDiff.tokenize = function (value) { + return value.slice(); + }; + arrayDiff.join = arrayDiff.removeEmpty = function (value) { + return value; + }; + + function diffArrays(oldArr, newArr, callback) { + return arrayDiff.diff(oldArr, newArr, callback); + } + //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9kaWZmL2FycmF5LmpzIl0sIm5hbWVzIjpbImRpZmZBcnJheXMiLCJhcnJheURpZmYiLCJ0b2tlbml6ZSIsInZhbHVlIiwic2xpY2UiLCJqb2luIiwicmVtb3ZlRW1wdHkiLCJvbGR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require__) { + + /*istanbul ignore start*/'use strict'; + + exports.__esModule = true; + exports. /*istanbul ignore end*/applyPatch = applyPatch; + /*istanbul ignore start*/exports. /*istanbul ignore end*/applyPatches = applyPatches; + + var /*istanbul ignore start*/_parse = __webpack_require__(11) /*istanbul ignore end*/; + + var /*istanbul ignore start*/_distanceIterator = __webpack_require__(12) /*istanbul ignore end*/; + + /*istanbul ignore start*/var _distanceIterator2 = _interopRequireDefault(_distanceIterator); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } + + /*istanbul ignore end*/function applyPatch(source, uniDiff) { + /*istanbul ignore start*/var /*istanbul ignore end*/options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; + + if (typeof uniDiff === 'string') { + uniDiff = /*istanbul ignore start*/(0, _parse.parsePatch) /*istanbul ignore end*/(uniDiff); + } + + if (Array.isArray(uniDiff)) { + if (uniDiff.length > 1) { + throw new Error('applyPatch only works with a single input.'); + } + + uniDiff = uniDiff[0]; + } + + // Apply the diff to the input + var lines = source.split(/\r\n|[\n\v\f\r\x85]/), + delimiters = source.match(/\r\n|[\n\v\f\r\x85]/g) || [], + hunks = uniDiff.hunks, + compareLine = options.compareLine || function (lineNumber, line, operation, patchContent) /*istanbul ignore start*/{ + return (/*istanbul ignore end*/line === patchContent + ); + }, + errorCount = 0, + fuzzFactor = options.fuzzFactor || 0, + minLine = 0, + offset = 0, + removeEOFNL = /*istanbul ignore start*/void 0 /*istanbul ignore end*/, + addEOFNL = /*istanbul ignore start*/void 0 /*istanbul ignore end*/; + + /** + * Checks if the hunk exactly fits on the provided location + */ + function hunkFits(hunk, toPos) { + for (var j = 0; j < hunk.lines.length; j++) { + var line = hunk.lines[j], + operation = line.length > 0 ? line[0] : ' ', + content = line.length > 0 ? line.substr(1) : line; + + if (operation === ' ' || operation === '-') { + // Context sanity check + if (!compareLine(toPos + 1, lines[toPos], operation, content)) { + errorCount++; + + if (errorCount > fuzzFactor) { + return false; + } + } + toPos++; + } + } + + return true; + } + + // Search best fit offsets for each hunk based on the previous ones + for (var i = 0; i < hunks.length; i++) { + var hunk = hunks[i], + maxLine = lines.length - hunk.oldLines, + localOffset = 0, + toPos = offset + hunk.oldStart - 1; + + var iterator = /*istanbul ignore start*/(0, _distanceIterator2['default']) /*istanbul ignore end*/(toPos, minLine, maxLine); + + for (; localOffset !== undefined; localOffset = iterator()) { + if (hunkFits(hunk, toPos + localOffset)) { + hunk.offset = offset += localOffset; + break; + } + } + + if (localOffset === undefined) { + return false; + } + + // Set lower text limit to end of the current hunk, so next ones don't try + // to fit over already patched text + minLine = hunk.offset + hunk.oldStart + hunk.oldLines; + } + + // Apply patch hunks + var diffOffset = 0; + for (var _i = 0; _i < hunks.length; _i++) { + var _hunk = hunks[_i], + _toPos = _hunk.oldStart + _hunk.offset + diffOffset - 1; + diffOffset += _hunk.newLines - _hunk.oldLines; + + if (_toPos < 0) { + // Creating a new file + _toPos = 0; + } + + for (var j = 0; j < _hunk.lines.length; j++) { + var line = _hunk.lines[j], + operation = line.length > 0 ? line[0] : ' ', + content = line.length > 0 ? line.substr(1) : line, + delimiter = _hunk.linedelimiters[j]; + + if (operation === ' ') { + _toPos++; + } else if (operation === '-') { + lines.splice(_toPos, 1); + delimiters.splice(_toPos, 1); + /* istanbul ignore else */ + } else if (operation === '+') { + lines.splice(_toPos, 0, content); + delimiters.splice(_toPos, 0, delimiter); + _toPos++; + } else if (operation === '\\') { + var previousOperation = _hunk.lines[j - 1] ? _hunk.lines[j - 1][0] : null; + if (previousOperation === '+') { + removeEOFNL = true; + } else if (previousOperation === '-') { + addEOFNL = true; + } + } + } + } + + // Handle EOFNL insertion/removal + if (removeEOFNL) { + while (!lines[lines.length - 1]) { + lines.pop(); + delimiters.pop(); + } + } else if (addEOFNL) { + lines.push(''); + delimiters.push('\n'); + } + for (var _k = 0; _k < lines.length - 1; _k++) { + lines[_k] = lines[_k] + delimiters[_k]; + } + return lines.join(''); + } + + // Wrapper that supports multiple file patches via callbacks. + function applyPatches(uniDiff, options) { + if (typeof uniDiff === 'string') { + uniDiff = /*istanbul ignore start*/(0, _parse.parsePatch) /*istanbul ignore end*/(uniDiff); + } + + var currentIndex = 0; + function processIndex() { + var index = uniDiff[currentIndex++]; + if (!index) { + return options.complete(); + } + + options.loadFile(index, function (err, data) { + if (err) { + return options.complete(err); + } + + var updatedContent = applyPatch(data, index, options); + options.patched(index, updatedContent, function (err) { + if (err) { + return options.complete(err); + } + + processIndex(); + }); + }); + } + processIndex(); + } + //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9wYXRjaC9hcHBseS5qcyJdLCJuYW1lcyI6WyJhcHBseVBhdGNoIiwiYXBwbHlQYXRjaGVzIiwic291cmNlIiwidW5pRGlmZiIsIm9wdGlvbnMiLCJBcnJheSIsImlzQXJyYXkiLCJsZW5ndGgiLCJFcnJvciIsImxpbmVzIiwic3BsaXQiLCJkZWxpbWl0ZXJzIiwibWF0Y2giLCJodW5rcyIsImNvbXBhcmVMaW5lIiwibGluZU51bWJlciIsImxpbmUiLCJvcGVyYXRpb24iLCJwYXRjaENvbnRlbnQiLCJlcnJvckNvdW50IiwiZnV6ekZhY3RvciIsIm1pbkxpbmUiLCJvZmZzZXQiLCJyZW1vdmVFT0ZOTCIsImFkZEVPRk5MIiwiaHVua0ZpdHMiLCJodW5rIiwidG9Qb3MiLCJqIiwiY29udGVudCIsInN1YnN0ciIsImkiLCJtYXhMaW5lIiwib2xkTGluZXMiLCJsb2NhbE9mZnNldCIsIm9sZFN0YXJ0IiwiaXRlcmF0b3IiLCJ1bmRlZmluZWQiLCJkaWZmT2Zmc2V0IiwibmV3TGluZXMiLCJkZWxpbWl0ZXIiLCJsaW5lZGVsaW1pdGVycyIsInNwbGljZSIsInByZXZpb3VzT3BlcmF0aW9uIiwicG9wIiwicHVzaCIsIl9rIiwiam9pbiIsImN1cnJlbnRJbmRleCIsInByb2Nlc3NJbm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biAgICAgICAgaWYgKGVycikge1xuICAgICAgICAgIHJldHVybiBvcHRpb25zLmNvbXBsZXRlKGVycik7XG4gICAgICAgIH1cblxuICAgICAgICBwcm9jZXNzSW5kZXgoKTtcbiAgICAgIH0pO1xuICAgIH0pO1xuICB9XG4gIHByb2Nlc3NJbmRleCgpO1xufVxuIl19 + + +/***/ }), +/* 11 */ +/***/ (function(module, exports) { + + /*istanbul ignore start*/'use strict'; + + exports.__esModule = true; + exports. /*istanbul ignore end*/parsePatch = parsePatch; + function parsePatch(uniDiff) { + /*istanbul ignore start*/var /*istanbul ignore end*/options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + + var diffstr = uniDiff.split(/\r\n|[\n\v\f\r\x85]/), + delimiters = uniDiff.match(/\r\n|[\n\v\f\r\x85]/g) || [], + list = [], + i = 0; + + function parseIndex() { + var index = {}; + list.push(index); + + // Parse diff metadata + while (i < diffstr.length) { + var line = diffstr[i]; + + // File header found, end parsing diff metadata + if (/^(\-\-\-|\+\+\+|@@)\s/.test(line)) { + break; + } + + // Diff index + var header = /^(?:Index:|diff(?: -r \w+)+)\s+(.+?)\s*$/.exec(line); + if (header) { + index.index = header[1]; + } + + i++; + } + + // Parse file headers if they are defined. Unified diff requires them, but + // there's no technical issues to have an isolated hunk without file header + parseFileHeader(index); + parseFileHeader(index); + + // Parse hunks + index.hunks = []; + + while (i < diffstr.length) { + var _line = diffstr[i]; + + if (/^(Index:|diff|\-\-\-|\+\+\+)\s/.test(_line)) { + break; + } else if (/^@@/.test(_line)) { + index.hunks.push(parseHunk()); + } else if (_line && options.strict) { + // Ignore unexpected content unless in strict mode + throw new Error('Unknown line ' + (i + 1) + ' ' + JSON.stringify(_line)); + } else { + i++; + } + } + } + + // Parses the --- and +++ headers, if none are found, no lines + // are consumed. + function parseFileHeader(index) { + var fileHeader = /^(---|\+\+\+)\s+(.*)$/.exec(diffstr[i]); + if (fileHeader) { + var keyPrefix = fileHeader[1] === '---' ? 'old' : 'new'; + var data = fileHeader[2].split('\t', 2); + var fileName = data[0].replace(/\\\\/g, '\\'); + if (/^".*"$/.test(fileName)) { + fileName = fileName.substr(1, fileName.length - 2); + } + index[keyPrefix + 'FileName'] = fileName; + index[keyPrefix + 'Header'] = (data[1] || '').trim(); + + i++; + } + } + + // Parses a hunk + // This assumes that we are at the start of a hunk. + function parseHunk() { + var chunkHeaderIndex = i, + chunkHeaderLine = diffstr[i++], + chunkHeader = chunkHeaderLine.split(/@@ -(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))? @@/); + + var hunk = { + oldStart: +chunkHeader[1], + oldLines: +chunkHeader[2] || 1, + newStart: +chunkHeader[3], + newLines: +chunkHeader[4] || 1, + lines: [], + linedelimiters: [] + }; + + var addCount = 0, + removeCount = 0; + for (; i < diffstr.length; i++) { + // Lines starting with '---' could be mistaken for the "remove line" operation + // But they could be the header for the next file. Therefore prune such cases out. + if (diffstr[i].indexOf('--- ') === 0 && i + 2 < diffstr.length && diffstr[i + 1].indexOf('+++ ') === 0 && diffstr[i + 2].indexOf('@@') === 0) { + break; + } + var operation = diffstr[i].length == 0 && i != diffstr.length - 1 ? ' ' : diffstr[i][0]; + + if (operation === '+' || operation === '-' || operation === ' ' || operation === '\\') { + hunk.lines.push(diffstr[i]); + hunk.linedelimiters.push(delimiters[i] || '\n'); + + if (operation === '+') { + addCount++; + } else if (operation === '-') { + removeCount++; + } else if (operation === ' ') { + addCount++; + removeCount++; + } + } else { + break; + } + } + + // Handle the empty block count case + if (!addCount && hunk.newLines === 1) { + hunk.newLines = 0; + } + if (!removeCount && hunk.oldLines === 1) { + hunk.oldLines = 0; + } + + // Perform optional sanity checking + if (options.strict) { + if (addCount !== hunk.newLines) { + throw new Error('Added line count did not match for hunk at line ' + (chunkHeaderIndex + 1)); + } + if (removeCount !== hunk.oldLines) { + throw new Error('Removed line count did not match for hunk at line ' + (chunkHeaderIndex + 1)); + } + } + + return hunk; + } + + while (i < diffstr.length) { + parseIndex(); + } + + return list; + } + //#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yBuZXcgRXJyb3IoJ1JlbW92ZWQgbGluZSBjb3VudCBkaWQgbm90IG1hdGNoIGZvciBodW5rIGF0IGxpbmUgJyArIChjaHVua0hlYWRlckluZGV4ICsgMSkpO1xuICAgICAgfVxuICAgIH1cblxuICAgIHJldHVybiBodW5rO1xuICB9XG5cbiAgd2hpbGUgKGkgPCBkaWZmc3RyLmxlbmd0aCkge1xuICAgIHBhcnNlSW5kZXgoKTtcbiAgfVxuXG4gIHJldHVybiBsaXN0O1xufVxuIl19 + + +/***/ }), +/* 12 */ +/***/ (function(module, exports) { + + /*istanbul ignore start*/"use strict"; + + exports.__esModule = true; + + exports["default"] = /*istanbul ignore end*/function (start, minLine, maxLine) { + var wantForward = true, + backwardExhausted = false, + forwardExhausted = false, + localOffset = 1; + + return function iterator() { + if (wantForward && !forwardExhausted) { + if (backwardExhausted) { + localOffset++; + } else { + wantForward = false; + } + + // Check if trying to fit beyond text length, and if not, check it fits + // after offset location (or desired location on first iteration) + if (start + localOffset <= maxLine) { + return localOffset; + } + + forwardExhausted = true; + } + + if (!backwardExhausted) { + if (!forwardExhausted) { + wantForward = true; + } + + // Check if trying to fit before text beginning, and if not, check it fits + // before offset location + if (minLine <= start - localOffset) { + return -localOffset++; + } + + backwardExhausted = true; + return iterator(); + } + + // We tried to fit hunk before text beginning and beyond text length, then + // hunk can't fit on the text. Return undefined + }; + }; + //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy91dGlsL2Rpc3RhbmNlLWl0ZXJhdG9yLmpzIl0sIm5hbWVzIjpbInN0YXJ0IiwibWluTGluZSIsIm1heExpbmUiLCJ3YW50Rm9yd2FyZCIsImJhY2t3YXJkRXhoYXVzdGVkIiwiZm9yd2FyZEV4aGF1c3RlZCIsImxvY2FsT2Zmc2V0IiwiaXRlcmF0b3IiXSwibWFwcGluZ3MiOiI7Ozs7NENBR2UsVUFBU0EsS0FBVCxFQUFnQk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Wdpbm5pbmcsIGFuZCBpZiBub3QsIGNoZWNrIGl0IGZpdHNcbiAgICAgIC8vIGJlZm9yZSBvZmZzZXQgbG9jYXRpb25cbiAgICAgIGlmIChtaW5MaW5lIDw9IHN0YXJ0IC0gbG9jYWxPZmZzZXQpIHtcbiAgICAgICAgcmV0dXJuIC1sb2NhbE9mZnNldCsrO1xuICAgICAgfVxuXG4gICAgICBiYWNrd2FyZEV4aGF1c3RlZCA9IHRydWU7XG4gICAgICByZXR1cm4gaXRlcmF0b3IoKTtcbiAgICB9XG5cbiAgICAvLyBXZSB0cmllZCB0byBmaXQgaHVuayBiZWZvcmUgdGV4dCBiZWdpbm5pbmcgYW5kIGJleW9uZCB0ZXh0IGxlbmd0aCwgdGhlblxuICAgIC8vIGh1bmsgY2FuJ3QgZml0IG9uIHRoZSB0ZXh0LiBSZXR1cm4gdW5kZWZpbmVkXG4gIH07XG59XG4iXX0= + + +/***/ }), +/* 13 */ +/***/ (function(module, exports, __webpack_require__) { + + /*istanbul ignore start*/'use strict'; + + exports.__esModule = true; + exports. /*istanbul ignore end*/calcLineCount = calcLineCount; + /*istanbul ignore start*/exports. /*istanbul ignore end*/merge = merge; + + var /*istanbul ignore start*/_create = __webpack_require__(14) /*istanbul ignore end*/; + + var /*istanbul ignore start*/_parse = __webpack_require__(11) /*istanbul ignore end*/; + + var /*istanbul ignore start*/_array = __webpack_require__(15) /*istanbul ignore end*/; + + /*istanbul ignore start*/function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } + + /*istanbul ignore end*/function calcLineCount(hunk) { + /*istanbul ignore start*/var _calcOldNewLineCount = /*istanbul ignore end*/calcOldNewLineCount(hunk.lines), + oldLines = _calcOldNewLineCount.oldLines, + newLines = _calcOldNewLineCount.newLines; + + if (oldLines !== undefined) { + hunk.oldLines = oldLines; + } else { + delete hunk.oldLines; + } + + if (newLines !== undefined) { + hunk.newLines = newLines; + } else { + delete hunk.newLines; + } + } + + function merge(mine, theirs, base) { + mine = loadPatch(mine, base); + theirs = loadPatch(theirs, base); + + var ret = {}; + + // For index we just let it pass through as it doesn't have any necessary meaning. + // Leaving sanity checks on this to the API consumer that may know more about the + // meaning in their own context. + if (mine.index || theirs.index) { + ret.index = mine.index || theirs.index; + } + + if (mine.newFileName || theirs.newFileName) { + if (!fileNameChanged(mine)) { + // No header or no change in ours, use theirs (and ours if theirs does not exist) + ret.oldFileName = theirs.oldFileName || mine.oldFileName; + ret.newFileName = theirs.newFileName || mine.newFileName; + ret.oldHeader = theirs.oldHeader || mine.oldHeader; + ret.newHeader = theirs.newHeader || mine.newHeader; + } else if (!fileNameChanged(theirs)) { + // No header or no change in theirs, use ours + ret.oldFileName = mine.oldFileName; + ret.newFileName = mine.newFileName; + ret.oldHeader = mine.oldHeader; + ret.newHeader = mine.newHeader; + } else { + // Both changed... figure it out + ret.oldFileName = selectField(ret, mine.oldFileName, theirs.oldFileName); + ret.newFileName = selectField(ret, mine.newFileName, theirs.newFileName); + ret.oldHeader = selectField(ret, mine.oldHeader, theirs.oldHeader); + ret.newHeader = selectField(ret, mine.newHeader, theirs.newHeader); + } + } + + ret.hunks = []; + + var mineIndex = 0, + theirsIndex = 0, + mineOffset = 0, + theirsOffset = 0; + + while (mineIndex < mine.hunks.length || theirsIndex < theirs.hunks.length) { + var mineCurrent = mine.hunks[mineIndex] || { oldStart: Infinity }, + theirsCurrent = theirs.hunks[theirsIndex] || { oldStart: Infinity }; + + if (hunkBefore(mineCurrent, theirsCurrent)) { + // This patch does not overlap with any of the others, yay. + ret.hunks.push(cloneHunk(mineCurrent, mineOffset)); + mineIndex++; + theirsOffset += mineCurrent.newLines - mineCurrent.oldLines; + } else if (hunkBefore(theirsCurrent, mineCurrent)) { + // This patch does not overlap with any of the others, yay. + ret.hunks.push(cloneHunk(theirsCurrent, theirsOffset)); + theirsIndex++; + mineOffset += theirsCurrent.newLines - theirsCurrent.oldLines; + } else { + // Overlap, merge as best we can + var mergedHunk = { + oldStart: Math.min(mineCurrent.oldStart, theirsCurrent.oldStart), + oldLines: 0, + newStart: Math.min(mineCurrent.newStart + mineOffset, theirsCurrent.oldStart + theirsOffset), + newLines: 0, + lines: [] + }; + mergeLines(mergedHunk, mineCurrent.oldStart, mineCurrent.lines, theirsCurrent.oldStart, theirsCurrent.lines); + theirsIndex++; + mineIndex++; + + ret.hunks.push(mergedHunk); + } + } + + return ret; + } + + function loadPatch(param, base) { + if (typeof param === 'string') { + if (/^@@/m.test(param) || /^Index:/m.test(param)) { + return (/*istanbul ignore start*/(0, _parse.parsePatch) /*istanbul ignore end*/(param)[0] + ); + } + + if (!base) { + throw new Error('Must provide a base reference or pass in a patch'); + } + return (/*istanbul ignore start*/(0, _create.structuredPatch) /*istanbul ignore end*/(undefined, undefined, base, param) + ); + } + + return param; + } + + function fileNameChanged(patch) { + return patch.newFileName && patch.newFileName !== patch.oldFileName; + } + + function selectField(index, mine, theirs) { + if (mine === theirs) { + return mine; + } else { + index.conflict = true; + return { mine: mine, theirs: theirs }; + } + } + + function hunkBefore(test, check) { + return test.oldStart < check.oldStart && test.oldStart + test.oldLines < check.oldStart; + } + + function cloneHunk(hunk, offset) { + return { + oldStart: hunk.oldStart, oldLines: hunk.oldLines, + newStart: hunk.newStart + offset, newLines: hunk.newLines, + lines: hunk.lines + }; + } + + function mergeLines(hunk, mineOffset, mineLines, theirOffset, theirLines) { + // This will generally result in a conflicted hunk, but there are cases where the context + // is the only overlap where we can successfully merge the content here. + var mine = { offset: mineOffset, lines: mineLines, index: 0 }, + their = { offset: theirOffset, lines: theirLines, index: 0 }; + + // Handle any leading content + insertLeading(hunk, mine, their); + insertLeading(hunk, their, mine); + + // Now in the overlap content. Scan through and select the best changes from each. + while (mine.index < mine.lines.length && their.index < their.lines.length) { + var mineCurrent = mine.lines[mine.index], + theirCurrent = their.lines[their.index]; + + if ((mineCurrent[0] === '-' || mineCurrent[0] === '+') && (theirCurrent[0] === '-' || theirCurrent[0] === '+')) { + // Both modified ... + mutualChange(hunk, mine, their); + } else if (mineCurrent[0] === '+' && theirCurrent[0] === ' ') { + /*istanbul ignore start*/var _hunk$lines; + + /*istanbul ignore end*/ // Mine inserted + /*istanbul ignore start*/(_hunk$lines = /*istanbul ignore end*/hunk.lines).push. /*istanbul ignore start*/apply /*istanbul ignore end*/( /*istanbul ignore start*/_hunk$lines /*istanbul ignore end*/, /*istanbul ignore start*/_toConsumableArray( /*istanbul ignore end*/collectChange(mine))); + } else if (theirCurrent[0] === '+' && mineCurrent[0] === ' ') { + /*istanbul ignore start*/var _hunk$lines2; + + /*istanbul ignore end*/ // Theirs inserted + /*istanbul ignore start*/(_hunk$lines2 = /*istanbul ignore end*/hunk.lines).push. /*istanbul ignore start*/apply /*istanbul ignore end*/( /*istanbul ignore start*/_hunk$lines2 /*istanbul ignore end*/, /*istanbul ignore start*/_toConsumableArray( /*istanbul ignore end*/collectChange(their))); + } else if (mineCurrent[0] === '-' && theirCurrent[0] === ' ') { + // Mine removed or edited + removal(hunk, mine, their); + } else if (theirCurrent[0] === '-' && mineCurrent[0] === ' ') { + // Their removed or edited + removal(hunk, their, mine, true); + } else if (mineCurrent === theirCurrent) { + // Context identity + hunk.lines.push(mineCurrent); + mine.index++; + their.index++; + } else { + // Context mismatch + conflict(hunk, collectChange(mine), collectChange(their)); + } + } + + // Now push anything that may be remaining + insertTrailing(hunk, mine); + insertTrailing(hunk, their); + + calcLineCount(hunk); + } + + function mutualChange(hunk, mine, their) { + var myChanges = collectChange(mine), + theirChanges = collectChange(their); + + if (allRemoves(myChanges) && allRemoves(theirChanges)) { + // Special case for remove changes that are supersets of one another + if ( /*istanbul ignore start*/(0, _array.arrayStartsWith) /*istanbul ignore end*/(myChanges, theirChanges) && skipRemoveSuperset(their, myChanges, myChanges.length - theirChanges.length)) { + /*istanbul ignore start*/var _hunk$lines3; + + /*istanbul ignore end*/ /*istanbul ignore start*/(_hunk$lines3 = /*istanbul ignore end*/hunk.lines).push. /*istanbul ignore start*/apply /*istanbul ignore end*/( /*istanbul ignore start*/_hunk$lines3 /*istanbul ignore end*/, /*istanbul ignore start*/_toConsumableArray( /*istanbul ignore end*/myChanges)); + return; + } else if ( /*istanbul ignore start*/(0, _array.arrayStartsWith) /*istanbul ignore end*/(theirChanges, myChanges) && skipRemoveSuperset(mine, theirChanges, theirChanges.length - myChanges.length)) { + /*istanbul ignore start*/var _hunk$lines4; + + /*istanbul ignore end*/ /*istanbul ignore start*/(_hunk$lines4 = /*istanbul ignore end*/hunk.lines).push. /*istanbul ignore start*/apply /*istanbul ignore end*/( /*istanbul ignore start*/_hunk$lines4 /*istanbul ignore end*/, /*istanbul ignore start*/_toConsumableArray( /*istanbul ignore end*/theirChanges)); + return; + } + } else if ( /*istanbul ignore start*/(0, _array.arrayEqual) /*istanbul ignore end*/(myChanges, theirChanges)) { + /*istanbul ignore start*/var _hunk$lines5; + + /*istanbul ignore end*/ /*istanbul ignore start*/(_hunk$lines5 = /*istanbul ignore end*/hunk.lines).push. /*istanbul ignore start*/apply /*istanbul ignore end*/( /*istanbul ignore start*/_hunk$lines5 /*istanbul ignore end*/, /*istanbul ignore start*/_toConsumableArray( /*istanbul ignore end*/myChanges)); + return; + } + + conflict(hunk, myChanges, theirChanges); + } + + function removal(hunk, mine, their, swap) { + var myChanges = collectChange(mine), + theirChanges = collectContext(their, myChanges); + if (theirChanges.merged) { + /*istanbul ignore start*/var _hunk$lines6; + + /*istanbul ignore end*/ /*istanbul ignore start*/(_hunk$lines6 = /*istanbul ignore end*/hunk.lines).push. /*istanbul ignore start*/apply /*istanbul ignore end*/( /*istanbul ignore start*/_hunk$lines6 /*istanbul ignore end*/, /*istanbul ignore start*/_toConsumableArray( /*istanbul ignore end*/theirChanges.merged)); + } else { + conflict(hunk, swap ? theirChanges : myChanges, swap ? myChanges : theirChanges); + } + } + + function conflict(hunk, mine, their) { + hunk.conflict = true; + hunk.lines.push({ + conflict: true, + mine: mine, + theirs: their + }); + } + + function insertLeading(hunk, insert, their) { + while (insert.offset < their.offset && insert.index < insert.lines.length) { + var line = insert.lines[insert.index++]; + hunk.lines.push(line); + insert.offset++; + } + } + function insertTrailing(hunk, insert) { + while (insert.index < insert.lines.length) { + var line = insert.lines[insert.index++]; + hunk.lines.push(line); + } + } + + function collectChange(state) { + var ret = [], + operation = state.lines[state.index][0]; + while (state.index < state.lines.length) { + var line = state.lines[state.index]; + + // Group additions that are immediately after subtractions and treat them as one "atomic" modify change. + if (operation === '-' && line[0] === '+') { + operation = '+'; + } + + if (operation === line[0]) { + ret.push(line); + state.index++; + } else { + break; + } + } + + return ret; + } + function collectContext(state, matchChanges) { + var changes = [], + merged = [], + matchIndex = 0, + contextChanges = false, + conflicted = false; + while (matchIndex < matchChanges.length && state.index < state.lines.length) { + var change = state.lines[state.index], + match = matchChanges[matchIndex]; + + // Once we've hit our add, then we are done + if (match[0] === '+') { + break; + } + + contextChanges = contextChanges || change[0] !== ' '; + + merged.push(match); + matchIndex++; + + // Consume any additions in the other block as a conflict to attempt + // to pull in the remaining context after this + if (change[0] === '+') { + conflicted = true; + + while (change[0] === '+') { + changes.push(change); + change = state.lines[++state.index]; + } + } + + if (match.substr(1) === change.substr(1)) { + changes.push(change); + state.index++; + } else { + conflicted = true; + } + } + + if ((matchChanges[matchIndex] || '')[0] === '+' && contextChanges) { + conflicted = true; + } + + if (conflicted) { + return changes; + } + + while (matchIndex < matchChanges.length) { + merged.push(matchChanges[matchIndex++]); + } + + return { + merged: merged, + changes: changes + }; + } + + function allRemoves(changes) { + return changes.reduce(function (prev, change) { + return prev && change[0] === '-'; + }, true); + } + function skipRemoveSuperset(state, removeChanges, delta) { + for (var i = 0; i < delta; i++) { + var changeContent = removeChanges[removeChanges.length - delta + i].substr(1); + if (state.lines[state.index + i] !== ' ' + changeContent) { + return false; + } + } + + state.index += delta; + return true; + } + + function calcOldNewLineCount(lines) { + var oldLines = 0; + var newLines = 0; + + lines.forEach(function (line) { + if (typeof line !== 'string') { + var myCount = calcOldNewLineCount(line.mine); + var theirCount = calcOldNewLineCount(line.theirs); + + if (oldLines !== undefined) { + if (myCount.oldLines === theirCount.oldLines) { + oldLines += myCount.oldLines; + } else { + oldLines = undefined; + } + } + + if (newLines !== undefined) { + if (myCount.newLines === theirCount.newLines) { + newLines += myCount.newLines; + } else { + newLines = undefined; + } + } + } else { + if (newLines !== undefined && (line[0] === '+' || line[0] === ' ')) { + newLines++; + } + if (oldLines !== undefined && (line[0] === '-' || line[0] === ' ')) { + oldLines++; + } + } + }); + + return { oldLines: oldLines, newLines: newLines }; + } + //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9wYXRjaC9tZXJnZS5qcyJdLCJuYW1lcyI6WyJjYWxjTGluZUNvdW50IiwibWVyZ2UiLCJodW5rIiwiY2FsY09sZE5ld0xpbmVDb3VudCIsImxpbmVzIiwib2xkTGluZXMiLCJuZXdMaW5lcyIsInVuZGVmaW5lZCIsIm1pbmUiLCJ0aGVpcnMiLCJiYXNlIiwibG9hZFBhdGNoIiwicmV0IiwiaW5kZXgiLCJuZXdGaWxlTmFtZSIsImZpbGVOYW1lQ2hhbmdlZCIsIm9sZEZpbGVOYW1lIiwib2xkSGVhZGVyIiwibmV3SGVhZGVyIiwic2VsZWN0RmllbGQiLCJodW5rcyIsIm1pbmVJbmRleCIsInRoZWlyc0luZGV4IiwibWluZU9mZnNldCIsInRoZWlyc09mZnNldCIsImxlbmd0aCIsIm1pbmVDdXJyZW50Iiwib2xkU3RhcnQiLCJJbmZpbml0eSIsInRoZWlyc0N1cnJlbnQiLCJodW5rQmVmb3JlIiwicHVzaCIsImNsb25lSHVuayIsIm1lcmdlZEh1bmsiLCJNYXRoIiwibWluIiwibmV3U3RhcnQiLCJtZXJnZUxpbmVzIiwicGFyYW0iLCJ0ZXN0IiwiRXJyb3IiLCJwYXRjaCIsImNvbmZsaWN0IiwiY2hlY2si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Lm5ld0xpbmVzID09PSB0aGVpckNvdW50Lm5ld0xpbmVzKSB7XG4gICAgICAgICAgbmV3TGluZXMgKz0gbXlDb3VudC5uZXdMaW5lcztcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICBuZXdMaW5lcyA9IHVuZGVmaW5lZDtcbiAgICAgICAgfVxuICAgICAgfVxuICAgIH0gZWxzZSB7XG4gICAgICBpZiAobmV3TGluZXMgIT09IHVuZGVmaW5lZCAmJiAobGluZVswXSA9PT0gJysnIHx8IGxpbmVbMF0gPT09ICcgJykpIHtcbiAgICAgICAgbmV3TGluZXMrKztcbiAgICAgIH1cbiAgICAgIGlmIChvbGRMaW5lcyAhPT0gdW5kZWZpbmVkICYmIChsaW5lWzBdID09PSAnLScgfHwgbGluZVswXSA9PT0gJyAnKSkge1xuICAgICAgICBvbGRMaW5lcysrO1xuICAgICAgfVxuICAgIH1cbiAgfSk7XG5cbiAgcmV0dXJuIHtvbGRMaW5lcywgbmV3TGluZXN9O1xufVxuIl19 + + +/***/ }), +/* 14 */ +/***/ (function(module, exports, __webpack_require__) { + + /*istanbul ignore start*/'use strict'; + + exports.__esModule = true; + exports. /*istanbul ignore end*/structuredPatch = structuredPatch; + /*istanbul ignore start*/exports. /*istanbul ignore end*/createTwoFilesPatch = createTwoFilesPatch; + /*istanbul ignore start*/exports. /*istanbul ignore end*/createPatch = createPatch; + + var /*istanbul ignore start*/_line = __webpack_require__(5) /*istanbul ignore end*/; + + /*istanbul ignore start*/function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } + + /*istanbul ignore end*/function structuredPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, newHeader, options) { + if (!options) { + options = {}; + } + if (typeof options.context === 'undefined') { + options.context = 4; + } + + var diff = /*istanbul ignore start*/(0, _line.diffLines) /*istanbul ignore end*/(oldStr, newStr, options); + diff.push({ value: '', lines: [] }); // Append an empty value to make cleanup easier + + function contextLines(lines) { + return lines.map(function (entry) { + return ' ' + entry; + }); + } + + var hunks = []; + var oldRangeStart = 0, + newRangeStart = 0, + curRange = [], + oldLine = 1, + newLine = 1; + + /*istanbul ignore start*/var _loop = function _loop( /*istanbul ignore end*/i) { + var current = diff[i], + lines = current.lines || current.value.replace(/\n$/, '').split('\n'); + current.lines = lines; + + if (current.added || current.removed) { + /*istanbul ignore start*/var _curRange; + + /*istanbul ignore end*/ // If we have previous context, start with that + if (!oldRangeStart) { + var prev = diff[i - 1]; + oldRangeStart = oldLine; + newRangeStart = newLine; + + if (prev) { + curRange = options.context > 0 ? contextLines(prev.lines.slice(-options.context)) : []; + oldRangeStart -= curRange.length; + newRangeStart -= curRange.length; + } + } + + // Output our changes + /*istanbul ignore start*/(_curRange = /*istanbul ignore end*/curRange).push. /*istanbul ignore start*/apply /*istanbul ignore end*/( /*istanbul ignore start*/_curRange /*istanbul ignore end*/, /*istanbul ignore start*/_toConsumableArray( /*istanbul ignore end*/lines.map(function (entry) { + return (current.added ? '+' : '-') + entry; + }))); + + // Track the updated file position + if (current.added) { + newLine += lines.length; + } else { + oldLine += lines.length; + } + } else { + // Identical context lines. Track line changes + if (oldRangeStart) { + // Close out any changes that have been output (or join overlapping) + if (lines.length <= options.context * 2 && i < diff.length - 2) { + /*istanbul ignore start*/var _curRange2; + + /*istanbul ignore end*/ // Overlapping + /*istanbul ignore start*/(_curRange2 = /*istanbul ignore end*/curRange).push. /*istanbul ignore start*/apply /*istanbul ignore end*/( /*istanbul ignore start*/_curRange2 /*istanbul ignore end*/, /*istanbul ignore start*/_toConsumableArray( /*istanbul ignore end*/contextLines(lines))); + } else { + /*istanbul ignore start*/var _curRange3; + + /*istanbul ignore end*/ // end the range and output + var contextSize = Math.min(lines.length, options.context); + /*istanbul ignore start*/(_curRange3 = /*istanbul ignore end*/curRange).push. /*istanbul ignore start*/apply /*istanbul ignore end*/( /*istanbul ignore start*/_curRange3 /*istanbul ignore end*/, /*istanbul ignore start*/_toConsumableArray( /*istanbul ignore end*/contextLines(lines.slice(0, contextSize)))); + + var hunk = { + oldStart: oldRangeStart, + oldLines: oldLine - oldRangeStart + contextSize, + newStart: newRangeStart, + newLines: newLine - newRangeStart + contextSize, + lines: curRange + }; + if (i >= diff.length - 2 && lines.length <= options.context) { + // EOF is inside this hunk + var oldEOFNewline = /\n$/.test(oldStr); + var newEOFNewline = /\n$/.test(newStr); + if (lines.length == 0 && !oldEOFNewline) { + // special case: old has no eol and no trailing context; no-nl can end up before adds + curRange.splice(hunk.oldLines, 0, '\\ No newline at end of file'); + } else if (!oldEOFNewline || !newEOFNewline) { + curRange.push('\\ No newline at end of file'); + } + } + hunks.push(hunk); + + oldRangeStart = 0; + newRangeStart = 0; + curRange = []; + } + } + oldLine += lines.length; + newLine += lines.length; + } + }; + + for (var i = 0; i < diff.length; i++) { + /*istanbul ignore start*/_loop( /*istanbul ignore end*/i); + } + + return { + oldFileName: oldFileName, newFileName: newFileName, + oldHeader: oldHeader, newHeader: newHeader, + hunks: hunks + }; + } + + function createTwoFilesPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, newHeader, options) { + var diff = structuredPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, newHeader, options); + + var ret = []; + if (oldFileName == newFileName) { + ret.push('Index: ' + oldFileName); + } + ret.push('==================================================================='); + ret.push('--- ' + diff.oldFileName + (typeof diff.oldHeader === 'undefined' ? '' : '\t' + diff.oldHeader)); + ret.push('+++ ' + diff.newFileName + (typeof diff.newHeader === 'undefined' ? '' : '\t' + diff.newHeader)); + + for (var i = 0; i < diff.hunks.length; i++) { + var hunk = diff.hunks[i]; + ret.push('@@ -' + hunk.oldStart + ',' + hunk.oldLines + ' +' + hunk.newStart + ',' + hunk.newLines + ' @@'); + ret.push.apply(ret, hunk.lines); + } + + return ret.join('\n') + '\n'; + } + + function createPatch(fileName, oldStr, newStr, oldHeader, newHeader, options) { + return createTwoFilesPatch(fileName, fileName, oldStr, new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zaChcbiAgICAgICdAQCAtJyArIGh1bmsub2xkU3RhcnQgKyAnLCcgKyBodW5rLm9sZExpbmVzXG4gICAgICArICcgKycgKyBodW5rLm5ld1N0YXJ0ICsgJywnICsgaHVuay5uZXdMaW5lc1xuICAgICAgKyAnIEBAJ1xuICAgICk7XG4gICAgcmV0LnB1c2guYXBwbHkocmV0LCBodW5rLmxpbmVzKTtcbiAgfVxuXG4gIHJldHVybiByZXQuam9pbignXFxuJykgKyAnXFxuJztcbn1cblxuZXhwb3J0IGZ1bmN0aW9uIGNyZWF0ZVBhdGNoKGZpbGVOYW1lLCBvbGRTdHIsIG5ld1N0ciwgb2xkSGVhZGVyLCBuZXdIZWFkZXIsIG9wdGlvbnMpIHtcbiAgcmV0dXJuIGNyZWF0ZVR3b0ZpbGVzUGF0Y2goZmlsZU5hbWUsIGZpbGVOYW1lLCBvbGRTdHIsIG5ld1N0ciwgb2xkSGVhZGVyLCBuZXdIZWFkZXIsIG9wdGlvbnMpO1xufVxuIl19 + + +/***/ }), +/* 15 */ +/***/ (function(module, exports) { + + /*istanbul ignore start*/"use strict"; + + exports.__esModule = true; + exports. /*istanbul ignore end*/arrayEqual = arrayEqual; + /*istanbul ignore start*/exports. /*istanbul ignore end*/arrayStartsWith = arrayStartsWith; + function arrayEqual(a, b) { + if (a.length !== b.length) { + return false; + } + + return arrayStartsWith(a, b); + } + + function arrayStartsWith(array, start) { + if (start.length > array.length) { + return false; + } + + for (var i = 0; i < start.length; i++) { + if (start[i] !== array[i]) { + return false; + } + } + + return true; + } + //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy91dGlsL2FycmF5LmpzIl0sIm5hbWVzIjpbImFycmF5RXF1YWwiLCJhcnJheVN0YXJ0c1dpdGgiLCJhIiwiYiIsImxlbmd0aCIsImFycmF5Iiwic3RhcnQiLCJpIl0sIm1hcHBpbmdzIjoiOzs7Z0NBQWdCQSxVLEdB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biAgICBpZiAoc3RhcnRbaV0gIT09IGFycmF5W2ldKSB7XG4gICAgICByZXR1cm4gZmFsc2U7XG4gICAgfVxuICB9XG5cbiAgcmV0dXJuIHRydWU7XG59XG4iXX0= + + +/***/ }), +/* 16 */ +/***/ (function(module, exports) { + + /*istanbul ignore start*/"use strict"; + + exports.__esModule = true; + exports. /*istanbul ignore end*/convertChangesToDMP = convertChangesToDMP; + // See: http://code.google.com/p/google-diff-match-patch/wiki/API + function convertChangesToDMP(changes) { + var ret = [], + change = /*istanbul ignore start*/void 0 /*istanbul ignore end*/, + operation = /*istanbul ignore start*/void 0 /*istanbul ignore end*/; + for (var i = 0; i < changes.length; i++) { + change = changes[i]; + if (change.added) { + operation = 1; + } else if (change.removed) { + operation = -1; + } else { + operation = 0; + } + + ret.push([operation, change.value]); + } + return ret; + } + //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9jb252ZXJ0L2RtcC5qcyJdLCJuYW1lcyI6WyJjb252ZXJ0Q2hhbmdlc1RvRE1QIiwiY2hhbmdlcyIsInJldCIsImNoYW5nZSIsIm9wZXJhdGlvbiIsImkiLCJsZW5ndGgiLCJhZGRlZCIsInJlbW92ZWQiLCJwdXNoIiwidmFsdWUiXSwibWFwcGluZ3MiOiI7OztnQ0FDZ0JBLG1CLEdBQUFBLG1CO0FBRGhCO0FBQ08sU0FBU0EsbUJBQVQsQ0FBNkJDLE9BQTdCLEVBQXNDO0FBQzNDLE1BQUlDLE1BQU0sRUFBVjtBQUFBLE1BQ0lDLHdDQURKO0FBQUEsTUFFSUMsMkNBRko7QUFHQSxPQUFLLElBQUlDLElBQUksQ0FBYixFQUFnQkEsSUFBSUosUUFBUUssTUFBNUIsRUFBb0NELEdBQXBDLEVBQXlDO0FBQ3ZDRixhQUFTRixRQUFRSSxDQUFSLENBQVQ7QUFDQSxRQUFJRixPQUFPSSxLQUFYLEVBQWtCO0FBQ2hCSCxrQkFBWSxDQUFaO0FBQ0QsS0FGRCxNQUVPLElBQUlELE9BQU9LLE9BQVgsRUFBb0I7QUFDekJKLGtCQUFZLENBQUMsQ0FBYjtBQUNELEtBRk0sTUFFQTtBQUNMQSxrQkFBWSxDQUFaO0FBQ0Q7O0FBRURGLFFBQUlPLElBQUosQ0FBUyxDQUFDTCxTQUFELEVBQVlELE9BQU9PLEtBQW5CLENBQVQ7QUFDRDtBQUNELFNBQU9SLEdBQVA7QUFDRCIsImZpbGUiOiJkbXAuanMiLCJzb3VyY2VzQ29udGVudCI6WyIvLyBTZWU6IGh0dHA6Ly9jb2RlLmdvb2dsZS5jb20vcC9nb29nbGUtZGlmZi1tYXRjaC1wYXRjaC93aWtpL0FQSVxuZXhwb3J0IGZ1bmN0aW9uIGNvbnZlcnRDaGFuZ2VzVG9ETVAoY2hhbmdlcykge1xuICBsZXQgcmV0ID0gW10sXG4gICAgICBjaGFuZ2UsXG4gICAgICBvcGVyYXRpb247XG4gIGZvciAobGV0IGkgPSAwOyBpIDwgY2hhbmdlcy5sZW5ndGg7IGkrKykge1xuICAgIGNoYW5nZSA9IGNoYW5nZXNbaV07XG4gICAgaWYgKGNoYW5nZS5hZGRlZCkge1xuICAgICAgb3BlcmF0aW9uID0gMTtcbiAgICB9IGVsc2UgaWYgKGNoYW5nZS5yZW1vdmVkKSB7XG4gICAgICBvcGVyYXRpb24gPSAtMTtcbiAgICB9IGVsc2Uge1xuICAgICAgb3BlcmF0aW9uID0gMDtcbiAgICB9XG5cbiAgICByZXQucHVzaChbb3BlcmF0aW9uLCBjaGFuZ2UudmFsdWVdKTtcbiAgfVxuICByZXR1cm4gcmV0O1xufVxuIl19 + + +/***/ }), +/* 17 */ +/***/ (function(module, exports) { + + /*istanbul ignore start*/'use strict'; + + exports.__esModule = true; + exports. /*istanbul ignore end*/convertChangesToXML = convertChangesToXML; + function convertChangesToXML(changes) { + var ret = []; + for (var i = 0; i < changes.length; i++) { + var change = changes[i]; + if (change.added) { + ret.push('<ins>'); + } else if (change.removed) { + ret.push('<del>'); + } + + ret.push(escapeHTML(change.value)); + + if (change.added) { + ret.push('</ins>'); + } else if (change.removed) { + ret.push('</del>'); + } + } + return ret.join(''); + } + + function escapeHTML(s) { + var n = s; + n = n.replace(/&/g, '&'); + n = n.replace(/</g, '<'); + n = n.replace(/>/g, '>'); + n = n.replace(/"/g, '"'); + + return n; + } + //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9jb252ZXJ0L3htbC5qcyJdLCJuYW1lcyI6WyJjb252ZXJ0Q2hhbmdlc1RvWE1MIiwiY2hhbmdlcyIsInJldCIsImkiLCJsZW5ndGgiLCJjaGFuZ2UiLCJhZGRlZCIsInB1c2giLCJyZW1vdmVkIiwiZXNjYXBlSFRNTCIsInZhbHVlIiwiam9pbiIsInMiLCJuIiwicmVwbGFjZSJdLCJtYXBwaW5ncyI6Ijs7O2dDQUFnQkEsbUIsR0FBQUEsbUI7QUFBVCxTQUFTQSxtQkFBVCxDQUE2QkMsT0FBN0IsRUFBc0M7QUFDM0MsTUFBSUMsTUFBTSxFQUFWO0FBQ0EsT0FBSyxJQUFJQyxJQUFJLENBQWIsRUFBZ0JBLElBQUlGLFFBQVFHLE1BQTVCLEVBQW9DRCxHQUFwQyxFQUF5QztBQUN2QyxRQUFJRSxTQUFTSixRQUFRRSxDQUFSLENBQWI7QUFDQSxRQUFJRSxPQUFPQyxLQUFYLEVBQWtCO0FBQ2hCSixVQUFJSyxJQUFKLENBQVMsT0FBVDtBQUNELEtBRkQsTUFFTyxJQUFJRixPQUFPRyxPQUFYLEVBQW9CO0FBQ3pCTixVQUFJSyxJQUFKLENBQVMsT0FBVDtBQUNEOztBQUVETCxRQUFJSyxJQUFKLENBQVNFLFdBQVdKLE9BQU9LLEtBQWxCLENBQVQ7O0FBRUEsUUFBSUwsT0FBT0MsS0FBWCxFQUFrQjtBQUNoQkosVUFBSUss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