Repository: dat-land/dat-desktop Branch: master Commit: 57a34e227227 Files: 88 Total size: 1.8 MB Directory structure: gitextract_rtm8sp7z/ ├── .babelrc ├── .github/ │ ├── PULL_REQUEST_TEMPLATE.md │ └── workflows/ │ └── nodejs.yml ├── .gitignore ├── .travis.yml ├── CHANGELOG.md ├── CONTRIBUTING.md ├── LICENSE ├── README.md ├── app/ │ ├── actions/ │ │ ├── dat-middleware.js │ │ └── index.js │ ├── components/ │ │ ├── app.js │ │ ├── button.js │ │ ├── dat-import.js │ │ ├── dialog.js │ │ ├── empty.js │ │ ├── file-list.js │ │ ├── finder-button.js │ │ ├── header.js │ │ ├── hex-content.js │ │ ├── icon.js │ │ ├── inspect.js │ │ ├── intro.js │ │ ├── status-bar.js │ │ ├── status.js │ │ ├── table-row.js │ │ ├── table.js │ │ └── title-field.js │ ├── consts/ │ │ ├── env.js │ │ ├── screen.js │ │ └── state.js │ ├── containers/ │ │ ├── dat-import.js │ │ ├── dialog.js │ │ ├── drag-drop.js │ │ ├── header.js │ │ ├── inspect.js │ │ ├── intro.js │ │ ├── status-bar.js │ │ ├── table-row.js │ │ └── table.js │ ├── index.js │ └── reducers/ │ └── index.js ├── appveyor.yml ├── build/ │ └── icon.icns ├── dev/ │ └── react-dev-tools/ │ ├── _metadata/ │ │ └── verified_contents.json │ ├── build/ │ │ ├── backend.js │ │ ├── background.js │ │ ├── contentScript.js │ │ ├── inject.js │ │ ├── main.js │ │ └── panel.js │ ├── main.html │ ├── manifest.json │ ├── panel.html │ └── popups/ │ ├── deadcode.html │ ├── development.html │ ├── disabled.html │ ├── outdated.html │ ├── production.html │ ├── shared.js │ └── unminified.html ├── dist/ │ └── .gitignore ├── index.html ├── index.js ├── lib/ │ └── auto-updater.js ├── package.json ├── preload.js ├── static/ │ └── base.css ├── tests/ │ ├── fixtures/ │ │ ├── dat.json │ │ └── hello.txt │ ├── index.js │ └── utils/ │ ├── wait.js │ ├── waitForAndClick.js │ ├── waitForMatch.js │ └── waitForVisible.js ├── unit-tests/ │ ├── _helpers/ │ │ ├── enzymeSetup.js │ │ └── mockWindow.js │ ├── dat-import.js │ ├── file-list.js │ ├── hex-content.js │ ├── inspect.js │ ├── intro.js │ ├── status-bar.js │ ├── status.js │ ├── table-row.js │ ├── table.js │ └── title-field.js └── webpack.config.js ================================================ FILE CONTENTS ================================================ ================================================ FILE: .babelrc ================================================ { "presets": [ "@babel/preset-react" ], "env": { "test": { "plugins": [ "@babel/plugin-transform-modules-commonjs", "@babel/plugin-transform-classes", "@babel/plugin-proposal-object-rest-spread" ] } } } ================================================ FILE: .github/PULL_REQUEST_TEMPLATE.md ================================================ ### First time contributor checklist: - [ ] I have read the [README](https://github.com/digidem/mapeo-desktop/blob/master/README.md) ### Contributor checklist: - [ ] My commits are in nice logical chunks with [good commit messages](http://chris.beams.io/posts/git-commit/) - [ ] If my changes depend upon an update to a dependency, I have updated the package-lock.json file using `npm install --package-lock` - [ ] I have used the app myself and all of the buttons work. - [ ] I have tested the application with [the commandline tool](https://github.com/datproject/dat). - [ ] My changes have been tested with the integration tests, and all tests pass. - [ ] My changes are ready to be shipped to users on Mac and Linux. ### Description ================================================ FILE: .github/workflows/nodejs.yml ================================================ name: Node CD on: [push] jobs: build: runs-on: ${{ matrix.os }} strategy: matrix: os: [windows-latest] steps: - name: Context env: GITHUB_CONTEXT: ${{ toJson(github) }} run: echo "$GITHUB_CONTEXT" - uses: actions/checkout@v1 with: fetch-depth: 1 - name: Use Node.js 12.4 uses: actions/setup-node@v1 with: node-version: 12.4 - name: npm install run: | npm install - name: Test run: | npm test - name: Build frontend run: | npm run build:prod env: CI: true - name: Publish run: | npm run dist:publish env: CI: true GITHUB_CI_REF: ${{ github.ref }} GH_TOKEN: ${{ secrets.GH_TOKEN }} - name: Cleanup artifacts run: | npx rimraf@2 'dist/!(*.exe|*.deb|*.AppImage|*.dmg)' shell: bash - name: Upload artifacts uses: actions/upload-artifact@v1 with: name: ${{ matrix.os }} path: dist ================================================ FILE: .gitignore ================================================ node_modules .DS_Store dmgs npm-debug.log build/background.tiff .dat tags yarn.lock static/bundle.js ================================================ FILE: .travis.yml ================================================ dist: trusty cache: bundler sudo: false language: node_js node_js: - 12.4 os: - osx - linux notifications: email: false addons: apt: packages: - icnsutils - graphicsmagick - xz-utils - xvfb env: - DISPLAY=":99.0" install: - Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 & - npm install - npm run build:prod deploy: provider: script script: npm run dist:publish on: branch: master skip_cleanup: true ================================================ FILE: CHANGELOG.md ================================================ # Changelog All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. ### [3.0.2](https://github.com/datproject/dat-desktop/compare/v3.0.1...v3.0.2) (2020-02-20) ### Bug Fixes * add standard version ([c6788cf](https://github.com/datproject/dat-desktop/commit/c6788cf)) * Windows download issue, an attempt to squash it! ([dd270f1](https://github.com/datproject/dat-desktop/commit/dd270f1)) ### [3.0.1](https://github.com/datproject/dat-desktop/compare/v3.0.0...v3.0.1) (2020-02-18) ### Bug Fixes * Fix a bug where sometimes download dir wouldn't exist and crash ([7e1f2a7](https://github.com/datproject/dat-desktop/commit/7e1f2a741c708772500a505e7f21b76456af1c92)) * Should no longer crash on startup for Mac. ([1bd0436](https://github.com/datproject/dat-desktop/commit/1bd043692129fe2436c15b8f6d2371bd9ea6f8bc)) * When downloading a dat, ensure Download button is visible. ([4a573ed](https://github.com/datproject/dat-desktop/commit/4a573ed385d7f3df7ac5f4f687f4e9db40397556)) ## [3.0.0](https://github.com/datproject/dat-desktop/compare/v2.1.0...v3.0.0) (2020-02-18) ### Features * Windows builds! ### Bug Fixes * add package-lock ([8420cbf](https://github.com/datproject/dat-desktop/commit/8420cbf44b7a05902dac014663886cd96e71b61d)) * avoid the screen white-out. ([f53397a](https://github.com/datproject/dat-desktop/commit/f53397aec79739b54d848a46726b242fee759ec1)) * buttons will click now ([f3aceb9](https://github.com/datproject/dat-desktop/commit/f3aceb9217ae4a97a5116a9f6e49b8de9de690f8)) * changing title still keep on the next session. ([2f826ac](https://github.com/datproject/dat-desktop/commit/2f826ac35155eda883773d840b76116c4bcc9630)) * deprecated syntax by current styled-components. ([6340267](https://github.com/datproject/dat-desktop/commit/634026755d15526edaac5a0888da9bc312915934)) * Even though if press "cancel" on download-preview-screen, still listed in dat-list. ([894225b](https://github.com/datproject/dat-desktop/commit/894225bedaa06b68835de9b4f386f74822b9f94b)) * https://github.com/dat-land/dat-desktop/pull/600#issuecomment-440926308 ([5d05d27](https://github.com/datproject/dat-desktop/commit/5d05d2737f0a504f37f1024620de75da44149b26)), closes [/github.com/dat-land/dat-desktop/pull/600#issuecomment-440926308](https://github.com/datproject//github.com/dat-land/dat-desktop/pull/600/issues/issuecomment-440926308) * overlay on menu open. ([96cf727](https://github.com/datproject/dat-desktop/commit/96cf7279e347dd9e64cfc1ce418af892ccf7a71e)) * overlay to be not enough filled the. ([c3698de](https://github.com/datproject/dat-desktop/commit/c3698de98c63341489291fcbe723dc45db7dc88f)) * Re-introduced --publish=onTagOrDraft flag, missing for the release management. ([ffff3d6](https://github.com/datproject/dat-desktop/commit/ffff3d6f81906ca5dfe7a4e829ee237886f81541)) * set to disable the hover action to dat-list-header. ([96f34c5](https://github.com/datproject/dat-desktop/commit/96f34c597d795ee8367c119a8860e6ef69c26ae6)) * to be fixed position the list header. ([5f198cb](https://github.com/datproject/dat-desktop/commit/5f198cb32e63c1766977134c73e8060818482891)) * unit-test ([840b108](https://github.com/datproject/dat-desktop/commit/840b1086bf73a5fff81697d39d4e1ef522e727b6)) * update Electron, comment deprecated makeSingleInstance call ([3a88c9f](https://github.com/datproject/dat-desktop/commit/3a88c9f42aff12a12f8c43defcbae75a9ae22073)) * update to electron changed showOpenDialog api ([834b23a](https://github.com/datproject/dat-desktop/commit/834b23aed094007d6b8dd144d85fa5050f09f6bb)) ================================================ FILE: CONTRIBUTING.md ================================================ # Hello there! Thanks for considering to contribute. Dat Desktop is a tool developed by the open source community, and it’s the time and effort of people like you that makes it better! ## What kind of contributions we are looking for You can help to improve Dat Desktop by [reporting bugs](https://github.com/datproject/dat-desktop/issues) or helping with existing [issues](https://github.com/datproject/dat-desktop/issues). Help with improving documentation like the [README](https://github.com/datproject/dat-desktop/blob/master/README.md) or the [Wiki](https://github.com/datproject/dat-desktop/wiki) is also welcome. ## How to report a problem [Check here](https://github.com/datproject/dat-desktop/issues) if the problem has already been reported. If so, you're welcome to add your description of the problem in a comment on the existing issue. If there is no issue that describes your poblem, go ahead and [open a new issue](https://github.com/datproject/dat-desktop/issues/new). Please include the following information: 1. Which version of Dat Desktop are you running? 2. What operating system and processor architecture are you using? 3. What did you do? 4. What did you expect to see? 5. What did you see instead? ## Pull Requests Please give 2 week days of time for reviews on each Pull Request, as we are a distributed team of non-fulltime contributors. ================================================ FILE: LICENSE ================================================ MIT License Copyright (c) 2017 Dat Project 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. ================================================ FILE: README.md ================================================ [![deprecated](http://badges.github.io/stability-badges/dist/deprecated.svg)](https://dat-ecosystem.org/) More info on active projects and modules at [dat-ecosystem.org](https://dat-ecosystem.org/) --- # Dat Desktop **Peer to peer data versioning & syncronization.** [!["Build Status"](https://img.shields.io/travis/dat-land/dat-desktop/master.svg?style=flat-square)](https://travis-ci.org/dat-land/dat-desktop) [!["Standard](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat-square)](https://standardjs.com) ![screenshot](assets/screenshot.png) ## Table of Content - [Download](https://github.com/datproject/dat-desktop/releases) - [FAQ](#faq) - [License](#licenses) ## Contributing To run _Dat Desktop_ in development mode: ```sh node --version # v12.4.0 npm install # install dependencies npm start # start the application ``` To create binary packages run: ```sh npm install # install dependencies npm run dist :os # compile the app into an binary package ``` ## FAQ ### How to speed up downloading Electron If you’re not in Europe or the US, you might want to use a different mirror for `electron`. You can set the `ELECTRON_MIRROR` variable to point to a different provider: ```sh # Europe / US $ npm install # Asia / Oceania $ ELECTRON_MIRROR="https://npm.taobao.org/mirrors/electron/" npm install ``` ## Licenses [MIT License](./LICENSE) ### Font Attribution & License SourceSansPro-Regular.ttf: Copyright 2010, 2012 Adobe Systems Incorporated (http://www.adobe.com/), with Reserved Font Name 'Source'. All Rights Reserved. Source is a trademark of Adobe Systems Incorporated in the United States and/or other countries. [SIL Open Font License, 1.1](http://scripts.sil.org/cms/scripts/page.php?site_id=nrsi&id=OFL) SourceCodePro-Regular.ttf: Copyright 2010, 2012 Adobe Systems Incorporated. All Rights Reserved. [SIL Open Font License, 1.1](http://scripts.sil.org/cms/scripts/page.php?site_id=nrsi&id=OFL) ================================================ FILE: app/actions/dat-middleware.js ================================================ 'use strict' import Dat from 'dat-node' import { encode } from 'dat-encoding' import fs from 'fs' import { basename, join as joinPath } from 'path' import { ipcRenderer, shell } from 'electron' import mkdirp from 'mkdirp-promise' import mirror from 'mirror-folder' import promisify from 'util-promisify' const readFile = promisify(fs.readFile) const writeFile = promisify(fs.writeFile) const { Notification } = window async function readJSON (file) { try { const blob = await readFile(file, 'utf8') if (!blob) { return {} } return JSON.parse(blob) } catch (_) {} return {} } export default class DatMiddleware { constructor ({ downloadsDir, dataDir }) { this.downloadsDir = downloadsDir this.dataDir = dataDir this.dats = {} this.listeners = [] this.execByType = { UPDATE_TITLE: action => this.updateTitle(action), REMOVE_DAT: action => this.removeDat(action), TRY_ADD_DAT: action => this.tryAddDat(action), REQUEST_DOWNLOAD: action => this.validateDownloadRequest(action), TOGGLE_PAUSE: action => this.togglePause(action), DOWNLOAD_SPARSE_DAT: action => this.downloadSparseDat(action), CANCEL_DOWNLOAD_DAT: action => this.cancelDownloadDat(action) } } async validateDownloadRequest ({ key }) { if (key) { key = encode(key) if (this.dats[key]) { return this.dispatch({ type: 'ADD_DAT_ERROR', key, error: new Error('Dat with same key already exists.') }) } } this.dispatch({ type: 'SHOW_DOWNLOAD_SCREEN', key }) } execAction (action) { const exec = this.execByType[action.type] if (!exec) return false // Telling it to all the middlewares. this.dispatch(action) exec(action) .then(data => this.dispatch({ ...action, type: `${action.type}_SUCCESS`, ...data }) ) .catch(error => this.dispatch({ ...action, type: `${action.type}_ERROR`, error }) ) return true } middleware (store) { return dispatch => { this.listeners.push(dispatch) return action => { const triggersEffect = this.execAction(action) if (!triggersEffect) { // This action was not ment for this middleware. // Pass on to the next. dispatch(action) } } } } dispatch (action) { this.listeners.forEach(listener => listener(action)) } async updateTitle ({ key, title }) { const dat = this.dats[key] const filePath = joinPath(dat.path, 'dat.json') const metadata = { ...dat.dat.metadata, title: title } try { await writeFile(filePath, JSON.stringify(metadata)) } catch (error) { return this.dispatch({ type: 'WRITE_METADATA_ERROR', key, error }) } } async removeDat ({ key }) { this.removeDatInternally(key) this.storeOnDisk() } async tryAddDat (action) { let { key, path } = action if (key) { key = encode(key) if (this.dats[key]) { this.dispatch({ type: 'ADD_DAT_ERROR:EXISTED' }) throw this.dispatch({ type: 'ADD_DAT_ERROR', key, error: new Error('Dat with same key already added.') }) } } if (!path) path = joinPath(this.downloadsDir, key) for (let key in this.dats) { const dat = this.dats[key] if (dat.path === path) { this.dispatch({ type: 'ADD_DAT_ERROR:EXISTED' }) throw this.dispatch({ type: 'ADD_DAT_ERROR', key, error: new Error('Dat with same path already added.') }) } } await this.internalAddDat(action) } async internalAddDat ({ key, path, paused, ...opts }) { if (key) { this.dispatch({ type: 'ADD_DAT', key, path, paused }) } opts = { watch: true, resume: true, ignoreHidden: true, compareFileContent: true, ...opts } Dat(path, { key }, (error, dat) => { if (error) return this.dispatch({ type: 'ADD_DAT_ERROR', key, error }) if (!key) { key = encode(dat.key) this.dispatch({ type: 'ADD_DAT', key, path, paused }) } dat.trackStats() if (dat.writable) dat.importFiles(opts) this.dispatch({ type: 'DAT_METADATA', key, metadata: { title: basename(path), author: 'Anonymous' } }) this.dispatch({ type: 'ADD_DAT_SUCCESS', key }) this.dispatch({ type: 'DAT_WRITABLE', key, writable: dat.writable }) dat.archive.readFile('dat.json', (err, blob) => { if (err) return let metadata = {} try { metadata = JSON.parse(blob) } catch (_) {} this.dispatch({ type: 'DAT_METADATA', key, metadata }) }) dat.stats.on('update', stats => { if (!stats) stats = dat.stats.get() this.updateProgress(dat, key, stats) this.dispatch({ type: 'DAT_STATS', key, stats: { ...stats } }) }) this.updateState(dat) this.updateProgress(dat, key) if (!paused) { this.joinNetwork(dat) this.updateConnections(dat) } let prevNetworkStats dat.updateInterval = setInterval(() => { const stats = JSON.stringify(dat.stats.network) if (stats === prevNetworkStats) return prevNetworkStats = stats this.dispatch({ type: 'DAT_NETWORK_STATS', key, stats: { up: dat.stats.network.uploadSpeed, down: dat.stats.network.downloadSpeed } }) }, 1000) this.appendDatInternally(key, dat, path, opts) this.storeOnDisk() }) } updateProgress (dat, key, stats) { if (!stats) stats = dat.stats.get() const prevProgress = dat.progress const progress = !dat.stats ? 0 : dat.writable ? 1 : Math.min(1, stats.downloaded / stats.length) dat.progress = progress this.dispatch({ type: 'DAT_PROGRESS', key, progress }) this.updateState(dat) const unfinishedBefore = prevProgress < 1 && prevProgress > 0 if (dat.progress === 1 && unfinishedBefore) { const notification = new Notification('Download finished', { body: key }) notification.onclick = () => shell.openExternal(`file://${dat.path}`, () => {}) } const incomplete = [] for (const d of Object.values(this.dats)) { if (d.network && d.progress < 1) incomplete.push(d) } let totalProgress = incomplete.length ? incomplete.reduce((acc, dat) => { return acc + dat.progress }, 0) / incomplete.length : 1 if (totalProgress === 1) totalProgress = -1 // deactivate if (ipcRenderer) ipcRenderer.send('progress', totalProgress) } async togglePause ({ key, paused }) { const { dat } = this.dats[key] if (paused) { this.joinNetwork(dat) } else { dat.leaveNetwork() } this.storeOnDisk() } async downloadSparseDat ({ key }) { key = encode(key) if (this.dats[key]) { this.dispatch({ type: 'ADD_DAT_ERROR:EXISTED' }) return } const path = joinPath(this.downloadsDir, key) this.dispatch({ type: 'ADD_DAT', key, path }) Dat(path, { key, sparse: true }, (error, dat) => { if (error) return this.dispatch({ type: 'ADD_DAT_ERROR', key, error }) dat.trackStats() this.dispatch({ type: 'DAT_METADATA', key, metadata: { title: basename(path), author: 'Anonymous' } }) this.dispatch({ type: 'ADD_DAT_SUCCESS', key }) dat.archive.readFile('/dat.json', (err, blob) => { if (err) return let metadata = {} try { metadata = JSON.parse(blob) } catch (_) {} this.dispatch({ type: 'DAT_METADATA', key, metadata }) }) dat.stats.on('update', stats => { if (!stats) stats = dat.stats.get() this.dispatch({ type: 'DAT_STATS', key, stats: { ...stats } }) }) this.updateState(dat) this.joinNetwork(dat) this.updateConnections(dat) this.appendDatInternally(key, dat, path) }) } async cancelDownloadDat ({ key }) { this.removeDatInternally(key) } appendDatInternally (key, dat, path, opts = {}) { this.dats[key] = { dat, path, opts } dat.stats.once('update', () => { this.walk(dat) }) } removeDatInternally (key) { this.dispatch({ type: 'REMOVE_DAT', key }) const { dat } = this.dats[key] || {} if (!dat) return // maybe was deleted delete this.dats[key] if (dat.mirrorProgress) { dat.mirrorProgress.destroy() } for (const con of dat.network.connections) { con.removeAllListeners() } dat.stats.removeAllListeners() clearInterval(dat.updateInterval) dat.close() } walk (dat) { const key = encode(dat.key) if (!this.dats[key]) return // maybe it was deleted? if (!dat.files) dat.files = [] var fs = { name: '/', fs: dat.archive } var progress = mirror(fs, '/', { dryRun: true }) progress.on('put', file => { file.name = file.name.slice(1) if (file.name === '') return dat.files.push({ path: file.name, size: file.stat.size, isFile: file.stat.isFile() }) dat.files.sort(function (a, b) { return a.path.localeCompare(b.path) }) const { files } = dat this.dispatch({ type: 'DAT_FILES', key, files }) }) dat.mirrorProgress = progress } updateState (dat) { const key = encode(dat.key) const state = !dat.network ? 'paused' : dat.writable || dat.progress === 1 ? 'complete' : dat.network.connected ? 'loading' : 'stale' this.dispatch({ type: 'DAT_STATE', key, state }) } updateConnections (dat) { if (!dat.network) return const key = encode(dat.key) this.dispatch({ type: 'DAT_PEERS', key, peers: dat.network.connected }) } joinNetwork (dat) { dat.joinNetwork() dat.network.on('connection', con => { this.updateConnections(dat) this.updateState(dat) con.on('close', () => { this.updateConnections(dat) this.updateState(dat) }) }) } async loadFromDisk () { try { await mkdirp(this.downloadsDir) await mkdirp(this.dataDir) } catch (_) {} const [datOpts, paused] = await Promise.all([ readJSON(joinPath(this.dataDir, 'dats.json')), readJSON(joinPath(this.dataDir, 'paused.json')) ]) for (const key of Object.keys(datOpts)) { const opts = JSON.parse(datOpts[key]) this.internalAddDat({ key, path: opts.dir, paused: paused[key], ...opts }) } } async storeOnDisk () { try { await mkdirp(this.dataDir) } catch (_) {} const datsState = Object.keys(this.dats).reduce( (acc, key) => ({ ...acc, [key]: JSON.stringify({ dir: this.dats[key].path, opts: this.dats[key].opts }) }), {} ) const pausedState = Object.keys(this.dats).reduce( (acc, key) => ({ ...acc, [key]: !this.dats[key].dat.network }), {} ) await writeFile( joinPath(this.dataDir, 'dats.json'), JSON.stringify(datsState) ) await writeFile( joinPath(this.dataDir, 'paused.json'), JSON.stringify(pausedState) ) } } ================================================ FILE: app/actions/index.js ================================================ 'use strict' import { encode } from 'dat-encoding' import { clipboard, remote, shell } from 'electron' import fs from 'fs' import promisify from 'util-promisify' import path from 'path' const stat = promisify(fs.stat) function showOpenDialog (props) { if (process.env.RUNNING_IN_SPECTRON && process.env.OPEN_RESULT) { return new Promise((resolve, reject) => { resolve({ cancelled: false, filePaths: [path.resolve(__dirname, process.env.OPEN_RESULT)] }) }) } return remote.dialog.showOpenDialog(props) } export const shareDat = key => ({ type: 'DIALOGS_LINK_OPEN', key }) export const copyLink = link => { clipboard.writeText(link) return { type: 'DIALOGS_LINK_COPY' } } export const closeShareDat = () => ({ type: 'DIALOGS_LINK_CLOSE' }) export const closeAlert = () => ({ type: 'DIALOGS_ALERT_CLOSE' }) export const createDat = () => dispatch => { showOpenDialog({ properties: ['openDirectory'] }) .then(({ filePaths, cancelled }) => { if (cancelled) return if (!filePaths) { console.error('Did not get files from the open dialog, closing') return } const path = filePaths[0] addDat({ path })(dispatch) }) .catch(err => { console.error(err) }) } export const requestDownload = key => ({ type: 'REQUEST_DOWNLOAD', key: encode(key) }) export const hideDownloadScreen = () => ({ type: 'HIDE_DOWNLOAD_SCREEN' }) export const cancelDownloadDat = key => dispatch => dispatch({ type: 'CANCEL_DOWNLOAD_DAT', key }) export const changeDownloadPath = key => dispatch => { const files = showOpenDialog({ properties: ['openDirectory'] }) if (!files || !files.length) return const path = files[0] dispatch({ type: 'CHANGE_DOWNLOAD_PATH', key, path }) } export const downloadSparseDat = ({ key }) => dispatch => dispatch({ type: 'DOWNLOAD_SPARSE_DAT', key }) export const addDat = ({ key, path, paused, ...opts }) => dispatch => dispatch({ type: 'TRY_ADD_DAT', key, path, paused, ...opts }) export const deleteDat = key => ({ type: 'DIALOGS_DELETE_OPEN', key }) export const confirmDeleteDat = key => dispatch => { dispatch({ type: 'REMOVE_DAT', key }) dispatch({ type: 'DIALOGS_DELETE_CLOSE' }) } export const cancelDeleteDat = () => ({ type: 'DIALOGS_DELETE_CLOSE' }) export const togglePause = ({ key, paused }) => dispatch => dispatch({ type: 'TOGGLE_PAUSE', paused, key }) export const inspectDat = key => dispatch => { dispatch({ type: 'INSPECT_DAT', key }) } export const closeInspectDat = () => ({ type: 'INSPECT_DAT_CLOSE' }) export const dropFolder = folder => async dispatch => { const isDirectory = (await stat(folder.path)).isDirectory() if (!isDirectory) return addDat({ path: folder.path })(dispatch) } export const openHomepage = () => shell.openExternal('https://datproject.org/') export const nextIntro = screen => ({ type: 'NEXT_INTRO', screen }) export const hideIntro = () => ({ type: 'HIDE_INTRO' }) export const updateTitle = (key, title) => async dispatch => dispatch({ type: 'UPDATE_TITLE', key, title }) export const toggleMenu = visible => dispatch => { dispatch({ type: 'TOGGLE_MENU', visible }) } ================================================ FILE: app/components/app.js ================================================ 'use strict' import React, { Fragment } from 'react' import { connect } from 'react-redux' import SCREEN from '../consts/screen' import IntroContainer from '../containers/intro' import HeaderContainer from '../containers/header' import TableContainer from '../containers/table' import * as Dialog from '../containers/dialog' import StatusBarContainer from '../containers/status-bar' import InspectContainer from '../containers/inspect' import DragDropContainer from '../containers/drag-drop' const mapStateToProps = state => ({ screen: state.screen }) const mapDispatchToProps = dispatch => ({}) export default connect(mapStateToProps, mapDispatchToProps)(function ({ screen }) { if (screen === SCREEN.INTRO) { return } return ( {/* header */} {/* /header */} {/* main */} {/* /main */} {/* footer */} {/* /footer */} ) }) ================================================ FILE: app/components/button.js ================================================ 'use strict' import React from 'react' import styled from 'styled-components' const BaseButton = styled.button.attrs(props => ({ ...props }))` text-transform: uppercase; letter-spacing: 0.025em; cursor: pointer; background-color: transparent; .icon-only { .btn-text { display: none; } } :hover, :focus { outline: 0; } ` const HeaderButton = styled(BaseButton)` color: var(--color-neutral-30); height: 2rem; :hover, :focus { color: var(--color-white); } ` var PlainButton = styled(BaseButton)` padding: 0.5rem 0.75rem; font-size: 0.75rem; background-color: transparent; color: var(--color-neutral-40); :hover, :focus { color: var(--color-neutral-70); } ` var TextButton = styled(BaseButton)` font-size: 0.75rem; background-color: transparent; color: var(--color-neutral-40); :hover, :focus { color: var(--color-neutral-70); } ` var GreenButton = styled(BaseButton)` padding: 0.5rem 0.75rem; font-size: 0.75rem; background-color: var(--color-green); color: var(--color-neutral-04); :hover, :focus { background-color: var(--color-green-hover); color: var(--color-white); } ` var RedButton = styled(BaseButton)` padding: 0.5rem 0.75rem; font-size: 0.75rem; background-color: var(--color-red); color: var(--color-neutral-04); :hover, :focus { background-color: var(--color-red-hover); color: var(--color-white); } ` const InnerWrapper = styled.div` display: flex; flex-wrap: nowrap; flex-direction: row; justify-content: center; align-items: center; ` export const Header = ({ children, icon, ...props }) => ( {children} ) export const Icon = ({ icon, ...props }) => ( {icon} ) export const Plain = ({ children, ...props }) => ( {children} ) export const Text = ({ children, icon, ...props }) => ( {children} ) export const Green = ({ children, icon, ...props }) => ( {children} ) export const Red = ({ children, icon, ...props }) => ( {children} ) const InnerWrapperComponent = ({ children, icon }) => ( {icon} {children} ) ================================================ FILE: app/components/dat-import.js ================================================ 'use strict' import React from 'react' import styled from 'styled-components' import Icon from './icon' const Label = styled.label` --icon-height: 1.2rem; color: var(--color-neutral-30); .icon-link { padding-top: 0.42rem; padding-left: 0.5rem; pointer-events: none; width: var(--icon-height); height: var(--icon-height); } input { height: 2rem; width: 7.5rem; padding-right: 0.5rem; padding-left: 2rem; border-radius: 2px; border: 1px solid transparent; background-color: transparent; color: var(--color-neutral-30); opacity: 1; text-transform: uppercase; letter-spacing: 0.025em; transition-property: width; transition-duration: 0.15s; transition-timing-function: ease-in; &::-webkit-input-placeholder { color: var(--color-neutral-30); opacity: 1; } &:hover, &:hover::-webkit-input-placeholder, &:hover + svg { color: var(--color-white); } &:focus, &:active { width: 14rem; outline: none; background-color: var(--color-white); color: var(--color-neutral); } &:focus::-webkit-input-placeholder, &:active::-webkit-input-placeholder, &:focus + svg, &:active + svg { color: var(--color-neutral-50); } } ` const DatImport = ({ requestDownload, downloadSparseDat }) => { const onKeyDown = e => { const value = e.target.value if (e.key !== 'Enter' || !value) return e.target.value = '' downloadSparseDat({ key: value, paused: false, sparse: true }) requestDownload(value) } return ( ) } export default DatImport ================================================ FILE: app/components/dialog.js ================================================ 'use strict' import React from 'react' import styled from 'styled-components' import Icon from './icon' import * as Button from './button' const Overlay = styled.div` background: rgba(0, 0, 0, 0.25); ` const Inner = styled.div` min-width: 25rem; max-width: 32rem; padding: 2rem 2.5rem 2rem; background-color: var(--color-white); box-shadow: 0 1.2rem 2.4rem rgba(0, 0, 0, 0.5); .exit { border: none; color: var(--color-neutral-40); } .exit:hover, .exit:focus { color: var(--color-neutral); } .icon-cross { vertical-align: middle; width: 1.6em; max-height: 1.6em; transition: color 0.025s ease-out; margin-right: auto; margin-left: auto; } ` const LabelInput = styled.label` --input-height: 3rem; --icon-height: 1.2rem; --button-width: 3rem; height: var(--input-height); border: 0; .btn-copy-to-clipboard { width: var(--button-width); height: calc(var(--input-height) - 2px); top: 1px; right: 1px; bottom: 1px; background-color: var(--color-neutral-10); border: none; color: var(--color-neutral-30); &:hover, &:focus { outline: none; color: var(--color-green-hover); } } .icon-link, .icon-clipboard { position: absolute; top: 0; bottom: 0; padding-top: calc(var(--icon-height) - 0.35rem); padding-left: 0.75rem; pointer-events: none; display: block; width: var(--icon-height); height: var(--icon-height); transition: color 0.025s ease-out; } .icon-link { left: 0; color: var(--color-neutral-30); } .icon-clipboard { right: 0.8rem; } .dat-input-input { width: 100%; height: var(--input-height); padding-right: var(--button-width); padding-left: 2.5rem; font-size: 1rem; font-weight: 600; border: 1px solid var(--color-neutral-20); background-color: var(--color-white); color: var(--color-green-hover); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; &:hover, &:focus { outline: none; } } .dat-input-check { color: var(--color-blue); top: 2rem; } .icon-check { width: var(--icon-height); height: 0.875rem; vertical-align: -0.15rem; display: inline-block; } .confirmation { right: 0; opacity: 0; top: -0.5rem; color: var(--color-blue); } .show-confirmation { top: -1.2rem; opacity: 1; transition: all 0.15s ease-out; } ` function CloseButton ({ onExit }) { return ( ) } export const Link = ({ link, copied, onCopy, onExit }) => (

Copy Dat Link

Link copied to clipboard

Anyone with this link can view your Dat.

) export const Confirm = ({ dat, onConfirm, onExit }) => (

Remove Dat

Are you sure you want to remove this dat?
This can’t be undone.

onConfirm(dat)} > Yes, Remove Dat No, Cancel

) export const Alert = ({ alert, onExit }) => (

{alert}

CLOSE

) ================================================ FILE: app/components/empty.js ================================================ import React from 'react' import styled from 'styled-components' import Icon from './icon' const Main = styled.main` position: relative; .skeleton { position: fixed; top: 3.5rem; left: 1.25rem; width: 232px; max-width: 100vw; } .dotted-lines { position: absolute; top: 0.25rem; right: 5.5rem; width: 17rem; } .create-new-dat, .link { position: absolute; width: 15rem; color: var(--color-neutral-30); svg { display: inline-block; width: 2rem; height: 2rem; } } .create-new-dat { top: 14.5rem; right: 4rem; } .link { top: 6rem; right: 8.5rem; svg { margin-bottom: -0.75rem; } } ` const Empty = () => (

Download A Dat

… and keep data up-to-date
by entering the link here.

Share a Folder

… and sync changes by sharing
the link with someone else.

) export default Empty ================================================ FILE: app/components/file-list.js ================================================ 'use strict' import React from 'react' import styled from 'styled-components' import bytes from 'prettier-bytes' const FileListTable = styled.table` width: 100%; border-collapse: collapse; tr:nth-child(odd) td { background-color: var(--color-white); } tr:nth-child(even) td { background-color: var(--color-neutral-10); } td { border: 0; padding: 0.25rem; } td:last-child { width: 4rem; text-align: right; } ` const FileList = ({ dat, fallback = null }) => { if (!dat || !dat.files || !dat.files.length) return fallback return ( {dat.files.map(file => { const size = Number(file.size) === file.size && file.isFile ? bytes(file.size) : '' return ( {file.path} {size} ) })} ) } export default FileList ================================================ FILE: app/components/finder-button.js ================================================ 'use strict' import React from 'react' import * as Button from './button' import Icon from './icon' import { resolve } from 'path' import { shell } from 'electron' import { DAT_ENV } from '../consts/env' const alt = { darwin: 'Finder', win32: 'Explorer' }[DAT_ENV.platform] || 'FileManager' const FinderButton = ({ dat, onClick }) => ( } className='row-action btn-finder' title={`Open in ${alt}`} onClick={ev => { ev.stopPropagation() shell.openExternal(`file://${resolve(dat.path)}`, () => {}) }} /> ) export default FinderButton ================================================ FILE: app/components/header.js ================================================ 'use strict' import React, { Fragment } from 'react' import styled from 'styled-components' import { transparentize } from 'polished' import { neutral } from 'dat-colors' import DatImport from '../containers/dat-import' import * as Button from './button' import Icon from './icon' const Container = styled.header` position: fixed; z-index: 1; width: 100%; height: 2.5rem; padding: 0.25rem 0.75rem; display: flex; align-items: center; justify-content: flex-end; -webkit-app-region: drag; background-color: var(--color-neutral); color: var(--color-white); & ~ main { margin-top: 2.5rem; } ` const HideLayer = styled.div` position: fixed; background: ${transparentize(0.85, neutral)}; width: 100vw; height: 100vh; left: 0; top: 0; ` const Header = ({ onShare, onMenu, onReport, menuVisible, version }) => { const toggleMenu = () => onMenu(!menuVisible) return ( {menuVisible && } } className='b--transparent v-mid color-neutral-30 hover-color-white f7 f6-l btn-share-folder' onClick={onShare} > Share Folder } className='ml2 v-mid color-neutral-20 hover-color-white pointer btn-toggle-menu' onClick={toggleMenu} /> {menuVisible && (

Dat Desktop {version}

Dat Desktop is a peer to peer data versioning and syncronization app.

Report Bug

)}
) } export default Header ================================================ FILE: app/components/hex-content.js ================================================ import React from 'react' import Swap from 'react-swap' import * as Button from './button' import Icon from './icon' const HexContent = ({ dat }) => { let hex let onHover if (dat.state === 'loading') { hex = ( } className='color-blue hover-color-blue-hover ph0' /> ) } else if (dat.paused) { hex = ( } className='color-neutral-30 hover-color-neutral-40 ph0' /> ) } else if (dat.state === 'complete') { hex = ( } className='color-green hover-color-green-hover ph0' /> ) } else { hex = ( } className='color-neutral-30 hover-color-neutral-40 ph0' /> ) } if (!dat.paused) { onHover = ( } className='color-neutral-40 ph0' /> ) } else { onHover = hex } return (
{hex}
{onHover}
) } export default HexContent ================================================ FILE: app/components/icon.js ================================================ 'use strict' import React from 'react' import styled from 'styled-components' const Svg = styled.svg` display: block; fill: currentColor; ` const Icon = ({ name, ...props }) => ( ) export default Icon ================================================ FILE: app/components/inspect.js ================================================ 'use strict' import React from 'react' import styled from 'styled-components' import { toStr } from 'dat-encoding' import bytes from 'prettier-bytes' import Icon from './icon' import FileList from './file-list' import { Plain as PlainButton, Green as GreenButton, Text as TextButton } from './button' import SCREEN from '../consts/screen' const DetailHeader = styled.header` width: 100%; height: 4rem; flex-shrink: 0; border-bottom: 1px solid var(--color-neutral-20); ` const DetailFooter = styled.footer` width: 100%; bottom: 0; flex-shrink: 0; border-top: 1px solid var(--color-neutral-20); ` const Label = styled.div` min-width: 8rem; color: var(--color-neutral-60); text-align: right; padding: 0.25rem; padding-right: 0.5rem; ` const Column = styled.div` overflow: hidden; padding: 0.25rem; ` const Row = ({ label = null, ...props }) => { return (
{label !== null && }
) } const Inspect = ({ screen, dat, closeInspectDat, addDat, hideDownloadScreen, cancelDownloadDat, changeDownloadPath }) => { if (!dat) return null const title = dat.metadata && dat.metadata.title ? dat.metadata.title : dat.key || 'N/A' const author = dat.metadata && dat.metadata.author ? dat.metadata.author : 'N/A' const description = dat.metadata && dat.metadata.description ? dat.metadata.description : 'N/A' const size = dat.stats && Number(dat.stats.length) === dat.stats.length ? bytes(dat.stats.length) : bytes(0) const peers = isNaN(parseInt(dat.peers)) ? '…' : dat.peers return (

{title}

{toStr(dat.key)} {size} {peers} {author} {description}
            {dat.path}
          
changeDownloadPath(dat.key)}> CHANGE...
N/A
} /> {screen === SCREEN.INSPECT && (
closeInspectDat()}> ← Back to Overview
)} {screen === SCREEN.DOWNLOAD && (
{ addDat({ key: dat.key, path: dat.path }) hideDownloadScreen() }} > Download { cancelDownloadDat(dat.key) hideDownloadScreen() }} > Cancel
)}
) } export default Inspect ================================================ FILE: app/components/intro.js ================================================ 'use strict' import React, { Fragment, Component } from 'react' import styled from 'styled-components' import { Green as GreenButton, Plain as PlainButton } from './button' const Intro = styled.main` position: relative; height: 100%; background-color: var(--color-neutral); color: var(--color-white); display: flex; flex-direction: column; align-items: center; justify-content: center; -webkit-app-region: drag; overflow: hidden; ` const Content = styled.div` position: relative; flex: 1; width: 100%; padding: 3rem 2rem; ` const Footer = styled.div` position: relative; width: 100%; padding: 1rem; display: flex; justify-content: space-between; button { min-width: 5rem; } ` const Image = styled.img` max-width: 100%; max-height: 100%; ` const StyledDots = styled.div` display: flex; justify-content: space-between; align-items: center; .dot { width: 0.5rem; height: 0.5rem; margin: 0.25rem; border-radius: 50%; background-color: var(--color-black); } .active { background-color: var(--color-blue); } ` const Dots = ({ screen }) => ( {Array(5) .fill(null) .map((_, i) => { const className = i === screen - 1 ? 'dot active' : 'dot' return
})} ) class IntroScreen extends Component { constructor (props) { super(props) this.onkeydown = this.onkeydown.bind(this) } onkeydown (ev) { if (ev.code !== 'Escape') return window.removeEventListener('keydown', this.onkeydown) this.props.hide() } componentWillMount () { window.addEventListener('keydown', this.onkeydown) } componentWillUnmount () { window.removeEventListener('keydown', this.onkeydown) } render () { const { show, screen, hide, next, openHomepage } = this.props if (!show) { return (
) } return ( { { 1:

Hey there! This is a Dat.

, 2: (

Think of it as a folder – with some magic.

), 3: (

You can turn any folder on your computer into a Dat.

), 4: (

Dats can be easily shared. Just copy the unique dat link and securely share it.

), 5: (

You can also import existing Dats. Check out{' '} openHomepage()} > datproject.org {' '} to explore open datasets.

) }[screen] }
{screen === 1 ? ( next(screen)} > Get Started ) : (
hide()} className='btn-skip'> Skip Intro {screen < 5 ? ( next(screen)} className='btn-next'> Next ) : ( hide()} className='btn-next btn-done'> Done )}
)}
) } } export default IntroScreen ================================================ FILE: app/components/status-bar.js ================================================ import React from 'react' import styled from 'styled-components' import bytes from 'prettier-bytes' const StatusBar = styled.footer` width: 100%; min-width: 800px; height: 2.5rem; padding: 0.25rem 0.75rem; background-color: var(--color-neutral-04); color: var(--color-neutral-60); ` export default function ({ up, down, show }) { if (!show) return null return ( Download: {bytes(down)}/s Upload: {bytes(up)}/s ) } ================================================ FILE: app/components/status.js ================================================ 'use strict' import React from 'react' import styled from 'styled-components' import bytes from 'prettier-bytes' const ProgressBar = styled.div` --progress-height: 0.5rem; --bar-height: var(--progress-height); --counter-width: 3rem; --tile-width: 28px; --stripe-width: 5px; min-width: 8rem; max-width: 24rem; overflow: hidden; padding-top: 0.4rem; .bar { height: var(--progress-height); width: calc(100% - var(--counter-width)); float: left; overflow: hidden; background-color: var(--color-neutral-20); border-radius: 2px; } .line { width: 0%; height: var(--progress-height); background-color: var(--color-blue); border-radius: 2px; } .line-loading { overflow: hidden; position: relative; height: var(--bar-height); &:before { content: ''; width: 100%; height: var(--bar-height); position: absolute; top: 0; left: 0; background-image: repeating-linear-gradient( -45deg, transparent, transparent var(--stripe-width), rgba(255, 255, 255, 0.1) var(--stripe-width), rgba(255, 255, 255, 0.1) calc(2 * var(--stripe-width)) ); background-size: var(--tile-width) var(--bar-height); animation: move-bg 0.75s linear infinite; } } .line-complete { background-color: var(--color-green); } .line-paused { background-color: var(--color-neutral-40); } .counter { float: right; min-width: var(--counter-width); margin-top: -0.4rem; text-align: right; } @keyframes move-bg { 0% { background-position: 28px 0; } 100% { background-position: 0 0; } } ` const ProgressSubline = styled.span` .arrow { vertical-align: top; } ` const speed = n => `${bytes(n || 0)}/s` const Status = ({ dat }) => { const progress = Math.floor((dat.progress || 0) * 100) const progressbarLine = dat.state === 'loading' ? 'line-loading' : dat.paused || dat.state === 'stale' ? 'line-paused' : 'line-complete' const netStats = dat.stats.network let progressText if (dat.paused) { progressText = 'Paused.' } else { switch (dat.state) { case 'complete': progressText = `Complete. ↑ ${speed(netStats.up)}` break case 'loading': progressText = ( {speed(netStats.down)} {speed(netStats.up)} ) break case 'stale': progressText = 'waiting for peers…' break default: progressText = 'Paused.' } } return (
{progress}%

{progressText}

) } export default Status ================================================ FILE: app/components/table-row.js ================================================ 'use strict' import React from 'react' import styled from 'styled-components' import * as Button from './button' import Icon from './icon' import Status from './status' import bytes from 'prettier-bytes' import FinderButton from './finder-button' import HexContent from './hex-content' import TitleField from './title-field' export const Tr = styled.tr` transition: background-color 0.025s ease-out; &.selectable { &:hover, &:focus { background-color: var(--color-neutral-04); cursor: pointer; } } .cell-1 { width: 4rem; } .cell-2 { width: 14rem; max-width: 12rem; @media (min-width: 768px) { max-width: 20rem; } @media (min-width: 1280px) { max-width: 24rem; } } .cell-3 { width: 15rem; } .cell-4 { width: 4.5rem; white-space: nowrap; } .cell-5 { width: 4.5rem; white-space: nowrap; } .cell-6 { width: 10.25rem; } .cell-truncate { width: 100%; } ` const IconContainer = styled.div` .row-action { height: 1.5rem; display: inline-block; color: var(--color-neutral-20); svg { vertical-align: middle; width: 0.75em; max-height: 1.6em; margin-top: -0.05em; margin-right: 5px; @media (min-width: 960px) { width: 1.4em; } } &:hover, &:focus { outline: none; color: var(--color-neutral-50); } &:first-child { padding-left: 0; } &:last-child { padding-right: 0; } } .icon-network { display: inline-block; color: var(--color-neutral-20); vertical-align: sub; width: 1em; svg polygon { fill: inherit; } } ` const NetworkContainer = styled.td` vertical-align: top; svg { height: 1.5rem; display: inline-block; color: var(--color-neutral-20); vertical-align: top; width: 1.1em; max-height: 1.6em; } .network-peers-many { --polygon-1-color: var(--color-green); --polygon-2-color: var(--color-green); --polygon-3-color: var(--color-green); } .network-peers-1 { --polygon-1-color: var(--color-yellow); --polygon-2-color: var(--color-yellow); } .network-peers-0 { --polygon-1-color: var(--color-red); } ` const NetworkIcon = ({ dat }) => { const iconClass = `network-peers ${ dat.peers === 0 ? 'network-peers-0' : dat.peers === 1 ? 'network-peers-1' : 'network-peers-many' }` return } const LinkButton = ({ ...props }) => ( } className='row-action btn-link' title='Copy Link' {...props} /> ) const DeleteButton = ({ ...props }) => ( } className='row-action mr2 btn-delete' title='Delete' {...props} /> ) const Row = ({ dat, shareDat, onDeleteDat, inspectDat, onTogglePause, updateTitle }) => { const { writable, metadata, key } = dat if (!metadata) return null const { title } = metadata const placeholderTitle = `#${key}` // TODO: inspectDat needs more work! // onClick={() => inspectDat(dat.key)} className='selectable'> return (
{ event.stopPropagation() onTogglePause(dat) }} >
updateTitle(key, title)} />

{dat.metadata.author || 'Anonymous'} •{' '} {dat.writable ? 'Read & Write' : 'Read-only'}

{bytes(dat.stats.byteLength || 0)} {dat.peers} shareDat(`dat://${dat.key}`)} /> onDeleteDat(dat.key)} /> ) } export default Row ================================================ FILE: app/components/table.js ================================================ 'use strict' import React from 'react' import styled from 'styled-components' import TableRowContainer from '../containers/table-row' import { Tr } from './table-row' import Empty from './empty' const StyledTable = styled.table` width: 100%; max-width: 80rem; margin: 0 auto; border-collapse: collapse; th, td { padding-right: 0.75rem; padding-left: 0.75rem; &:nth-child(2) { padding-left: 0; } } th { height: 4rem; font-size: 0.8125rem; font-weight: normal; color: var(--color-neutral-60); border-bottom: 1px solid var(--color-neutral-20); &:first-child { border: none; } } td { height: 4rem; vertical-align: top; padding-top: 1rem; } tr:hover td { background-color: var(--color-neutral--04); } ` const Table = ({ dats, show }) => { if (!show) return null if (!Object.keys(dats).length) return return (
Link Status Size Peers
{Object.keys(dats).map(key => ( ))}
) } export default Table ================================================ FILE: app/components/title-field.js ================================================ import React, { Component } from 'react' import ReactDOM from 'react-dom' import styled from 'styled-components' import Icon from './icon' import { Plain as PlainButton, Green as GreenButton } from './button' const Overlay = styled.div` position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; background-color: rgba(0, 0, 0, 0.2); z-index: 1; ` const EditableFieldWrapper = styled.div` position: relative; h2 { position: relative; } .indicator { position: absolute; display: none; top: 0.25rem; right: 0; width: 0.75rem; } &:hover, &:focus { h2 { color: var(--color-blue); } .indicator { display: block; } } ` const ActiveEditableFieldWrapper = styled(EditableFieldWrapper)` z-index: 1; ` const InputFieldStyle = styled.input` :focus { outline: none; } ` class InputField extends Component { componentDidMount () { const input = ReactDOM.findDOMNode(this) input.focus() input.select() } render () { return } } class TitleField extends Component { constructor (props) { super(props) this.titleInput = React.createRef() } onclick (ev) { ev.stopPropagation() ev.preventDefault() this.setState({ editing: true }) } commit () { const oldValue = this.props.value const newValue = ReactDOM.findDOMNode(this.titleInput.current).value if (oldValue !== newValue) { this.props.onChange(newValue) } this.cancel() } cancel () { this.setState({ modified: false, editing: false }) } handleKeyup (ev) { ev.stopPropagation() if (ev.key === 'Escape') { ev.preventDefault() this.cancel() return } if (ev.key === 'Enter') { ev.preventDefault() this.commit() return } const oldValue = this.props.value const newValue = ev.target.value const modified = oldValue !== newValue this.setState({ modified }) } render () { const { writable, value } = this.props const { editing, modified } = this.state || {} if (editing && writable) { return (
e.stopPropagation()}> this.cancel()} /> {/* why innerRef in following component? check here - styled-components/styled-components#102 */} this.handleKeyup(ev)} ref={this.titleInput} /> {modified ? ( this.commit()}>Save ) : ( this.cancel()}>Save )}
) } if (writable) { return (

this.onclick(ev)} > {value}

) } return (

{value}

) } } export default TitleField ================================================ FILE: app/consts/env.js ================================================ export const DAT_ENV = window.DAT_ENV || {} // in test, attach the blank object. ================================================ FILE: app/consts/screen.js ================================================ export const INTRO = 'intro' export const DATS = 'dats' export const DOWNLOAD = 'download' export const INSPECT = 'inspect' export default { INTRO, DATS, DOWNLOAD, INSPECT } ================================================ FILE: app/consts/state.js ================================================ 'use strict' import SCREEN from '../consts/screen' export const generateDefaultState = () => ({ dats: {}, screen: SCREEN.INTRO, dialogs: { link: { link: null, copied: false }, delete: { dat: null } }, speed: { up: 0, down: 0 }, inspect: { key: null }, intro: { screen: 1 }, version: require('../../package.json').version, menu: { visible: false }, downloadDatKey: null }) ================================================ FILE: app/containers/dat-import.js ================================================ import DatImport from '../components/dat-import' import { requestDownload, downloadSparseDat } from '../actions' import { connect } from 'react-redux' const mapStateToProps = state => state const mapDispatchToProps = dispatch => { return { requestDownload: key => dispatch(requestDownload(key)), downloadSparseDat: key => dispatch(downloadSparseDat(key)) } } const DatImportContainer = connect(mapStateToProps, mapDispatchToProps)( DatImport ) export default DatImportContainer ================================================ FILE: app/containers/dialog.js ================================================ import { Link, Confirm, Alert } from '../components/dialog' import { copyLink, closeShareDat, confirmDeleteDat, cancelDeleteDat, closeAlert } from '../actions' import { connect } from 'react-redux' export const LinkContainer = connect( state => ({ link: state.dialogs.link.link, copied: state.dialogs.link.copied }), dispatch => ({ onCopy: link => dispatch(copyLink(link)), onExit: () => dispatch(closeShareDat()) }) )(Link) export const ConfirmContainer = connect( state => ({ dat: state.dialogs.delete.dat }), dispatch => ({ onConfirm: dat => dispatch(confirmDeleteDat(dat)), onExit: () => dispatch(cancelDeleteDat()) }) )(Confirm) export const AlertContainer = connect( state => ({ alert: state.dialogs.alert }), dispatch => ({ onExit: () => dispatch(closeAlert()) }) )(Alert) ================================================ FILE: app/containers/drag-drop.js ================================================ import React from 'react' import styled from 'styled-components' import FileDrop from 'react-file-drop' import { connect } from 'react-redux' import { dropFolder } from '../actions' import Icon from '../components/icon' const mapStateToProps = state => ({}) const mapDispatchToProps = dispatch => ({ onDrop: list => dispatch(dropFolder(list[0])) }) const DropFrame = styled(FileDrop)` .file-drop-target { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; background: rgba(42, 202, 75, 0.6); align-items: center; justify-content: center; z-index: 1; display: none; } .file-drop-dragging-over-frame { display: flex; } ` const DropIcon = styled(Icon)` width: 128px; color: white; ` const DragDropContainer = connect(mapStateToProps, mapDispatchToProps)(function ( props ) { return ( ) }) export default DragDropContainer ================================================ FILE: app/containers/header.js ================================================ import Header from '../components/header' import { createDat, toggleMenu } from '../actions' import { connect } from 'react-redux' import { shell } from 'electron' const mapStateToProps = state => ({ menuVisible: state.menu.visible, version: state.version }) const mapDispatchToProps = dispatch => ({ onShare: () => dispatch(createDat()), onMenu: visible => dispatch(toggleMenu(visible)), onReport: () => shell.openExternal('https://github.com/dat-land/dat-desktop/issues/') }) const HeaderContainer = connect(mapStateToProps, mapDispatchToProps)(Header) export default HeaderContainer ================================================ FILE: app/containers/inspect.js ================================================ 'use strict' import SCREEN from '../consts/screen' import Inspect from '../components/inspect' import { closeInspectDat, addDat, hideDownloadScreen, cancelDownloadDat, changeDownloadPath } from '../actions' import { connect } from 'react-redux' const mapStateToProps = state => ({ dat: state.screen === SCREEN.INSPECT ? state.dats[state.inspect.key] : state.screen === SCREEN.DOWNLOAD ? state.dats[state.downloadDatKey] : null, screen: state.screen }) const mapDispatchToProps = dispatch => ({ closeInspectDat: () => dispatch(closeInspectDat()), addDat: ({ key, path }) => dispatch(addDat({ key, path })), hideDownloadScreen: () => dispatch(hideDownloadScreen()), cancelDownloadDat: key => dispatch(cancelDownloadDat(key)), changeDownloadPath: key => dispatch(changeDownloadPath(key)) }) const InspectContainer = connect(mapStateToProps, mapDispatchToProps)(Inspect) export default InspectContainer ================================================ FILE: app/containers/intro.js ================================================ 'use strict' import SCREEN from '../consts/screen' import { connect } from 'react-redux' import IntroScreen from '../components/intro' import { openHomepage, nextIntro, hideIntro } from '../actions' const mapStateToProps = state => ({ show: state.screen === SCREEN.INTRO, screen: state.intro.screen }) const mapDispatchToProps = dispatch => ({ openHomepage: () => openHomepage(), next: screen => dispatch(nextIntro(screen)), hide: () => dispatch(hideIntro()) }) const IntroContainer = connect(mapStateToProps, mapDispatchToProps)(IntroScreen) export default IntroContainer ================================================ FILE: app/containers/status-bar.js ================================================ 'use strict' import StatusBar from '../components/status-bar' import { connect } from 'react-redux' const mapStateToProps = state => ({ up: state.speed.up, down: state.speed.down, show: true }) const mapDispatchToProps = dispatch => ({}) const StatusBarContainer = connect(mapStateToProps, mapDispatchToProps)( StatusBar ) export default StatusBarContainer ================================================ FILE: app/containers/table-row.js ================================================ 'use strict' import { connect } from 'react-redux' import TableRow from '../components/table-row' import { shareDat, deleteDat, togglePause, inspectDat, updateTitle } from '../actions' const mapStateToProps = (state, ownProps) => ({ dat: ownProps.dat }) const mapDispatchToProps = dispatch => ({ shareDat: link => dispatch(shareDat(link)), onDeleteDat: key => dispatch(deleteDat(key)), inspectDat: key => dispatch(inspectDat(key)), onTogglePause: dat => dispatch(togglePause(dat)), updateTitle: (key, title) => dispatch(updateTitle(key, title)) }) const TableRowContainer = connect(mapStateToProps, mapDispatchToProps)(TableRow) export default TableRowContainer ================================================ FILE: app/containers/table.js ================================================ 'use strict' import SCREEN from '../consts/screen' import Table from '../components/table' import { connect } from 'react-redux' const mapStateToProps = state => ({ dats: state.dats, show: state.screen === SCREEN.DATS }) const TableContainer = connect(mapStateToProps, null)(Table) export default TableContainer ================================================ FILE: app/index.js ================================================ 'use strict' import React from 'react' import { render } from 'react-dom' import { Provider } from 'react-redux' import { createStore, applyMiddleware, compose } from 'redux' import datDesktopApp from './reducers' import { addDat } from './actions' import App from './components/app' import logger from 'redux-logger' import thunk from 'redux-thunk' import { ipcRenderer as ipc, remote } from 'electron' import DatMiddleware from './actions/dat-middleware' import minimist from 'minimist' import path from 'path' import { homedir } from 'os' import datIcons from 'dat-icons' const argv = minimist(remote.process.argv.slice(2), { default: { db: path.join(homedir(), '.dat-desktop'), data: path.join(remote.app.getPath('downloads'), '/dat') } }) const datMiddleware = new DatMiddleware({ dataDir: argv.db, downloadsDir: argv.data }) const isDev = process.env.NODE_ENV === 'development' const store = createStore( datDesktopApp, compose( applyMiddleware( store => datMiddleware.middleware(store), thunk, isDev ? logger : storage => dispatch => dispatch ) ) ) document.title = 'Dat Desktop | Welcome' datMiddleware .loadFromDisk() .then(function () { // # addGlobalComponents // Adding global components only once to the DOM. const svg = document.body.appendChild(datIcons()) // remove titleTag from SVG. // titleTag is provide uncontrollable "tooltip". Array.from(svg.querySelectorAll('title')).forEach(node => node.parentNode.removeChild(node) ) }) .then(function () { render( , document.getElementById('app-root') ) }) .catch(err => { console.log(err.stack || err) }) ipc.on('log', (_, str) => console.log(str)) ipc.on('link', key => store.dispatch(addDat({ key }))) ipc.on('file', path => store.dispatch(addDat({ path }))) ================================================ FILE: app/reducers/index.js ================================================ 'use strict' import SCREEN from '../consts/screen' import { generateDefaultState } from '../consts/state' const redatApp = (state = generateDefaultState(), action) => { switch (action.type) { case 'NEXT_INTRO': return { ...state, intro: { screen: action.screen + 1 } } case 'HIDE_INTRO': document.title = 'Dat Desktop' return { ...state, screen: SCREEN.DATS } case 'SHOW_DOWNLOAD_SCREEN': return { ...state, screen: SCREEN.DOWNLOAD, downloadDatKey: action.key } case 'HIDE_DOWNLOAD_SCREEN': return { ...state, screen: SCREEN.DATS, downloadDatKey: null } case 'CHANGE_DOWNLOAD_PATH': return { ...state, dats: { ...state.dats, [action.key]: { ...state.dats[action.key], path: action.path } } } case 'ADD_DAT': return { ...state, dats: { ...state.dats, [action.key]: { key: action.key, path: action.path, loading: true, paused: action.paused, metadata: {}, stats: { network: { up: 0, down: 0 } } } }, screen: SCREEN.DATS } case 'ADD_DAT_ERROR:EXISTED': return { ...state, dialogs: { ...state.dialogs, alert: 'The DAT is already in the list.' } } case 'ADD_DAT_ERROR': case 'WRITE_METADATA_ERROR': return { ...state, dats: { ...state.dats, [action.key]: { ...state.dats[action.key], error: action.error, loading: false } } } case 'ADD_DAT_SUCCESS': return { ...state, dats: { ...state.dats, [action.key]: { ...state.dats[action.key], loading: false } } } case 'REMOVE_DAT': if (state.dats[action.key]) { const { [action.key]: del, ...dats } = state.dats return { ...state, dats } } return state case 'INSPECT_DAT': return { ...state, screen: SCREEN.INSPECT, inspect: { key: action.key } } case 'INSPECT_DAT_CLOSE': return { ...state, screen: SCREEN.DATS } case 'DAT_FILES': return { ...state, dats: { ...state.dats, [action.key]: { ...state.dats[action.key], files: action.files } } } case 'DAT_METADATA': return { ...state, dats: { ...state.dats, [action.key]: { ...state.dats[action.key], metadata: action.metadata } } } case 'DAT_WRITABLE': return { ...state, dats: { ...state.dats, [action.key]: { ...state.dats[action.key], writable: action.writable } } } case 'DAT_STATS': return { ...state, dats: { ...state.dats, [action.key]: { ...state.dats[action.key], stats: { ...state.dats[action.key].stats, ...action.stats } } } } case 'DAT_PROGRESS': return { ...state, dats: { ...state.dats, [action.key]: { ...state.dats[action.key], progress: action.progress } } } case 'DAT_STATE': return { ...state, dats: { ...state.dats, [action.key]: { ...state.dats[action.key], state: action.state } } } case 'DAT_NETWORK_STATS': return { ...state, dats: { ...state.dats, [action.key]: { ...state.dats[action.key], stats: { ...state.dats[action.key].stats, network: action.stats } } }, speed: { up: state.speed.up - state.dats[action.key].stats.network.up + action.stats.up, down: state.speed.down - state.dats[action.key].stats.network.down + action.stats.down } } case 'DAT_PEERS': return { ...state, dats: { ...state.dats, [action.key]: { ...state.dats[action.key], peers: action.peers } } } case 'UPDATE_TITLE': return { ...state, dats: { ...state.dats, [action.key]: { ...state.dats[action.key], metadata: { ...state.dats[action.key].metadata, title: action.title } } } } case 'DIALOGS_LINK_OPEN': return { ...state, dialogs: { ...state.dialogs, link: { link: action.key, copied: false } } } case 'DIALOGS_LINK_COPY': return { ...state, dialogs: { ...state.dialogs, link: { ...state.dialogs.link, copied: true } } } case 'DIALOGS_LINK_CLOSE': return { ...state, dialogs: { ...state.dialogs, link: { link: null, copied: false } } } case 'DIALOGS_DELETE_OPEN': return { ...state, dialogs: { ...state.dialogs, delete: { dat: action.key } } } case 'DIALOGS_DELETE_CLOSE': return { ...state, screen: SCREEN.DATS, dialogs: { ...state.dialogs, delete: { dat: null } } } case 'DIALOGS_ALERT_CLOSE': return { ...state, dialogs: { ...state.dialogs, alert: null } } case 'TOGGLE_PAUSE': const dat = state.dats[action.key] return { ...state, dats: { ...state.dats, [action.key]: { ...dat, paused: !action.paused, peers: !action.paused ? 0 : dat.peers } } } case 'TOGGLE_MENU': return { ...state, menu: { ...state.menu, visible: action.visible } } default: return state } } export default redatApp ================================================ FILE: appveyor.yml ================================================ environment: ELECTRON_ENABLE_STACK_DUMPING: 'true' DEBUG: '*,-nugget*,-eslint*,-extract-zip*,-sumchecker*,-electron-download*,-dependency-check*' matrix: - nodejs_version: "8" platform: - x86 - x64 install: - ps: Install-Product node $env:nodejs_version $env:platform - npm install - node --version - npm --version test_script: - npm run build:prod - npm test # Don't actually build. build: off # RDP for debugging purposes init: - ps: iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1')) ================================================ FILE: dev/react-dev-tools/_metadata/verified_contents.json ================================================ [{"description":"treehash per file","signed_content":{"payload":"eyJjb250ZW50X2hhc2hlcyI6W3siYmxvY2tfc2l6ZSI6NDA5NiwiZGlnZXN0Ijoic2hhMjU2IiwiZmlsZXMiOlt7InBhdGgiOiJidWlsZC9iYWNrZW5kLmpzIiwicm9vdF9oYXNoIjoiVDF0d1pGbnItRTd4NlgtekxmYXllWWl0OEwzbmE1bnBqVEFxcnJVNzNQWSJ9LHsicGF0aCI6ImJ1aWxkL2JhY2tncm91bmQuanMiLCJyb290X2hhc2giOiJwd2o2TFdiZGpDRTV4U3czRmxKT0lXSUhZdFJFWE1jNjIxeG8yZE9EajVRIn0seyJwYXRoIjoiYnVpbGQvY29udGVudFNjcmlwdC5qcyIsInJvb3RfaGFzaCI6Im1WUnMtdEp2eEFRR0pOY2l5ZjFkZjBCeVAyM1hVYlRHNjhXYVZQNE1oalUifSx7InBhdGgiOiJidWlsZC9pbmplY3QuanMiLCJyb290X2hhc2giOiJjVS13V3Q1ckFYdGpzdnNSZUQ3QWxZUVJFam1xOE8wTGk0bU1CSk95U204In0seyJwYXRoIjoiYnVpbGQvbWFpbi5qcyIsInJvb3RfaGFzaCI6InJ4OVdHcG9MSlNGWjh4Zjd0bXBkMXVSYjBzRFBoNkVVS1dOTlo5dkh6WDAifSx7InBhdGgiOiJidWlsZC9wYW5lbC5qcyIsInJvb3RfaGFzaCI6IjdubkM3azBocURUSkVHbFJQWVFFb2JSN1VBcEw5R0pfZFd4dy1XQnBkdEUifSx7InBhdGgiOiJpY29ucy8xMjgtZGVhZGNvZGUucG5nIiwicm9vdF9oYXNoIjoiMUF4MUl2eXRyeUtYQTFzQkZxU1FIWmtjWnJMbVJaNjBvcEVQcWIzSDZiNCJ9LHsicGF0aCI6Imljb25zLzEyOC1kZXZlbG9wbWVudC5wbmciLCJyb290X2hhc2giOiIxQXgxSXZ5dHJ5S1hBMXNCRnFTUUhaa2NackxtUlo2MG9wRVBxYjNINmI0In0seyJwYXRoIjoiaWNvbnMvMTI4LWRpc2FibGVkLnBuZyIsInJvb3RfaGFzaCI6InIta3JhcWpva3FJbHozTTFwQmxiSWk4dGdDXzFHU3hrT2VFMlFwU1FDblUifSx7InBhdGgiOiJpY29ucy8xMjgtb3V0ZGF0ZWQucG5nIiwicm9vdF9oYXNoIjoidVNIdEo2cUFsTHVETWRGYkxnSkpwTHBVSEVEVjRHckRSeVhHcGdSUVNfZyJ9LHsicGF0aCI6Imljb25zLzEyOC1wcm9kdWN0aW9uLnBuZyIsInJvb3RfaGFzaCI6ImF3VDBvNEVpVGowQm1lMFRBUmJaeS1ZSklEcDAzdlBpOG5XU1JPSlFMd2sifSx7InBhdGgiOiJpY29ucy8xMjgtdW5taW5pZmllZC5wbmciLCJyb290X2hhc2giOiIxQXgxSXZ5dHJ5S1hBMXNCRnFTUUhaa2NackxtUlo2MG9wRVBxYjNINmI0In0seyJwYXRoIjoiaWNvbnMvMTYtZGVhZGNvZGUucG5nIiwicm9vdF9oYXNoIjoiX2J4aVZ4bmlCcGUxRG5CSDF0azRDalhkYWp3eGtQM2hSbnBIZDVEQUxFSSJ9LHsicGF0aCI6Imljb25zLzE2LWRldmVsb3BtZW50LnBuZyIsInJvb3RfaGFzaCI6Il9ieGlWeG5pQnBlMURuQkgxdGs0Q2pYZGFqd3hrUDNoUm5wSGQ1REFMRUkifSx7InBhdGgiOiJpY29ucy8xNi1kaXNhYmxlZC5wbmciLCJyb290X2hhc2giOiJ2QWZQVW4xd3UtbU1MclFSTlNrM2pSVUN1V2ZZZWRIUHFKR1p0RUFRV1BZIn0seyJwYXRoIjoiaWNvbnMvMTYtb3V0ZGF0ZWQucG5nIiwicm9vdF9oYXNoIjoiX0VXZVpIeVprMDY0bFAyWF9jWTJHcHF1R0JIanpDcU55M1Z0c3YxXzVhRSJ9LHsicGF0aCI6Imljb25zLzE2LXByb2R1Y3Rpb24ucG5nIiwicm9vdF9oYXNoIjoiR19FcWRrQmtTQ09Tb3M5NHN6bldwUWNhZUhWcFJwN3NRbUNrd3cySUVlRSJ9LHsicGF0aCI6Imljb25zLzE2LXVubWluaWZpZWQucG5nIiwicm9vdF9oYXNoIjoiX2J4aVZ4bmlCcGUxRG5CSDF0azRDalhkYWp3eGtQM2hSbnBIZDVEQUxFSSJ9LHsicGF0aCI6Imljb25zLzMyLWRlYWRjb2RlLnBuZyIsInJvb3RfaGFzaCI6Ijk5WjZZZEtfbEw5aVFZeU1VSElwT1ZSU1dKNm5ZQUQ2Mmx4UkNrMF9kU0kifSx7InBhdGgiOiJpY29ucy8zMi1kZXZlbG9wbWVudC5wbmciLCJyb290X2hhc2giOiI5OVo2WWRLX2xMOWlRWXlNVUhJcE9WUlNXSjZuWUFENjJseFJDazBfZFNJIn0seyJwYXRoIjoiaWNvbnMvMzItZGlzYWJsZWQucG5nIiwicm9vdF9oYXNoIjoiUzN3T25MeFBzd013UGotQXRuNUF1Ny1iTklTREtWbWtlUl9hVDNlSnNXVSJ9LHsicGF0aCI6Imljb25zLzMyLW91dGRhdGVkLnBuZyIsInJvb3RfaGFzaCI6IkJWS0gtbnEyMlB5UDdLZl9lQXFYeDdVM1M5ZzMyRi1wLWxxVVE1NnBGbDAifSx7InBhdGgiOiJpY29ucy8zMi1wcm9kdWN0aW9uLnBuZyIsInJvb3RfaGFzaCI6Il9Fdzc5ODc4bGRYWlVSUGlaemw5NjhPelA5NURURmpNT3l1TlhqejdpUWsifSx7InBhdGgiOiJpY29ucy8zMi11bm1pbmlmaWVkLnBuZyIsInJvb3RfaGFzaCI6Ijk5WjZZZEtfbEw5aVFZeU1VSElwT1ZSU1dKNm5ZQUQ2Mmx4UkNrMF9kU0kifSx7InBhdGgiOiJpY29ucy80OC1kZWFkY29kZS5wbmciLCJyb290X2hhc2giOiJnR3JxVnJhTkl4N2J6M0labTN0MUJxb3BYSFRUQU9td0ZTeHpxdFhoZkI4In0seyJwYXRoIjoiaWNvbnMvNDgtZGV2ZWxvcG1lbnQucG5nIiwicm9vdF9oYXNoIjoiZ0dycVZyYU5JeDdiejNJWm0zdDFCcW9wWEhUVEFPbXdGU3h6cXRYaGZCOCJ9LHsicGF0aCI6Imljb25zLzQ4LWRpc2FibGVkLnBuZyIsInJvb3RfaGFzaCI6InZXMkZBNXlWRzhDRGtNcjBRekVsS1lfQmxTdWxURnB5YkpDdmlIOFplU00ifSx7InBhdGgiOiJpY29ucy80OC1vdXRkYXRlZC5wbmciLCJyb290X2hhc2giOiJ4dFY4U1RBVm42VzUyWXA5aDJxdHdHckdyVzl4LTcxR0U0UUZnMjZ6Rm9vIn0seyJwYXRoIjoiaWNvbnMvNDgtcHJvZHVjdGlvbi5wbmciLCJyb290X2hhc2giOiJHUzczNkQ5TXp3UUhzRW5JOTU4UGxNVnp4RkdGaF92TEt2MFN2VGVTdkdVIn0seyJwYXRoIjoiaWNvbnMvNDgtdW5taW5pZmllZC5wbmciLCJyb290X2hhc2giOiJnR3JxVnJhTkl4N2J6M0labTN0MUJxb3BYSFRUQU9td0ZTeHpxdFhoZkI4In0seyJwYXRoIjoiaWNvbnMvZGVhZGNvZGUuc3ZnIiwicm9vdF9oYXNoIjoick1abk15VkR6VWtRbDdLQl9UVzlTYjlEVjJqVXl5cTQ5WGwwQUhKMVl4TSJ9LHsicGF0aCI6Imljb25zL2RldmVsb3BtZW50LnN2ZyIsInJvb3RfaGFzaCI6InJNWm5NeVZEelVrUWw3S0JfVFc5U2I5RFYyalV5eXE0OVhsMEFISjFZeE0ifSx7InBhdGgiOiJpY29ucy9kaXNhYmxlZC5zdmciLCJyb290X2hhc2giOiJKNU1Rd3Rfb2NmUDJxSFh2UFZ6N2lTTFRmNjdybkJKLXd4S3U2LUhGSE5NIn0seyJwYXRoIjoiaWNvbnMvb3V0ZGF0ZWQuc3ZnIiwicm9vdF9oYXNoIjoiMTkzazMzdmpTTE5CMU5nTXFINGktUjc2YXhHeXktVW1VVFNJYmhadlNKSSJ9LHsicGF0aCI6Imljb25zL3Byb2R1Y3Rpb24uc3ZnIiwicm9vdF9oYXNoIjoiRVB4cHFIQU9IRzlwUUtHMXJYelRJZmN2cV9qTUYxU0xRR3g1b1RkYmFQOCJ9LHsicGF0aCI6Im1haW4uaHRtbCIsInJvb3RfaGFzaCI6InM3OURqWERtdng3bWdySFZNcmpod3JnNFk3SUYyd2JuUUxEcnVDS2hUWU0ifSx7InBhdGgiOiJtYW5pZmVzdC5qc29uIiwicm9vdF9oYXNoIjoicDJEV0RZNVRvcHR0Q0pMcnRJX3BfcjQzTlVYQXRhZ0NtNUgtcVpuY0pZNCJ9LHsicGF0aCI6InBhbmVsLmh0bWwiLCJyb290X2hhc2giOiJJQk9KT3JEeGtBMkFGdUlIT0IyQTJlLThoMUVoV1ZHNUZPVVdwSzNUSUg0In0seyJwYXRoIjoicG9wdXBzL2RlYWRjb2RlLmh0bWwiLCJyb290X2hhc2giOiJzSHBuSUVZeDh5SFoycDk4ejdkclc4dkRTQm1SUWFpd3hqOHJhN3Q0OUpvIn0seyJwYXRoIjoicG9wdXBzL2RldmVsb3BtZW50Lmh0bWwiLCJyb290X2hhc2giOiJMOTQ5M0ptdjVyclRPYmZDWUlObDJiWHJJNEdxandOcXFEbEx5YWpsX3lzIn0seyJwYXRoIjoicG9wdXBzL2Rpc2FibGVkLmh0bWwiLCJyb290X2hhc2giOiJka3FZLXNTZC1Gem85cURpX203WjRsbGdDT3lLRUdQZlRKejBGdjdwRENJIn0seyJwYXRoIjoicG9wdXBzL291dGRhdGVkLmh0bWwiLCJyb290X2hhc2giOiJEY1VNcXRVb0gyYzR5Rjl5QXl2VERwcXc4TVhLdFk0QUo4VVRiSXdkRDNnIn0seyJwYXRoIjoicG9wdXBzL3Byb2R1Y3Rpb24uaHRtbCIsInJvb3RfaGFzaCI6Ikt1UXdjbVQ5dnA4R0ozS3RtQkRjdHlrdDg5ZFMtZW5pMV9SS0ZBdmx3TDgifSx7InBhdGgiOiJwb3B1cHMvc2hhcmVkLmpzIiwicm9vdF9oYXNoIjoiaXIwWkhXM0toUWktRVU3NG03Z3JvdzE5bmYxWk8xZmczeFRjbmZLUnp1SSJ9LHsicGF0aCI6InBvcHVwcy91bm1pbmlmaWVkLmh0bWwiLCJyb290X2hhc2giOiJjb0U5c3ZkeDJZcDgwMFl3a012YVpWRmxvMVV1M2dhcGQ4ZnRZOUhuVWpjIn1dLCJmb3JtYXQiOiJ0cmVlaGFzaCIsImhhc2hfYmxvY2tfc2l6ZSI6NDA5Nn1dLCJpdGVtX2lkIjoiZm1rYWRtYXBnb2ZhZG9wbGpiamZrYXBka29pZW5paGkiLCJpdGVtX3ZlcnNpb24iOiIzLjQuMiIsInByb3RvY29sX3ZlcnNpb24iOjF9","signatures":[{"header":{"kid":"publisher"},"protected":"eyJhbGciOiJSUzI1NiJ9","signature":"l9HNvm0-gZjyrebNPghVRPgTrdN5ipEVo2PhVwMv06YdMpbqHpIetSoWMYj_X4RwZrGJ5xmRF2ZRDtICXOzYifjFeXrxE2Pqzqb8o8LaQYAAkaw_Ts9QppBcUDgW0lfdSbUvDqzdjQxxVHwMuKy4D9t30eZsTH9l4GFVWX1NQNUBqtoV_b71daiwPcf1rTr59XrBUEx8SXeuDMY-CSKI2wt9III8vdcXm7FQv9HsPA0bkmaJXPMpFBU-iL6pTreUgtS3m-ZxB6xDPU_ctTsRkoKtPby7ljyc0ARAcyYEkoIY12hlb0hyqC0OR3EMO_K_rd_4LFlsU6NZAiEjRsGxVA"},{"header":{"kid":"webstore"},"protected":"eyJhbGciOiJSUzI1NiJ9","signature":"My_ktGjIASNiBZ4CZVTMsbGSr61XDMzUxfpJMCdXvR3Wa0kkFBGi6k80BzvcKS8fR45xIp1q6VVEpN_yqkuAHzsno4NGJI9ZOKNYh5Hf0Tga4bGwwisw5Y5SyqgRb9pJ01j6Y-fhzmWrcqPflAtcz-DQLCYUrbQQIbzUgF9AwyvxlYHATH_lr__2Q67JEuTHhY4macOKLESdhRM5lwbfyBrlGph6oDL6KtaHqAqtEYsqDMi6jcnoUAQBe4HzER4xZb4QimBagLBVCIH-HRKrh2ZYb_LOgv4paEz0e8nXd2Hg2b1C5kv5I6eyU2i3aZAYpVcra4pk3DV9p3OqcDprPA"}]}}] ================================================ FILE: dev/react-dev-tools/build/backend.js ================================================ /******/ (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__) { /** * Copyright (c) 2015-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. * * */ 'use strict'; // Do not add requires here! // Running module factories is intentionally delayed until we know the hook exists. // This is to avoid issues like: https://github.com/facebook/react-devtools/issues/1039 window.addEventListener('message', welcome); function welcome(evt) { if (evt.source !== window || evt.data.source !== 'react-devtools-content-script') { return; } window.removeEventListener('message', welcome); setup(window.__REACT_DEVTOOLS_GLOBAL_HOOK__); } function setup(hook) { var Agent = __webpack_require__(1); var ProfileCollector = __webpack_require__(11); var TraceUpdatesBackendManager = __webpack_require__(12); var Bridge = __webpack_require__(21); var inject = __webpack_require__(46); var setupRNStyle = __webpack_require__(58); var setupHighlighter = __webpack_require__(60); var setupProfiler = __webpack_require__(65); var setupRelay = __webpack_require__(66); var listeners = []; var wall = { listen: function listen(fn) { var listener = function listener(evt) { if (evt.source !== window || !evt.data || evt.data.source !== 'react-devtools-content-script' || !evt.data.payload) { return; } fn(evt.data.payload); }; listeners.push(listener); window.addEventListener('message', listener); }, send: function send(data) { window.postMessage({ source: 'react-devtools-bridge', payload: data }, '*'); } }; // Note: this is only useful for react-native-web (and equivalents). // They would have to set this field directly on the hook. var isRNStyleEnabled = !!hook.resolveRNStyle; var bridge = new Bridge(wall); var agent = new Agent(window, { rnStyle: isRNStyleEnabled }); agent.addBridge(bridge); agent.once('connected', function () { inject(hook, agent); }); if (isRNStyleEnabled) { setupRNStyle(bridge, agent, hook.resolveRNStyle); } setupProfiler(bridge, agent, hook); setupRelay(bridge, agent, hook); agent.on('shutdown', function () { hook.emit('shutdown'); listeners.forEach(function (fn) { window.removeEventListener('message', fn); }); listeners = []; }); setupHighlighter(agent); ProfileCollector.init(agent); TraceUpdatesBackendManager.init(agent); } /***/ }, /* 1 */ /***/ function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(__webpack_provided_Object_dot_create, Map, WeakMap, Set) {/** * Copyright (c) 2015-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. * * */ 'use strict'; 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; }; }(); 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 = __webpack_provided_Object_dot_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 _require = __webpack_require__(6), EventEmitter = _require.EventEmitter; var assign = __webpack_require__(7); var nullthrows = __webpack_require__(8).default; var guid = __webpack_require__(9); var getIn = __webpack_require__(10); /** * The agent lives on the page in the same context as React, observes events * from the `backend`, and communicates (via a `Bridge`) with the frontend. * * It is responsible for generating string IDs (ElementID) for each react * element, maintaining a mapping of those IDs to elements, handling messages * from the frontend, and translating between react elements and native * handles. * * * React * | * v * backend * | * v * ----------- * | **Agent** | * ----------- * ^ * | * v * (Bridge) * ^ * | * serialization * | * v * (Bridge) * ^ * | * v * ---------------- * | Frontend Store | * ---------------- * * * Events from the `backend`: * - root (got a root) * - mount (a component mounted) * - update (a component updated) * - unmount (a component mounted) * * Events from the `frontend` Store: * - see `addBridge` for subscriptions * * Events that Agent fires: * - selected * - hideHighlight * - startInspecting * - stopInspecting * - shutdown * - highlight /highlightMany * - setSelection * - root * - mount * - update * - unmount */ var Agent = function (_EventEmitter) { _inherits(Agent, _EventEmitter); // the window or global -> used to "make a value available in the console" function Agent(global, capabilities) { _classCallCheck(this, Agent); var _this = _possibleConstructorReturn(this, (Agent.__proto__ || Object.getPrototypeOf(Agent)).call(this)); _this.global = global; _this.internalInstancesById = new Map(); _this.idsByInternalInstances = new WeakMap(); _this.renderers = new Map(); _this.elementData = new Map(); _this.roots = new Set(); _this.reactInternals = {}; var lastSelected; _this.on('selected', function (id) { var data = _this.elementData.get(id); if (data && data.publicInstance && _this.global.$r === lastSelected) { _this.global.$r = data.publicInstance; lastSelected = data.publicInstance; } }); _this._prevSelected = null; _this._scrollUpdate = false; var isReactDOM = window.document && typeof window.document.createElement === 'function'; _this.capabilities = assign({ scroll: isReactDOM && typeof window.document.body.scrollIntoView === 'function', dom: isReactDOM, editTextContent: false }, capabilities); if (isReactDOM) { _this._updateScroll = _this._updateScroll.bind(_this); window.addEventListener('scroll', _this._onScroll.bind(_this), true); window.addEventListener('click', _this._onClick.bind(_this), true); window.addEventListener('mouseover', _this._onMouseOver.bind(_this), true); window.addEventListener('resize', _this._onResize.bind(_this), true); } return _this; } // returns an "unsubscribe" function _createClass(Agent, [{ key: 'sub', value: function sub(ev, fn) { var _this2 = this; this.on(ev, fn); return function () { _this2.removeListener(ev, fn); }; } }, { key: 'setReactInternals', value: function setReactInternals(renderer, reactInternals) { this.reactInternals[renderer] = reactInternals; } }, { key: 'addBridge', value: function addBridge(bridge) { var _this3 = this; /** Events received from the frontend **/ // the initial handshake bridge.on('requestCapabilities', function () { bridge.send('capabilities', _this3.capabilities); _this3.emit('connected'); }); bridge.on('setState', this._setState.bind(this)); bridge.on('setProps', this._setProps.bind(this)); bridge.on('setContext', this._setContext.bind(this)); bridge.on('makeGlobal', this._makeGlobal.bind(this)); bridge.on('highlight', function (id) { return _this3.highlight(id); }); bridge.on('highlightMany', function (id) { return _this3.highlightMany(id); }); bridge.on('hideHighlight', function () { return _this3.emit('hideHighlight'); }); bridge.on('startInspecting', function () { return _this3.emit('startInspecting'); }); bridge.on('stopInspecting', function () { return _this3.emit('stopInspecting'); }); bridge.on('selected', function (id) { return _this3.emit('selected', id); }); bridge.on('isRecording', function (isRecording) { return _this3.emit('isRecording', isRecording); }); bridge.on('setInspectEnabled', function (enabled) { _this3._inspectEnabled = enabled; _this3.emit('stopInspecting'); }); bridge.on('shutdown', function () { return _this3.emit('shutdown'); }); bridge.on('changeTextContent', function (_ref) { var id = _ref.id, text = _ref.text; var node = _this3.getNodeForID(id); if (!node) { return; } node.textContent = text; }); // used to "inspect node in Elements pane" bridge.on('putSelectedNode', function (id) { window.__REACT_DEVTOOLS_GLOBAL_HOOK__.$node = _this3.getNodeForID(id); }); // used to "view source in Sources pane" bridge.on('putSelectedInstance', function (id) { var node = _this3.elementData.get(id); if (node) { window.__REACT_DEVTOOLS_GLOBAL_HOOK__.$type = node.type; } else { window.__REACT_DEVTOOLS_GLOBAL_HOOK__.$type = null; } if (node && node.publicInstance) { window.__REACT_DEVTOOLS_GLOBAL_HOOK__.$inst = node.publicInstance; } else { window.__REACT_DEVTOOLS_GLOBAL_HOOK__.$inst = null; } }); // used to select the inspected node ($0) bridge.on('checkSelection', function () { var newSelected = window.__REACT_DEVTOOLS_GLOBAL_HOOK__.$0; if (newSelected !== _this3._prevSelected) { _this3._prevSelected = newSelected; var sentSelected = window.__REACT_DEVTOOLS_GLOBAL_HOOK__.$node; if (newSelected !== sentSelected) { _this3.selectFromDOMNode(newSelected, true); } } }); bridge.on('scrollToNode', function (id) { return _this3.scrollToNode(id); }); bridge.on('traceupdatesstatechange', function (value) { return _this3.emit('traceupdatesstatechange', value); }); bridge.on('colorizerchange', function (value) { return _this3.emit('colorizerchange', value); }); /** Events sent to the frontend **/ this.on('root', function (id) { return bridge.send('root', id); }); this.on('mount', function (data) { return bridge.send('mount', data); }); this.on('update', function (data) { return bridge.send('update', data); }); this.on('updateProfileTimes', function (data) { return bridge.send('updateProfileTimes', data); }); this.on('unmount', function (id) { bridge.send('unmount', id); // once an element has been unmounted, the bridge doesn't need to be // able to inspect it anymore. bridge.forget(id); }); this.on('setSelection', function (data) { return bridge.send('select', data); }); this.on('setInspectEnabled', function (data) { return bridge.send('setInspectEnabled', data); }); this.on('isRecording', function (isRecording) { return bridge.send('isRecording', isRecording); }); this.on('storeSnapshot', function (data) { return bridge.send('storeSnapshot', data); }); this.on('clearSnapshots', function () { return bridge.send('clearSnapshots'); }); } }, { key: 'scrollToNode', value: function scrollToNode(id) { var node = this.getNodeForID(id); if (!node) { console.warn('unable to get the node for scrolling'); return; } var domElement = node.nodeType === Node.ELEMENT_NODE ? node : node.parentElement; if (!domElement) { console.warn('unable to get the domElement for scrolling'); return; } if (typeof domElement.scrollIntoViewIfNeeded === 'function') { domElement.scrollIntoViewIfNeeded(); } else if (typeof domElement.scrollIntoView === 'function') { domElement.scrollIntoView(); } this.highlight(id); } }, { key: 'highlight', value: function highlight(id) { var data = this.elementData.get(id); var node = this.getNodeForID(id); if (data && node) { this.emit('highlight', { node: node, name: data.name, props: data.props }); } } }, { key: 'highlightMany', value: function highlightMany(ids) { var _this4 = this; var nodes = []; ids.forEach(function (id) { var node = _this4.getNodeForID(id); if (node) { nodes.push(node); } }); if (nodes.length) { this.emit('highlightMany', nodes); } } }, { key: 'getNodeForID', value: function getNodeForID(id) { var component = this.internalInstancesById.get(id); if (!component) { return null; } var renderer = this.renderers.get(id); if (renderer && this.reactInternals[renderer].getNativeFromReactElement) { return this.reactInternals[renderer].getNativeFromReactElement(component); } return null; } }, { key: 'selectFromDOMNode', value: function selectFromDOMNode(node, quiet) { var offsetFromLeaf = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0; var id = this.getIDForNode(node); if (!id) { return; } this.emit('setSelection', { id: id, quiet: quiet, offsetFromLeaf: offsetFromLeaf }); } // TODO: remove this method because it's breaking encapsulation. // It was used by RN inspector but this required leaking Fibers to it. // RN inspector will use selectFromDOMNode() instead now. // Remove this method in a few months after this comment was added. }, { key: 'selectFromReactInstance', value: function selectFromReactInstance(instance, quiet) { var id = this.getId(instance); if (!id) { console.log('no instance id', instance); return; } this.emit('setSelection', { id: id, quiet: quiet }); } }, { key: 'getIDForNode', value: function getIDForNode(node) { if (!this.reactInternals) { return null; } var component; for (var renderer in this.reactInternals) { // If a renderer doesn't know about a reactId, it will throw an error. try { // $FlowFixMe possibly null - it's not null component = this.reactInternals[renderer].getReactElementFromNative(node); } catch (e) {} if (component) { return this.getId(component); } } return null; } }, { key: '_setProps', value: function _setProps(_ref2) { var id = _ref2.id, path = _ref2.path, value = _ref2.value; var data = this.elementData.get(id); if (data && data.updater && typeof data.updater.setInProps === 'function') { data.updater.setInProps(path, value); } else { console.warn("trying to set props on a component that doesn't support it"); } } }, { key: '_setState', value: function _setState(_ref3) { var id = _ref3.id, path = _ref3.path, value = _ref3.value; var data = this.elementData.get(id); if (data && data.updater && typeof data.updater.setInState === 'function') { data.updater.setInState(path, value); } else { console.warn("trying to set state on a component that doesn't support it"); } } }, { key: '_setContext', value: function _setContext(_ref4) { var id = _ref4.id, path = _ref4.path, value = _ref4.value; var data = this.elementData.get(id); if (data && data.updater && typeof data.updater.setInContext === 'function') { // $FlowFixMe data.updater.setInContext(path, value); } else { console.warn("trying to set context on a component that doesn't support it"); } } }, { key: '_makeGlobal', value: function _makeGlobal(_ref5) { var id = _ref5.id, path = _ref5.path; var data = this.elementData.get(id); if (!data) { return; } var value; if (path === 'instance') { value = data.publicInstance; } else { value = getIn(data, path); } this.global.$tmp = value; console.log('$tmp =', value); } }, { key: 'getId', value: function getId(internalInstance) { if ((typeof internalInstance === 'undefined' ? 'undefined' : _typeof(internalInstance)) !== 'object' || !internalInstance) { return internalInstance; } if (!this.idsByInternalInstances.has(internalInstance)) { this.idsByInternalInstances.set(internalInstance, guid()); this.internalInstancesById.set(nullthrows(this.idsByInternalInstances.get(internalInstance)), internalInstance); } return nullthrows(this.idsByInternalInstances.get(internalInstance)); } }, { key: 'addRoot', value: function addRoot(renderer, internalInstance) { var id = this.getId(internalInstance); this.roots.add(id); this.emit('root', id); } }, { key: 'rootCommitted', value: function rootCommitted(renderer, internalInstance, data) { var id = this.getId(internalInstance); this.emit('rootCommitted', id, internalInstance, data); } }, { key: 'onMounted', value: function onMounted(renderer, component, data) { var _this5 = this; var id = this.getId(component); this.renderers.set(id, renderer); this.elementData.set(id, data); var send = assign({}, data); if (send.children && send.children.map) { send.children = send.children.map(function (c) { return _this5.getId(c); }); } send.id = id; send.canUpdate = send.updater && !!send.updater.forceUpdate; delete send.type; delete send.updater; this.emit('mount', send); } }, { key: 'onUpdated', value: function onUpdated(component, data) { var _this6 = this; var id = this.getId(component); this.elementData.set(id, data); var send = assign({}, data); if (send.children && send.children.map) { send.children = send.children.map(function (c) { return _this6.getId(c); }); } send.id = id; send.canUpdate = send.updater && !!send.updater.forceUpdate; delete send.type; delete send.updater; this.emit('update', send); } }, { key: 'onUpdatedProfileTimes', value: function onUpdatedProfileTimes(component, data) { var _this7 = this; var id = this.getId(component); this.elementData.set(id, data); var send = assign({}, data); if (send.children && send.children.map) { send.children = send.children.map(function (c) { return _this7.getId(c); }); } send.id = id; send.canUpdate = send.updater && !!send.updater.forceUpdate; delete send.type; delete send.updater; this.emit('updateProfileTimes', send); } }, { key: 'onUnmounted', value: function onUnmounted(component) { var id = this.getId(component); this.elementData.delete(id); if (this.roots.has(id)) { this.roots.delete(id); this.emit('rootUnmounted', id); } this.renderers.delete(id); this.emit('unmount', id); this.idsByInternalInstances.delete(component); } }, { key: '_onScroll', value: function _onScroll() { if (!this._scrollUpdate) { this._scrollUpdate = true; window.requestAnimationFrame(this._updateScroll); } } }, { key: '_updateScroll', value: function _updateScroll() { this.emit('refreshMultiOverlay'); this.emit('stopInspecting'); this._scrollUpdate = false; } }, { key: '_onClick', value: function _onClick(event) { if (!this._inspectEnabled) { return; } var id = this.getIDForNode(event.target); if (!id) { return; } event.stopPropagation(); event.preventDefault(); this.emit('setSelection', { id: id }); this.emit('setInspectEnabled', false); } }, { key: '_onMouseOver', value: function _onMouseOver(event) { if (this._inspectEnabled) { var id = this.getIDForNode(event.target); if (!id) { return; } this.highlight(id); } } }, { key: '_onResize', value: function _onResize(event) { this.emit('stopInspecting'); } }]); return Agent; }(EventEmitter); module.exports = Agent; /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(2), __webpack_require__(3), __webpack_require__(4), __webpack_require__(5))) /***/ }, /* 2 */ /***/ function(module, exports) { /** * Copyright (c) 2015-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. * * */ 'use strict'; module.exports = window.__REACT_DEVTOOLS_GLOBAL_HOOK__.nativeObjectCreate; /***/ }, /* 3 */ /***/ function(module, exports) { /** * Copyright (c) 2015-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. * */ 'use strict'; module.exports = window.__REACT_DEVTOOLS_GLOBAL_HOOK__.nativeMap; /***/ }, /* 4 */ /***/ function(module, exports) { /** * Copyright (c) 2015-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. * */ 'use strict'; module.exports = window.__REACT_DEVTOOLS_GLOBAL_HOOK__.nativeWeakMap; /***/ }, /* 5 */ /***/ function(module, exports) { /** * Copyright (c) 2015-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. * */ 'use strict'; module.exports = window.__REACT_DEVTOOLS_GLOBAL_HOOK__.nativeSet; /***/ }, /* 6 */ /***/ function(module, exports) { // Copyright Joyent, Inc. and other Node contributors. // // 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. function EventEmitter() { this._events = this._events || {}; this._maxListeners = this._maxListeners || undefined; } module.exports = EventEmitter; // Backwards-compat with node 0.10.x EventEmitter.EventEmitter = EventEmitter; EventEmitter.prototype._events = undefined; EventEmitter.prototype._maxListeners = undefined; // By default EventEmitters will print a warning if more than 10 listeners are // added to it. This is a useful default which helps finding memory leaks. EventEmitter.defaultMaxListeners = 10; // Obviously not all Emitters should be limited to 10. This function allows // that to be increased. Set to zero for unlimited. EventEmitter.prototype.setMaxListeners = function(n) { if (!isNumber(n) || n < 0 || isNaN(n)) throw TypeError('n must be a positive number'); this._maxListeners = n; return this; }; EventEmitter.prototype.emit = function(type) { var er, handler, len, args, i, listeners; if (!this._events) this._events = {}; // If there is no 'error' event listener then throw. if (type === 'error') { if (!this._events.error || (isObject(this._events.error) && !this._events.error.length)) { er = arguments[1]; if (er instanceof Error) { throw er; // Unhandled 'error' event } else { // At least give some kind of context to the user var err = new Error('Uncaught, unspecified "error" event. (' + er + ')'); err.context = er; throw err; } } } handler = this._events[type]; if (isUndefined(handler)) return false; if (isFunction(handler)) { switch (arguments.length) { // fast cases case 1: handler.call(this); break; case 2: handler.call(this, arguments[1]); break; case 3: handler.call(this, arguments[1], arguments[2]); break; // slower default: args = Array.prototype.slice.call(arguments, 1); handler.apply(this, args); } } else if (isObject(handler)) { args = Array.prototype.slice.call(arguments, 1); listeners = handler.slice(); len = listeners.length; for (i = 0; i < len; i++) listeners[i].apply(this, args); } return true; }; EventEmitter.prototype.addListener = function(type, listener) { var m; if (!isFunction(listener)) throw TypeError('listener must be a function'); if (!this._events) this._events = {}; // To avoid recursion in the case that type === "newListener"! Before // adding it to the listeners, first emit "newListener". if (this._events.newListener) this.emit('newListener', type, isFunction(listener.listener) ? listener.listener : listener); if (!this._events[type]) // Optimize the case of one listener. Don't need the extra array object. this._events[type] = listener; else if (isObject(this._events[type])) // If we've already got an array, just append. this._events[type].push(listener); else // Adding the second element, need to change to array. this._events[type] = [this._events[type], listener]; // Check for listener leak if (isObject(this._events[type]) && !this._events[type].warned) { if (!isUndefined(this._maxListeners)) { m = this._maxListeners; } else { m = EventEmitter.defaultMaxListeners; } if (m && m > 0 && this._events[type].length > m) { this._events[type].warned = true; console.error('(node) warning: possible EventEmitter memory ' + 'leak detected. %d listeners added. ' + 'Use emitter.setMaxListeners() to increase limit.', this._events[type].length); if (typeof console.trace === 'function') { // not supported in IE 10 console.trace(); } } } return this; }; EventEmitter.prototype.on = EventEmitter.prototype.addListener; EventEmitter.prototype.once = function(type, listener) { if (!isFunction(listener)) throw TypeError('listener must be a function'); var fired = false; function g() { this.removeListener(type, g); if (!fired) { fired = true; listener.apply(this, arguments); } } g.listener = listener; this.on(type, g); return this; }; // emits a 'removeListener' event iff the listener was removed EventEmitter.prototype.removeListener = function(type, listener) { var list, position, length, i; if (!isFunction(listener)) throw TypeError('listener must be a function'); if (!this._events || !this._events[type]) return this; list = this._events[type]; length = list.length; position = -1; if (list === listener || (isFunction(list.listener) && list.listener === listener)) { delete this._events[type]; if (this._events.removeListener) this.emit('removeListener', type, listener); } else if (isObject(list)) { for (i = length; i-- > 0;) { if (list[i] === listener || (list[i].listener && list[i].listener === listener)) { position = i; break; } } if (position < 0) return this; if (list.length === 1) { list.length = 0; delete this._events[type]; } else { list.splice(position, 1); } if (this._events.removeListener) this.emit('removeListener', type, listener); } return this; }; EventEmitter.prototype.removeAllListeners = function(type) { var key, listeners; if (!this._events) return this; // not listening for removeListener, no need to emit if (!this._events.removeListener) { if (arguments.length === 0) this._events = {}; else if (this._events[type]) delete this._events[type]; return this; } // emit removeListener for all listeners on all events if (arguments.length === 0) { for (key in this._events) { if (key === 'removeListener') continue; this.removeAllListeners(key); } this.removeAllListeners('removeListener'); this._events = {}; return this; } listeners = this._events[type]; if (isFunction(listeners)) { this.removeListener(type, listeners); } else if (listeners) { // LIFO order while (listeners.length) this.removeListener(type, listeners[listeners.length - 1]); } delete this._events[type]; return this; }; EventEmitter.prototype.listeners = function(type) { var ret; if (!this._events || !this._events[type]) ret = []; else if (isFunction(this._events[type])) ret = [this._events[type]]; else ret = this._events[type].slice(); return ret; }; EventEmitter.prototype.listenerCount = function(type) { if (this._events) { var evlistener = this._events[type]; if (isFunction(evlistener)) return 1; else if (evlistener) return evlistener.length; } return 0; }; EventEmitter.listenerCount = function(emitter, type) { return emitter.listenerCount(type); }; function isFunction(arg) { return typeof arg === 'function'; } function isNumber(arg) { return typeof arg === 'number'; } function isObject(arg) { return typeof arg === 'object' && arg !== null; } function isUndefined(arg) { return arg === void 0; } /***/ }, /* 7 */ /***/ function(module, exports) { /* eslint-disable no-unused-vars */ 'use strict'; 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); } module.exports = 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 (Object.getOwnPropertySymbols) { symbols = Object.getOwnPropertySymbols(from); for (var i = 0; i < symbols.length; i++) { if (propIsEnumerable.call(from, symbols[i])) { to[symbols[i]] = from[symbols[i]]; } } } } return to; }; /***/ }, /* 8 */ /***/ function(module, exports) { 'use strict'; Object.defineProperty(exports, '__esModule', {value: true}); exports.default = function nullthrows(x) { if (x != null) { return x; } throw new Error('Got unexpected null or undefined'); }; /***/ }, /* 9 */ /***/ function(module, exports) { /** * Copyright (c) 2015-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. * * */ 'use strict'; function guid() { return 'g' + Math.random().toString(16).substr(2); } module.exports = guid; /***/ }, /* 10 */ /***/ function(module, exports) { 'use strict'; 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); } } /** * Copyright (c) 2015-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. * */ var hasOwnProperty = Object.prototype.hasOwnProperty; /** * Retrieves the value from the path of nested objects * @param {Object} base Base or root object for path * @param {Array} path nested path * @return {any} Value at end of path or `mull` */ function getIn(base, path) { return path.reduce(function (obj, attr) { if (obj) { if (hasOwnProperty.call(obj, attr)) { return obj[attr]; } if (typeof obj[Symbol.iterator] === 'function') { // Convert iterable to array and return array[index] return [].concat(_toConsumableArray(obj))[attr]; } } return null; }, base); } module.exports = getIn; /***/ }, /* 11 */ /***/ function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(Set) {/** * Copyright (c) 2015-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. * * */ 'use strict'; 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 _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; }; function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } var hasNativePerformanceNow = (typeof performance === 'undefined' ? 'undefined' : _typeof(performance)) === 'object' && typeof performance.now === 'function'; var now = hasNativePerformanceNow ? function () { return performance.now(); } : function () { return Date.now(); }; /** * The Profiler UI displays the entire React tree, with timing info, for each commit. * The frontend store only has the latest tree at any given time though, * So the ProfileCollector stores snapshots of the immutable tree for each commit, * Along with timing information for nodes that were updated in that commit. * This information is saved in the ProfilerStore. */ var ProfileCollector = function () { function ProfileCollector(agent) { var _this = this; _classCallCheck(this, ProfileCollector); this._committedNodes = new Set(); this._isRecording = false; this._maxActualDuration = 0; this._recordingStartTime = 0; this._onIsRecording = function (isRecording) { _this._committedNodes = new Set(); _this._isRecording = isRecording; _this._recordingStartTime = isRecording ? now() : 0; if (isRecording) { // Maybe in the future, we'll allow collecting multiple profiles and stepping through them. // For now, clear old snapshots when we start recording new data though. _this._agent.emit('clearSnapshots'); // Note that the Profiler doesn't need to do anything to turn profiling on in React. // Profiling-capable builds automatically profile all roots when DevTools is detected. } }; this._onMountOrUpdate = function (data) { if (!_this._isRecording || data.actualDuration === undefined) { return; } _this._committedNodes.add(data.id); _this._maxActualDuration = Math.max(_this._maxActualDuration, data.actualDuration); }; this._onRootCommitted = function (id, internalInstance, data) { if (!_this._isRecording) { return; } // Once all roots have been committed, // Take a snapshot of the current tree. _this._takeCommitSnapshotForRoot(id, data); // Then reset data for the next snapshot. _this._committedNodes = new Set(); _this._maxActualDuration = 0; }; this._onUnmount = function (id) { _this._committedNodes.delete(id); }; this._agent = agent; agent.on('isRecording', this._onIsRecording); agent.on('mount', this._onMountOrUpdate); agent.on('rootCommitted', this._onRootCommitted); agent.on('unmount', this._onUnmount); agent.on('update', this._onMountOrUpdate); } _createClass(ProfileCollector, [{ key: '_takeCommitSnapshotForRoot', value: function _takeCommitSnapshotForRoot(id, data) { var _this2 = this; var interactionsArray = data.memoizedInteractions != null ? Array.from(data.memoizedInteractions) : []; // Map interaction start times to when we started profiling. // We clone (rather than mutate) the interactions in stateNode.memoizedInteractions, // Because we don't want to affect user code that might be consuming these Interactions via Profiler. var memoizedInteractions = interactionsArray.map(function (_ref) { var name = _ref.name, timestamp = _ref.timestamp; return { name: name, timestamp: timestamp - _this2._recordingStartTime }; }); var storeSnapshot = { memoizedInteractions: memoizedInteractions, committedNodes: Array.from(this._committedNodes), commitTime: now() - this._recordingStartTime, duration: this._maxActualDuration, root: id }; this._agent.emit('storeSnapshot', storeSnapshot); } }]); return ProfileCollector; }(); function init(agent) { return new ProfileCollector(agent); } module.exports = { init: init }; /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5))) /***/ }, /* 12 */ /***/ function(module, exports, __webpack_require__) { /** * Copyright (c) 2015-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. * * */ 'use strict'; 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; }; }(); function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } var TraceUpdatesAbstractNodeMeasurer = __webpack_require__(13); var TraceUpdatesAbstractNodePresenter = __webpack_require__(18); var TraceUpdatesWebNodeMeasurer = __webpack_require__(19); var TraceUpdatesWebNodePresenter = __webpack_require__(20); var NODE_TYPE_COMPOSITE = 'Composite'; var NODE_TYPE_SPECIAL = 'Special'; var TraceUpdatesBackendManager = function () { function TraceUpdatesBackendManager(agent) { _classCallCheck(this, TraceUpdatesBackendManager); this._onMeasureNode = this._onMeasureNode.bind(this); var useDOM = agent.capabilities.dom; this._measurer = useDOM ? new TraceUpdatesWebNodeMeasurer() : new TraceUpdatesAbstractNodeMeasurer(); this._presenter = useDOM ? new TraceUpdatesWebNodePresenter() : new TraceUpdatesAbstractNodePresenter(); this._isActive = false; agent.on('traceupdatesstatechange', this._onTraceUpdatesStateChange.bind(this)); agent.on('update', this._onUpdate.bind(this, agent)); agent.on('shutdown', this._shutdown.bind(this)); } _createClass(TraceUpdatesBackendManager, [{ key: '_onUpdate', value: function _onUpdate(agent, obj) { if (!this._isActive || !obj.id) { return; } // Highlighting every host node would be too noisy. // We highlight user components and context consumers // (without consumers, a context update that renders // only host nodes directly wouldn't highlight at all). var shouldHighlight = obj.nodeType === NODE_TYPE_COMPOSITE || obj.nodeType === NODE_TYPE_SPECIAL && obj.name.endsWith('.Consumer'); if (!shouldHighlight) { return; } var node = agent.getNodeForID(obj.id); if (!node) { return; } this._measurer.request(node, this._onMeasureNode); } }, { key: '_onMeasureNode', value: function _onMeasureNode(measurement) { this._presenter.present(measurement); } }, { key: '_onTraceUpdatesStateChange', value: function _onTraceUpdatesStateChange(state) { this._isActive = state.enabled; this._presenter.setEnabled(state.enabled); } }, { key: '_shutdown', value: function _shutdown() { this._isActive = false; this._presenter.setEnabled(false); } }]); return TraceUpdatesBackendManager; }(); function init(agent) { return new TraceUpdatesBackendManager(agent); } module.exports = { init: init }; /***/ }, /* 13 */ /***/ function(module, exports, __webpack_require__) { /** * Copyright (c) 2015-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. * * */ 'use strict'; 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 _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); var _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; }; }(); function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } var requestAnimationFrame = __webpack_require__(14); var immutable = __webpack_require__(17); // How long the measurement can be cached in ms. var DURATION = 800; var Record = immutable.Record, Map = immutable.Map, Set = immutable.Set; var MeasurementRecord = Record({ bottom: 0, expiration: 0, height: 0, id: '', left: 0, right: 0, scrollX: 0, scrollY: 0, top: 0, width: 0 }); var _id = 100; var TraceUpdatesAbstractNodeMeasurer = function () { function TraceUpdatesAbstractNodeMeasurer() { _classCallCheck(this, TraceUpdatesAbstractNodeMeasurer); // pending nodes to measure. this._nodes = new Map(); // ids of pending nodes. this._ids = new Map(); // cached measurements. this._measurements = new Map(); // callbacks for pending nodes. this._callbacks = new Map(); this._isRequesting = false; // non-auto-binds. this._measureNodes = this._measureNodes.bind(this); } _createClass(TraceUpdatesAbstractNodeMeasurer, [{ key: 'request', value: function request(node, callback) { var requestID = this._nodes.has(node) ? this._nodes.get(node) : String(_id++); this._nodes = this._nodes.set(node, requestID); this._ids = this._ids.set(requestID, node); var callbacks = this._callbacks.has(node) ? this._callbacks.get(node) : new Set(); callbacks = callbacks.add(callback); this._callbacks = this._callbacks.set(node, callbacks); if (this._isRequesting) { return requestID; } this._isRequesting = true; requestAnimationFrame(this._measureNodes); return requestID; } }, { key: 'cancel', value: function cancel(requestID) { if (this._ids.has(requestID)) { var node = this._ids.get(requestID); this._ids = this._ids.delete(requestID); this._nodes = this._nodes.delete(node); this._callbacks = this._callbacks.delete(node); } } }, { key: 'measureImpl', value: function measureImpl(node) { // sub-class must overwrite this. return new MeasurementRecord(); } }, { key: '_measureNodes', value: function _measureNodes() { var _this = this; var now = Date.now(); this._measurements = this._measurements.withMutations(function (_measurements) { var _iteratorNormalCompletion = true; var _didIteratorError = false; var _iteratorError = undefined; try { for (var _iterator = _this._nodes.keys()[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { var node = _step.value; var measurement = _this._measureNode(now, node); // cache measurement. _measurements.set(node, measurement); } } catch (err) { _didIteratorError = true; _iteratorError = err; } finally { try { if (!_iteratorNormalCompletion && _iterator.return) { _iterator.return(); } } finally { if (_didIteratorError) { throw _iteratorError; } } } }); // execute callbacks. var _iteratorNormalCompletion2 = true; var _didIteratorError2 = false; var _iteratorError2 = undefined; try { var _loop = function _loop() { var node = _step2.value; var measurement = _this._measurements.get(node); _this._callbacks.get(node).forEach(function (callback) { return callback(measurement); }); }; for (var _iterator2 = this._nodes.keys()[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) { _loop(); } // clear stale measurement. } catch (err) { _didIteratorError2 = true; _iteratorError2 = err; } finally { try { if (!_iteratorNormalCompletion2 && _iterator2.return) { _iterator2.return(); } } finally { if (_didIteratorError2) { throw _iteratorError2; } } } this._measurements = this._measurements.withMutations(function (_measurements) { var _iteratorNormalCompletion3 = true; var _didIteratorError3 = false; var _iteratorError3 = undefined; try { for (var _iterator3 = _measurements.entries()[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) { var _step3$value = _slicedToArray(_step3.value, 2), node = _step3$value[0], measurement = _step3$value[1]; if (measurement.expiration < now) { _measurements.delete(node); } } } catch (err) { _didIteratorError3 = true; _iteratorError3 = err; } finally { try { if (!_iteratorNormalCompletion3 && _iterator3.return) { _iterator3.return(); } } finally { if (_didIteratorError3) { throw _iteratorError3; } } } }); this._ids = this._ids.clear(); this._nodes = this._nodes.clear(); this._callbacks = this._callbacks.clear(); this._isRequesting = false; } }, { key: '_measureNode', value: function _measureNode(timestamp, node) { var measurement; var data; if (this._measurements.has(node)) { measurement = this._measurements.get(node); if (measurement.expiration < timestamp) { // measurement expires. measure again. data = this.measureImpl(node); measurement = measurement.merge(_extends({}, data, { expiration: timestamp + DURATION })); } } else { data = this.measureImpl(node); measurement = new MeasurementRecord(_extends({}, data, { expiration: timestamp + DURATION, id: 'm_' + String(_id++) })); } return measurement; } }]); return TraceUpdatesAbstractNodeMeasurer; }(); module.exports = TraceUpdatesAbstractNodeMeasurer; /***/ }, /* 14 */ /***/ function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(global) {/** * 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. * * @providesModule requestAnimationFrame */ 'use strict'; var emptyFunction = __webpack_require__(15); var nativeRequestAnimationFrame = __webpack_require__(16); var lastTime = 0; var requestAnimationFrame = nativeRequestAnimationFrame || function (callback) { var currTime = Date.now(); var timeDelay = Math.max(0, 16 - (currTime - lastTime)); lastTime = currTime + timeDelay; return global.setTimeout(function () { callback(Date.now()); }, timeDelay); }; // Works around a rare bug in Safari 6 where the first request is never invoked. requestAnimationFrame(emptyFunction); module.exports = requestAnimationFrame; /* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }()))) /***/ }, /* 15 */ /***/ function(module, exports) { /** * 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. * * @providesModule emptyFunction */ "use strict"; 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. */ 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; /***/ }, /* 16 */ /***/ function(module, exports) { /* WEBPACK VAR INJECTION */(function(global) {/** * 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. * * @providesModule nativeRequestAnimationFrame */ "use strict"; var nativeRequestAnimationFrame = global.requestAnimationFrame || global.webkitRequestAnimationFrame || global.mozRequestAnimationFrame || global.oRequestAnimationFrame || global.msRequestAnimationFrame; module.exports = nativeRequestAnimationFrame; /* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }()))) /***/ }, /* 17 */ /***/ function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(__webpack_provided_Object_dot_create, WeakMap, Map, Set) {/** * Copyright (c) 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. */ (function (global, factory) { true ? module.exports = factory() : typeof define === 'function' && define.amd ? define(factory) : global.Immutable = factory(); }(this, function () { 'use strict';var SLICE$0 = Array.prototype.slice; function createClass(ctor, superClass) { if (superClass) { ctor.prototype = __webpack_provided_Object_dot_create(superClass.prototype); } ctor.prototype.constructor = ctor; } function Iterable(value) { return isIterable(value) ? value : Seq(value); } createClass(KeyedIterable, Iterable); function KeyedIterable(value) { return isKeyed(value) ? value : KeyedSeq(value); } createClass(IndexedIterable, Iterable); function IndexedIterable(value) { return isIndexed(value) ? value : IndexedSeq(value); } createClass(SetIterable, Iterable); function SetIterable(value) { return isIterable(value) && !isAssociative(value) ? value : SetSeq(value); } function isIterable(maybeIterable) { return !!(maybeIterable && maybeIterable[IS_ITERABLE_SENTINEL]); } function isKeyed(maybeKeyed) { return !!(maybeKeyed && maybeKeyed[IS_KEYED_SENTINEL]); } function isIndexed(maybeIndexed) { return !!(maybeIndexed && maybeIndexed[IS_INDEXED_SENTINEL]); } function isAssociative(maybeAssociative) { return isKeyed(maybeAssociative) || isIndexed(maybeAssociative); } function isOrdered(maybeOrdered) { return !!(maybeOrdered && maybeOrdered[IS_ORDERED_SENTINEL]); } Iterable.isIterable = isIterable; Iterable.isKeyed = isKeyed; Iterable.isIndexed = isIndexed; Iterable.isAssociative = isAssociative; Iterable.isOrdered = isOrdered; Iterable.Keyed = KeyedIterable; Iterable.Indexed = IndexedIterable; Iterable.Set = SetIterable; var IS_ITERABLE_SENTINEL = '@@__IMMUTABLE_ITERABLE__@@'; var IS_KEYED_SENTINEL = '@@__IMMUTABLE_KEYED__@@'; var IS_INDEXED_SENTINEL = '@@__IMMUTABLE_INDEXED__@@'; var IS_ORDERED_SENTINEL = '@@__IMMUTABLE_ORDERED__@@'; // Used for setting prototype methods that IE8 chokes on. var DELETE = 'delete'; // Constants describing the size of trie nodes. var SHIFT = 5; // Resulted in best performance after ______? var SIZE = 1 << SHIFT; var MASK = SIZE - 1; // A consistent shared value representing "not set" which equals nothing other // than itself, and nothing that could be provided externally. var NOT_SET = {}; // Boolean references, Rough equivalent of `bool &`. var CHANGE_LENGTH = { value: false }; var DID_ALTER = { value: false }; function MakeRef(ref) { ref.value = false; return ref; } function SetRef(ref) { ref && (ref.value = true); } // A function which returns a value representing an "owner" for transient writes // to tries. The return value will only ever equal itself, and will not equal // the return of any subsequent call of this function. function OwnerID() {} // http://jsperf.com/copy-array-inline function arrCopy(arr, offset) { offset = offset || 0; var len = Math.max(0, arr.length - offset); var newArr = new Array(len); for (var ii = 0; ii < len; ii++) { newArr[ii] = arr[ii + offset]; } return newArr; } function ensureSize(iter) { if (iter.size === undefined) { iter.size = iter.__iterate(returnTrue); } return iter.size; } function wrapIndex(iter, index) { // This implements "is array index" which the ECMAString spec defines as: // // A String property name P is an array index if and only if // ToString(ToUint32(P)) is equal to P and ToUint32(P) is not equal // to 2^32−1. // // http://www.ecma-international.org/ecma-262/6.0/#sec-array-exotic-objects if (typeof index !== 'number') { var uint32Index = index >>> 0; // N >>> 0 is shorthand for ToUint32 if ('' + uint32Index !== index || uint32Index === 4294967295) { return NaN; } index = uint32Index; } return index < 0 ? ensureSize(iter) + index : index; } function returnTrue() { return true; } function wholeSlice(begin, end, size) { return (begin === 0 || (size !== undefined && begin <= -size)) && (end === undefined || (size !== undefined && end >= size)); } function resolveBegin(begin, size) { return resolveIndex(begin, size, 0); } function resolveEnd(end, size) { return resolveIndex(end, size, size); } function resolveIndex(index, size, defaultIndex) { return index === undefined ? defaultIndex : index < 0 ? Math.max(0, size + index) : size === undefined ? index : Math.min(size, index); } /* global Symbol */ var ITERATE_KEYS = 0; var ITERATE_VALUES = 1; var ITERATE_ENTRIES = 2; var REAL_ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator; var FAUX_ITERATOR_SYMBOL = '@@iterator'; var ITERATOR_SYMBOL = REAL_ITERATOR_SYMBOL || FAUX_ITERATOR_SYMBOL; function Iterator(next) { this.next = next; } Iterator.prototype.toString = function() { return '[Iterator]'; }; Iterator.KEYS = ITERATE_KEYS; Iterator.VALUES = ITERATE_VALUES; Iterator.ENTRIES = ITERATE_ENTRIES; Iterator.prototype.inspect = Iterator.prototype.toSource = function () { return this.toString(); } Iterator.prototype[ITERATOR_SYMBOL] = function () { return this; }; function iteratorValue(type, k, v, iteratorResult) { var value = type === 0 ? k : type === 1 ? v : [k, v]; iteratorResult ? (iteratorResult.value = value) : (iteratorResult = { value: value, done: false }); return iteratorResult; } function iteratorDone() { return { value: undefined, done: true }; } function hasIterator(maybeIterable) { return !!getIteratorFn(maybeIterable); } function isIterator(maybeIterator) { return maybeIterator && typeof maybeIterator.next === 'function'; } function getIterator(iterable) { var iteratorFn = getIteratorFn(iterable); return iteratorFn && iteratorFn.call(iterable); } function getIteratorFn(iterable) { var iteratorFn = iterable && ( (REAL_ITERATOR_SYMBOL && iterable[REAL_ITERATOR_SYMBOL]) || iterable[FAUX_ITERATOR_SYMBOL] ); if (typeof iteratorFn === 'function') { return iteratorFn; } } function isArrayLike(value) { return value && typeof value.length === 'number'; } createClass(Seq, Iterable); function Seq(value) { return value === null || value === undefined ? emptySequence() : isIterable(value) ? value.toSeq() : seqFromValue(value); } Seq.of = function(/*...values*/) { return Seq(arguments); }; Seq.prototype.toSeq = function() { return this; }; Seq.prototype.toString = function() { return this.__toString('Seq {', '}'); }; Seq.prototype.cacheResult = function() { if (!this._cache && this.__iterateUncached) { this._cache = this.entrySeq().toArray(); this.size = this._cache.length; } return this; }; // abstract __iterateUncached(fn, reverse) Seq.prototype.__iterate = function(fn, reverse) { return seqIterate(this, fn, reverse, true); }; // abstract __iteratorUncached(type, reverse) Seq.prototype.__iterator = function(type, reverse) { return seqIterator(this, type, reverse, true); }; createClass(KeyedSeq, Seq); function KeyedSeq(value) { return value === null || value === undefined ? emptySequence().toKeyedSeq() : isIterable(value) ? (isKeyed(value) ? value.toSeq() : value.fromEntrySeq()) : keyedSeqFromValue(value); } KeyedSeq.prototype.toKeyedSeq = function() { return this; }; createClass(IndexedSeq, Seq); function IndexedSeq(value) { return value === null || value === undefined ? emptySequence() : !isIterable(value) ? indexedSeqFromValue(value) : isKeyed(value) ? value.entrySeq() : value.toIndexedSeq(); } IndexedSeq.of = function(/*...values*/) { return IndexedSeq(arguments); }; IndexedSeq.prototype.toIndexedSeq = function() { return this; }; IndexedSeq.prototype.toString = function() { return this.__toString('Seq [', ']'); }; IndexedSeq.prototype.__iterate = function(fn, reverse) { return seqIterate(this, fn, reverse, false); }; IndexedSeq.prototype.__iterator = function(type, reverse) { return seqIterator(this, type, reverse, false); }; createClass(SetSeq, Seq); function SetSeq(value) { return ( value === null || value === undefined ? emptySequence() : !isIterable(value) ? indexedSeqFromValue(value) : isKeyed(value) ? value.entrySeq() : value ).toSetSeq(); } SetSeq.of = function(/*...values*/) { return SetSeq(arguments); }; SetSeq.prototype.toSetSeq = function() { return this; }; Seq.isSeq = isSeq; Seq.Keyed = KeyedSeq; Seq.Set = SetSeq; Seq.Indexed = IndexedSeq; var IS_SEQ_SENTINEL = '@@__IMMUTABLE_SEQ__@@'; Seq.prototype[IS_SEQ_SENTINEL] = true; createClass(ArraySeq, IndexedSeq); function ArraySeq(array) { this._array = array; this.size = array.length; } ArraySeq.prototype.get = function(index, notSetValue) { return this.has(index) ? this._array[wrapIndex(this, index)] : notSetValue; }; ArraySeq.prototype.__iterate = function(fn, reverse) { var array = this._array; var maxIndex = array.length - 1; for (var ii = 0; ii <= maxIndex; ii++) { if (fn(array[reverse ? maxIndex - ii : ii], ii, this) === false) { return ii + 1; } } return ii; }; ArraySeq.prototype.__iterator = function(type, reverse) { var array = this._array; var maxIndex = array.length - 1; var ii = 0; return new Iterator(function() {return ii > maxIndex ? iteratorDone() : iteratorValue(type, ii, array[reverse ? maxIndex - ii++ : ii++])} ); }; createClass(ObjectSeq, KeyedSeq); function ObjectSeq(object) { var keys = Object.keys(object); this._object = object; this._keys = keys; this.size = keys.length; } ObjectSeq.prototype.get = function(key, notSetValue) { if (notSetValue !== undefined && !this.has(key)) { return notSetValue; } return this._object[key]; }; ObjectSeq.prototype.has = function(key) { return this._object.hasOwnProperty(key); }; ObjectSeq.prototype.__iterate = function(fn, reverse) { var object = this._object; var keys = this._keys; var maxIndex = keys.length - 1; for (var ii = 0; ii <= maxIndex; ii++) { var key = keys[reverse ? maxIndex - ii : ii]; if (fn(object[key], key, this) === false) { return ii + 1; } } return ii; }; ObjectSeq.prototype.__iterator = function(type, reverse) { var object = this._object; var keys = this._keys; var maxIndex = keys.length - 1; var ii = 0; return new Iterator(function() { var key = keys[reverse ? maxIndex - ii : ii]; return ii++ > maxIndex ? iteratorDone() : iteratorValue(type, key, object[key]); }); }; ObjectSeq.prototype[IS_ORDERED_SENTINEL] = true; createClass(IterableSeq, IndexedSeq); function IterableSeq(iterable) { this._iterable = iterable; this.size = iterable.length || iterable.size; } IterableSeq.prototype.__iterateUncached = function(fn, reverse) { if (reverse) { return this.cacheResult().__iterate(fn, reverse); } var iterable = this._iterable; var iterator = getIterator(iterable); var iterations = 0; if (isIterator(iterator)) { var step; while (!(step = iterator.next()).done) { if (fn(step.value, iterations++, this) === false) { break; } } } return iterations; }; IterableSeq.prototype.__iteratorUncached = function(type, reverse) { if (reverse) { return this.cacheResult().__iterator(type, reverse); } var iterable = this._iterable; var iterator = getIterator(iterable); if (!isIterator(iterator)) { return new Iterator(iteratorDone); } var iterations = 0; return new Iterator(function() { var step = iterator.next(); return step.done ? step : iteratorValue(type, iterations++, step.value); }); }; createClass(IteratorSeq, IndexedSeq); function IteratorSeq(iterator) { this._iterator = iterator; this._iteratorCache = []; } IteratorSeq.prototype.__iterateUncached = function(fn, reverse) { if (reverse) { return this.cacheResult().__iterate(fn, reverse); } var iterator = this._iterator; var cache = this._iteratorCache; var iterations = 0; while (iterations < cache.length) { if (fn(cache[iterations], iterations++, this) === false) { return iterations; } } var step; while (!(step = iterator.next()).done) { var val = step.value; cache[iterations] = val; if (fn(val, iterations++, this) === false) { break; } } return iterations; }; IteratorSeq.prototype.__iteratorUncached = function(type, reverse) { if (reverse) { return this.cacheResult().__iterator(type, reverse); } var iterator = this._iterator; var cache = this._iteratorCache; var iterations = 0; return new Iterator(function() { if (iterations >= cache.length) { var step = iterator.next(); if (step.done) { return step; } cache[iterations] = step.value; } return iteratorValue(type, iterations, cache[iterations++]); }); }; // # pragma Helper functions function isSeq(maybeSeq) { return !!(maybeSeq && maybeSeq[IS_SEQ_SENTINEL]); } var EMPTY_SEQ; function emptySequence() { return EMPTY_SEQ || (EMPTY_SEQ = new ArraySeq([])); } function keyedSeqFromValue(value) { var seq = Array.isArray(value) ? new ArraySeq(value).fromEntrySeq() : isIterator(value) ? new IteratorSeq(value).fromEntrySeq() : hasIterator(value) ? new IterableSeq(value).fromEntrySeq() : typeof value === 'object' ? new ObjectSeq(value) : undefined; if (!seq) { throw new TypeError( 'Expected Array or iterable object of [k, v] entries, '+ 'or keyed object: ' + value ); } return seq; } function indexedSeqFromValue(value) { var seq = maybeIndexedSeqFromValue(value); if (!seq) { throw new TypeError( 'Expected Array or iterable object of values: ' + value ); } return seq; } function seqFromValue(value) { var seq = maybeIndexedSeqFromValue(value) || (typeof value === 'object' && new ObjectSeq(value)); if (!seq) { throw new TypeError( 'Expected Array or iterable object of values, or keyed object: ' + value ); } return seq; } function maybeIndexedSeqFromValue(value) { return ( isArrayLike(value) ? new ArraySeq(value) : isIterator(value) ? new IteratorSeq(value) : hasIterator(value) ? new IterableSeq(value) : undefined ); } function seqIterate(seq, fn, reverse, useKeys) { var cache = seq._cache; if (cache) { var maxIndex = cache.length - 1; for (var ii = 0; ii <= maxIndex; ii++) { var entry = cache[reverse ? maxIndex - ii : ii]; if (fn(entry[1], useKeys ? entry[0] : ii, seq) === false) { return ii + 1; } } return ii; } return seq.__iterateUncached(fn, reverse); } function seqIterator(seq, type, reverse, useKeys) { var cache = seq._cache; if (cache) { var maxIndex = cache.length - 1; var ii = 0; return new Iterator(function() { var entry = cache[reverse ? maxIndex - ii : ii]; return ii++ > maxIndex ? iteratorDone() : iteratorValue(type, useKeys ? entry[0] : ii - 1, entry[1]); }); } return seq.__iteratorUncached(type, reverse); } function fromJS(json, converter) { return converter ? fromJSWith(converter, json, '', {'': json}) : fromJSDefault(json); } function fromJSWith(converter, json, key, parentJSON) { if (Array.isArray(json)) { return converter.call(parentJSON, key, IndexedSeq(json).map(function(v, k) {return fromJSWith(converter, v, k, json)})); } if (isPlainObj(json)) { return converter.call(parentJSON, key, KeyedSeq(json).map(function(v, k) {return fromJSWith(converter, v, k, json)})); } return json; } function fromJSDefault(json) { if (Array.isArray(json)) { return IndexedSeq(json).map(fromJSDefault).toList(); } if (isPlainObj(json)) { return KeyedSeq(json).map(fromJSDefault).toMap(); } return json; } function isPlainObj(value) { return value && (value.constructor === Object || value.constructor === undefined); } /** * An extension of the "same-value" algorithm as [described for use by ES6 Map * and Set](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map#Key_equality) * * NaN is considered the same as NaN, however -0 and 0 are considered the same * value, which is different from the algorithm described by * [`Object.is`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is). * * This is extended further to allow Objects to describe the values they * represent, by way of `valueOf` or `equals` (and `hashCode`). * * Note: because of this extension, the key equality of Immutable.Map and the * value equality of Immutable.Set will differ from ES6 Map and Set. * * ### Defining custom values * * The easiest way to describe the value an object represents is by implementing * `valueOf`. For example, `Date` represents a value by returning a unix * timestamp for `valueOf`: * * var date1 = new Date(1234567890000); // Fri Feb 13 2009 ... * var date2 = new Date(1234567890000); * date1.valueOf(); // 1234567890000 * assert( date1 !== date2 ); * assert( Immutable.is( date1, date2 ) ); * * Note: overriding `valueOf` may have other implications if you use this object * where JavaScript expects a primitive, such as implicit string coercion. * * For more complex types, especially collections, implementing `valueOf` may * not be performant. An alternative is to implement `equals` and `hashCode`. * * `equals` takes another object, presumably of similar type, and returns true * if the it is equal. Equality is symmetrical, so the same result should be * returned if this and the argument are flipped. * * assert( a.equals(b) === b.equals(a) ); * * `hashCode` returns a 32bit integer number representing the object which will * be used to determine how to store the value object in a Map or Set. You must * provide both or neither methods, one must not exist without the other. * * Also, an important relationship between these methods must be upheld: if two * values are equal, they *must* return the same hashCode. If the values are not * equal, they might have the same hashCode; this is called a hash collision, * and while undesirable for performance reasons, it is acceptable. * * if (a.equals(b)) { * assert( a.hashCode() === b.hashCode() ); * } * * All Immutable collections implement `equals` and `hashCode`. * */ function is(valueA, valueB) { if (valueA === valueB || (valueA !== valueA && valueB !== valueB)) { return true; } if (!valueA || !valueB) { return false; } if (typeof valueA.valueOf === 'function' && typeof valueB.valueOf === 'function') { valueA = valueA.valueOf(); valueB = valueB.valueOf(); if (valueA === valueB || (valueA !== valueA && valueB !== valueB)) { return true; } if (!valueA || !valueB) { return false; } } if (typeof valueA.equals === 'function' && typeof valueB.equals === 'function' && valueA.equals(valueB)) { return true; } return false; } function deepEqual(a, b) { if (a === b) { return true; } if ( !isIterable(b) || a.size !== undefined && b.size !== undefined && a.size !== b.size || a.__hash !== undefined && b.__hash !== undefined && a.__hash !== b.__hash || isKeyed(a) !== isKeyed(b) || isIndexed(a) !== isIndexed(b) || isOrdered(a) !== isOrdered(b) ) { return false; } if (a.size === 0 && b.size === 0) { return true; } var notAssociative = !isAssociative(a); if (isOrdered(a)) { var entries = a.entries(); return b.every(function(v, k) { var entry = entries.next().value; return entry && is(entry[1], v) && (notAssociative || is(entry[0], k)); }) && entries.next().done; } var flipped = false; if (a.size === undefined) { if (b.size === undefined) { if (typeof a.cacheResult === 'function') { a.cacheResult(); } } else { flipped = true; var _ = a; a = b; b = _; } } var allEqual = true; var bSize = b.__iterate(function(v, k) { if (notAssociative ? !a.has(v) : flipped ? !is(v, a.get(k, NOT_SET)) : !is(a.get(k, NOT_SET), v)) { allEqual = false; return false; } }); return allEqual && a.size === bSize; } createClass(Repeat, IndexedSeq); function Repeat(value, times) { if (!(this instanceof Repeat)) { return new Repeat(value, times); } this._value = value; this.size = times === undefined ? Infinity : Math.max(0, times); if (this.size === 0) { if (EMPTY_REPEAT) { return EMPTY_REPEAT; } EMPTY_REPEAT = this; } } Repeat.prototype.toString = function() { if (this.size === 0) { return 'Repeat []'; } return 'Repeat [ ' + this._value + ' ' + this.size + ' times ]'; }; Repeat.prototype.get = function(index, notSetValue) { return this.has(index) ? this._value : notSetValue; }; Repeat.prototype.includes = function(searchValue) { return is(this._value, searchValue); }; Repeat.prototype.slice = function(begin, end) { var size = this.size; return wholeSlice(begin, end, size) ? this : new Repeat(this._value, resolveEnd(end, size) - resolveBegin(begin, size)); }; Repeat.prototype.reverse = function() { return this; }; Repeat.prototype.indexOf = function(searchValue) { if (is(this._value, searchValue)) { return 0; } return -1; }; Repeat.prototype.lastIndexOf = function(searchValue) { if (is(this._value, searchValue)) { return this.size; } return -1; }; Repeat.prototype.__iterate = function(fn, reverse) { for (var ii = 0; ii < this.size; ii++) { if (fn(this._value, ii, this) === false) { return ii + 1; } } return ii; }; Repeat.prototype.__iterator = function(type, reverse) {var this$0 = this; var ii = 0; return new Iterator(function() {return ii < this$0.size ? iteratorValue(type, ii++, this$0._value) : iteratorDone()} ); }; Repeat.prototype.equals = function(other) { return other instanceof Repeat ? is(this._value, other._value) : deepEqual(other); }; var EMPTY_REPEAT; function invariant(condition, error) { if (!condition) throw new Error(error); } createClass(Range, IndexedSeq); function Range(start, end, step) { if (!(this instanceof Range)) { return new Range(start, end, step); } invariant(step !== 0, 'Cannot step a Range by 0'); start = start || 0; if (end === undefined) { end = Infinity; } step = step === undefined ? 1 : Math.abs(step); if (end < start) { step = -step; } this._start = start; this._end = end; this._step = step; this.size = Math.max(0, Math.ceil((end - start) / step - 1) + 1); if (this.size === 0) { if (EMPTY_RANGE) { return EMPTY_RANGE; } EMPTY_RANGE = this; } } Range.prototype.toString = function() { if (this.size === 0) { return 'Range []'; } return 'Range [ ' + this._start + '...' + this._end + (this._step > 1 ? ' by ' + this._step : '') + ' ]'; }; Range.prototype.get = function(index, notSetValue) { return this.has(index) ? this._start + wrapIndex(this, index) * this._step : notSetValue; }; Range.prototype.includes = function(searchValue) { var possibleIndex = (searchValue - this._start) / this._step; return possibleIndex >= 0 && possibleIndex < this.size && possibleIndex === Math.floor(possibleIndex); }; Range.prototype.slice = function(begin, end) { if (wholeSlice(begin, end, this.size)) { return this; } begin = resolveBegin(begin, this.size); end = resolveEnd(end, this.size); if (end <= begin) { return new Range(0, 0); } return new Range(this.get(begin, this._end), this.get(end, this._end), this._step); }; Range.prototype.indexOf = function(searchValue) { var offsetValue = searchValue - this._start; if (offsetValue % this._step === 0) { var index = offsetValue / this._step; if (index >= 0 && index < this.size) { return index } } return -1; }; Range.prototype.lastIndexOf = function(searchValue) { return this.indexOf(searchValue); }; Range.prototype.__iterate = function(fn, reverse) { var maxIndex = this.size - 1; var step = this._step; var value = reverse ? this._start + maxIndex * step : this._start; for (var ii = 0; ii <= maxIndex; ii++) { if (fn(value, ii, this) === false) { return ii + 1; } value += reverse ? -step : step; } return ii; }; Range.prototype.__iterator = function(type, reverse) { var maxIndex = this.size - 1; var step = this._step; var value = reverse ? this._start + maxIndex * step : this._start; var ii = 0; return new Iterator(function() { var v = value; value += reverse ? -step : step; return ii > maxIndex ? iteratorDone() : iteratorValue(type, ii++, v); }); }; Range.prototype.equals = function(other) { return other instanceof Range ? this._start === other._start && this._end === other._end && this._step === other._step : deepEqual(this, other); }; var EMPTY_RANGE; createClass(Collection, Iterable); function Collection() { throw TypeError('Abstract'); } createClass(KeyedCollection, Collection);function KeyedCollection() {} createClass(IndexedCollection, Collection);function IndexedCollection() {} createClass(SetCollection, Collection);function SetCollection() {} Collection.Keyed = KeyedCollection; Collection.Indexed = IndexedCollection; Collection.Set = SetCollection; var imul = typeof Math.imul === 'function' && Math.imul(0xffffffff, 2) === -2 ? Math.imul : function imul(a, b) { a = a | 0; // int b = b | 0; // int var c = a & 0xffff; var d = b & 0xffff; // Shift by 0 fixes the sign on the high part. return (c * d) + ((((a >>> 16) * d + c * (b >>> 16)) << 16) >>> 0) | 0; // int }; // v8 has an optimization for storing 31-bit signed numbers. // Values which have either 00 or 11 as the high order bits qualify. // This function drops the highest order bit in a signed number, maintaining // the sign bit. function smi(i32) { return ((i32 >>> 1) & 0x40000000) | (i32 & 0xBFFFFFFF); } function hash(o) { if (o === false || o === null || o === undefined) { return 0; } if (typeof o.valueOf === 'function') { o = o.valueOf(); if (o === false || o === null || o === undefined) { return 0; } } if (o === true) { return 1; } var type = typeof o; if (type === 'number') { var h = o | 0; if (h !== o) { h ^= o * 0xFFFFFFFF; } while (o > 0xFFFFFFFF) { o /= 0xFFFFFFFF; h ^= o; } return smi(h); } if (type === 'string') { return o.length > STRING_HASH_CACHE_MIN_STRLEN ? cachedHashString(o) : hashString(o); } if (typeof o.hashCode === 'function') { return o.hashCode(); } if (type === 'object') { return hashJSObj(o); } if (typeof o.toString === 'function') { return hashString(o.toString()); } throw new Error('Value type ' + type + ' cannot be hashed.'); } function cachedHashString(string) { var hash = stringHashCache[string]; if (hash === undefined) { hash = hashString(string); if (STRING_HASH_CACHE_SIZE === STRING_HASH_CACHE_MAX_SIZE) { STRING_HASH_CACHE_SIZE = 0; stringHashCache = {}; } STRING_HASH_CACHE_SIZE++; stringHashCache[string] = hash; } return hash; } // http://jsperf.com/hashing-strings function hashString(string) { // This is the hash from JVM // The hash code for a string is computed as // s[0] * 31 ^ (n - 1) + s[1] * 31 ^ (n - 2) + ... + s[n - 1], // where s[i] is the ith character of the string and n is the length of // the string. We "mod" the result to make it between 0 (inclusive) and 2^31 // (exclusive) by dropping high bits. var hash = 0; for (var ii = 0; ii < string.length; ii++) { hash = 31 * hash + string.charCodeAt(ii) | 0; } return smi(hash); } function hashJSObj(obj) { var hash; if (usingWeakMap) { hash = weakMap.get(obj); if (hash !== undefined) { return hash; } } hash = obj[UID_HASH_KEY]; if (hash !== undefined) { return hash; } if (!canDefineProperty) { hash = obj.propertyIsEnumerable && obj.propertyIsEnumerable[UID_HASH_KEY]; if (hash !== undefined) { return hash; } hash = getIENodeHash(obj); if (hash !== undefined) { return hash; } } hash = ++objHashUID; if (objHashUID & 0x40000000) { objHashUID = 0; } if (usingWeakMap) { weakMap.set(obj, hash); } else if (isExtensible !== undefined && isExtensible(obj) === false) { throw new Error('Non-extensible objects are not allowed as keys.'); } else if (canDefineProperty) { Object.defineProperty(obj, UID_HASH_KEY, { 'enumerable': false, 'configurable': false, 'writable': false, 'value': hash }); } else if (obj.propertyIsEnumerable !== undefined && obj.propertyIsEnumerable === obj.constructor.prototype.propertyIsEnumerable) { // Since we can't define a non-enumerable property on the object // we'll hijack one of the less-used non-enumerable properties to // save our hash on it. Since this is a function it will not show up in // `JSON.stringify` which is what we want. obj.propertyIsEnumerable = function() { return this.constructor.prototype.propertyIsEnumerable.apply(this, arguments); }; obj.propertyIsEnumerable[UID_HASH_KEY] = hash; } else if (obj.nodeType !== undefined) { // At this point we couldn't get the IE `uniqueID` to use as a hash // and we couldn't use a non-enumerable property to exploit the // dontEnum bug so we simply add the `UID_HASH_KEY` on the node // itself. obj[UID_HASH_KEY] = hash; } else { throw new Error('Unable to set a non-enumerable property on object.'); } return hash; } // Get references to ES5 object methods. var isExtensible = Object.isExtensible; // True if Object.defineProperty works as expected. IE8 fails this test. var canDefineProperty = (function() { try { Object.defineProperty({}, '@', {}); return true; } catch (e) { return false; } }()); // IE has a `uniqueID` property on DOM nodes. We can construct the hash from it // and avoid memory leaks from the IE cloneNode bug. function getIENodeHash(node) { if (node && node.nodeType > 0) { switch (node.nodeType) { case 1: // Element return node.uniqueID; case 9: // Document return node.documentElement && node.documentElement.uniqueID; } } } // If possible, use a WeakMap. var usingWeakMap = typeof WeakMap === 'function'; var weakMap; if (usingWeakMap) { weakMap = new WeakMap(); } var objHashUID = 0; var UID_HASH_KEY = '__immutablehash__'; if (typeof Symbol === 'function') { UID_HASH_KEY = Symbol(UID_HASH_KEY); } var STRING_HASH_CACHE_MIN_STRLEN = 16; var STRING_HASH_CACHE_MAX_SIZE = 255; var STRING_HASH_CACHE_SIZE = 0; var stringHashCache = {}; function assertNotInfinite(size) { invariant( size !== Infinity, 'Cannot perform this action with an infinite size.' ); } createClass(Map, KeyedCollection); // @pragma Construction function Map(value) { return value === null || value === undefined ? emptyMap() : isMap(value) && !isOrdered(value) ? value : emptyMap().withMutations(function(map ) { var iter = KeyedIterable(value); assertNotInfinite(iter.size); iter.forEach(function(v, k) {return map.set(k, v)}); }); } Map.prototype.toString = function() { return this.__toString('Map {', '}'); }; // @pragma Access Map.prototype.get = function(k, notSetValue) { return this._root ? this._root.get(0, undefined, k, notSetValue) : notSetValue; }; // @pragma Modification Map.prototype.set = function(k, v) { return updateMap(this, k, v); }; Map.prototype.setIn = function(keyPath, v) { return this.updateIn(keyPath, NOT_SET, function() {return v}); }; Map.prototype.remove = function(k) { return updateMap(this, k, NOT_SET); }; Map.prototype.deleteIn = function(keyPath) { return this.updateIn(keyPath, function() {return NOT_SET}); }; Map.prototype.update = function(k, notSetValue, updater) { return arguments.length === 1 ? k(this) : this.updateIn([k], notSetValue, updater); }; Map.prototype.updateIn = function(keyPath, notSetValue, updater) { if (!updater) { updater = notSetValue; notSetValue = undefined; } var updatedValue = updateInDeepMap( this, forceIterator(keyPath), notSetValue, updater ); return updatedValue === NOT_SET ? undefined : updatedValue; }; Map.prototype.clear = function() { if (this.size === 0) { return this; } if (this.__ownerID) { this.size = 0; this._root = null; this.__hash = undefined; this.__altered = true; return this; } return emptyMap(); }; // @pragma Composition Map.prototype.merge = function(/*...iters*/) { return mergeIntoMapWith(this, undefined, arguments); }; Map.prototype.mergeWith = function(merger) {var iters = SLICE$0.call(arguments, 1); return mergeIntoMapWith(this, merger, iters); }; Map.prototype.mergeIn = function(keyPath) {var iters = SLICE$0.call(arguments, 1); return this.updateIn( keyPath, emptyMap(), function(m ) {return typeof m.merge === 'function' ? m.merge.apply(m, iters) : iters[iters.length - 1]} ); }; Map.prototype.mergeDeep = function(/*...iters*/) { return mergeIntoMapWith(this, deepMerger, arguments); }; Map.prototype.mergeDeepWith = function(merger) {var iters = SLICE$0.call(arguments, 1); return mergeIntoMapWith(this, deepMergerWith(merger), iters); }; Map.prototype.mergeDeepIn = function(keyPath) {var iters = SLICE$0.call(arguments, 1); return this.updateIn( keyPath, emptyMap(), function(m ) {return typeof m.mergeDeep === 'function' ? m.mergeDeep.apply(m, iters) : iters[iters.length - 1]} ); }; Map.prototype.sort = function(comparator) { // Late binding return OrderedMap(sortFactory(this, comparator)); }; Map.prototype.sortBy = function(mapper, comparator) { // Late binding return OrderedMap(sortFactory(this, comparator, mapper)); }; // @pragma Mutability Map.prototype.withMutations = function(fn) { var mutable = this.asMutable(); fn(mutable); return mutable.wasAltered() ? mutable.__ensureOwner(this.__ownerID) : this; }; Map.prototype.asMutable = function() { return this.__ownerID ? this : this.__ensureOwner(new OwnerID()); }; Map.prototype.asImmutable = function() { return this.__ensureOwner(); }; Map.prototype.wasAltered = function() { return this.__altered; }; Map.prototype.__iterator = function(type, reverse) { return new MapIterator(this, type, reverse); }; Map.prototype.__iterate = function(fn, reverse) {var this$0 = this; var iterations = 0; this._root && this._root.iterate(function(entry ) { iterations++; return fn(entry[1], entry[0], this$0); }, reverse); return iterations; }; Map.prototype.__ensureOwner = function(ownerID) { if (ownerID === this.__ownerID) { return this; } if (!ownerID) { this.__ownerID = ownerID; this.__altered = false; return this; } return makeMap(this.size, this._root, ownerID, this.__hash); }; function isMap(maybeMap) { return !!(maybeMap && maybeMap[IS_MAP_SENTINEL]); } Map.isMap = isMap; var IS_MAP_SENTINEL = '@@__IMMUTABLE_MAP__@@'; var MapPrototype = Map.prototype; MapPrototype[IS_MAP_SENTINEL] = true; MapPrototype[DELETE] = MapPrototype.remove; MapPrototype.removeIn = MapPrototype.deleteIn; // #pragma Trie Nodes function ArrayMapNode(ownerID, entries) { this.ownerID = ownerID; this.entries = entries; } ArrayMapNode.prototype.get = function(shift, keyHash, key, notSetValue) { var entries = this.entries; for (var ii = 0, len = entries.length; ii < len; ii++) { if (is(key, entries[ii][0])) { return entries[ii][1]; } } return notSetValue; }; ArrayMapNode.prototype.update = function(ownerID, shift, keyHash, key, value, didChangeSize, didAlter) { var removed = value === NOT_SET; var entries = this.entries; var idx = 0; for (var len = entries.length; idx < len; idx++) { if (is(key, entries[idx][0])) { break; } } var exists = idx < len; if (exists ? entries[idx][1] === value : removed) { return this; } SetRef(didAlter); (removed || !exists) && SetRef(didChangeSize); if (removed && entries.length === 1) { return; // undefined } if (!exists && !removed && entries.length >= MAX_ARRAY_MAP_SIZE) { return createNodes(ownerID, entries, key, value); } var isEditable = ownerID && ownerID === this.ownerID; var newEntries = isEditable ? entries : arrCopy(entries); if (exists) { if (removed) { idx === len - 1 ? newEntries.pop() : (newEntries[idx] = newEntries.pop()); } else { newEntries[idx] = [key, value]; } } else { newEntries.push([key, value]); } if (isEditable) { this.entries = newEntries; return this; } return new ArrayMapNode(ownerID, newEntries); }; function BitmapIndexedNode(ownerID, bitmap, nodes) { this.ownerID = ownerID; this.bitmap = bitmap; this.nodes = nodes; } BitmapIndexedNode.prototype.get = function(shift, keyHash, key, notSetValue) { if (keyHash === undefined) { keyHash = hash(key); } var bit = (1 << ((shift === 0 ? keyHash : keyHash >>> shift) & MASK)); var bitmap = this.bitmap; return (bitmap & bit) === 0 ? notSetValue : this.nodes[popCount(bitmap & (bit - 1))].get(shift + SHIFT, keyHash, key, notSetValue); }; BitmapIndexedNode.prototype.update = function(ownerID, shift, keyHash, key, value, didChangeSize, didAlter) { if (keyHash === undefined) { keyHash = hash(key); } var keyHashFrag = (shift === 0 ? keyHash : keyHash >>> shift) & MASK; var bit = 1 << keyHashFrag; var bitmap = this.bitmap; var exists = (bitmap & bit) !== 0; if (!exists && value === NOT_SET) { return this; } var idx = popCount(bitmap & (bit - 1)); var nodes = this.nodes; var node = exists ? nodes[idx] : undefined; var newNode = updateNode(node, ownerID, shift + SHIFT, keyHash, key, value, didChangeSize, didAlter); if (newNode === node) { return this; } if (!exists && newNode && nodes.length >= MAX_BITMAP_INDEXED_SIZE) { return expandNodes(ownerID, nodes, bitmap, keyHashFrag, newNode); } if (exists && !newNode && nodes.length === 2 && isLeafNode(nodes[idx ^ 1])) { return nodes[idx ^ 1]; } if (exists && newNode && nodes.length === 1 && isLeafNode(newNode)) { return newNode; } var isEditable = ownerID && ownerID === this.ownerID; var newBitmap = exists ? newNode ? bitmap : bitmap ^ bit : bitmap | bit; var newNodes = exists ? newNode ? setIn(nodes, idx, newNode, isEditable) : spliceOut(nodes, idx, isEditable) : spliceIn(nodes, idx, newNode, isEditable); if (isEditable) { this.bitmap = newBitmap; this.nodes = newNodes; return this; } return new BitmapIndexedNode(ownerID, newBitmap, newNodes); }; function HashArrayMapNode(ownerID, count, nodes) { this.ownerID = ownerID; this.count = count; this.nodes = nodes; } HashArrayMapNode.prototype.get = function(shift, keyHash, key, notSetValue) { if (keyHash === undefined) { keyHash = hash(key); } var idx = (shift === 0 ? keyHash : keyHash >>> shift) & MASK; var node = this.nodes[idx]; return node ? node.get(shift + SHIFT, keyHash, key, notSetValue) : notSetValue; }; HashArrayMapNode.prototype.update = function(ownerID, shift, keyHash, key, value, didChangeSize, didAlter) { if (keyHash === undefined) { keyHash = hash(key); } var idx = (shift === 0 ? keyHash : keyHash >>> shift) & MASK; var removed = value === NOT_SET; var nodes = this.nodes; var node = nodes[idx]; if (removed && !node) { return this; } var newNode = updateNode(node, ownerID, shift + SHIFT, keyHash, key, value, didChangeSize, didAlter); if (newNode === node) { return this; } var newCount = this.count; if (!node) { newCount++; } else if (!newNode) { newCount--; if (newCount < MIN_HASH_ARRAY_MAP_SIZE) { return packNodes(ownerID, nodes, newCount, idx); } } var isEditable = ownerID && ownerID === this.ownerID; var newNodes = setIn(nodes, idx, newNode, isEditable); if (isEditable) { this.count = newCount; this.nodes = newNodes; return this; } return new HashArrayMapNode(ownerID, newCount, newNodes); }; function HashCollisionNode(ownerID, keyHash, entries) { this.ownerID = ownerID; this.keyHash = keyHash; this.entries = entries; } HashCollisionNode.prototype.get = function(shift, keyHash, key, notSetValue) { var entries = this.entries; for (var ii = 0, len = entries.length; ii < len; ii++) { if (is(key, entries[ii][0])) { return entries[ii][1]; } } return notSetValue; }; HashCollisionNode.prototype.update = function(ownerID, shift, keyHash, key, value, didChangeSize, didAlter) { if (keyHash === undefined) { keyHash = hash(key); } var removed = value === NOT_SET; if (keyHash !== this.keyHash) { if (removed) { return this; } SetRef(didAlter); SetRef(didChangeSize); return mergeIntoNode(this, ownerID, shift, keyHash, [key, value]); } var entries = this.entries; var idx = 0; for (var len = entries.length; idx < len; idx++) { if (is(key, entries[idx][0])) { break; } } var exists = idx < len; if (exists ? entries[idx][1] === value : removed) { return this; } SetRef(didAlter); (removed || !exists) && SetRef(didChangeSize); if (removed && len === 2) { return new ValueNode(ownerID, this.keyHash, entries[idx ^ 1]); } var isEditable = ownerID && ownerID === this.ownerID; var newEntries = isEditable ? entries : arrCopy(entries); if (exists) { if (removed) { idx === len - 1 ? newEntries.pop() : (newEntries[idx] = newEntries.pop()); } else { newEntries[idx] = [key, value]; } } else { newEntries.push([key, value]); } if (isEditable) { this.entries = newEntries; return this; } return new HashCollisionNode(ownerID, this.keyHash, newEntries); }; function ValueNode(ownerID, keyHash, entry) { this.ownerID = ownerID; this.keyHash = keyHash; this.entry = entry; } ValueNode.prototype.get = function(shift, keyHash, key, notSetValue) { return is(key, this.entry[0]) ? this.entry[1] : notSetValue; }; ValueNode.prototype.update = function(ownerID, shift, keyHash, key, value, didChangeSize, didAlter) { var removed = value === NOT_SET; var keyMatch = is(key, this.entry[0]); if (keyMatch ? value === this.entry[1] : removed) { return this; } SetRef(didAlter); if (removed) { SetRef(didChangeSize); return; // undefined } if (keyMatch) { if (ownerID && ownerID === this.ownerID) { this.entry[1] = value; return this; } return new ValueNode(ownerID, this.keyHash, [key, value]); } SetRef(didChangeSize); return mergeIntoNode(this, ownerID, shift, hash(key), [key, value]); }; // #pragma Iterators ArrayMapNode.prototype.iterate = HashCollisionNode.prototype.iterate = function (fn, reverse) { var entries = this.entries; for (var ii = 0, maxIndex = entries.length - 1; ii <= maxIndex; ii++) { if (fn(entries[reverse ? maxIndex - ii : ii]) === false) { return false; } } } BitmapIndexedNode.prototype.iterate = HashArrayMapNode.prototype.iterate = function (fn, reverse) { var nodes = this.nodes; for (var ii = 0, maxIndex = nodes.length - 1; ii <= maxIndex; ii++) { var node = nodes[reverse ? maxIndex - ii : ii]; if (node && node.iterate(fn, reverse) === false) { return false; } } } ValueNode.prototype.iterate = function (fn, reverse) { return fn(this.entry); } createClass(MapIterator, Iterator); function MapIterator(map, type, reverse) { this._type = type; this._reverse = reverse; this._stack = map._root && mapIteratorFrame(map._root); } MapIterator.prototype.next = function() { var type = this._type; var stack = this._stack; while (stack) { var node = stack.node; var index = stack.index++; var maxIndex; if (node.entry) { if (index === 0) { return mapIteratorValue(type, node.entry); } } else if (node.entries) { maxIndex = node.entries.length - 1; if (index <= maxIndex) { return mapIteratorValue(type, node.entries[this._reverse ? maxIndex - index : index]); } } else { maxIndex = node.nodes.length - 1; if (index <= maxIndex) { var subNode = node.nodes[this._reverse ? maxIndex - index : index]; if (subNode) { if (subNode.entry) { return mapIteratorValue(type, subNode.entry); } stack = this._stack = mapIteratorFrame(subNode, stack); } continue; } } stack = this._stack = this._stack.__prev; } return iteratorDone(); }; function mapIteratorValue(type, entry) { return iteratorValue(type, entry[0], entry[1]); } function mapIteratorFrame(node, prev) { return { node: node, index: 0, __prev: prev }; } function makeMap(size, root, ownerID, hash) { var map = __webpack_provided_Object_dot_create(MapPrototype); map.size = size; map._root = root; map.__ownerID = ownerID; map.__hash = hash; map.__altered = false; return map; } var EMPTY_MAP; function emptyMap() { return EMPTY_MAP || (EMPTY_MAP = makeMap(0)); } function updateMap(map, k, v) { var newRoot; var newSize; if (!map._root) { if (v === NOT_SET) { return map; } newSize = 1; newRoot = new ArrayMapNode(map.__ownerID, [[k, v]]); } else { var didChangeSize = MakeRef(CHANGE_LENGTH); var didAlter = MakeRef(DID_ALTER); newRoot = updateNode(map._root, map.__ownerID, 0, undefined, k, v, didChangeSize, didAlter); if (!didAlter.value) { return map; } newSize = map.size + (didChangeSize.value ? v === NOT_SET ? -1 : 1 : 0); } if (map.__ownerID) { map.size = newSize; map._root = newRoot; map.__hash = undefined; map.__altered = true; return map; } return newRoot ? makeMap(newSize, newRoot) : emptyMap(); } function updateNode(node, ownerID, shift, keyHash, key, value, didChangeSize, didAlter) { if (!node) { if (value === NOT_SET) { return node; } SetRef(didAlter); SetRef(didChangeSize); return new ValueNode(ownerID, keyHash, [key, value]); } return node.update(ownerID, shift, keyHash, key, value, didChangeSize, didAlter); } function isLeafNode(node) { return node.constructor === ValueNode || node.constructor === HashCollisionNode; } function mergeIntoNode(node, ownerID, shift, keyHash, entry) { if (node.keyHash === keyHash) { return new HashCollisionNode(ownerID, keyHash, [node.entry, entry]); } var idx1 = (shift === 0 ? node.keyHash : node.keyHash >>> shift) & MASK; var idx2 = (shift === 0 ? keyHash : keyHash >>> shift) & MASK; var newNode; var nodes = idx1 === idx2 ? [mergeIntoNode(node, ownerID, shift + SHIFT, keyHash, entry)] : ((newNode = new ValueNode(ownerID, keyHash, entry)), idx1 < idx2 ? [node, newNode] : [newNode, node]); return new BitmapIndexedNode(ownerID, (1 << idx1) | (1 << idx2), nodes); } function createNodes(ownerID, entries, key, value) { if (!ownerID) { ownerID = new OwnerID(); } var node = new ValueNode(ownerID, hash(key), [key, value]); for (var ii = 0; ii < entries.length; ii++) { var entry = entries[ii]; node = node.update(ownerID, 0, undefined, entry[0], entry[1]); } return node; } function packNodes(ownerID, nodes, count, excluding) { var bitmap = 0; var packedII = 0; var packedNodes = new Array(count); for (var ii = 0, bit = 1, len = nodes.length; ii < len; ii++, bit <<= 1) { var node = nodes[ii]; if (node !== undefined && ii !== excluding) { bitmap |= bit; packedNodes[packedII++] = node; } } return new BitmapIndexedNode(ownerID, bitmap, packedNodes); } function expandNodes(ownerID, nodes, bitmap, including, node) { var count = 0; var expandedNodes = new Array(SIZE); for (var ii = 0; bitmap !== 0; ii++, bitmap >>>= 1) { expandedNodes[ii] = bitmap & 1 ? nodes[count++] : undefined; } expandedNodes[including] = node; return new HashArrayMapNode(ownerID, count + 1, expandedNodes); } function mergeIntoMapWith(map, merger, iterables) { var iters = []; for (var ii = 0; ii < iterables.length; ii++) { var value = iterables[ii]; var iter = KeyedIterable(value); if (!isIterable(value)) { iter = iter.map(function(v ) {return fromJS(v)}); } iters.push(iter); } return mergeIntoCollectionWith(map, merger, iters); } function deepMerger(existing, value, key) { return existing && existing.mergeDeep && isIterable(value) ? existing.mergeDeep(value) : is(existing, value) ? existing : value; } function deepMergerWith(merger) { return function(existing, value, key) { if (existing && existing.mergeDeepWith && isIterable(value)) { return existing.mergeDeepWith(merger, value); } var nextValue = merger(existing, value, key); return is(existing, nextValue) ? existing : nextValue; }; } function mergeIntoCollectionWith(collection, merger, iters) { iters = iters.filter(function(x ) {return x.size !== 0}); if (iters.length === 0) { return collection; } if (collection.size === 0 && !collection.__ownerID && iters.length === 1) { return collection.constructor(iters[0]); } return collection.withMutations(function(collection ) { var mergeIntoMap = merger ? function(value, key) { collection.update(key, NOT_SET, function(existing ) {return existing === NOT_SET ? value : merger(existing, value, key)} ); } : function(value, key) { collection.set(key, value); } for (var ii = 0; ii < iters.length; ii++) { iters[ii].forEach(mergeIntoMap); } }); } function updateInDeepMap(existing, keyPathIter, notSetValue, updater) { var isNotSet = existing === NOT_SET; var step = keyPathIter.next(); if (step.done) { var existingValue = isNotSet ? notSetValue : existing; var newValue = updater(existingValue); return newValue === existingValue ? existing : newValue; } invariant( isNotSet || (existing && existing.set), 'invalid keyPath' ); var key = step.value; var nextExisting = isNotSet ? NOT_SET : existing.get(key, NOT_SET); var nextUpdated = updateInDeepMap( nextExisting, keyPathIter, notSetValue, updater ); return nextUpdated === nextExisting ? existing : nextUpdated === NOT_SET ? existing.remove(key) : (isNotSet ? emptyMap() : existing).set(key, nextUpdated); } function popCount(x) { x = x - ((x >> 1) & 0x55555555); x = (x & 0x33333333) + ((x >> 2) & 0x33333333); x = (x + (x >> 4)) & 0x0f0f0f0f; x = x + (x >> 8); x = x + (x >> 16); return x & 0x7f; } function setIn(array, idx, val, canEdit) { var newArray = canEdit ? array : arrCopy(array); newArray[idx] = val; return newArray; } function spliceIn(array, idx, val, canEdit) { var newLen = array.length + 1; if (canEdit && idx + 1 === newLen) { array[idx] = val; return array; } var newArray = new Array(newLen); var after = 0; for (var ii = 0; ii < newLen; ii++) { if (ii === idx) { newArray[ii] = val; after = -1; } else { newArray[ii] = array[ii + after]; } } return newArray; } function spliceOut(array, idx, canEdit) { var newLen = array.length - 1; if (canEdit && idx === newLen) { array.pop(); return array; } var newArray = new Array(newLen); var after = 0; for (var ii = 0; ii < newLen; ii++) { if (ii === idx) { after = 1; } newArray[ii] = array[ii + after]; } return newArray; } var MAX_ARRAY_MAP_SIZE = SIZE / 4; var MAX_BITMAP_INDEXED_SIZE = SIZE / 2; var MIN_HASH_ARRAY_MAP_SIZE = SIZE / 4; createClass(List, IndexedCollection); // @pragma Construction function List(value) { var empty = emptyList(); if (value === null || value === undefined) { return empty; } if (isList(value)) { return value; } var iter = IndexedIterable(value); var size = iter.size; if (size === 0) { return empty; } assertNotInfinite(size); if (size > 0 && size < SIZE) { return makeList(0, size, SHIFT, null, new VNode(iter.toArray())); } return empty.withMutations(function(list ) { list.setSize(size); iter.forEach(function(v, i) {return list.set(i, v)}); }); } List.of = function(/*...values*/) { return this(arguments); }; List.prototype.toString = function() { return this.__toString('List [', ']'); }; // @pragma Access List.prototype.get = function(index, notSetValue) { index = wrapIndex(this, index); if (index >= 0 && index < this.size) { index += this._origin; var node = listNodeFor(this, index); return node && node.array[index & MASK]; } return notSetValue; }; // @pragma Modification List.prototype.set = function(index, value) { return updateList(this, index, value); }; List.prototype.remove = function(index) { return !this.has(index) ? this : index === 0 ? this.shift() : index === this.size - 1 ? this.pop() : this.splice(index, 1); }; List.prototype.insert = function(index, value) { return this.splice(index, 0, value); }; List.prototype.clear = function() { if (this.size === 0) { return this; } if (this.__ownerID) { this.size = this._origin = this._capacity = 0; this._level = SHIFT; this._root = this._tail = null; this.__hash = undefined; this.__altered = true; return this; } return emptyList(); }; List.prototype.push = function(/*...values*/) { var values = arguments; var oldSize = this.size; return this.withMutations(function(list ) { setListBounds(list, 0, oldSize + values.length); for (var ii = 0; ii < values.length; ii++) { list.set(oldSize + ii, values[ii]); } }); }; List.prototype.pop = function() { return setListBounds(this, 0, -1); }; List.prototype.unshift = function(/*...values*/) { var values = arguments; return this.withMutations(function(list ) { setListBounds(list, -values.length); for (var ii = 0; ii < values.length; ii++) { list.set(ii, values[ii]); } }); }; List.prototype.shift = function() { return setListBounds(this, 1); }; // @pragma Composition List.prototype.merge = function(/*...iters*/) { return mergeIntoListWith(this, undefined, arguments); }; List.prototype.mergeWith = function(merger) {var iters = SLICE$0.call(arguments, 1); return mergeIntoListWith(this, merger, iters); }; List.prototype.mergeDeep = function(/*...iters*/) { return mergeIntoListWith(this, deepMerger, arguments); }; List.prototype.mergeDeepWith = function(merger) {var iters = SLICE$0.call(arguments, 1); return mergeIntoListWith(this, deepMergerWith(merger), iters); }; List.prototype.setSize = function(size) { return setListBounds(this, 0, size); }; // @pragma Iteration List.prototype.slice = function(begin, end) { var size = this.size; if (wholeSlice(begin, end, size)) { return this; } return setListBounds( this, resolveBegin(begin, size), resolveEnd(end, size) ); }; List.prototype.__iterator = function(type, reverse) { var index = 0; var values = iterateList(this, reverse); return new Iterator(function() { var value = values(); return value === DONE ? iteratorDone() : iteratorValue(type, index++, value); }); }; List.prototype.__iterate = function(fn, reverse) { var index = 0; var values = iterateList(this, reverse); var value; while ((value = values()) !== DONE) { if (fn(value, index++, this) === false) { break; } } return index; }; List.prototype.__ensureOwner = function(ownerID) { if (ownerID === this.__ownerID) { return this; } if (!ownerID) { this.__ownerID = ownerID; return this; } return makeList(this._origin, this._capacity, this._level, this._root, this._tail, ownerID, this.__hash); }; function isList(maybeList) { return !!(maybeList && maybeList[IS_LIST_SENTINEL]); } List.isList = isList; var IS_LIST_SENTINEL = '@@__IMMUTABLE_LIST__@@'; var ListPrototype = List.prototype; ListPrototype[IS_LIST_SENTINEL] = true; ListPrototype[DELETE] = ListPrototype.remove; ListPrototype.setIn = MapPrototype.setIn; ListPrototype.deleteIn = ListPrototype.removeIn = MapPrototype.removeIn; ListPrototype.update = MapPrototype.update; ListPrototype.updateIn = MapPrototype.updateIn; ListPrototype.mergeIn = MapPrototype.mergeIn; ListPrototype.mergeDeepIn = MapPrototype.mergeDeepIn; ListPrototype.withMutations = MapPrototype.withMutations; ListPrototype.asMutable = MapPrototype.asMutable; ListPrototype.asImmutable = MapPrototype.asImmutable; ListPrototype.wasAltered = MapPrototype.wasAltered; function VNode(array, ownerID) { this.array = array; this.ownerID = ownerID; } // TODO: seems like these methods are very similar VNode.prototype.removeBefore = function(ownerID, level, index) { if (index === level ? 1 << level : 0 || this.array.length === 0) { return this; } var originIndex = (index >>> level) & MASK; if (originIndex >= this.array.length) { return new VNode([], ownerID); } var removingFirst = originIndex === 0; var newChild; if (level > 0) { var oldChild = this.array[originIndex]; newChild = oldChild && oldChild.removeBefore(ownerID, level - SHIFT, index); if (newChild === oldChild && removingFirst) { return this; } } if (removingFirst && !newChild) { return this; } var editable = editableVNode(this, ownerID); if (!removingFirst) { for (var ii = 0; ii < originIndex; ii++) { editable.array[ii] = undefined; } } if (newChild) { editable.array[originIndex] = newChild; } return editable; }; VNode.prototype.removeAfter = function(ownerID, level, index) { if (index === (level ? 1 << level : 0) || this.array.length === 0) { return this; } var sizeIndex = ((index - 1) >>> level) & MASK; if (sizeIndex >= this.array.length) { return this; } var newChild; if (level > 0) { var oldChild = this.array[sizeIndex]; newChild = oldChild && oldChild.removeAfter(ownerID, level - SHIFT, index); if (newChild === oldChild && sizeIndex === this.array.length - 1) { return this; } } var editable = editableVNode(this, ownerID); editable.array.splice(sizeIndex + 1); if (newChild) { editable.array[sizeIndex] = newChild; } return editable; }; var DONE = {}; function iterateList(list, reverse) { var left = list._origin; var right = list._capacity; var tailPos = getTailOffset(right); var tail = list._tail; return iterateNodeOrLeaf(list._root, list._level, 0); function iterateNodeOrLeaf(node, level, offset) { return level === 0 ? iterateLeaf(node, offset) : iterateNode(node, level, offset); } function iterateLeaf(node, offset) { var array = offset === tailPos ? tail && tail.array : node && node.array; var from = offset > left ? 0 : left - offset; var to = right - offset; if (to > SIZE) { to = SIZE; } return function() { if (from === to) { return DONE; } var idx = reverse ? --to : from++; return array && array[idx]; }; } function iterateNode(node, level, offset) { var values; var array = node && node.array; var from = offset > left ? 0 : (left - offset) >> level; var to = ((right - offset) >> level) + 1; if (to > SIZE) { to = SIZE; } return function() { do { if (values) { var value = values(); if (value !== DONE) { return value; } values = null; } if (from === to) { return DONE; } var idx = reverse ? --to : from++; values = iterateNodeOrLeaf( array && array[idx], level - SHIFT, offset + (idx << level) ); } while (true); }; } } function makeList(origin, capacity, level, root, tail, ownerID, hash) { var list = __webpack_provided_Object_dot_create(ListPrototype); list.size = capacity - origin; list._origin = origin; list._capacity = capacity; list._level = level; list._root = root; list._tail = tail; list.__ownerID = ownerID; list.__hash = hash; list.__altered = false; return list; } var EMPTY_LIST; function emptyList() { return EMPTY_LIST || (EMPTY_LIST = makeList(0, 0, SHIFT)); } function updateList(list, index, value) { index = wrapIndex(list, index); if (index !== index) { return list; } if (index >= list.size || index < 0) { return list.withMutations(function(list ) { index < 0 ? setListBounds(list, index).set(0, value) : setListBounds(list, 0, index + 1).set(index, value) }); } index += list._origin; var newTail = list._tail; var newRoot = list._root; var didAlter = MakeRef(DID_ALTER); if (index >= getTailOffset(list._capacity)) { newTail = updateVNode(newTail, list.__ownerID, 0, index, value, didAlter); } else { newRoot = updateVNode(newRoot, list.__ownerID, list._level, index, value, didAlter); } if (!didAlter.value) { return list; } if (list.__ownerID) { list._root = newRoot; list._tail = newTail; list.__hash = undefined; list.__altered = true; return list; } return makeList(list._origin, list._capacity, list._level, newRoot, newTail); } function updateVNode(node, ownerID, level, index, value, didAlter) { var idx = (index >>> level) & MASK; var nodeHas = node && idx < node.array.length; if (!nodeHas && value === undefined) { return node; } var newNode; if (level > 0) { var lowerNode = node && node.array[idx]; var newLowerNode = updateVNode(lowerNode, ownerID, level - SHIFT, index, value, didAlter); if (newLowerNode === lowerNode) { return node; } newNode = editableVNode(node, ownerID); newNode.array[idx] = newLowerNode; return newNode; } if (nodeHas && node.array[idx] === value) { return node; } SetRef(didAlter); newNode = editableVNode(node, ownerID); if (value === undefined && idx === newNode.array.length - 1) { newNode.array.pop(); } else { newNode.array[idx] = value; } return newNode; } function editableVNode(node, ownerID) { if (ownerID && node && ownerID === node.ownerID) { return node; } return new VNode(node ? node.array.slice() : [], ownerID); } function listNodeFor(list, rawIndex) { if (rawIndex >= getTailOffset(list._capacity)) { return list._tail; } if (rawIndex < 1 << (list._level + SHIFT)) { var node = list._root; var level = list._level; while (node && level > 0) { node = node.array[(rawIndex >>> level) & MASK]; level -= SHIFT; } return node; } } function setListBounds(list, begin, end) { // Sanitize begin & end using this shorthand for ToInt32(argument) // http://www.ecma-international.org/ecma-262/6.0/#sec-toint32 if (begin !== undefined) { begin = begin | 0; } if (end !== undefined) { end = end | 0; } var owner = list.__ownerID || new OwnerID(); var oldOrigin = list._origin; var oldCapacity = list._capacity; var newOrigin = oldOrigin + begin; var newCapacity = end === undefined ? oldCapacity : end < 0 ? oldCapacity + end : oldOrigin + end; if (newOrigin === oldOrigin && newCapacity === oldCapacity) { return list; } // If it's going to end after it starts, it's empty. if (newOrigin >= newCapacity) { return list.clear(); } var newLevel = list._level; var newRoot = list._root; // New origin might need creating a higher root. var offsetShift = 0; while (newOrigin + offsetShift < 0) { newRoot = new VNode(newRoot && newRoot.array.length ? [undefined, newRoot] : [], owner); newLevel += SHIFT; offsetShift += 1 << newLevel; } if (offsetShift) { newOrigin += offsetShift; oldOrigin += offsetShift; newCapacity += offsetShift; oldCapacity += offsetShift; } var oldTailOffset = getTailOffset(oldCapacity); var newTailOffset = getTailOffset(newCapacity); // New size might need creating a higher root. while (newTailOffset >= 1 << (newLevel + SHIFT)) { newRoot = new VNode(newRoot && newRoot.array.length ? [newRoot] : [], owner); newLevel += SHIFT; } // Locate or create the new tail. var oldTail = list._tail; var newTail = newTailOffset < oldTailOffset ? listNodeFor(list, newCapacity - 1) : newTailOffset > oldTailOffset ? new VNode([], owner) : oldTail; // Merge Tail into tree. if (oldTail && newTailOffset > oldTailOffset && newOrigin < oldCapacity && oldTail.array.length) { newRoot = editableVNode(newRoot, owner); var node = newRoot; for (var level = newLevel; level > SHIFT; level -= SHIFT) { var idx = (oldTailOffset >>> level) & MASK; node = node.array[idx] = editableVNode(node.array[idx], owner); } node.array[(oldTailOffset >>> SHIFT) & MASK] = oldTail; } // If the size has been reduced, there's a chance the tail needs to be trimmed. if (newCapacity < oldCapacity) { newTail = newTail && newTail.removeAfter(owner, 0, newCapacity); } // If the new origin is within the tail, then we do not need a root. if (newOrigin >= newTailOffset) { newOrigin -= newTailOffset; newCapacity -= newTailOffset; newLevel = SHIFT; newRoot = null; newTail = newTail && newTail.removeBefore(owner, 0, newOrigin); // Otherwise, if the root has been trimmed, garbage collect. } else if (newOrigin > oldOrigin || newTailOffset < oldTailOffset) { offsetShift = 0; // Identify the new top root node of the subtree of the old root. while (newRoot) { var beginIndex = (newOrigin >>> newLevel) & MASK; if (beginIndex !== (newTailOffset >>> newLevel) & MASK) { break; } if (beginIndex) { offsetShift += (1 << newLevel) * beginIndex; } newLevel -= SHIFT; newRoot = newRoot.array[beginIndex]; } // Trim the new sides of the new root. if (newRoot && newOrigin > oldOrigin) { newRoot = newRoot.removeBefore(owner, newLevel, newOrigin - offsetShift); } if (newRoot && newTailOffset < oldTailOffset) { newRoot = newRoot.removeAfter(owner, newLevel, newTailOffset - offsetShift); } if (offsetShift) { newOrigin -= offsetShift; newCapacity -= offsetShift; } } if (list.__ownerID) { list.size = newCapacity - newOrigin; list._origin = newOrigin; list._capacity = newCapacity; list._level = newLevel; list._root = newRoot; list._tail = newTail; list.__hash = undefined; list.__altered = true; return list; } return makeList(newOrigin, newCapacity, newLevel, newRoot, newTail); } function mergeIntoListWith(list, merger, iterables) { var iters = []; var maxSize = 0; for (var ii = 0; ii < iterables.length; ii++) { var value = iterables[ii]; var iter = IndexedIterable(value); if (iter.size > maxSize) { maxSize = iter.size; } if (!isIterable(value)) { iter = iter.map(function(v ) {return fromJS(v)}); } iters.push(iter); } if (maxSize > list.size) { list = list.setSize(maxSize); } return mergeIntoCollectionWith(list, merger, iters); } function getTailOffset(size) { return size < SIZE ? 0 : (((size - 1) >>> SHIFT) << SHIFT); } createClass(OrderedMap, Map); // @pragma Construction function OrderedMap(value) { return value === null || value === undefined ? emptyOrderedMap() : isOrderedMap(value) ? value : emptyOrderedMap().withMutations(function(map ) { var iter = KeyedIterable(value); assertNotInfinite(iter.size); iter.forEach(function(v, k) {return map.set(k, v)}); }); } OrderedMap.of = function(/*...values*/) { return this(arguments); }; OrderedMap.prototype.toString = function() { return this.__toString('OrderedMap {', '}'); }; // @pragma Access OrderedMap.prototype.get = function(k, notSetValue) { var index = this._map.get(k); return index !== undefined ? this._list.get(index)[1] : notSetValue; }; // @pragma Modification OrderedMap.prototype.clear = function() { if (this.size === 0) { return this; } if (this.__ownerID) { this.size = 0; this._map.clear(); this._list.clear(); return this; } return emptyOrderedMap(); }; OrderedMap.prototype.set = function(k, v) { return updateOrderedMap(this, k, v); }; OrderedMap.prototype.remove = function(k) { return updateOrderedMap(this, k, NOT_SET); }; OrderedMap.prototype.wasAltered = function() { return this._map.wasAltered() || this._list.wasAltered(); }; OrderedMap.prototype.__iterate = function(fn, reverse) {var this$0 = this; return this._list.__iterate( function(entry ) {return entry && fn(entry[1], entry[0], this$0)}, reverse ); }; OrderedMap.prototype.__iterator = function(type, reverse) { return this._list.fromEntrySeq().__iterator(type, reverse); }; OrderedMap.prototype.__ensureOwner = function(ownerID) { if (ownerID === this.__ownerID) { return this; } var newMap = this._map.__ensureOwner(ownerID); var newList = this._list.__ensureOwner(ownerID); if (!ownerID) { this.__ownerID = ownerID; this._map = newMap; this._list = newList; return this; } return makeOrderedMap(newMap, newList, ownerID, this.__hash); }; function isOrderedMap(maybeOrderedMap) { return isMap(maybeOrderedMap) && isOrdered(maybeOrderedMap); } OrderedMap.isOrderedMap = isOrderedMap; OrderedMap.prototype[IS_ORDERED_SENTINEL] = true; OrderedMap.prototype[DELETE] = OrderedMap.prototype.remove; function makeOrderedMap(map, list, ownerID, hash) { var omap = __webpack_provided_Object_dot_create(OrderedMap.prototype); omap.size = map ? map.size : 0; omap._map = map; omap._list = list; omap.__ownerID = ownerID; omap.__hash = hash; return omap; } var EMPTY_ORDERED_MAP; function emptyOrderedMap() { return EMPTY_ORDERED_MAP || (EMPTY_ORDERED_MAP = makeOrderedMap(emptyMap(), emptyList())); } function updateOrderedMap(omap, k, v) { var map = omap._map; var list = omap._list; var i = map.get(k); var has = i !== undefined; var newMap; var newList; if (v === NOT_SET) { // removed if (!has) { return omap; } if (list.size >= SIZE && list.size >= map.size * 2) { newList = list.filter(function(entry, idx) {return entry !== undefined && i !== idx}); newMap = newList.toKeyedSeq().map(function(entry ) {return entry[0]}).flip().toMap(); if (omap.__ownerID) { newMap.__ownerID = newList.__ownerID = omap.__ownerID; } } else { newMap = map.remove(k); newList = i === list.size - 1 ? list.pop() : list.set(i, undefined); } } else { if (has) { if (v === list.get(i)[1]) { return omap; } newMap = map; newList = list.set(i, [k, v]); } else { newMap = map.set(k, list.size); newList = list.set(list.size, [k, v]); } } if (omap.__ownerID) { omap.size = newMap.size; omap._map = newMap; omap._list = newList; omap.__hash = undefined; return omap; } return makeOrderedMap(newMap, newList); } createClass(ToKeyedSequence, KeyedSeq); function ToKeyedSequence(indexed, useKeys) { this._iter = indexed; this._useKeys = useKeys; this.size = indexed.size; } ToKeyedSequence.prototype.get = function(key, notSetValue) { return this._iter.get(key, notSetValue); }; ToKeyedSequence.prototype.has = function(key) { return this._iter.has(key); }; ToKeyedSequence.prototype.valueSeq = function() { return this._iter.valueSeq(); }; ToKeyedSequence.prototype.reverse = function() {var this$0 = this; var reversedSequence = reverseFactory(this, true); if (!this._useKeys) { reversedSequence.valueSeq = function() {return this$0._iter.toSeq().reverse()}; } return reversedSequence; }; ToKeyedSequence.prototype.map = function(mapper, context) {var this$0 = this; var mappedSequence = mapFactory(this, mapper, context); if (!this._useKeys) { mappedSequence.valueSeq = function() {return this$0._iter.toSeq().map(mapper, context)}; } return mappedSequence; }; ToKeyedSequence.prototype.__iterate = function(fn, reverse) {var this$0 = this; var ii; return this._iter.__iterate( this._useKeys ? function(v, k) {return fn(v, k, this$0)} : ((ii = reverse ? resolveSize(this) : 0), function(v ) {return fn(v, reverse ? --ii : ii++, this$0)}), reverse ); }; ToKeyedSequence.prototype.__iterator = function(type, reverse) { if (this._useKeys) { return this._iter.__iterator(type, reverse); } var iterator = this._iter.__iterator(ITERATE_VALUES, reverse); var ii = reverse ? resolveSize(this) : 0; return new Iterator(function() { var step = iterator.next(); return step.done ? step : iteratorValue(type, reverse ? --ii : ii++, step.value, step); }); }; ToKeyedSequence.prototype[IS_ORDERED_SENTINEL] = true; createClass(ToIndexedSequence, IndexedSeq); function ToIndexedSequence(iter) { this._iter = iter; this.size = iter.size; } ToIndexedSequence.prototype.includes = function(value) { return this._iter.includes(value); }; ToIndexedSequence.prototype.__iterate = function(fn, reverse) {var this$0 = this; var iterations = 0; return this._iter.__iterate(function(v ) {return fn(v, iterations++, this$0)}, reverse); }; ToIndexedSequence.prototype.__iterator = function(type, reverse) { var iterator = this._iter.__iterator(ITERATE_VALUES, reverse); var iterations = 0; return new Iterator(function() { var step = iterator.next(); return step.done ? step : iteratorValue(type, iterations++, step.value, step) }); }; createClass(ToSetSequence, SetSeq); function ToSetSequence(iter) { this._iter = iter; this.size = iter.size; } ToSetSequence.prototype.has = function(key) { return this._iter.includes(key); }; ToSetSequence.prototype.__iterate = function(fn, reverse) {var this$0 = this; return this._iter.__iterate(function(v ) {return fn(v, v, this$0)}, reverse); }; ToSetSequence.prototype.__iterator = function(type, reverse) { var iterator = this._iter.__iterator(ITERATE_VALUES, reverse); return new Iterator(function() { var step = iterator.next(); return step.done ? step : iteratorValue(type, step.value, step.value, step); }); }; createClass(FromEntriesSequence, KeyedSeq); function FromEntriesSequence(entries) { this._iter = entries; this.size = entries.size; } FromEntriesSequence.prototype.entrySeq = function() { return this._iter.toSeq(); }; FromEntriesSequence.prototype.__iterate = function(fn, reverse) {var this$0 = this; return this._iter.__iterate(function(entry ) { // Check if entry exists first so array access doesn't throw for holes // in the parent iteration. if (entry) { validateEntry(entry); var indexedIterable = isIterable(entry); return fn( indexedIterable ? entry.get(1) : entry[1], indexedIterable ? entry.get(0) : entry[0], this$0 ); } }, reverse); }; FromEntriesSequence.prototype.__iterator = function(type, reverse) { var iterator = this._iter.__iterator(ITERATE_VALUES, reverse); return new Iterator(function() { while (true) { var step = iterator.next(); if (step.done) { return step; } var entry = step.value; // Check if entry exists first so array access doesn't throw for holes // in the parent iteration. if (entry) { validateEntry(entry); var indexedIterable = isIterable(entry); return iteratorValue( type, indexedIterable ? entry.get(0) : entry[0], indexedIterable ? entry.get(1) : entry[1], step ); } } }); }; ToIndexedSequence.prototype.cacheResult = ToKeyedSequence.prototype.cacheResult = ToSetSequence.prototype.cacheResult = FromEntriesSequence.prototype.cacheResult = cacheResultThrough; function flipFactory(iterable) { var flipSequence = makeSequence(iterable); flipSequence._iter = iterable; flipSequence.size = iterable.size; flipSequence.flip = function() {return iterable}; flipSequence.reverse = function () { var reversedSequence = iterable.reverse.apply(this); // super.reverse() reversedSequence.flip = function() {return iterable.reverse()}; return reversedSequence; }; flipSequence.has = function(key ) {return iterable.includes(key)}; flipSequence.includes = function(key ) {return iterable.has(key)}; flipSequence.cacheResult = cacheResultThrough; flipSequence.__iterateUncached = function (fn, reverse) {var this$0 = this; return iterable.__iterate(function(v, k) {return fn(k, v, this$0) !== false}, reverse); } flipSequence.__iteratorUncached = function(type, reverse) { if (type === ITERATE_ENTRIES) { var iterator = iterable.__iterator(type, reverse); return new Iterator(function() { var step = iterator.next(); if (!step.done) { var k = step.value[0]; step.value[0] = step.value[1]; step.value[1] = k; } return step; }); } return iterable.__iterator( type === ITERATE_VALUES ? ITERATE_KEYS : ITERATE_VALUES, reverse ); } return flipSequence; } function mapFactory(iterable, mapper, context) { var mappedSequence = makeSequence(iterable); mappedSequence.size = iterable.size; mappedSequence.has = function(key ) {return iterable.has(key)}; mappedSequence.get = function(key, notSetValue) { var v = iterable.get(key, NOT_SET); return v === NOT_SET ? notSetValue : mapper.call(context, v, key, iterable); }; mappedSequence.__iterateUncached = function (fn, reverse) {var this$0 = this; return iterable.__iterate( function(v, k, c) {return fn(mapper.call(context, v, k, c), k, this$0) !== false}, reverse ); } mappedSequence.__iteratorUncached = function (type, reverse) { var iterator = iterable.__iterator(ITERATE_ENTRIES, reverse); return new Iterator(function() { var step = iterator.next(); if (step.done) { return step; } var entry = step.value; var key = entry[0]; return iteratorValue( type, key, mapper.call(context, entry[1], key, iterable), step ); }); } return mappedSequence; } function reverseFactory(iterable, useKeys) { var reversedSequence = makeSequence(iterable); reversedSequence._iter = iterable; reversedSequence.size = iterable.size; reversedSequence.reverse = function() {return iterable}; if (iterable.flip) { reversedSequence.flip = function () { var flipSequence = flipFactory(iterable); flipSequence.reverse = function() {return iterable.flip()}; return flipSequence; }; } reversedSequence.get = function(key, notSetValue) {return iterable.get(useKeys ? key : -1 - key, notSetValue)}; reversedSequence.has = function(key ) {return iterable.has(useKeys ? key : -1 - key)}; reversedSequence.includes = function(value ) {return iterable.includes(value)}; reversedSequence.cacheResult = cacheResultThrough; reversedSequence.__iterate = function (fn, reverse) {var this$0 = this; return iterable.__iterate(function(v, k) {return fn(v, k, this$0)}, !reverse); }; reversedSequence.__iterator = function(type, reverse) {return iterable.__iterator(type, !reverse)}; return reversedSequence; } function filterFactory(iterable, predicate, context, useKeys) { var filterSequence = makeSequence(iterable); if (useKeys) { filterSequence.has = function(key ) { var v = iterable.get(key, NOT_SET); return v !== NOT_SET && !!predicate.call(context, v, key, iterable); }; filterSequence.get = function(key, notSetValue) { var v = iterable.get(key, NOT_SET); return v !== NOT_SET && predicate.call(context, v, key, iterable) ? v : notSetValue; }; } filterSequence.__iterateUncached = function (fn, reverse) {var this$0 = this; var iterations = 0; iterable.__iterate(function(v, k, c) { if (predicate.call(context, v, k, c)) { iterations++; return fn(v, useKeys ? k : iterations - 1, this$0); } }, reverse); return iterations; }; filterSequence.__iteratorUncached = function (type, reverse) { var iterator = iterable.__iterator(ITERATE_ENTRIES, reverse); var iterations = 0; return new Iterator(function() { while (true) { var step = iterator.next(); if (step.done) { return step; } var entry = step.value; var key = entry[0]; var value = entry[1]; if (predicate.call(context, value, key, iterable)) { return iteratorValue(type, useKeys ? key : iterations++, value, step); } } }); } return filterSequence; } function countByFactory(iterable, grouper, context) { var groups = Map().asMutable(); iterable.__iterate(function(v, k) { groups.update( grouper.call(context, v, k, iterable), 0, function(a ) {return a + 1} ); }); return groups.asImmutable(); } function groupByFactory(iterable, grouper, context) { var isKeyedIter = isKeyed(iterable); var groups = (isOrdered(iterable) ? OrderedMap() : Map()).asMutable(); iterable.__iterate(function(v, k) { groups.update( grouper.call(context, v, k, iterable), function(a ) {return (a = a || [], a.push(isKeyedIter ? [k, v] : v), a)} ); }); var coerce = iterableClass(iterable); return groups.map(function(arr ) {return reify(iterable, coerce(arr))}); } function sliceFactory(iterable, begin, end, useKeys) { var originalSize = iterable.size; // Sanitize begin & end using this shorthand for ToInt32(argument) // http://www.ecma-international.org/ecma-262/6.0/#sec-toint32 if (begin !== undefined) { begin = begin | 0; } if (end !== undefined) { end = end | 0; } if (wholeSlice(begin, end, originalSize)) { return iterable; } var resolvedBegin = resolveBegin(begin, originalSize); var resolvedEnd = resolveEnd(end, originalSize); // begin or end will be NaN if they were provided as negative numbers and // this iterable's size is unknown. In that case, cache first so there is // a known size and these do not resolve to NaN. if (resolvedBegin !== resolvedBegin || resolvedEnd !== resolvedEnd) { return sliceFactory(iterable.toSeq().cacheResult(), begin, end, useKeys); } // Note: resolvedEnd is undefined when the original sequence's length is // unknown and this slice did not supply an end and should contain all // elements after resolvedBegin. // In that case, resolvedSize will be NaN and sliceSize will remain undefined. var resolvedSize = resolvedEnd - resolvedBegin; var sliceSize; if (resolvedSize === resolvedSize) { sliceSize = resolvedSize < 0 ? 0 : resolvedSize; } var sliceSeq = makeSequence(iterable); // If iterable.size is undefined, the size of the realized sliceSeq is // unknown at this point unless the number of items to slice is 0 sliceSeq.size = sliceSize === 0 ? sliceSize : iterable.size && sliceSize || undefined; if (!useKeys && isSeq(iterable) && sliceSize >= 0) { sliceSeq.get = function (index, notSetValue) { index = wrapIndex(this, index); return index >= 0 && index < sliceSize ? iterable.get(index + resolvedBegin, notSetValue) : notSetValue; } } sliceSeq.__iterateUncached = function(fn, reverse) {var this$0 = this; if (sliceSize === 0) { return 0; } if (reverse) { return this.cacheResult().__iterate(fn, reverse); } var skipped = 0; var isSkipping = true; var iterations = 0; iterable.__iterate(function(v, k) { if (!(isSkipping && (isSkipping = skipped++ < resolvedBegin))) { iterations++; return fn(v, useKeys ? k : iterations - 1, this$0) !== false && iterations !== sliceSize; } }); return iterations; }; sliceSeq.__iteratorUncached = function(type, reverse) { if (sliceSize !== 0 && reverse) { return this.cacheResult().__iterator(type, reverse); } // Don't bother instantiating parent iterator if taking 0. var iterator = sliceSize !== 0 && iterable.__iterator(type, reverse); var skipped = 0; var iterations = 0; return new Iterator(function() { while (skipped++ < resolvedBegin) { iterator.next(); } if (++iterations > sliceSize) { return iteratorDone(); } var step = iterator.next(); if (useKeys || type === ITERATE_VALUES) { return step; } else if (type === ITERATE_KEYS) { return iteratorValue(type, iterations - 1, undefined, step); } else { return iteratorValue(type, iterations - 1, step.value[1], step); } }); } return sliceSeq; } function takeWhileFactory(iterable, predicate, context) { var takeSequence = makeSequence(iterable); takeSequence.__iterateUncached = function(fn, reverse) {var this$0 = this; if (reverse) { return this.cacheResult().__iterate(fn, reverse); } var iterations = 0; iterable.__iterate(function(v, k, c) {return predicate.call(context, v, k, c) && ++iterations && fn(v, k, this$0)} ); return iterations; }; takeSequence.__iteratorUncached = function(type, reverse) {var this$0 = this; if (reverse) { return this.cacheResult().__iterator(type, reverse); } var iterator = iterable.__iterator(ITERATE_ENTRIES, reverse); var iterating = true; return new Iterator(function() { if (!iterating) { return iteratorDone(); } var step = iterator.next(); if (step.done) { return step; } var entry = step.value; var k = entry[0]; var v = entry[1]; if (!predicate.call(context, v, k, this$0)) { iterating = false; return iteratorDone(); } return type === ITERATE_ENTRIES ? step : iteratorValue(type, k, v, step); }); }; return takeSequence; } function skipWhileFactory(iterable, predicate, context, useKeys) { var skipSequence = makeSequence(iterable); skipSequence.__iterateUncached = function (fn, reverse) {var this$0 = this; if (reverse) { return this.cacheResult().__iterate(fn, reverse); } var isSkipping = true; var iterations = 0; iterable.__iterate(function(v, k, c) { if (!(isSkipping && (isSkipping = predicate.call(context, v, k, c)))) { iterations++; return fn(v, useKeys ? k : iterations - 1, this$0); } }); return iterations; }; skipSequence.__iteratorUncached = function(type, reverse) {var this$0 = this; if (reverse) { return this.cacheResult().__iterator(type, reverse); } var iterator = iterable.__iterator(ITERATE_ENTRIES, reverse); var skipping = true; var iterations = 0; return new Iterator(function() { var step, k, v; do { step = iterator.next(); if (step.done) { if (useKeys || type === ITERATE_VALUES) { return step; } else if (type === ITERATE_KEYS) { return iteratorValue(type, iterations++, undefined, step); } else { return iteratorValue(type, iterations++, step.value[1], step); } } var entry = step.value; k = entry[0]; v = entry[1]; skipping && (skipping = predicate.call(context, v, k, this$0)); } while (skipping); return type === ITERATE_ENTRIES ? step : iteratorValue(type, k, v, step); }); }; return skipSequence; } function concatFactory(iterable, values) { var isKeyedIterable = isKeyed(iterable); var iters = [iterable].concat(values).map(function(v ) { if (!isIterable(v)) { v = isKeyedIterable ? keyedSeqFromValue(v) : indexedSeqFromValue(Array.isArray(v) ? v : [v]); } else if (isKeyedIterable) { v = KeyedIterable(v); } return v; }).filter(function(v ) {return v.size !== 0}); if (iters.length === 0) { return iterable; } if (iters.length === 1) { var singleton = iters[0]; if (singleton === iterable || isKeyedIterable && isKeyed(singleton) || isIndexed(iterable) && isIndexed(singleton)) { return singleton; } } var concatSeq = new ArraySeq(iters); if (isKeyedIterable) { concatSeq = concatSeq.toKeyedSeq(); } else if (!isIndexed(iterable)) { concatSeq = concatSeq.toSetSeq(); } concatSeq = concatSeq.flatten(true); concatSeq.size = iters.reduce( function(sum, seq) { if (sum !== undefined) { var size = seq.size; if (size !== undefined) { return sum + size; } } }, 0 ); return concatSeq; } function flattenFactory(iterable, depth, useKeys) { var flatSequence = makeSequence(iterable); flatSequence.__iterateUncached = function(fn, reverse) { var iterations = 0; var stopped = false; function flatDeep(iter, currentDepth) {var this$0 = this; iter.__iterate(function(v, k) { if ((!depth || currentDepth < depth) && isIterable(v)) { flatDeep(v, currentDepth + 1); } else if (fn(v, useKeys ? k : iterations++, this$0) === false) { stopped = true; } return !stopped; }, reverse); } flatDeep(iterable, 0); return iterations; } flatSequence.__iteratorUncached = function(type, reverse) { var iterator = iterable.__iterator(type, reverse); var stack = []; var iterations = 0; return new Iterator(function() { while (iterator) { var step = iterator.next(); if (step.done !== false) { iterator = stack.pop(); continue; } var v = step.value; if (type === ITERATE_ENTRIES) { v = v[1]; } if ((!depth || stack.length < depth) && isIterable(v)) { stack.push(iterator); iterator = v.__iterator(type, reverse); } else { return useKeys ? step : iteratorValue(type, iterations++, v, step); } } return iteratorDone(); }); } return flatSequence; } function flatMapFactory(iterable, mapper, context) { var coerce = iterableClass(iterable); return iterable.toSeq().map( function(v, k) {return coerce(mapper.call(context, v, k, iterable))} ).flatten(true); } function interposeFactory(iterable, separator) { var interposedSequence = makeSequence(iterable); interposedSequence.size = iterable.size && iterable.size * 2 -1; interposedSequence.__iterateUncached = function(fn, reverse) {var this$0 = this; var iterations = 0; iterable.__iterate(function(v, k) {return (!iterations || fn(separator, iterations++, this$0) !== false) && fn(v, iterations++, this$0) !== false}, reverse ); return iterations; }; interposedSequence.__iteratorUncached = function(type, reverse) { var iterator = iterable.__iterator(ITERATE_VALUES, reverse); var iterations = 0; var step; return new Iterator(function() { if (!step || iterations % 2) { step = iterator.next(); if (step.done) { return step; } } return iterations % 2 ? iteratorValue(type, iterations++, separator) : iteratorValue(type, iterations++, step.value, step); }); }; return interposedSequence; } function sortFactory(iterable, comparator, mapper) { if (!comparator) { comparator = defaultComparator; } var isKeyedIterable = isKeyed(iterable); var index = 0; var entries = iterable.toSeq().map( function(v, k) {return [k, v, index++, mapper ? mapper(v, k, iterable) : v]} ).toArray(); entries.sort(function(a, b) {return comparator(a[3], b[3]) || a[2] - b[2]}).forEach( isKeyedIterable ? function(v, i) { entries[i].length = 2; } : function(v, i) { entries[i] = v[1]; } ); return isKeyedIterable ? KeyedSeq(entries) : isIndexed(iterable) ? IndexedSeq(entries) : SetSeq(entries); } function maxFactory(iterable, comparator, mapper) { if (!comparator) { comparator = defaultComparator; } if (mapper) { var entry = iterable.toSeq() .map(function(v, k) {return [v, mapper(v, k, iterable)]}) .reduce(function(a, b) {return maxCompare(comparator, a[1], b[1]) ? b : a}); return entry && entry[0]; } else { return iterable.reduce(function(a, b) {return maxCompare(comparator, a, b) ? b : a}); } } function maxCompare(comparator, a, b) { var comp = comparator(b, a); // b is considered the new max if the comparator declares them equal, but // they are not equal and b is in fact a nullish value. return (comp === 0 && b !== a && (b === undefined || b === null || b !== b)) || comp > 0; } function zipWithFactory(keyIter, zipper, iters) { var zipSequence = makeSequence(keyIter); zipSequence.size = new ArraySeq(iters).map(function(i ) {return i.size}).min(); // Note: this a generic base implementation of __iterate in terms of // __iterator which may be more generically useful in the future. zipSequence.__iterate = function(fn, reverse) { /* generic: var iterator = this.__iterator(ITERATE_ENTRIES, reverse); var step; var iterations = 0; while (!(step = iterator.next()).done) { iterations++; if (fn(step.value[1], step.value[0], this) === false) { break; } } return iterations; */ // indexed: var iterator = this.__iterator(ITERATE_VALUES, reverse); var step; var iterations = 0; while (!(step = iterator.next()).done) { if (fn(step.value, iterations++, this) === false) { break; } } return iterations; }; zipSequence.__iteratorUncached = function(type, reverse) { var iterators = iters.map(function(i ) {return (i = Iterable(i), getIterator(reverse ? i.reverse() : i))} ); var iterations = 0; var isDone = false; return new Iterator(function() { var steps; if (!isDone) { steps = iterators.map(function(i ) {return i.next()}); isDone = steps.some(function(s ) {return s.done}); } if (isDone) { return iteratorDone(); } return iteratorValue( type, iterations++, zipper.apply(null, steps.map(function(s ) {return s.value})) ); }); }; return zipSequence } // #pragma Helper Functions function reify(iter, seq) { return isSeq(iter) ? seq : iter.constructor(seq); } function validateEntry(entry) { if (entry !== Object(entry)) { throw new TypeError('Expected [K, V] tuple: ' + entry); } } function resolveSize(iter) { assertNotInfinite(iter.size); return ensureSize(iter); } function iterableClass(iterable) { return isKeyed(iterable) ? KeyedIterable : isIndexed(iterable) ? IndexedIterable : SetIterable; } function makeSequence(iterable) { return __webpack_provided_Object_dot_create( ( isKeyed(iterable) ? KeyedSeq : isIndexed(iterable) ? IndexedSeq : SetSeq ).prototype ); } function cacheResultThrough() { if (this._iter.cacheResult) { this._iter.cacheResult(); this.size = this._iter.size; return this; } else { return Seq.prototype.cacheResult.call(this); } } function defaultComparator(a, b) { return a > b ? 1 : a < b ? -1 : 0; } function forceIterator(keyPath) { var iter = getIterator(keyPath); if (!iter) { // Array might not be iterable in this environment, so we need a fallback // to our wrapped type. if (!isArrayLike(keyPath)) { throw new TypeError('Expected iterable or array-like: ' + keyPath); } iter = getIterator(Iterable(keyPath)); } return iter; } createClass(Record, KeyedCollection); function Record(defaultValues, name) { var hasInitialized; var RecordType = function Record(values) { if (values instanceof RecordType) { return values; } if (!(this instanceof RecordType)) { return new RecordType(values); } if (!hasInitialized) { hasInitialized = true; var keys = Object.keys(defaultValues); setProps(RecordTypePrototype, keys); RecordTypePrototype.size = keys.length; RecordTypePrototype._name = name; RecordTypePrototype._keys = keys; RecordTypePrototype._defaultValues = defaultValues; } this._map = Map(values); }; var RecordTypePrototype = RecordType.prototype = __webpack_provided_Object_dot_create(RecordPrototype); RecordTypePrototype.constructor = RecordType; return RecordType; } Record.prototype.toString = function() { return this.__toString(recordName(this) + ' {', '}'); }; // @pragma Access Record.prototype.has = function(k) { return this._defaultValues.hasOwnProperty(k); }; Record.prototype.get = function(k, notSetValue) { if (!this.has(k)) { return notSetValue; } var defaultVal = this._defaultValues[k]; return this._map ? this._map.get(k, defaultVal) : defaultVal; }; // @pragma Modification Record.prototype.clear = function() { if (this.__ownerID) { this._map && this._map.clear(); return this; } var RecordType = this.constructor; return RecordType._empty || (RecordType._empty = makeRecord(this, emptyMap())); }; Record.prototype.set = function(k, v) { if (!this.has(k)) { throw new Error('Cannot set unknown key "' + k + '" on ' + recordName(this)); } var newMap = this._map && this._map.set(k, v); if (this.__ownerID || newMap === this._map) { return this; } return makeRecord(this, newMap); }; Record.prototype.remove = function(k) { if (!this.has(k)) { return this; } var newMap = this._map && this._map.remove(k); if (this.__ownerID || newMap === this._map) { return this; } return makeRecord(this, newMap); }; Record.prototype.wasAltered = function() { return this._map.wasAltered(); }; Record.prototype.__iterator = function(type, reverse) {var this$0 = this; return KeyedIterable(this._defaultValues).map(function(_, k) {return this$0.get(k)}).__iterator(type, reverse); }; Record.prototype.__iterate = function(fn, reverse) {var this$0 = this; return KeyedIterable(this._defaultValues).map(function(_, k) {return this$0.get(k)}).__iterate(fn, reverse); }; Record.prototype.__ensureOwner = function(ownerID) { if (ownerID === this.__ownerID) { return this; } var newMap = this._map && this._map.__ensureOwner(ownerID); if (!ownerID) { this.__ownerID = ownerID; this._map = newMap; return this; } return makeRecord(this, newMap, ownerID); }; var RecordPrototype = Record.prototype; RecordPrototype[DELETE] = RecordPrototype.remove; RecordPrototype.deleteIn = RecordPrototype.removeIn = MapPrototype.removeIn; RecordPrototype.merge = MapPrototype.merge; RecordPrototype.mergeWith = MapPrototype.mergeWith; RecordPrototype.mergeIn = MapPrototype.mergeIn; RecordPrototype.mergeDeep = MapPrototype.mergeDeep; RecordPrototype.mergeDeepWith = MapPrototype.mergeDeepWith; RecordPrototype.mergeDeepIn = MapPrototype.mergeDeepIn; RecordPrototype.setIn = MapPrototype.setIn; RecordPrototype.update = MapPrototype.update; RecordPrototype.updateIn = MapPrototype.updateIn; RecordPrototype.withMutations = MapPrototype.withMutations; RecordPrototype.asMutable = MapPrototype.asMutable; RecordPrototype.asImmutable = MapPrototype.asImmutable; function makeRecord(likeRecord, map, ownerID) { var record = __webpack_provided_Object_dot_create(Object.getPrototypeOf(likeRecord)); record._map = map; record.__ownerID = ownerID; return record; } function recordName(record) { return record._name || record.constructor.name || 'Record'; } function setProps(prototype, names) { try { names.forEach(setProp.bind(undefined, prototype)); } catch (error) { // Object.defineProperty failed. Probably IE8. } } function setProp(prototype, name) { Object.defineProperty(prototype, name, { get: function() { return this.get(name); }, set: function(value) { invariant(this.__ownerID, 'Cannot set on an immutable record.'); this.set(name, value); } }); } createClass(Set, SetCollection); // @pragma Construction function Set(value) { return value === null || value === undefined ? emptySet() : isSet(value) && !isOrdered(value) ? value : emptySet().withMutations(function(set ) { var iter = SetIterable(value); assertNotInfinite(iter.size); iter.forEach(function(v ) {return set.add(v)}); }); } Set.of = function(/*...values*/) { return this(arguments); }; Set.fromKeys = function(value) { return this(KeyedIterable(value).keySeq()); }; Set.prototype.toString = function() { return this.__toString('Set {', '}'); }; // @pragma Access Set.prototype.has = function(value) { return this._map.has(value); }; // @pragma Modification Set.prototype.add = function(value) { return updateSet(this, this._map.set(value, true)); }; Set.prototype.remove = function(value) { return updateSet(this, this._map.remove(value)); }; Set.prototype.clear = function() { return updateSet(this, this._map.clear()); }; // @pragma Composition Set.prototype.union = function() {var iters = SLICE$0.call(arguments, 0); iters = iters.filter(function(x ) {return x.size !== 0}); if (iters.length === 0) { return this; } if (this.size === 0 && !this.__ownerID && iters.length === 1) { return this.constructor(iters[0]); } return this.withMutations(function(set ) { for (var ii = 0; ii < iters.length; ii++) { SetIterable(iters[ii]).forEach(function(value ) {return set.add(value)}); } }); }; Set.prototype.intersect = function() {var iters = SLICE$0.call(arguments, 0); if (iters.length === 0) { return this; } iters = iters.map(function(iter ) {return SetIterable(iter)}); var originalSet = this; return this.withMutations(function(set ) { originalSet.forEach(function(value ) { if (!iters.every(function(iter ) {return iter.includes(value)})) { set.remove(value); } }); }); }; Set.prototype.subtract = function() {var iters = SLICE$0.call(arguments, 0); if (iters.length === 0) { return this; } iters = iters.map(function(iter ) {return SetIterable(iter)}); var originalSet = this; return this.withMutations(function(set ) { originalSet.forEach(function(value ) { if (iters.some(function(iter ) {return iter.includes(value)})) { set.remove(value); } }); }); }; Set.prototype.merge = function() { return this.union.apply(this, arguments); }; Set.prototype.mergeWith = function(merger) {var iters = SLICE$0.call(arguments, 1); return this.union.apply(this, iters); }; Set.prototype.sort = function(comparator) { // Late binding return OrderedSet(sortFactory(this, comparator)); }; Set.prototype.sortBy = function(mapper, comparator) { // Late binding return OrderedSet(sortFactory(this, comparator, mapper)); }; Set.prototype.wasAltered = function() { return this._map.wasAltered(); }; Set.prototype.__iterate = function(fn, reverse) {var this$0 = this; return this._map.__iterate(function(_, k) {return fn(k, k, this$0)}, reverse); }; Set.prototype.__iterator = function(type, reverse) { return this._map.map(function(_, k) {return k}).__iterator(type, reverse); }; Set.prototype.__ensureOwner = function(ownerID) { if (ownerID === this.__ownerID) { return this; } var newMap = this._map.__ensureOwner(ownerID); if (!ownerID) { this.__ownerID = ownerID; this._map = newMap; return this; } return this.__make(newMap, ownerID); }; function isSet(maybeSet) { return !!(maybeSet && maybeSet[IS_SET_SENTINEL]); } Set.isSet = isSet; var IS_SET_SENTINEL = '@@__IMMUTABLE_SET__@@'; var SetPrototype = Set.prototype; SetPrototype[IS_SET_SENTINEL] = true; SetPrototype[DELETE] = SetPrototype.remove; SetPrototype.mergeDeep = SetPrototype.merge; SetPrototype.mergeDeepWith = SetPrototype.mergeWith; SetPrototype.withMutations = MapPrototype.withMutations; SetPrototype.asMutable = MapPrototype.asMutable; SetPrototype.asImmutable = MapPrototype.asImmutable; SetPrototype.__empty = emptySet; SetPrototype.__make = makeSet; function updateSet(set, newMap) { if (set.__ownerID) { set.size = newMap.size; set._map = newMap; return set; } return newMap === set._map ? set : newMap.size === 0 ? set.__empty() : set.__make(newMap); } function makeSet(map, ownerID) { var set = __webpack_provided_Object_dot_create(SetPrototype); set.size = map ? map.size : 0; set._map = map; set.__ownerID = ownerID; return set; } var EMPTY_SET; function emptySet() { return EMPTY_SET || (EMPTY_SET = makeSet(emptyMap())); } createClass(OrderedSet, Set); // @pragma Construction function OrderedSet(value) { return value === null || value === undefined ? emptyOrderedSet() : isOrderedSet(value) ? value : emptyOrderedSet().withMutations(function(set ) { var iter = SetIterable(value); assertNotInfinite(iter.size); iter.forEach(function(v ) {return set.add(v)}); }); } OrderedSet.of = function(/*...values*/) { return this(arguments); }; OrderedSet.fromKeys = function(value) { return this(KeyedIterable(value).keySeq()); }; OrderedSet.prototype.toString = function() { return this.__toString('OrderedSet {', '}'); }; function isOrderedSet(maybeOrderedSet) { return isSet(maybeOrderedSet) && isOrdered(maybeOrderedSet); } OrderedSet.isOrderedSet = isOrderedSet; var OrderedSetPrototype = OrderedSet.prototype; OrderedSetPrototype[IS_ORDERED_SENTINEL] = true; OrderedSetPrototype.__empty = emptyOrderedSet; OrderedSetPrototype.__make = makeOrderedSet; function makeOrderedSet(map, ownerID) { var set = __webpack_provided_Object_dot_create(OrderedSetPrototype); set.size = map ? map.size : 0; set._map = map; set.__ownerID = ownerID; return set; } var EMPTY_ORDERED_SET; function emptyOrderedSet() { return EMPTY_ORDERED_SET || (EMPTY_ORDERED_SET = makeOrderedSet(emptyOrderedMap())); } createClass(Stack, IndexedCollection); // @pragma Construction function Stack(value) { return value === null || value === undefined ? emptyStack() : isStack(value) ? value : emptyStack().unshiftAll(value); } Stack.of = function(/*...values*/) { return this(arguments); }; Stack.prototype.toString = function() { return this.__toString('Stack [', ']'); }; // @pragma Access Stack.prototype.get = function(index, notSetValue) { var head = this._head; index = wrapIndex(this, index); while (head && index--) { head = head.next; } return head ? head.value : notSetValue; }; Stack.prototype.peek = function() { return this._head && this._head.value; }; // @pragma Modification Stack.prototype.push = function(/*...values*/) { if (arguments.length === 0) { return this; } var newSize = this.size + arguments.length; var head = this._head; for (var ii = arguments.length - 1; ii >= 0; ii--) { head = { value: arguments[ii], next: head }; } if (this.__ownerID) { this.size = newSize; this._head = head; this.__hash = undefined; this.__altered = true; return this; } return makeStack(newSize, head); }; Stack.prototype.pushAll = function(iter) { iter = IndexedIterable(iter); if (iter.size === 0) { return this; } assertNotInfinite(iter.size); var newSize = this.size; var head = this._head; iter.reverse().forEach(function(value ) { newSize++; head = { value: value, next: head }; }); if (this.__ownerID) { this.size = newSize; this._head = head; this.__hash = undefined; this.__altered = true; return this; } return makeStack(newSize, head); }; Stack.prototype.pop = function() { return this.slice(1); }; Stack.prototype.unshift = function(/*...values*/) { return this.push.apply(this, arguments); }; Stack.prototype.unshiftAll = function(iter) { return this.pushAll(iter); }; Stack.prototype.shift = function() { return this.pop.apply(this, arguments); }; Stack.prototype.clear = function() { if (this.size === 0) { return this; } if (this.__ownerID) { this.size = 0; this._head = undefined; this.__hash = undefined; this.__altered = true; return this; } return emptyStack(); }; Stack.prototype.slice = function(begin, end) { if (wholeSlice(begin, end, this.size)) { return this; } var resolvedBegin = resolveBegin(begin, this.size); var resolvedEnd = resolveEnd(end, this.size); if (resolvedEnd !== this.size) { // super.slice(begin, end); return IndexedCollection.prototype.slice.call(this, begin, end); } var newSize = this.size - resolvedBegin; var head = this._head; while (resolvedBegin--) { head = head.next; } if (this.__ownerID) { this.size = newSize; this._head = head; this.__hash = undefined; this.__altered = true; return this; } return makeStack(newSize, head); }; // @pragma Mutability Stack.prototype.__ensureOwner = function(ownerID) { if (ownerID === this.__ownerID) { return this; } if (!ownerID) { this.__ownerID = ownerID; this.__altered = false; return this; } return makeStack(this.size, this._head, ownerID, this.__hash); }; // @pragma Iteration Stack.prototype.__iterate = function(fn, reverse) { if (reverse) { return this.reverse().__iterate(fn); } var iterations = 0; var node = this._head; while (node) { if (fn(node.value, iterations++, this) === false) { break; } node = node.next; } return iterations; }; Stack.prototype.__iterator = function(type, reverse) { if (reverse) { return this.reverse().__iterator(type); } var iterations = 0; var node = this._head; return new Iterator(function() { if (node) { var value = node.value; node = node.next; return iteratorValue(type, iterations++, value); } return iteratorDone(); }); }; function isStack(maybeStack) { return !!(maybeStack && maybeStack[IS_STACK_SENTINEL]); } Stack.isStack = isStack; var IS_STACK_SENTINEL = '@@__IMMUTABLE_STACK__@@'; var StackPrototype = Stack.prototype; StackPrototype[IS_STACK_SENTINEL] = true; StackPrototype.withMutations = MapPrototype.withMutations; StackPrototype.asMutable = MapPrototype.asMutable; StackPrototype.asImmutable = MapPrototype.asImmutable; StackPrototype.wasAltered = MapPrototype.wasAltered; function makeStack(size, head, ownerID, hash) { var map = __webpack_provided_Object_dot_create(StackPrototype); map.size = size; map._head = head; map.__ownerID = ownerID; map.__hash = hash; map.__altered = false; return map; } var EMPTY_STACK; function emptyStack() { return EMPTY_STACK || (EMPTY_STACK = makeStack(0)); } /** * Contributes additional methods to a constructor */ function mixin(ctor, methods) { var keyCopier = function(key ) { ctor.prototype[key] = methods[key]; }; Object.keys(methods).forEach(keyCopier); Object.getOwnPropertySymbols && Object.getOwnPropertySymbols(methods).forEach(keyCopier); return ctor; } Iterable.Iterator = Iterator; mixin(Iterable, { // ### Conversion to other types toArray: function() { assertNotInfinite(this.size); var array = new Array(this.size || 0); this.valueSeq().__iterate(function(v, i) { array[i] = v; }); return array; }, toIndexedSeq: function() { return new ToIndexedSequence(this); }, toJS: function() { return this.toSeq().map( function(value ) {return value && typeof value.toJS === 'function' ? value.toJS() : value} ).__toJS(); }, toJSON: function() { return this.toSeq().map( function(value ) {return value && typeof value.toJSON === 'function' ? value.toJSON() : value} ).__toJS(); }, toKeyedSeq: function() { return new ToKeyedSequence(this, true); }, toMap: function() { // Use Late Binding here to solve the circular dependency. return Map(this.toKeyedSeq()); }, toObject: function() { assertNotInfinite(this.size); var object = {}; this.__iterate(function(v, k) { object[k] = v; }); return object; }, toOrderedMap: function() { // Use Late Binding here to solve the circular dependency. return OrderedMap(this.toKeyedSeq()); }, toOrderedSet: function() { // Use Late Binding here to solve the circular dependency. return OrderedSet(isKeyed(this) ? this.valueSeq() : this); }, toSet: function() { // Use Late Binding here to solve the circular dependency. return Set(isKeyed(this) ? this.valueSeq() : this); }, toSetSeq: function() { return new ToSetSequence(this); }, toSeq: function() { return isIndexed(this) ? this.toIndexedSeq() : isKeyed(this) ? this.toKeyedSeq() : this.toSetSeq(); }, toStack: function() { // Use Late Binding here to solve the circular dependency. return Stack(isKeyed(this) ? this.valueSeq() : this); }, toList: function() { // Use Late Binding here to solve the circular dependency. return List(isKeyed(this) ? this.valueSeq() : this); }, // ### Common JavaScript methods and properties toString: function() { return '[Iterable]'; }, __toString: function(head, tail) { if (this.size === 0) { return head + tail; } return head + ' ' + this.toSeq().map(this.__toStringMapper).join(', ') + ' ' + tail; }, // ### ES6 Collection methods (ES6 Array and Map) concat: function() {var values = SLICE$0.call(arguments, 0); return reify(this, concatFactory(this, values)); }, includes: function(searchValue) { return this.some(function(value ) {return is(value, searchValue)}); }, entries: function() { return this.__iterator(ITERATE_ENTRIES); }, every: function(predicate, context) { assertNotInfinite(this.size); var returnValue = true; this.__iterate(function(v, k, c) { if (!predicate.call(context, v, k, c)) { returnValue = false; return false; } }); return returnValue; }, filter: function(predicate, context) { return reify(this, filterFactory(this, predicate, context, true)); }, find: function(predicate, context, notSetValue) { var entry = this.findEntry(predicate, context); return entry ? entry[1] : notSetValue; }, findEntry: function(predicate, context) { var found; this.__iterate(function(v, k, c) { if (predicate.call(context, v, k, c)) { found = [k, v]; return false; } }); return found; }, findLastEntry: function(predicate, context) { return this.toSeq().reverse().findEntry(predicate, context); }, forEach: function(sideEffect, context) { assertNotInfinite(this.size); return this.__iterate(context ? sideEffect.bind(context) : sideEffect); }, join: function(separator) { assertNotInfinite(this.size); separator = separator !== undefined ? '' + separator : ','; var joined = ''; var isFirst = true; this.__iterate(function(v ) { isFirst ? (isFirst = false) : (joined += separator); joined += v !== null && v !== undefined ? v.toString() : ''; }); return joined; }, keys: function() { return this.__iterator(ITERATE_KEYS); }, map: function(mapper, context) { return reify(this, mapFactory(this, mapper, context)); }, reduce: function(reducer, initialReduction, context) { assertNotInfinite(this.size); var reduction; var useFirst; if (arguments.length < 2) { useFirst = true; } else { reduction = initialReduction; } this.__iterate(function(v, k, c) { if (useFirst) { useFirst = false; reduction = v; } else { reduction = reducer.call(context, reduction, v, k, c); } }); return reduction; }, reduceRight: function(reducer, initialReduction, context) { var reversed = this.toKeyedSeq().reverse(); return reversed.reduce.apply(reversed, arguments); }, reverse: function() { return reify(this, reverseFactory(this, true)); }, slice: function(begin, end) { return reify(this, sliceFactory(this, begin, end, true)); }, some: function(predicate, context) { return !this.every(not(predicate), context); }, sort: function(comparator) { return reify(this, sortFactory(this, comparator)); }, values: function() { return this.__iterator(ITERATE_VALUES); }, // ### More sequential methods butLast: function() { return this.slice(0, -1); }, isEmpty: function() { return this.size !== undefined ? this.size === 0 : !this.some(function() {return true}); }, count: function(predicate, context) { return ensureSize( predicate ? this.toSeq().filter(predicate, context) : this ); }, countBy: function(grouper, context) { return countByFactory(this, grouper, context); }, equals: function(other) { return deepEqual(this, other); }, entrySeq: function() { var iterable = this; if (iterable._cache) { // We cache as an entries array, so we can just return the cache! return new ArraySeq(iterable._cache); } var entriesSequence = iterable.toSeq().map(entryMapper).toIndexedSeq(); entriesSequence.fromEntrySeq = function() {return iterable.toSeq()}; return entriesSequence; }, filterNot: function(predicate, context) { return this.filter(not(predicate), context); }, findLast: function(predicate, context, notSetValue) { return this.toKeyedSeq().reverse().find(predicate, context, notSetValue); }, first: function() { return this.find(returnTrue); }, flatMap: function(mapper, context) { return reify(this, flatMapFactory(this, mapper, context)); }, flatten: function(depth) { return reify(this, flattenFactory(this, depth, true)); }, fromEntrySeq: function() { return new FromEntriesSequence(this); }, get: function(searchKey, notSetValue) { return this.find(function(_, key) {return is(key, searchKey)}, undefined, notSetValue); }, getIn: function(searchKeyPath, notSetValue) { var nested = this; // Note: in an ES6 environment, we would prefer: // for (var key of searchKeyPath) { var iter = forceIterator(searchKeyPath); var step; while (!(step = iter.next()).done) { var key = step.value; nested = nested && nested.get ? nested.get(key, NOT_SET) : NOT_SET; if (nested === NOT_SET) { return notSetValue; } } return nested; }, groupBy: function(grouper, context) { return groupByFactory(this, grouper, context); }, has: function(searchKey) { return this.get(searchKey, NOT_SET) !== NOT_SET; }, hasIn: function(searchKeyPath) { return this.getIn(searchKeyPath, NOT_SET) !== NOT_SET; }, isSubset: function(iter) { iter = typeof iter.includes === 'function' ? iter : Iterable(iter); return this.every(function(value ) {return iter.includes(value)}); }, isSuperset: function(iter) { iter = typeof iter.isSubset === 'function' ? iter : Iterable(iter); return iter.isSubset(this); }, keySeq: function() { return this.toSeq().map(keyMapper).toIndexedSeq(); }, last: function() { return this.toSeq().reverse().first(); }, max: function(comparator) { return maxFactory(this, comparator); }, maxBy: function(mapper, comparator) { return maxFactory(this, comparator, mapper); }, min: function(comparator) { return maxFactory(this, comparator ? neg(comparator) : defaultNegComparator); }, minBy: function(mapper, comparator) { return maxFactory(this, comparator ? neg(comparator) : defaultNegComparator, mapper); }, rest: function() { return this.slice(1); }, skip: function(amount) { return this.slice(Math.max(0, amount)); }, skipLast: function(amount) { return reify(this, this.toSeq().reverse().skip(amount).reverse()); }, skipWhile: function(predicate, context) { return reify(this, skipWhileFactory(this, predicate, context, true)); }, skipUntil: function(predicate, context) { return this.skipWhile(not(predicate), context); }, sortBy: function(mapper, comparator) { return reify(this, sortFactory(this, comparator, mapper)); }, take: function(amount) { return this.slice(0, Math.max(0, amount)); }, takeLast: function(amount) { return reify(this, this.toSeq().reverse().take(amount).reverse()); }, takeWhile: function(predicate, context) { return reify(this, takeWhileFactory(this, predicate, context)); }, takeUntil: function(predicate, context) { return this.takeWhile(not(predicate), context); }, valueSeq: function() { return this.toIndexedSeq(); }, // ### Hashable Object hashCode: function() { return this.__hash || (this.__hash = hashIterable(this)); } // ### Internal // abstract __iterate(fn, reverse) // abstract __iterator(type, reverse) }); // var IS_ITERABLE_SENTINEL = '@@__IMMUTABLE_ITERABLE__@@'; // var IS_KEYED_SENTINEL = '@@__IMMUTABLE_KEYED__@@'; // var IS_INDEXED_SENTINEL = '@@__IMMUTABLE_INDEXED__@@'; // var IS_ORDERED_SENTINEL = '@@__IMMUTABLE_ORDERED__@@'; var IterablePrototype = Iterable.prototype; IterablePrototype[IS_ITERABLE_SENTINEL] = true; IterablePrototype[ITERATOR_SYMBOL] = IterablePrototype.values; IterablePrototype.__toJS = IterablePrototype.toArray; IterablePrototype.__toStringMapper = quoteString; IterablePrototype.inspect = IterablePrototype.toSource = function() { return this.toString(); }; IterablePrototype.chain = IterablePrototype.flatMap; IterablePrototype.contains = IterablePrototype.includes; // Temporary warning about using length (function () { try { Object.defineProperty(IterablePrototype, 'length', { get: function () { if (!Iterable.noLengthWarning) { var stack; try { throw new Error(); } catch (error) { stack = error.stack; } if (stack.indexOf('_wrapObject') === -1) { console && console.warn && console.warn( 'iterable.length has been deprecated, '+ 'use iterable.size or iterable.count(). '+ 'This warning will become a silent error in a future version. ' + stack ); return this.size; } } } }); } catch (e) {} })(); mixin(KeyedIterable, { // ### More sequential methods flip: function() { return reify(this, flipFactory(this)); }, findKey: function(predicate, context) { var entry = this.findEntry(predicate, context); return entry && entry[0]; }, findLastKey: function(predicate, context) { return this.toSeq().reverse().findKey(predicate, context); }, keyOf: function(searchValue) { return this.findKey(function(value ) {return is(value, searchValue)}); }, lastKeyOf: function(searchValue) { return this.findLastKey(function(value ) {return is(value, searchValue)}); }, mapEntries: function(mapper, context) {var this$0 = this; var iterations = 0; return reify(this, this.toSeq().map( function(v, k) {return mapper.call(context, [k, v], iterations++, this$0)} ).fromEntrySeq() ); }, mapKeys: function(mapper, context) {var this$0 = this; return reify(this, this.toSeq().flip().map( function(k, v) {return mapper.call(context, k, v, this$0)} ).flip() ); } }); var KeyedIterablePrototype = KeyedIterable.prototype; KeyedIterablePrototype[IS_KEYED_SENTINEL] = true; KeyedIterablePrototype[ITERATOR_SYMBOL] = IterablePrototype.entries; KeyedIterablePrototype.__toJS = IterablePrototype.toObject; KeyedIterablePrototype.__toStringMapper = function(v, k) {return JSON.stringify(k) + ': ' + quoteString(v)}; mixin(IndexedIterable, { // ### Conversion to other types toKeyedSeq: function() { return new ToKeyedSequence(this, false); }, // ### ES6 Collection methods (ES6 Array and Map) filter: function(predicate, context) { return reify(this, filterFactory(this, predicate, context, false)); }, findIndex: function(predicate, context) { var entry = this.findEntry(predicate, context); return entry ? entry[0] : -1; }, indexOf: function(searchValue) { var key = this.toKeyedSeq().keyOf(searchValue); return key === undefined ? -1 : key; }, lastIndexOf: function(searchValue) { var key = this.toKeyedSeq().reverse().keyOf(searchValue); return key === undefined ? -1 : key; // var index = // return this.toSeq().reverse().indexOf(searchValue); }, reverse: function() { return reify(this, reverseFactory(this, false)); }, slice: function(begin, end) { return reify(this, sliceFactory(this, begin, end, false)); }, splice: function(index, removeNum /*, ...values*/) { var numArgs = arguments.length; removeNum = Math.max(removeNum | 0, 0); if (numArgs === 0 || (numArgs === 2 && !removeNum)) { return this; } // If index is negative, it should resolve relative to the size of the // collection. However size may be expensive to compute if not cached, so // only call count() if the number is in fact negative. index = resolveBegin(index, index < 0 ? this.count() : this.size); var spliced = this.slice(0, index); return reify( this, numArgs === 1 ? spliced : spliced.concat(arrCopy(arguments, 2), this.slice(index + removeNum)) ); }, // ### More collection methods findLastIndex: function(predicate, context) { var key = this.toKeyedSeq().findLastKey(predicate, context); return key === undefined ? -1 : key; }, first: function() { return this.get(0); }, flatten: function(depth) { return reify(this, flattenFactory(this, depth, false)); }, get: function(index, notSetValue) { index = wrapIndex(this, index); return (index < 0 || (this.size === Infinity || (this.size !== undefined && index > this.size))) ? notSetValue : this.find(function(_, key) {return key === index}, undefined, notSetValue); }, has: function(index) { index = wrapIndex(this, index); return index >= 0 && (this.size !== undefined ? this.size === Infinity || index < this.size : this.indexOf(index) !== -1 ); }, interpose: function(separator) { return reify(this, interposeFactory(this, separator)); }, interleave: function(/*...iterables*/) { var iterables = [this].concat(arrCopy(arguments)); var zipped = zipWithFactory(this.toSeq(), IndexedSeq.of, iterables); var interleaved = zipped.flatten(true); if (zipped.size) { interleaved.size = zipped.size * iterables.length; } return reify(this, interleaved); }, last: function() { return this.get(-1); }, skipWhile: function(predicate, context) { return reify(this, skipWhileFactory(this, predicate, context, false)); }, zip: function(/*, ...iterables */) { var iterables = [this].concat(arrCopy(arguments)); return reify(this, zipWithFactory(this, defaultZipper, iterables)); }, zipWith: function(zipper/*, ...iterables */) { var iterables = arrCopy(arguments); iterables[0] = this; return reify(this, zipWithFactory(this, zipper, iterables)); } }); IndexedIterable.prototype[IS_INDEXED_SENTINEL] = true; IndexedIterable.prototype[IS_ORDERED_SENTINEL] = true; mixin(SetIterable, { // ### ES6 Collection methods (ES6 Array and Map) get: function(value, notSetValue) { return this.has(value) ? value : notSetValue; }, includes: function(value) { return this.has(value); }, // ### More sequential methods keySeq: function() { return this.valueSeq(); } }); SetIterable.prototype.has = IterablePrototype.includes; // Mixin subclasses mixin(KeyedSeq, KeyedIterable.prototype); mixin(IndexedSeq, IndexedIterable.prototype); mixin(SetSeq, SetIterable.prototype); mixin(KeyedCollection, KeyedIterable.prototype); mixin(IndexedCollection, IndexedIterable.prototype); mixin(SetCollection, SetIterable.prototype); // #pragma Helper functions function keyMapper(v, k) { return k; } function entryMapper(v, k) { return [k, v]; } function not(predicate) { return function() { return !predicate.apply(this, arguments); } } function neg(predicate) { return function() { return -predicate.apply(this, arguments); } } function quoteString(value) { return typeof value === 'string' ? JSON.stringify(value) : value; } function defaultZipper() { return arrCopy(arguments); } function defaultNegComparator(a, b) { return a < b ? 1 : a > b ? -1 : 0; } function hashIterable(iterable) { if (iterable.size === Infinity) { return 0; } var ordered = isOrdered(iterable); var keyed = isKeyed(iterable); var h = ordered ? 1 : 0; var size = iterable.__iterate( keyed ? ordered ? function(v, k) { h = 31 * h + hashMerge(hash(v), hash(k)) | 0; } : function(v, k) { h = h + hashMerge(hash(v), hash(k)) | 0; } : ordered ? function(v ) { h = 31 * h + hash(v) | 0; } : function(v ) { h = h + hash(v) | 0; } ); return murmurHashOfSize(size, h); } function murmurHashOfSize(size, h) { h = imul(h, 0xCC9E2D51); h = imul(h << 15 | h >>> -15, 0x1B873593); h = imul(h << 13 | h >>> -13, 5); h = (h + 0xE6546B64 | 0) ^ size; h = imul(h ^ h >>> 16, 0x85EBCA6B); h = imul(h ^ h >>> 13, 0xC2B2AE35); h = smi(h ^ h >>> 16); return h; } function hashMerge(a, b) { return a ^ b + 0x9E3779B9 + (a << 6) + (a >> 2) | 0; // int } var Immutable = { Iterable: Iterable, Seq: Seq, Collection: Collection, Map: Map, OrderedMap: OrderedMap, List: List, Stack: Stack, Set: Set, OrderedSet: OrderedSet, Record: Record, Range: Range, Repeat: Repeat, is: is, fromJS: fromJS }; return Immutable; })); /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(2), __webpack_require__(4), __webpack_require__(3), __webpack_require__(5))) /***/ }, /* 18 */ /***/ function(module, exports, __webpack_require__) { /** * Copyright (c) 2015-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. * * */ 'use strict'; var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); 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; }; }(); function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } var immutable = __webpack_require__(17); var requestAnimationFrame = __webpack_require__(14); // How long the measurement should be presented for. var DURATION = 250; var Record = immutable.Record, Map = immutable.Map; var MetaData = Record({ expiration: 0, hit: 0 }); var TraceUpdatesAbstractNodePresenter = function () { // eslint shouldn't error on type positions. TODO: update eslint // eslint-disable-next-line no-undef function TraceUpdatesAbstractNodePresenter() { _classCallCheck(this, TraceUpdatesAbstractNodePresenter); this._pool = new Map(); this._drawing = false; this._enabled = false; this._clearTimer = null; this._draw = this._draw.bind(this); this._redraw = this._redraw.bind(this); } _createClass(TraceUpdatesAbstractNodePresenter, [{ key: 'present', value: function present(measurement) { if (!this._enabled) { return; } var data; if (this._pool.has(measurement)) { data = this._pool.get(measurement); } else { // $FlowIssue data = new MetaData(); } data = data.merge({ expiration: Date.now() + DURATION, hit: data.hit + 1 }); this._pool = this._pool.set(measurement, data); if (this._drawing) { return; } this._drawing = true; requestAnimationFrame(this._draw); } }, { key: 'setEnabled', value: function setEnabled(enabled) { // console.log('setEnabled', enabled); if (this._enabled === enabled) { return; } this._enabled = enabled; if (enabled) { return; } if (this._clearTimer) { clearTimeout(this._clearTimer); this._clearTimer = null; } this._pool = this._pool.clear(); this._drawing = false; this.clearImpl(); } }, { key: 'drawImpl', value: function drawImpl(measurements) { // sub-class should implement this. } }, { key: 'clearImpl', value: function clearImpl() { // sub-class should implement this. } }, { key: '_redraw', value: function _redraw() { this._clearTimer = null; if (!this._drawing && this._pool.size > 0) { this._drawing = true; this._draw(); } } }, { key: '_draw', value: function _draw() { if (!this._enabled) { this._drawing = false; return; } var now = Date.now(); var minExpiration = Number.MAX_VALUE; this._pool = this._pool.withMutations(function (_pool) { var _iteratorNormalCompletion = true; var _didIteratorError = false; var _iteratorError = undefined; try { for (var _iterator = _pool.entries()[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { var _step$value = _slicedToArray(_step.value, 2), measurement = _step$value[0], data = _step$value[1]; if (data.expiration < now) { // already passed the expiration time. _pool.delete(measurement); } else { minExpiration = Math.min(data.expiration, minExpiration); } } } catch (err) { _didIteratorError = true; _iteratorError = err; } finally { try { if (!_iteratorNormalCompletion && _iterator.return) { _iterator.return(); } } finally { if (_didIteratorError) { throw _iteratorError; } } } }); this.drawImpl(this._pool); if (this._pool.size > 0) { if (this._clearTimer != null) { clearTimeout(this._clearTimer); } this._clearTimer = setTimeout(this._redraw, minExpiration - now); } this._drawing = false; } }]); return TraceUpdatesAbstractNodePresenter; }(); module.exports = TraceUpdatesAbstractNodePresenter; /***/ }, /* 19 */ /***/ function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(__webpack_provided_Object_dot_create) {/** * Copyright (c) 2015-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. * * */ 'use strict'; 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; }; }(); 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 = __webpack_provided_Object_dot_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 TraceUpdatesAbstractNodeMeasurer = __webpack_require__(13); var DUMMY = { bottom: 0, expiration: 0, height: 0, id: '', left: 0, right: 0, scrollX: 0, scrollY: 0, top: 0, width: 0 }; var TraceUpdatesWebNodeMeasurer = function (_TraceUpdatesAbstract) { _inherits(TraceUpdatesWebNodeMeasurer, _TraceUpdatesAbstract); function TraceUpdatesWebNodeMeasurer() { _classCallCheck(this, TraceUpdatesWebNodeMeasurer); return _possibleConstructorReturn(this, (TraceUpdatesWebNodeMeasurer.__proto__ || Object.getPrototypeOf(TraceUpdatesWebNodeMeasurer)).apply(this, arguments)); } _createClass(TraceUpdatesWebNodeMeasurer, [{ key: 'measureImpl', value: function measureImpl(node) { if (!node || typeof node.getBoundingClientRect !== 'function') { return DUMMY; } var rect = node.getBoundingClientRect(); var scrollX = Math.max(document.body ? document.body.scrollLeft : 0, document.documentElement ? document.documentElement.scrollLeft : 0, window.pageXOffset || 0, window.scrollX || 0); var scrollY = Math.max(document.body ? document.body.scrollTop : 0, document.documentElement ? document.documentElement.scrollTop : 0, window.pageYOffset || 0, window.scrollY || 0); return { bottom: rect.bottom, expiration: 0, height: rect.height, id: '', left: rect.left, right: rect.right, scrollX: scrollX, scrollY: scrollY, top: rect.top, width: rect.width }; } }]); return TraceUpdatesWebNodeMeasurer; }(TraceUpdatesAbstractNodeMeasurer); module.exports = TraceUpdatesWebNodeMeasurer; /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(2))) /***/ }, /* 20 */ /***/ function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(__webpack_provided_Object_dot_create) {/** * Copyright (c) 2015-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. * * */ 'use strict'; var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); 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; }; }(); 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 = __webpack_provided_Object_dot_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 TraceUpdatesAbstractNodePresenter = __webpack_require__(18); var OUTLINE_COLOR = '#f0f0f0'; var COLORS = [ // coolest '#55cef6', '#55f67b', '#a5f655', '#f4f655', '#f6a555', '#f66855', // hottest '#ff0000']; var HOTTEST_COLOR = COLORS[COLORS.length - 1]; function drawBorder(ctx, measurement, borderWidth, borderColor) { // outline ctx.lineWidth = 1; ctx.strokeStyle = OUTLINE_COLOR; ctx.strokeRect(measurement.left - 1, measurement.top - 1, measurement.width + 2, measurement.height + 2); // inset ctx.lineWidth = 1; ctx.strokeStyle = OUTLINE_COLOR; ctx.strokeRect(measurement.left + borderWidth, measurement.top + borderWidth, measurement.width - borderWidth, measurement.height - borderWidth); ctx.strokeStyle = borderColor; if (measurement.should_update) { ctx.setLineDash([2]); } else { ctx.setLineDash([0]); } // border ctx.lineWidth = '' + borderWidth; ctx.strokeRect(measurement.left + Math.floor(borderWidth / 2), measurement.top + Math.floor(borderWidth / 2), measurement.width - borderWidth, measurement.height - borderWidth); ctx.setLineDash([0]); } var CANVAS_NODE_ID = 'TraceUpdatesWebNodePresenter'; var TraceUpdatesWebNodePresenter = function (_TraceUpdatesAbstract) { _inherits(TraceUpdatesWebNodePresenter, _TraceUpdatesAbstract); function TraceUpdatesWebNodePresenter() { _classCallCheck(this, TraceUpdatesWebNodePresenter); var _this = _possibleConstructorReturn(this, (TraceUpdatesWebNodePresenter.__proto__ || Object.getPrototypeOf(TraceUpdatesWebNodePresenter)).call(this)); _this._canvas = null; return _this; } _createClass(TraceUpdatesWebNodePresenter, [{ key: 'drawImpl', value: function drawImpl(pool) { this._ensureCanvas(); var canvas = this._canvas; var ctx = canvas.getContext('2d'); ctx.clearRect(0, 0, canvas.width, canvas.height); var _iteratorNormalCompletion = true; var _didIteratorError = false; var _iteratorError = undefined; try { for (var _iterator = pool.entries()[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { var _step$value = _slicedToArray(_step.value, 2), measurement = _step$value[0], data = _step$value[1]; var color = COLORS[data.hit - 1] || HOTTEST_COLOR; drawBorder(ctx, measurement, 1, color); } } catch (err) { _didIteratorError = true; _iteratorError = err; } finally { try { if (!_iteratorNormalCompletion && _iterator.return) { _iterator.return(); } } finally { if (_didIteratorError) { throw _iteratorError; } } } } }, { key: 'clearImpl', value: function clearImpl() { var canvas = this._canvas; if (canvas === null) { return; } if (!canvas.parentNode) { return; } var ctx = canvas.getContext('2d'); ctx.clearRect(0, 0, canvas.width, canvas.height); canvas.parentNode.removeChild(canvas); this._canvas = null; } }, { key: '_ensureCanvas', value: function _ensureCanvas() { var canvas = this._canvas; if (canvas === null) { canvas = window.document.getElementById(CANVAS_NODE_ID) || window.document.createElement('canvas'); canvas.id = CANVAS_NODE_ID; canvas.width = window.screen.availWidth; canvas.height = window.screen.availHeight; canvas.style.cssText = '\n xx-background-color: red;\n xx-opacity: 0.5;\n bottom: 0;\n left: 0;\n pointer-events: none;\n position: fixed;\n right: 0;\n top: 0;\n z-index: 1000000000;\n '; } if (!canvas.parentNode) { var root = window.document.documentElement; root.insertBefore(canvas, root.firstChild); } this._canvas = canvas; } }]); return TraceUpdatesWebNodePresenter; }(TraceUpdatesAbstractNodePresenter); module.exports = TraceUpdatesWebNodePresenter; /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(2))) /***/ }, /* 21 */ /***/ function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(Map, __webpack_provided_Object_dot_create) {/** * Copyright (c) 2015-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. * * */ 'use strict'; 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; }; }(); 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); } } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } var consts = __webpack_require__(22); var hydrate = __webpack_require__(41); var dehydrate = __webpack_require__(42); var getIn = __webpack_require__(10); var performanceNow = __webpack_require__(43); // Use the polyfill if the function is not native implementation function getWindowFunction(name, polyfill) { if (String(window[name]).indexOf('[native code]') === -1) { return polyfill; } return window[name]; } // Custom polyfill that runs the queue with a backoff. // If you change it, make sure it behaves reasonably well in Firefox. var lastRunTimeMS = 5; var cancelIdleCallback = getWindowFunction('cancelIdleCallback', clearTimeout); var requestIdleCallback = getWindowFunction('requestIdleCallback', function (cb, options) { // Magic numbers determined by tweaking in Firefox. // There is no special meaning to them. var delayMS = 3000 * lastRunTimeMS; if (delayMS > 500) { delayMS = 500; } return setTimeout(function () { var startTime = performanceNow(); cb({ didTimeout: false, timeRemaining: function timeRemaining() { return Infinity; } }); var endTime = performanceNow(); lastRunTimeMS = (endTime - startTime) / 1000; }, delayMS); }); /** * The bridge is responsible for serializing requests between the Agent and * the Frontend Store. It needs to be connected to a Wall object that can send * JSONable data to the bridge on the other side. * * complex data * | * v * [Bridge] * | * jsonable data * | * v * [wall] * | * v * ~ some barrier ~ * | * v * [wall] * | * v * [Bridge] * | * v * "hydrated" data * * When an item is passed in that can't be serialized (anything other than a * plain array, object, or literal value), the object is "cleaned", and * rehydrated on the other side with `Symbol` attributes indicating that the * object needs to be inspected for more detail. * * Example: * * bridge.send('evname', {id: 'someid', foo: MyCoolObjectInstance}) * -> * shows up, hydrated as * { * id: 'someid', * foo: { * [consts.name]: 'MyCoolObjectInstance', * [consts.type]: 'object', * [consts.meta]: {}, * [consts.inspected]: false, * } * } * * The `consts` variables are Symbols, and as such are non-ennumerable. * The front-end therefore needs to check for `consts.inspected` on received * objects, and can thereby display object proxies and inspect them. * * Complex objects that are passed are expected to have a top-level `id` * attribute, which is used for later lookup + inspection. Once it has been * determined that an object is no longer needed, call `.forget(id)` to clean * up. */ var Bridge = function () { function Bridge(wall) { _classCallCheck(this, Bridge); this._cbs = new Map(); this._inspectables = new Map(); this._cid = 0; this._listeners = {}; this._buffer = []; this._flushHandle = null; this._callers = {}; this._paused = false; this._wall = wall; wall.listen(this._handleMessage.bind(this)); } _createClass(Bridge, [{ key: 'inspect', value: function inspect(id, path, cb) { var _cid = this._cid++; this._cbs.set(_cid, function (data, cleaned, proto, protoclean) { if (cleaned.length) { hydrate(data, cleaned); } if (proto && protoclean.length) { hydrate(proto, protoclean); } if (proto) { data[consts.proto] = proto; } cb(data); }); this._wall.send({ type: 'inspect', callback: _cid, path: path, id: id }); } }, { key: 'call', value: function call(name, args, cb) { var _cid = this._cid++; this._cbs.set(_cid, cb); this._wall.send({ type: 'call', callback: _cid, args: args, name: name }); } }, { key: 'onCall', value: function onCall(name, handler) { if (this._callers[name]) { throw new Error('only one call handler per call name allowed'); } this._callers[name] = handler; } }, { key: 'pause', value: function pause() { this._wall.send({ type: 'pause' }); } }, { key: 'resume', value: function resume() { this._wall.send({ type: 'resume' }); } }, { key: 'setInspectable', value: function setInspectable(id, data) { var prev = this._inspectables.get(id); if (!prev) { this._inspectables.set(id, data); return; } this._inspectables.set(id, _extends({}, prev, data)); } }, { key: 'send', value: function send(evt, data) { this._buffer.push({ evt: evt, data: data }); this.scheduleFlush(); } }, { key: 'scheduleFlush', value: function scheduleFlush() { if (!this._flushHandle && this._buffer.length) { var timeout = this._paused ? 5000 : 500; this._flushHandle = requestIdleCallback(this.flushBufferWhileIdle.bind(this), { timeout: timeout }); } } }, { key: 'cancelFlush', value: function cancelFlush() { if (this._flushHandle) { cancelIdleCallback(this._flushHandle); this._flushHandle = null; } } }, { key: 'flushBufferWhileIdle', value: function flushBufferWhileIdle(deadline) { this._flushHandle = null; // Magic numbers were determined by tweaking in a heavy UI and seeing // what performs reasonably well both when DevTools are hidden and visible. // The goal is that we try to catch up but avoid blocking the UI. // When paused, it's okay to lag more, but not forever because otherwise // when user activates React tab, it will freeze syncing. var chunkCount = this._paused ? 20 : 10; var chunkSize = Math.round(this._buffer.length / chunkCount); var minChunkSize = this._paused ? 50 : 100; while (this._buffer.length && (deadline.timeRemaining() > 0 || deadline.didTimeout)) { var take = Math.min(this._buffer.length, Math.max(minChunkSize, chunkSize)); var currentBuffer = this._buffer.splice(0, take); this.flushBufferSlice(currentBuffer); } if (this._buffer.length) { this.scheduleFlush(); } } }, { key: 'flushBufferSlice', value: function flushBufferSlice(bufferSlice) { var _this = this; var events = bufferSlice.map(function (_ref) { var evt = _ref.evt, data = _ref.data; var cleaned = []; var san = dehydrate(data, cleaned); if (cleaned.length) { _this.setInspectable(data.id, data); } return { type: 'event', evt: evt, data: san, cleaned: cleaned }; }); this._wall.send({ type: 'many-events', events: events }); } }, { key: 'forget', value: function forget(id) { this._inspectables.delete(id); } }, { key: 'on', value: function on(evt, fn) { if (!this._listeners[evt]) { this._listeners[evt] = [fn]; } else { this._listeners[evt].push(fn); } } }, { key: 'off', value: function off(evt, fn) { if (!this._listeners[evt]) { return; } var ix = this._listeners[evt].indexOf(fn); if (ix !== -1) { this._listeners[evt].splice(ix, 1); } } }, { key: 'once', value: function once(evt, fn) { var self = this; var listener = function listener() { fn.apply(this, arguments); self.off(evt, listener); }; this.on(evt, listener); } }, { key: '_handleMessage', value: function _handleMessage(payload) { var _this2 = this; if (payload.type === 'resume') { this._paused = false; this.scheduleFlush(); return; } if (payload.type === 'pause') { this._paused = true; this.cancelFlush(); return; } if (payload.type === 'callback') { var callback = this._cbs.get(payload.id); if (callback) { callback.apply(undefined, _toConsumableArray(payload.args)); this._cbs.delete(payload.id); } return; } if (payload.type === 'call') { this._handleCall(payload.name, payload.args, payload.callback); return; } if (payload.type === 'inspect') { this._inspectResponse(payload.id, payload.path, payload.callback); return; } if (payload.type === 'event') { // console.log('[bridge<-]', payload.evt); if (payload.cleaned) { hydrate(payload.data, payload.cleaned); } var fns = this._listeners[payload.evt]; var data = payload.data; if (fns) { fns.forEach(function (fn) { return fn(data); }); } } if (payload.type === 'many-events') { payload.events.forEach(function (event) { // console.log('[bridge<-]', payload.evt); if (event.cleaned) { hydrate(event.data, event.cleaned); } var handlers = _this2._listeners[event.evt]; if (handlers) { handlers.forEach(function (fn) { return fn(event.data); }); } }); } } }, { key: '_handleCall', value: function _handleCall(name, args, callback) { if (!this._callers[name]) { console.warn('unknown call: "' + name + '"'); return; } args = !Array.isArray(args) ? [args] : args; var result; try { result = this._callers[name].apply(null, args); } catch (e) { console.error('Failed to call', e); return; } this._wall.send({ type: 'callback', id: callback, args: [result] }); } }, { key: '_inspectResponse', value: function _inspectResponse(id, path, callback) { var inspectable = this._inspectables.get(id); var result = {}; var cleaned = []; var proto = null; var protoclean = []; if (inspectable) { var val = getIn(inspectable, path); var protod = false; var isFn = typeof val === 'function'; if (val && typeof val[Symbol.iterator] === 'function') { var iterVal = __webpack_provided_Object_dot_create({}); // flow throws "object literal incompatible with object type" var count = 0; var _iteratorNormalCompletion = true; var _didIteratorError = false; var _iteratorError = undefined; try { for (var _iterator = val[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { var entry = _step.value; if (count > 100) { // TODO: replace this if block with better logic to handle large iterables break; } iterVal[count] = entry; count++; } } catch (err) { _didIteratorError = true; _iteratorError = err; } finally { try { if (!_iteratorNormalCompletion && _iterator.return) { _iterator.return(); } } finally { if (_didIteratorError) { throw _iteratorError; } } } val = iterVal; } Object.getOwnPropertyNames(val).forEach(function (name) { if (name === '__proto__') { protod = true; } if (isFn && (name === 'arguments' || name === 'callee' || name === 'caller')) { return; } // $FlowIgnore This is intentional result[name] = dehydrate(val[name], cleaned, [name]); }); /* eslint-disable no-proto */ if (!protod && val.__proto__ && val.constructor.name !== 'Object') { var newProto = {}; var pIsFn = typeof val.__proto__ === 'function'; Object.getOwnPropertyNames(val.__proto__).forEach(function (name) { if (pIsFn && (name === 'arguments' || name === 'callee' || name === 'caller')) { return; } newProto[name] = dehydrate(val.__proto__[name], protoclean, [name]); }); proto = newProto; } /* eslint-enable no-proto */ } this._wall.send({ type: 'callback', id: callback, args: [result, cleaned, proto, protoclean] }); } }]); return Bridge; }(); module.exports = Bridge; /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3), __webpack_require__(2))) /***/ }, /* 22 */ /***/ function(module, exports, __webpack_require__) { /** * Copyright (c) 2015-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. * * */ 'use strict'; var _Symbol = __webpack_require__(23); module.exports = { name: _Symbol('name'), type: _Symbol('type'), inspected: _Symbol('inspected'), meta: _Symbol('meta'), proto: _Symbol('proto') }; /***/ }, /* 23 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; module.exports = __webpack_require__(24)() ? Symbol : __webpack_require__(25); /***/ }, /* 24 */ /***/ function(module, exports) { 'use strict'; module.exports = function () { var symbol; if (typeof Symbol !== 'function') return false; symbol = Symbol('test symbol'); try { String(symbol); } catch (e) { return false; } if (typeof Symbol.iterator === 'symbol') return true; // Return 'true' for polyfills if (typeof Symbol.isConcatSpreadable !== 'object') return false; if (typeof Symbol.iterator !== 'object') return false; if (typeof Symbol.toPrimitive !== 'object') return false; if (typeof Symbol.toStringTag !== 'object') return false; if (typeof Symbol.unscopables !== 'object') return false; return true; }; /***/ }, /* 25 */ /***/ function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(__webpack_provided_Object_dot_create) {// ES2015 Symbol polyfill for environments that do not support it (or partially support it_ 'use strict'; var d = __webpack_require__(26) , validateSymbol = __webpack_require__(39) , create = __webpack_provided_Object_dot_create, defineProperties = Object.defineProperties , defineProperty = Object.defineProperty, objPrototype = Object.prototype , NativeSymbol, SymbolPolyfill, HiddenSymbol, globalSymbols = create(null); if (typeof Symbol === 'function') NativeSymbol = Symbol; var generateName = (function () { var created = create(null); return function (desc) { var postfix = 0, name, ie11BugWorkaround; while (created[desc + (postfix || '')]) ++postfix; desc += (postfix || ''); created[desc] = true; name = '@@' + desc; defineProperty(objPrototype, name, d.gs(null, function (value) { // For IE11 issue see: // https://connect.microsoft.com/IE/feedbackdetail/view/1928508/ // ie11-broken-getters-on-dom-objects // https://github.com/medikoo/es6-symbol/issues/12 if (ie11BugWorkaround) return; ie11BugWorkaround = true; defineProperty(this, name, d(value)); ie11BugWorkaround = false; })); return name; }; }()); // Internal constructor (not one exposed) for creating Symbol instances. // This one is used to ensure that `someSymbol instanceof Symbol` always return false HiddenSymbol = function Symbol(description) { if (this instanceof HiddenSymbol) throw new TypeError('TypeError: Symbol is not a constructor'); return SymbolPolyfill(description); }; // Exposed `Symbol` constructor // (returns instances of HiddenSymbol) module.exports = SymbolPolyfill = function Symbol(description) { var symbol; if (this instanceof Symbol) throw new TypeError('TypeError: Symbol is not a constructor'); symbol = create(HiddenSymbol.prototype); description = (description === undefined ? '' : String(description)); return defineProperties(symbol, { __description__: d('', description), __name__: d('', generateName(description)) }); }; defineProperties(SymbolPolyfill, { for: d(function (key) { if (globalSymbols[key]) return globalSymbols[key]; return (globalSymbols[key] = SymbolPolyfill(String(key))); }), keyFor: d(function (s) { var key; validateSymbol(s); for (key in globalSymbols) if (globalSymbols[key] === s) return key; }), // If there's native implementation of given symbol, let's fallback to it // to ensure proper interoperability with other native functions e.g. Array.from hasInstance: d('', (NativeSymbol && NativeSymbol.hasInstance) || SymbolPolyfill('hasInstance')), isConcatSpreadable: d('', (NativeSymbol && NativeSymbol.isConcatSpreadable) || SymbolPolyfill('isConcatSpreadable')), iterator: d('', (NativeSymbol && NativeSymbol.iterator) || SymbolPolyfill('iterator')), match: d('', (NativeSymbol && NativeSymbol.match) || SymbolPolyfill('match')), replace: d('', (NativeSymbol && NativeSymbol.replace) || SymbolPolyfill('replace')), search: d('', (NativeSymbol && NativeSymbol.search) || SymbolPolyfill('search')), species: d('', (NativeSymbol && NativeSymbol.species) || SymbolPolyfill('species')), split: d('', (NativeSymbol && NativeSymbol.split) || SymbolPolyfill('split')), toPrimitive: d('', (NativeSymbol && NativeSymbol.toPrimitive) || SymbolPolyfill('toPrimitive')), toStringTag: d('', (NativeSymbol && NativeSymbol.toStringTag) || SymbolPolyfill('toStringTag')), unscopables: d('', (NativeSymbol && NativeSymbol.unscopables) || SymbolPolyfill('unscopables')) }); // Internal tweaks for real symbol producer defineProperties(HiddenSymbol.prototype, { constructor: d(SymbolPolyfill), toString: d('', function () { return this.__name__; }) }); // Proper implementation of methods exposed on Symbol.prototype // They won't be accessible on produced symbol instances as they derive from HiddenSymbol.prototype defineProperties(SymbolPolyfill.prototype, { toString: d(function () { return 'Symbol (' + validateSymbol(this).__description__ + ')'; }), valueOf: d(function () { return validateSymbol(this); }) }); defineProperty(SymbolPolyfill.prototype, SymbolPolyfill.toPrimitive, d('', function () { return validateSymbol(this); })); defineProperty(SymbolPolyfill.prototype, SymbolPolyfill.toStringTag, d('c', 'Symbol')); // Proper implementaton of toPrimitive and toStringTag for returned symbol instances defineProperty(HiddenSymbol.prototype, SymbolPolyfill.toStringTag, d('c', SymbolPolyfill.prototype[SymbolPolyfill.toStringTag])); // Note: It's important to define `toPrimitive` as last one, as some implementations // implement `toPrimitive` natively without implementing `toStringTag` (or other specified symbols) // And that may invoke error in definition flow: // See: https://github.com/medikoo/es6-symbol/issues/13#issuecomment-164146149 defineProperty(HiddenSymbol.prototype, SymbolPolyfill.toPrimitive, d('c', SymbolPolyfill.prototype[SymbolPolyfill.toPrimitive])); /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(2))) /***/ }, /* 26 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; var assign = __webpack_require__(27) , normalizeOpts = __webpack_require__(34) , isCallable = __webpack_require__(35) , contains = __webpack_require__(36) , d; d = module.exports = function (dscr, value/*, options*/) { var c, e, w, options, desc; if ((arguments.length < 2) || (typeof dscr !== 'string')) { options = value; value = dscr; dscr = null; } else { options = arguments[2]; } if (dscr == null) { c = w = true; e = false; } else { c = contains.call(dscr, 'c'); e = contains.call(dscr, 'e'); w = contains.call(dscr, 'w'); } desc = { value: value, configurable: c, enumerable: e, writable: w }; return !options ? desc : assign(normalizeOpts(options), desc); }; d.gs = function (dscr, get, set/*, options*/) { var c, e, options, desc; if (typeof dscr !== 'string') { options = set; set = get; get = dscr; dscr = null; } else { options = arguments[3]; } if (get == null) { get = undefined; } else if (!isCallable(get)) { options = get; get = set = undefined; } else if (set == null) { set = undefined; } else if (!isCallable(set)) { options = set; set = undefined; } if (dscr == null) { c = true; e = false; } else { c = contains.call(dscr, 'c'); e = contains.call(dscr, 'e'); } desc = { get: get, set: set, configurable: c, enumerable: e }; return !options ? desc : assign(normalizeOpts(options), desc); }; /***/ }, /* 27 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; module.exports = __webpack_require__(28)() ? Object.assign : __webpack_require__(29); /***/ }, /* 28 */ /***/ function(module, exports) { 'use strict'; module.exports = function () { var assign = Object.assign, obj; if (typeof assign !== 'function') return false; obj = { foo: 'raz' }; assign(obj, { bar: 'dwa' }, { trzy: 'trzy' }); return (obj.foo + obj.bar + obj.trzy) === 'razdwatrzy'; }; /***/ }, /* 29 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; var keys = __webpack_require__(30) , value = __webpack_require__(33) , max = Math.max; module.exports = function (dest, src/*, …srcn*/) { var error, i, l = max(arguments.length, 2), assign; dest = Object(value(dest)); assign = function (key) { try { dest[key] = src[key]; } catch (e) { if (!error) error = e; } }; for (i = 1; i < l; ++i) { src = arguments[i]; keys(src).forEach(assign); } if (error !== undefined) throw error; return dest; }; /***/ }, /* 30 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; module.exports = __webpack_require__(31)() ? Object.keys : __webpack_require__(32); /***/ }, /* 31 */ /***/ function(module, exports) { 'use strict'; module.exports = function () { try { Object.keys('primitive'); return true; } catch (e) { return false; } }; /***/ }, /* 32 */ /***/ function(module, exports) { 'use strict'; var keys = Object.keys; module.exports = function (object) { return keys(object == null ? object : Object(object)); }; /***/ }, /* 33 */ /***/ function(module, exports) { 'use strict'; module.exports = function (value) { if (value == null) throw new TypeError("Cannot use null or undefined"); return value; }; /***/ }, /* 34 */ /***/ function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(__webpack_provided_Object_dot_create) {'use strict'; var forEach = Array.prototype.forEach, create = __webpack_provided_Object_dot_create; var process = function (src, obj) { var key; for (key in src) obj[key] = src[key]; }; module.exports = function (options/*, …options*/) { var result = create(null); forEach.call(arguments, function (options) { if (options == null) return; process(Object(options), result); }); return result; }; /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(2))) /***/ }, /* 35 */ /***/ function(module, exports) { // Deprecated 'use strict'; module.exports = function (obj) { return typeof obj === 'function'; }; /***/ }, /* 36 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; module.exports = __webpack_require__(37)() ? String.prototype.contains : __webpack_require__(38); /***/ }, /* 37 */ /***/ function(module, exports) { 'use strict'; var str = 'razdwatrzy'; module.exports = function () { if (typeof str.contains !== 'function') return false; return ((str.contains('dwa') === true) && (str.contains('foo') === false)); }; /***/ }, /* 38 */ /***/ function(module, exports) { 'use strict'; var indexOf = String.prototype.indexOf; module.exports = function (searchString/*, position*/) { return indexOf.call(this, searchString, arguments[1]) > -1; }; /***/ }, /* 39 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; var isSymbol = __webpack_require__(40); module.exports = function (value) { if (!isSymbol(value)) throw new TypeError(value + " is not a symbol"); return value; }; /***/ }, /* 40 */ /***/ function(module, exports) { 'use strict'; module.exports = function (x) { return (x && ((typeof x === 'symbol') || (x['@@toStringTag'] === 'Symbol'))) || false; }; /***/ }, /* 41 */ /***/ function(module, exports, __webpack_require__) { /** * Copyright (c) 2015-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. * * */ 'use strict'; var consts = __webpack_require__(22); function hydrate(data, cleaned) { cleaned.forEach(function (path) { var last = path.pop(); var obj = path.reduce(function (obj_, attr) { return obj_ ? obj_[attr] : null; }, data); if (!obj || !obj[last]) { return; } var replace = {}; replace[consts.name] = obj[last].name; replace[consts.type] = obj[last].type; replace[consts.meta] = obj[last].meta; replace[consts.inspected] = false; obj[last] = replace; }); } module.exports = hydrate; /***/ }, /* 42 */ /***/ function(module, exports) { /** * Copyright (c) 2015-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. * * */ 'use strict'; /** * Get a enhanced/artificial type string based on the object instance */ 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; }; function getPropType(data) { if (!data) { return null; } var type = typeof data === 'undefined' ? 'undefined' : _typeof(data); if (type === 'object') { if (data._reactFragment) { return 'react_fragment'; } if (Array.isArray(data)) { return 'array'; } if (ArrayBuffer.isView(data)) { if (data instanceof DataView) { return 'data_view'; } return 'typed_array'; } if (data instanceof ArrayBuffer) { return 'array_buffer'; } if (typeof data[Symbol.iterator] === 'function') { return 'iterator'; } if (Object.prototype.toString.call(data) === '[object Date]') { return 'date'; } } return type; } /** * Generate the dehydrated metadata for complex object instances */ function createDehydrated(type, data, cleaned, path) { var meta = {}; if (type === 'array' || type === 'typed_array') { meta.length = data.length; } if (type === 'iterator' || type === 'typed_array') { meta.readOnly = true; } cleaned.push(path); return { type: type, meta: meta, name: !data.constructor || data.constructor.name === 'Object' ? '' : data.constructor.name }; } /** * Strip out complex data (instances, functions, and data nested > 2 levels * deep). The paths of the stripped out objects are appended to the `cleaned` * list. On the other side of the barrier, the cleaned list is used to * "re-hydrate" the cleaned representation into an object with symbols as * attributes, so that a sanitized object can be distinguished from a normal * object. * * Input: {"some": {"attr": fn()}, "other": AnInstance} * Output: { * "some": { * "attr": {"name": the fn.name, type: "function"} * }, * "other": { * "name": "AnInstance", * "type": "object", * }, * } * and cleaned = [["some", "attr"], ["other"]] */ function dehydrate(data, cleaned) { var path = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : []; var level = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0; var type = getPropType(data); switch (type) { case 'function': cleaned.push(path); return { name: data.name, type: 'function' }; case 'string': return data.length <= 500 ? data : data.slice(0, 500) + '...'; // We have to do this assignment b/c Flow doesn't think "symbol" is // something typeof would return. Error 'unexpected predicate "symbol"' case 'symbol': cleaned.push(path); return { type: 'symbol', name: data.toString() }; // React Fragments error if you try to inspect them. case 'react_fragment': return 'A React Fragment'; // ArrayBuffers error if you try to inspect them. case 'array_buffer': case 'data_view': cleaned.push(path); return { type: type, name: type === 'data_view' ? 'DataView' : 'ArrayBuffer', meta: { length: data.byteLength, uninspectable: true } }; case 'array': if (level > 2) { return createDehydrated(type, data, cleaned, path); } return data.map(function (item, i) { return dehydrate(item, cleaned, path.concat([i]), level + 1); }); case 'typed_array': case 'iterator': return createDehydrated(type, data, cleaned, path); case 'date': cleaned.push(path); return { name: data.toString(), type: 'date', meta: { uninspectable: true } }; case 'object': if (level > 2 || data.constructor && typeof data.constructor === 'function' && data.constructor.name !== 'Object') { return createDehydrated(type, data, cleaned, path); } else { var res = {}; for (var name in data) { res[name] = dehydrate(data[name], cleaned, path.concat([name]), level + 1); } return res; } default: return data; } } module.exports = dehydrate; /***/ }, /* 43 */ /***/ function(module, exports, __webpack_require__) { /** * 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. * * @providesModule performanceNow * @typechecks */ 'use strict'; var performance = __webpack_require__(44); 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 () { return performance.now(); }; } else { performanceNow = function () { return Date.now(); }; } module.exports = performanceNow; /***/ }, /* 44 */ /***/ function(module, exports, __webpack_require__) { /** * 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. * * @providesModule performance * @typechecks */ 'use strict'; var ExecutionEnvironment = __webpack_require__(45); var performance; if (ExecutionEnvironment.canUseDOM) { performance = window.performance || window.msPerformance || window.webkitPerformance; } module.exports = performance || {}; /***/ }, /* 45 */ /***/ function(module, exports) { /** * 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. * * @providesModule ExecutionEnvironment */ 'use strict'; 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; /***/ }, /* 46 */ /***/ function(module, exports, __webpack_require__) { /** * Copyright (c) 2015-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. * * */ 'use strict'; var setupBackend = __webpack_require__(47); module.exports = function (hook, agent) { var subs = [ // Basic functionality hook.sub('renderer-attached', function (_ref) { var id = _ref.id, renderer = _ref.renderer, helpers = _ref.helpers; agent.setReactInternals(id, helpers); helpers.walkTree(agent.onMounted.bind(agent, id), agent.addRoot.bind(agent, id)); }), hook.sub('mount', function (_ref2) { var renderer = _ref2.renderer, internalInstance = _ref2.internalInstance, data = _ref2.data; return agent.onMounted(renderer, internalInstance, data); }), hook.sub('unmount', function (_ref3) { var renderer = _ref3.renderer, internalInstance = _ref3.internalInstance; return agent.onUnmounted(internalInstance); }), hook.sub('update', function (_ref4) { var renderer = _ref4.renderer, internalInstance = _ref4.internalInstance, data = _ref4.data; return agent.onUpdated(internalInstance, data); }), // Required by Profiler plugin hook.sub('root', function (_ref5) { var renderer = _ref5.renderer, internalInstance = _ref5.internalInstance; return agent.addRoot(renderer, internalInstance); }), hook.sub('rootCommitted', function (_ref6) { var renderer = _ref6.renderer, internalInstance = _ref6.internalInstance, data = _ref6.data; return agent.rootCommitted(renderer, internalInstance, data); }), hook.sub('updateProfileTimes', function (_ref7) { var renderer = _ref7.renderer, internalInstance = _ref7.internalInstance, data = _ref7.data; return agent.onUpdatedProfileTimes(internalInstance, data); })]; var success = setupBackend(hook); if (!success) { return; } hook.emit('react-devtools', agent); hook.reactDevtoolsAgent = agent; agent.on('shutdown', function () { subs.forEach(function (fn) { return fn(); }); hook.reactDevtoolsAgent = null; }); }; /***/ }, /* 47 */ /***/ function(module, exports, __webpack_require__) { /** * Copyright (c) 2015-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. * * * * This is the chrome devtools * * 1. Devtools sets the __REACT_DEVTOOLS_GLOBAL_HOOK__ global. * 2. React (if present) calls .inject() with the internal renderer * 3. Devtools sees the renderer, and then adds this backend, along with the Agent * and whatever else is needed. * 4. The agent then calls `.emit('react-devtools', agent)` * * Now things are hooked up. * * When devtools closes, it calls `cleanup()` to remove the listeners * and any overhead caused by the backend. */ 'use strict'; var attachRenderer = __webpack_require__(48); module.exports = function setupBackend(hook) { var oldReact = window.React && window.React.__internals; if (oldReact && Object.keys(hook._renderers).length === 0) { hook.inject(oldReact); } for (var rid in hook._renderers) { hook.helpers[rid] = attachRenderer(hook, rid, hook._renderers[rid]); hook.emit('renderer-attached', { id: rid, renderer: hook._renderers[rid], helpers: hook.helpers[rid] }); } hook.on('renderer', function (_ref) { var id = _ref.id, renderer = _ref.renderer; hook.helpers[id] = attachRenderer(hook, id, renderer); hook.emit('renderer-attached', { id: id, renderer: renderer, helpers: hook.helpers[id] }); }); var shutdown = function shutdown() { for (var id in hook.helpers) { hook.helpers[id].cleanup(); } hook.off('shutdown', shutdown); }; hook.on('shutdown', shutdown); return true; }; /***/ }, /* 48 */ /***/ function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(Map) {/** * Copyright (c) 2015-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. * * */ 'use strict'; var getData = __webpack_require__(49); var getData012 = __webpack_require__(55); var attachRendererFiber = __webpack_require__(56); /** * This takes care of patching the renderer to emit events on the global * `Hook`. The returned object has a `.cleanup` method to un-patch everything. */ function attachRenderer(hook, rid, renderer) { var rootNodeIDMap = new Map(); var extras = {}; // Before 0.13 there was no Reconciler, so we patch Component.Mixin var isPre013 = !renderer.Reconciler; // React Fiber if (typeof renderer.findFiberByHostInstance === 'function') { return attachRendererFiber(hook, rid, renderer); } // React Native if (renderer.Mount.findNodeHandle && renderer.Mount.nativeTagToRootNodeID) { extras.getNativeFromReactElement = function (component) { return renderer.Mount.findNodeHandle(component); }; extras.getReactElementFromNative = function (nativeTag) { var id = renderer.Mount.nativeTagToRootNodeID(nativeTag); return rootNodeIDMap.get(id); }; // React DOM 15+ } else if (renderer.ComponentTree) { extras.getNativeFromReactElement = function (component) { return renderer.ComponentTree.getNodeFromInstance(component); }; extras.getReactElementFromNative = function (node) { return renderer.ComponentTree.getClosestInstanceFromNode(node); }; // React DOM } else if (renderer.Mount.getID && renderer.Mount.getNode) { extras.getNativeFromReactElement = function (component) { try { return renderer.Mount.getNode(component._rootNodeID); } catch (e) { return undefined; } }; extras.getReactElementFromNative = function (node) { // $FlowFixMe var id = renderer.Mount.getID(node); while (node && node.parentNode && !id) { node = node.parentNode; // $FlowFixMe id = renderer.Mount.getID(node); } return rootNodeIDMap.get(id); }; } else { console.warn('Unknown react version (does not have getID), probably an unshimmed React Native'); } var oldMethods; var oldRenderComponent; var oldRenderRoot; // React DOM if (renderer.Mount._renderNewRootComponent) { oldRenderRoot = decorateResult(renderer.Mount, '_renderNewRootComponent', function (internalInstance) { hook.emit('root', { renderer: rid, internalInstance: internalInstance }); }); // React Native } else if (renderer.Mount.renderComponent) { oldRenderComponent = decorateResult(renderer.Mount, 'renderComponent', function (internalInstance) { hook.emit('root', { renderer: rid, internalInstance: internalInstance._reactInternalInstance }); }); } if (renderer.Component) { console.error('You are using a version of React with limited support in this version of the devtools.\nPlease upgrade to use at least 0.13, or you can downgrade to use the old version of the devtools:\ninstructions here https://github.com/facebook/react-devtools/tree/devtools-next#how-do-i-use-this-for-react--013'); // 0.11 - 0.12 // $FlowFixMe renderer.Component is not "possibly undefined" oldMethods = decorateMany(renderer.Component.Mixin, { mountComponent: function mountComponent() { var _this = this; rootNodeIDMap.set(this._rootNodeID, this); // FIXME DOMComponent calls Component.Mixin, and sets up the // `children` *after* that call, meaning we don't have access to the // children at this point. Maybe we should find something else to shim // (do we have access to DOMComponent here?) so that we don't have to // setTimeout. setTimeout(function () { hook.emit('mount', { internalInstance: _this, data: getData012(_this), renderer: rid }); }, 0); }, updateComponent: function updateComponent() { var _this2 = this; setTimeout(function () { hook.emit('update', { internalInstance: _this2, data: getData012(_this2), renderer: rid }); }, 0); }, unmountComponent: function unmountComponent() { hook.emit('unmount', { internalInstance: this, renderer: rid }); rootNodeIDMap.delete(this._rootNodeID); } }); } else if (renderer.Reconciler) { oldMethods = decorateMany(renderer.Reconciler, { mountComponent: function mountComponent(internalInstance, rootID, transaction, context) { var data = getData(internalInstance); rootNodeIDMap.set(internalInstance._rootNodeID, internalInstance); hook.emit('mount', { internalInstance: internalInstance, data: data, renderer: rid }); }, performUpdateIfNecessary: function performUpdateIfNecessary(internalInstance, nextChild, transaction, context) { hook.emit('update', { internalInstance: internalInstance, data: getData(internalInstance), renderer: rid }); }, receiveComponent: function receiveComponent(internalInstance, nextChild, transaction, context) { hook.emit('update', { internalInstance: internalInstance, data: getData(internalInstance), renderer: rid }); }, unmountComponent: function unmountComponent(internalInstance) { hook.emit('unmount', { internalInstance: internalInstance, renderer: rid }); rootNodeIDMap.delete(internalInstance._rootNodeID); } }); } extras.walkTree = function (visit, visitRoot) { var onMount = function onMount(component, data) { rootNodeIDMap.set(component._rootNodeID, component); visit(component, data); }; walkRoots(renderer.Mount._instancesByReactRootID || renderer.Mount._instancesByContainerID, onMount, visitRoot, isPre013); }; extras.cleanup = function () { if (oldMethods) { if (renderer.Component) { restoreMany(renderer.Component.Mixin, oldMethods); } else { restoreMany(renderer.Reconciler, oldMethods); } } if (oldRenderRoot) { renderer.Mount._renderNewRootComponent = oldRenderRoot; } if (oldRenderComponent) { renderer.Mount.renderComponent = oldRenderComponent; } oldMethods = null; oldRenderRoot = null; oldRenderComponent = null; }; return extras; } function walkRoots(roots, onMount, onRoot, isPre013) { for (var name in roots) { walkNode(roots[name], onMount, isPre013); onRoot(roots[name]); } } function walkNode(internalInstance, onMount, isPre013) { var data = isPre013 ? getData012(internalInstance) : getData(internalInstance); if (data.children && Array.isArray(data.children)) { data.children.forEach(function (child) { return walkNode(child, onMount, isPre013); }); } onMount(internalInstance, data); } function decorateResult(obj, attr, fn) { var old = obj[attr]; obj[attr] = function (instance) { var res = old.apply(this, arguments); fn(res); return res; }; return old; } function decorate(obj, attr, fn) { var old = obj[attr]; obj[attr] = function (instance) { var res = old.apply(this, arguments); fn.apply(this, arguments); return res; }; return old; } function decorateMany(source, fns) { var olds = {}; for (var name in fns) { olds[name] = decorate(source, name, fns[name]); } return olds; } function restoreMany(source, olds) { for (var name in olds) { source[name] = olds[name]; } } module.exports = attachRenderer; /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3))) /***/ }, /* 49 */ /***/ function(module, exports, __webpack_require__) { /** * Copyright (c) 2015-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. * * */ 'use strict'; // ---------------------------------------------------- // This is Stack-only version. // The Fiber version is inlined in attachRendererFiber. // ---------------------------------------------------- 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 copyWithSet = __webpack_require__(50); var getDisplayName = __webpack_require__(51); var traverseAllChildrenImpl = __webpack_require__(52); /** * Convert a react internal instance to a sanitized data object. */ function getData(internalInstance) { var children = null; var props = null; var state = null; var context = null; var updater = null; var name = null; var type = null; var key = null; var ref = null; var source = null; var text = null; var publicInstance = null; var nodeType = 'Native'; // If the parent is a native node without rendered children, but with // multiple string children, then the `element` that gets passed in here is // a plain value -- a string or number. if ((typeof internalInstance === 'undefined' ? 'undefined' : _typeof(internalInstance)) !== 'object') { nodeType = 'Text'; text = internalInstance + ''; } else if (internalInstance._currentElement === null || internalInstance._currentElement === false) { nodeType = 'Empty'; } else if (internalInstance._renderedComponent) { nodeType = 'NativeWrapper'; children = [internalInstance._renderedComponent]; props = internalInstance._instance.props; state = internalInstance._instance.state; context = internalInstance._instance.context; if (context && Object.keys(context).length === 0) { context = null; } } else if (internalInstance._renderedChildren) { children = childrenList(internalInstance._renderedChildren); } else if (internalInstance._currentElement && internalInstance._currentElement.props) { // This is a native node without rendered children -- meaning the children // prop is the unfiltered list of children. // This may include 'null' or even other invalid values, so we need to // filter it the same way that ReactDOM does. // Instead of pulling in the whole React library, we just copied over the // 'traverseAllChildrenImpl' method. // https://github.com/facebook/react/blob/240b84ed8e1db715d759afaae85033718a0b24e1/src/isomorphic/children/ReactChildren.js#L112-L158 var unfilteredChildren = internalInstance._currentElement.props.children; var filteredChildren = []; traverseAllChildrenImpl(unfilteredChildren, '', // nameSoFar function (_traverseContext, child) { var childType = typeof child === 'undefined' ? 'undefined' : _typeof(child); if (childType === 'string' || childType === 'number') { filteredChildren.push(child); } }); if (filteredChildren.length <= 1) { // children must be an array of nodes or a string or undefined // can't be an empty array children = filteredChildren.length ? String(filteredChildren[0]) : undefined; } else { children = filteredChildren; } } if (!props && internalInstance._currentElement && internalInstance._currentElement.props) { props = internalInstance._currentElement.props; } // != used deliberately here to catch undefined and null if (internalInstance._currentElement != null) { type = internalInstance._currentElement.type; if (internalInstance._currentElement.key) { key = String(internalInstance._currentElement.key); } source = internalInstance._currentElement._source; ref = internalInstance._currentElement.ref; if (typeof type === 'string') { name = type; if (internalInstance._nativeNode != null) { publicInstance = internalInstance._nativeNode; } if (internalInstance._hostNode != null) { publicInstance = internalInstance._hostNode; } } else if (typeof type === 'function') { nodeType = 'Composite'; name = getDisplayName(type); // 0.14 top-level wrapper // TODO(jared): The backend should just act as if these don't exist. if (internalInstance._renderedComponent && (internalInstance._currentElement.props === internalInstance._renderedComponent._currentElement || internalInstance._currentElement.type.isReactTopLevelWrapper)) { nodeType = 'Wrapper'; } if (name === null) { name = 'No display name'; } } else if (typeof internalInstance._stringText === 'string') { nodeType = 'Text'; text = internalInstance._stringText; } else { name = getDisplayName(type); } } if (internalInstance._instance) { var inst = internalInstance._instance; // A forceUpdate for stateless (functional) components. var forceUpdate = inst.forceUpdate || inst.updater && inst.updater.enqueueForceUpdate && function (cb) { inst.updater.enqueueForceUpdate(this, cb, 'forceUpdate'); }; updater = { setState: inst.setState && inst.setState.bind(inst), forceUpdate: forceUpdate && forceUpdate.bind(inst), setInProps: forceUpdate && setInProps.bind(null, internalInstance, forceUpdate), setInState: inst.forceUpdate && setInState.bind(null, inst), setInContext: forceUpdate && setInContext.bind(null, inst, forceUpdate) }; if (typeof type === 'function') { publicInstance = inst; } // TODO: React ART currently falls in this bucket, but this doesn't // actually make sense and we should clean this up after stabilizing our // API for backends if (inst._renderedChildren) { children = childrenList(inst._renderedChildren); } } if (typeof internalInstance.setNativeProps === 'function') { // For editing styles in RN updater = { setNativeProps: function setNativeProps(nativeProps) { internalInstance.setNativeProps(nativeProps); } }; } // $FlowFixMe return { nodeType: nodeType, type: type, key: key, ref: ref, source: source, name: name, props: props, state: state, context: context, children: children, text: text, updater: updater, publicInstance: publicInstance }; } function setInProps(internalInst, forceUpdate, path, value) { var element = internalInst._currentElement; internalInst._currentElement = _extends({}, element, { props: copyWithSet(element.props, path, value) }); forceUpdate.call(internalInst._instance); } function setInState(inst, path, value) { setIn(inst.state, path, value); inst.forceUpdate(); } function setInContext(inst, forceUpdate, path, value) { setIn(inst.context, path, value); forceUpdate.call(inst); } function setIn(obj, path, value) { var last = path.pop(); var parent = path.reduce(function (obj_, attr) { return obj_ ? obj_[attr] : null; }, obj); if (parent) { parent[last] = value; } } function childrenList(children) { var res = []; for (var name in children) { res.push(children[name]); } return res; } module.exports = getData; /***/ }, /* 50 */ /***/ function(module, exports) { /** * Copyright (c) 2015-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. * * */ 'use strict'; 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 copyWithSetImpl(obj, path, idx, value) { if (idx >= path.length) { return value; } var key = path[idx]; var updated = Array.isArray(obj) ? obj.slice() : _extends({}, obj); // $FlowFixMe number or string is fine here updated[key] = copyWithSetImpl(obj[key], path, idx + 1, value); return updated; } function copyWithSet(obj, path, value) { return copyWithSetImpl(obj, path, 0, value); } module.exports = copyWithSet; /***/ }, /* 51 */ /***/ function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(WeakMap) {/** * Copyright (c) 2015-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. * * */ 'use strict'; var FB_MODULE_RE = /^(.*) \[from (.*)\]$/; var cachedDisplayNames = new WeakMap(); function getDisplayName(type) { var fallbackName = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'Unknown'; var nameFromCache = cachedDisplayNames.get(type); if (nameFromCache != null) { return nameFromCache; } var displayName = void 0; // The displayName property is not guaranteed to be a string. // It's only safe to use for our purposes if it's a string. // github.com/facebook/react-devtools/issues/803 if (typeof type.displayName === 'string') { displayName = type.displayName; } if (!displayName) { displayName = type.name || fallbackName; } // Facebook-specific hack to turn "Image [from Image.react]" into just "Image". // We need displayName with module name for error reports but it clutters the DevTools. var match = displayName.match(FB_MODULE_RE); if (match) { var componentName = match[1]; var moduleName = match[2]; if (componentName && moduleName) { if (moduleName === componentName || moduleName.startsWith(componentName + '.')) { displayName = componentName; } } } cachedDisplayNames.set(type, displayName); return displayName; } module.exports = getDisplayName; /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4))) /***/ }, /* 52 */ /***/ function(module, exports, __webpack_require__) { /** * Copyright (c) 2015-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. * * */ 'use strict'; 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 invariant = __webpack_require__(53); var SEPARATOR = '.'; var SUBSEPARATOR = ':'; var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec. // 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 ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator; var REACT_ELEMENT_TYPE = typeof Symbol === 'function' && Symbol.for && Symbol.for('react.element') || 0xeac7; /** * 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; } /** * 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 ((typeof component === 'undefined' ? 'undefined' : _typeof(component)) === 'object' && component !== null && component.key != null) { // Explicit key return escape(component.key); } // Implicit key determined by the index in the set return index.toString(36); } /** * We do a copied the 'traverseAllChildrenImpl' method from * `React.Children` so that we don't pull in the whole React library. * @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 === 'undefined' ? 'undefined' : _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 = ITERATOR_SYMBOL && children[ITERATOR_SYMBOL] || children[FAUX_ITERATOR_SYMBOL]; if (typeof iteratorFn === 'function') { var iterator = iteratorFn.call(children); var step; var ii = 0; while (!(step = iterator.next()).done) { child = step.value; nextName = nextNamePrefix + getComponentKey(child, ii++); subtreeCount += traverseAllChildrenImpl(child, nextName, callback, traverseContext); } } else if (type === 'object') { var addendum = ' If you meant to render a collection of children, use an array ' + 'instead.'; var childrenString = '' + children; invariant(false, 'The React Devtools cannot render an object as a child. (found: %s).%s', childrenString === '[object Object]' ? 'object with keys {' + Object.keys(children).join(', ') + '}' : childrenString, addendum); } } return subtreeCount; } module.exports = traverseAllChildrenImpl; /***/ }, /* 53 */ /***/ function(module, exports, __webpack_require__) { /* 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. * * @providesModule invariant */ 'use strict'; /** * 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. */ function invariant(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__(54))) /***/ }, /* 54 */ /***/ 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.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; }; /***/ }, /* 55 */ /***/ function(module, exports, __webpack_require__) { /** * Copyright (c) 2015-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. * * */ 'use strict'; // ---------------------------------------------------- // This is Stack-only version. // The Fiber version is inlined in attachRendererFiber. // ---------------------------------------------------- var copyWithSet = __webpack_require__(50); function getData012(internalInstance) { var children = null; var props = internalInstance.props; var state = internalInstance.state; var context = internalInstance.context; var updater = null; var name = null; var type = null; var key = null; var ref = null; var text = null; var publicInstance = null; var nodeType = 'Native'; if (internalInstance._renderedComponent) { nodeType = 'Wrapper'; children = [internalInstance._renderedComponent]; if (context && Object.keys(context).length === 0) { context = null; } } else if (internalInstance._renderedChildren) { name = internalInstance.constructor.displayName; children = childrenList(internalInstance._renderedChildren); } else if (typeof props.children === 'string') { // string children name = internalInstance.constructor.displayName; children = props.children; nodeType = 'Native'; } if (!props && internalInstance._currentElement && internalInstance._currentElement.props) { props = internalInstance._currentElement.props; } if (internalInstance._currentElement) { type = internalInstance._currentElement.type; if (internalInstance._currentElement.key) { key = String(internalInstance._currentElement.key); } ref = internalInstance._currentElement.ref; if (typeof type === 'string') { name = type; } else { nodeType = 'Composite'; name = type.displayName; if (!name) { name = 'No display name'; } } } if (!name) { name = internalInstance.constructor.displayName || 'No display name'; nodeType = 'Composite'; } if (typeof props === 'string') { nodeType = 'Text'; text = props; props = null; name = null; } if (internalInstance.forceUpdate) { updater = { setState: internalInstance.setState.bind(internalInstance), forceUpdate: internalInstance.forceUpdate.bind(internalInstance), setInProps: internalInstance.forceUpdate && setInProps.bind(null, internalInstance), setInState: internalInstance.forceUpdate && setInState.bind(null, internalInstance), setInContext: internalInstance.forceUpdate && setInContext.bind(null, internalInstance) }; publicInstance = internalInstance; } // $FlowFixMe return { nodeType: nodeType, type: type, key: key, ref: ref, source: null, name: name, props: props, state: state, context: context, children: children, text: text, updater: updater, publicInstance: publicInstance }; } function setInProps(inst, path, value) { inst.props = copyWithSet(inst.props, path, value); inst.forceUpdate(); } function setInState(inst, path, value) { setIn(inst.state, path, value); inst.forceUpdate(); } function setInContext(inst, path, value) { setIn(inst.context, path, value); inst.forceUpdate(); } function setIn(obj, path, value) { var last = path.pop(); var parent = path.reduce(function (obj_, attr) { return obj_ ? obj_[attr] : null; }, obj); if (parent) { parent[last] = value; } } function childrenList(children) { var res = []; for (var name in children) { res.push(children[name]); } return res; } module.exports = getData012; /***/ }, /* 56 */ /***/ function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(Set) {/** * Copyright (c) 2015-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. * * */ 'use strict'; 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 semver = __webpack_require__(57); var copyWithSet = __webpack_require__(50); var getDisplayName = __webpack_require__(51); function getInternalReactConstants(version) { var ReactTypeOfWork; var ReactSymbols; var ReactTypeOfSideEffect; // ********************************************************** // The section below is copied from files in React repo. // Keep it in sync, and add version guards if it changes. // ********************************************************** if (semver.gte(version, '16.6.0-beta.0')) { ReactTypeOfWork = { ClassComponent: 1, ContextConsumer: 9, ContextProvider: 10, CoroutineComponent: -1, // Removed CoroutineHandlerPhase: -1, // Removed ForwardRef: 11, Fragment: 7, FunctionalComponent: 0, HostComponent: 5, HostPortal: 4, HostRoot: 3, HostText: 6, IndeterminateComponent: 2, LazyComponent: 16, MemoComponent: 14, Mode: 8, Profiler: 12, SimpleMemoComponent: 15, SuspenseComponent: 13, YieldComponent: -1 }; } else if (semver.gte(version, '16.4.3-alpha')) { ReactTypeOfWork = { ClassComponent: 2, ContextConsumer: 11, ContextProvider: 12, CoroutineComponent: -1, // Removed CoroutineHandlerPhase: -1, // Removed ForwardRef: 13, Fragment: 9, FunctionalComponent: 0, HostComponent: 7, HostPortal: 6, HostRoot: 5, HostText: 8, IndeterminateComponent: 4, LazyComponent: -1, // Doesn't exist yet MemoComponent: -1, // Doesn't exist yet Mode: 10, Profiler: 15, SimpleMemoComponent: -1, // Doesn't exist yet SuspenseComponent: 16, YieldComponent: -1 }; } else { ReactTypeOfWork = { ClassComponent: 2, ContextConsumer: 12, ContextProvider: 13, CoroutineComponent: 7, CoroutineHandlerPhase: 8, ForwardRef: 14, Fragment: 10, FunctionalComponent: 1, HostComponent: 5, HostPortal: 4, HostRoot: 3, HostText: 6, IndeterminateComponent: 0, LazyComponent: -1, // Doesn't exist yet MemoComponent: -1, // Doesn't exist yet Mode: 11, Profiler: 15, SimpleMemoComponent: -1, // Doesn't exist yet SuspenseComponent: 16, YieldComponent: 9 }; } ReactSymbols = { CONCURRENT_MODE_NUMBER: 0xeacf, CONCURRENT_MODE_SYMBOL_STRING: 'Symbol(react.concurrent_mode)', DEPRECATED_ASYNC_MODE_SYMBOL_STRING: 'Symbol(react.async_mode)', CONTEXT_CONSUMER_NUMBER: 0xeace, CONTEXT_CONSUMER_SYMBOL_STRING: 'Symbol(react.context)', CONTEXT_PROVIDER_NUMBER: 0xeacd, CONTEXT_PROVIDER_SYMBOL_STRING: 'Symbol(react.provider)', FORWARD_REF_NUMBER: 0xead0, FORWARD_REF_SYMBOL_STRING: 'Symbol(react.forward_ref)', PROFILER_NUMBER: 0xead2, PROFILER_SYMBOL_STRING: 'Symbol(react.profiler)', PURE_NUMBER: 0xead3, PURE_SYMBOL_STRING: 'Symbol(react.pure)', STRICT_MODE_NUMBER: 0xeacc, STRICT_MODE_SYMBOL_STRING: 'Symbol(react.strict_mode)', SUSPENSE_NUMBER: 0xead1, SUSPENSE_SYMBOL_STRING: 'Symbol(react.suspense)', DEPRECATED_PLACEHOLDER_SYMBOL_STRING: 'Symbol(react.placeholder)' }; ReactTypeOfSideEffect = { PerformedWork: 1 }; // ********************************************************** // End of copied code. // ********************************************************** return { ReactTypeOfWork: ReactTypeOfWork, ReactSymbols: ReactSymbols, ReactTypeOfSideEffect: ReactTypeOfSideEffect }; } function attachRendererFiber(hook, rid, renderer) { var _getInternalReactCons = getInternalReactConstants(renderer.version), ReactTypeOfWork = _getInternalReactCons.ReactTypeOfWork, ReactSymbols = _getInternalReactCons.ReactSymbols, ReactTypeOfSideEffect = _getInternalReactCons.ReactTypeOfSideEffect; var PerformedWork = ReactTypeOfSideEffect.PerformedWork; var FunctionalComponent = ReactTypeOfWork.FunctionalComponent, ClassComponent = ReactTypeOfWork.ClassComponent, ContextConsumer = ReactTypeOfWork.ContextConsumer, HostRoot = ReactTypeOfWork.HostRoot, HostPortal = ReactTypeOfWork.HostPortal, HostComponent = ReactTypeOfWork.HostComponent, HostText = ReactTypeOfWork.HostText, Fragment = ReactTypeOfWork.Fragment, ForwardRef = ReactTypeOfWork.ForwardRef; var CONCURRENT_MODE_NUMBER = ReactSymbols.CONCURRENT_MODE_NUMBER, CONCURRENT_MODE_SYMBOL_STRING = ReactSymbols.CONCURRENT_MODE_SYMBOL_STRING, DEPRECATED_ASYNC_MODE_SYMBOL_STRING = ReactSymbols.DEPRECATED_ASYNC_MODE_SYMBOL_STRING, CONTEXT_CONSUMER_NUMBER = ReactSymbols.CONTEXT_CONSUMER_NUMBER, CONTEXT_CONSUMER_SYMBOL_STRING = ReactSymbols.CONTEXT_CONSUMER_SYMBOL_STRING, CONTEXT_PROVIDER_NUMBER = ReactSymbols.CONTEXT_PROVIDER_NUMBER, CONTEXT_PROVIDER_SYMBOL_STRING = ReactSymbols.CONTEXT_PROVIDER_SYMBOL_STRING, PROFILER_NUMBER = ReactSymbols.PROFILER_NUMBER, PROFILER_SYMBOL_STRING = ReactSymbols.PROFILER_SYMBOL_STRING, PURE_NUMBER = ReactSymbols.PURE_NUMBER, PURE_SYMBOL_STRING = ReactSymbols.PURE_SYMBOL_STRING, STRICT_MODE_NUMBER = ReactSymbols.STRICT_MODE_NUMBER, STRICT_MODE_SYMBOL_STRING = ReactSymbols.STRICT_MODE_SYMBOL_STRING, SUSPENSE_NUMBER = ReactSymbols.SUSPENSE_NUMBER, SUSPENSE_SYMBOL_STRING = ReactSymbols.SUSPENSE_SYMBOL_STRING, DEPRECATED_PLACEHOLDER_SYMBOL_STRING = ReactSymbols.DEPRECATED_PLACEHOLDER_SYMBOL_STRING; // TODO: we might want to change the data structure // once we no longer suppport Stack versions of `getData`. function getDataFiber(fiber) { var type = fiber.type; var key = fiber.key; var ref = fiber.ref; var source = fiber._debugSource; var publicInstance = null; var props = null; var state = null; var children = null; var context = null; var updater = null; var nodeType = null; var name = null; var text = null; // Profiler data var actualDuration = null; var actualStartTime = null; var treeBaseDuration = null; var memoizedInteractions = null; var resolvedType = type; if ((typeof type === 'undefined' ? 'undefined' : _typeof(type)) === 'object' && type !== null) { if (typeof type.then === 'function') { resolvedType = type._reactResult; } } // TODO: Add support for new tags LazyComponent, MemoComponent, and SimpleMemoComponent switch (fiber.tag) { case FunctionalComponent: case ClassComponent: nodeType = 'Composite'; name = getDisplayName(resolvedType); publicInstance = fiber.stateNode; props = fiber.memoizedProps; state = fiber.memoizedState; if (publicInstance != null) { context = publicInstance.context; if (context && Object.keys(context).length === 0) { context = null; } } var inst = publicInstance; if (inst) { updater = { setState: inst.setState && inst.setState.bind(inst), forceUpdate: inst.forceUpdate && inst.forceUpdate.bind(inst), setInProps: inst.forceUpdate && setInProps.bind(null, fiber), setInState: inst.forceUpdate && setInState.bind(null, inst), setInContext: inst.forceUpdate && setInContext.bind(null, inst) }; } children = []; break; case ForwardRef: var functionName = getDisplayName(resolvedType.render, ''); nodeType = 'Special'; name = resolvedType.displayName || (functionName !== '' ? 'ForwardRef(' + functionName + ')' : 'ForwardRef'); children = []; break; case HostRoot: nodeType = 'Wrapper'; children = []; memoizedInteractions = fiber.stateNode.memoizedInteractions; break; case HostPortal: nodeType = 'Portal'; name = 'ReactPortal'; props = { target: fiber.stateNode.containerInfo }; children = []; break; case HostComponent: nodeType = 'Native'; name = fiber.type; // TODO (bvaughn) we plan to remove this prefix anyway. // We can cut this special case out when it's gone. name = name.replace('topsecret-', ''); publicInstance = fiber.stateNode; props = fiber.memoizedProps; if (typeof props.children === 'string' || typeof props.children === 'number') { children = props.children.toString(); } else { children = []; } if (typeof fiber.stateNode.setNativeProps === 'function') { // For editing styles in RN updater = { setNativeProps: function setNativeProps(nativeProps) { fiber.stateNode.setNativeProps(nativeProps); } }; } break; case HostText: nodeType = 'Text'; text = fiber.memoizedProps; break; case Fragment: nodeType = 'Wrapper'; children = []; break; default: var symbolOrNumber = (typeof type === 'undefined' ? 'undefined' : _typeof(type)) === 'object' && type !== null ? type.$$typeof : type; // $FlowFixMe facebook/flow/issues/2362 var switchValue = (typeof symbolOrNumber === 'undefined' ? 'undefined' : _typeof(symbolOrNumber)) === 'symbol' ? symbolOrNumber.toString() : symbolOrNumber; switch (switchValue) { case PURE_NUMBER: case PURE_SYMBOL_STRING: nodeType = 'Special'; if (type.displayName) { name = type.displayName; } else { var displayName = type.render.displayName || type.render.name; name = displayName ? 'Pure(' + displayName + ')' : 'Pure'; } children = []; break; case CONCURRENT_MODE_NUMBER: case CONCURRENT_MODE_SYMBOL_STRING: case DEPRECATED_ASYNC_MODE_SYMBOL_STRING: nodeType = 'Special'; name = 'ConcurrentMode'; children = []; break; case CONTEXT_PROVIDER_NUMBER: case CONTEXT_PROVIDER_SYMBOL_STRING: nodeType = 'Special'; props = fiber.memoizedProps; name = (fiber.type._context.displayName || 'Context') + '.Provider'; children = []; break; case CONTEXT_CONSUMER_NUMBER: case CONTEXT_CONSUMER_SYMBOL_STRING: nodeType = 'Special'; props = fiber.memoizedProps; // NOTE: TraceUpdatesBackendManager depends on the name ending in '.Consumer' // If you change the name, figure out a more resilient way to detect it. name = (fiber.type.displayName || 'Context') + '.Consumer'; children = []; break; case STRICT_MODE_NUMBER: case STRICT_MODE_SYMBOL_STRING: nodeType = 'Special'; name = 'StrictMode'; children = []; break; case SUSPENSE_NUMBER: case SUSPENSE_SYMBOL_STRING: case DEPRECATED_PLACEHOLDER_SYMBOL_STRING: nodeType = 'Special'; name = 'Suspense'; props = fiber.memoizedProps; children = []; break; case PROFILER_NUMBER: case PROFILER_SYMBOL_STRING: nodeType = 'Special'; props = fiber.memoizedProps; name = 'Profiler(' + fiber.memoizedProps.id + ')'; children = []; break; default: nodeType = 'Native'; props = fiber.memoizedProps; name = 'TODO_NOT_IMPLEMENTED_YET'; children = []; break; } break; } if (Array.isArray(children)) { var child = fiber.child; while (child) { children.push(getOpaqueNode(child)); child = child.sibling; } } if (fiber.actualDuration !== undefined) { actualDuration = fiber.actualDuration; actualStartTime = fiber.actualStartTime; treeBaseDuration = fiber.treeBaseDuration; } // $FlowFixMe return { nodeType: nodeType, type: type, key: key, ref: ref, source: source, name: name, props: props, state: state, context: context, children: children, text: text, updater: updater, publicInstance: publicInstance, memoizedInteractions: memoizedInteractions, // Profiler data actualDuration: actualDuration, actualStartTime: actualStartTime, treeBaseDuration: treeBaseDuration }; } function setInProps(fiber, path, value) { var inst = fiber.stateNode; fiber.pendingProps = copyWithSet(inst.props, path, value); if (fiber.alternate) { // We don't know which fiber is the current one because DevTools may bail out of getDataFiber() call, // and so the data object may refer to another version of the fiber. Therefore we update pendingProps // on both. I hope that this is safe. fiber.alternate.pendingProps = fiber.pendingProps; } fiber.stateNode.forceUpdate(); } function setInState(inst, path, value) { setIn(inst.state, path, value); inst.forceUpdate(); } function setInContext(inst, path, value) { setIn(inst.context, path, value); inst.forceUpdate(); } function setIn(obj, path, value) { var last = path.pop(); var parent = path.reduce(function (obj_, attr) { return obj_ ? obj_[attr] : null; }, obj); if (parent) { parent[last] = value; } } // This is a slightly annoying indirection. // It is currently necessary because DevTools wants // to use unique objects as keys for instances. // However fibers have two versions. // We use this set to remember first encountered fiber for // each conceptual instance. var opaqueNodes = new Set(); function getOpaqueNode(fiber) { if (opaqueNodes.has(fiber)) { return fiber; } var alternate = fiber.alternate; if (alternate != null && opaqueNodes.has(alternate)) { return alternate; } opaqueNodes.add(fiber); return fiber; } function hasDataChanged(prevFiber, nextFiber) { switch (nextFiber.tag) { case ClassComponent: case FunctionalComponent: case ContextConsumer: // For types that execute user code, we check PerformedWork effect. // We don't reflect bailouts (either referential or sCU) in DevTools. // eslint-disable-next-line no-bitwise return (nextFiber.effectTag & PerformedWork) === PerformedWork; // Note: ContextConsumer only gets PerformedWork effect in 16.3.3+ // so it won't get highlighted with React 16.3.0 to 16.3.2. default: // For host components and other types, we compare inputs // to determine whether something is an update. return prevFiber.memoizedProps !== nextFiber.memoizedProps || prevFiber.memoizedState !== nextFiber.memoizedState || prevFiber.ref !== nextFiber.ref; } } function haveProfilerTimesChanged(prevFiber, nextFiber) { return prevFiber.actualDuration !== undefined && ( // Short-circuit check for non-profiling builds prevFiber.actualDuration !== nextFiber.actualDuration || prevFiber.actualStartTime !== nextFiber.actualStartTime || prevFiber.treeBaseDuration !== nextFiber.treeBaseDuration); } var pendingEvents = []; function flushPendingEvents() { var events = pendingEvents; pendingEvents = []; for (var i = 0; i < events.length; i++) { var event = events[i]; hook.emit(event.type, event); } } function enqueueMount(fiber) { pendingEvents.push({ internalInstance: getOpaqueNode(fiber), data: getDataFiber(fiber), renderer: rid, type: 'mount' }); var isRoot = fiber.tag === HostRoot; if (isRoot) { pendingEvents.push({ internalInstance: getOpaqueNode(fiber), renderer: rid, type: 'root' }); } } function enqueueUpdateIfNecessary(fiber, hasChildOrderChanged) { if (!hasChildOrderChanged && !hasDataChanged(fiber.alternate, fiber)) { // If only timing information has changed, we still need to update the nodes. // But we can do it in a faster way since we know it's safe to skip the children. // It's also important to avoid emitting an "update" signal for the node in this case, // Since that would indicate to the Profiler that it was part of the "commit" when it wasn't. if (haveProfilerTimesChanged(fiber.alternate, fiber)) { pendingEvents.push({ internalInstance: getOpaqueNode(fiber), data: getDataFiber(fiber), renderer: rid, type: 'updateProfileTimes' }); } return; } pendingEvents.push({ internalInstance: getOpaqueNode(fiber), data: getDataFiber(fiber), renderer: rid, type: 'update' }); } function enqueueUnmount(fiber) { var isRoot = fiber.tag === HostRoot; var opaqueNode = getOpaqueNode(fiber); var event = { internalInstance: opaqueNode, renderer: rid, type: 'unmount' }; if (isRoot) { pendingEvents.push(event); } else { // Non-root fibers are deleted during the commit phase. // They are deleted in the child-first order. However // DevTools currently expects deletions to be parent-first. // This is why we unshift deletions rather than push them. pendingEvents.unshift(event); } opaqueNodes.delete(opaqueNode); } function markRootCommitted(fiber) { pendingEvents.push({ internalInstance: getOpaqueNode(fiber), data: getDataFiber(fiber), renderer: rid, type: 'rootCommitted' }); } function mountFiber(fiber) { // Depth-first. // Logs mounting of children first, parents later. var node = fiber; outer: while (true) { if (node.child) { node.child.return = node; node = node.child; continue; } enqueueMount(node); if (node == fiber) { return; } if (node.sibling) { node.sibling.return = node.return; node = node.sibling; continue; } while (node.return) { node = node.return; enqueueMount(node); if (node == fiber) { return; } if (node.sibling) { node.sibling.return = node.return; node = node.sibling; continue outer; } } return; } } function updateFiber(nextFiber, prevFiber) { var hasChildOrderChanged = false; if (nextFiber.child !== prevFiber.child) { // If the first child is different, we need to traverse them. // Each next child will be either a new child (mount) or an alternate (update). var nextChild = nextFiber.child; var prevChildAtSameIndex = prevFiber.child; while (nextChild) { // We already know children will be referentially different because // they are either new mounts or alternates of previous children. // Schedule updates and mounts depending on whether alternates exist. // We don't track deletions here because they are reported separately. if (nextChild.alternate) { var prevChild = nextChild.alternate; updateFiber(nextChild, prevChild); // However we also keep track if the order of the children matches // the previous order. They are always different referentially, but // if the instances line up conceptually we'll want to know that. if (!hasChildOrderChanged && prevChild !== prevChildAtSameIndex) { hasChildOrderChanged = true; } } else { mountFiber(nextChild); if (!hasChildOrderChanged) { hasChildOrderChanged = true; } } // Try the next child. nextChild = nextChild.sibling; // Advance the pointer in the previous list so that we can // keep comparing if they line up. if (!hasChildOrderChanged && prevChildAtSameIndex != null) { prevChildAtSameIndex = prevChildAtSameIndex.sibling; } } // If we have no more children, but used to, they don't line up. if (!hasChildOrderChanged && prevChildAtSameIndex != null) { hasChildOrderChanged = true; } } enqueueUpdateIfNecessary(nextFiber, hasChildOrderChanged); } function walkTree() { hook.getFiberRoots(rid).forEach(function (root) { // Hydrate all the roots for the first time. mountFiber(root.current); markRootCommitted(root.current); }); flushPendingEvents(); } function cleanup() { // We don't patch any methods so there is no cleanup. } function handleCommitFiberUnmount(fiber) { // This is not recursive. // We can't traverse fibers after unmounting so instead // we rely on React telling us about each unmount. // It will be flushed after the root is committed. enqueueUnmount(fiber); } function handleCommitFiberRoot(root) { var current = root.current; var alternate = current.alternate; if (alternate) { // TODO: relying on this seems a bit fishy. var wasMounted = alternate.memoizedState != null && alternate.memoizedState.element != null; var isMounted = current.memoizedState != null && current.memoizedState.element != null; if (!wasMounted && isMounted) { // Mount a new root. mountFiber(current); } else if (wasMounted && isMounted) { // Update an existing root. updateFiber(current, alternate); } else if (wasMounted && !isMounted) { // Unmount an existing root. enqueueUnmount(current); } } else { // Mount a new root. mountFiber(current); } markRootCommitted(current); // We're done here. flushPendingEvents(); } // The naming is confusing. // They deal with opaque nodes (fibers), not elements. function getNativeFromReactElement(fiber) { try { var opaqueNode = fiber; var hostInstance = renderer.findHostInstanceByFiber(opaqueNode); return hostInstance; } catch (err) { // The fiber might have unmounted by now. return null; } } function getReactElementFromNative(hostInstance) { var fiber = renderer.findFiberByHostInstance(hostInstance); if (fiber != null) { // TODO: type fibers. var opaqueNode = getOpaqueNode(fiber); return opaqueNode; } return null; } return { getNativeFromReactElement: getNativeFromReactElement, getReactElementFromNative: getReactElementFromNative, handleCommitFiberRoot: handleCommitFiberRoot, handleCommitFiberUnmount: handleCommitFiberUnmount, cleanup: cleanup, walkTree: walkTree }; } module.exports = attachRendererFiber; /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5))) /***/ }, /* 57 */ /***/ function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(process) {exports = module.exports = SemVer; // The debug function is excluded entirely from the minified version. /* nomin */ var debug; /* nomin */ if (typeof process === 'object' && /* nomin */ process.env && /* nomin */ process.env.NODE_DEBUG && /* nomin */ /\bsemver\b/i.test(process.env.NODE_DEBUG)) /* nomin */ debug = function() { /* nomin */ var args = Array.prototype.slice.call(arguments, 0); /* nomin */ args.unshift('SEMVER'); /* nomin */ console.log.apply(console, args); /* nomin */ }; /* nomin */ else /* nomin */ debug = function() {}; // Note: this is the semver.org version of the spec that it implements // Not necessarily the package version of this code. exports.SEMVER_SPEC_VERSION = '2.0.0'; var MAX_LENGTH = 256; var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || 9007199254740991; // Max safe segment length for coercion. var MAX_SAFE_COMPONENT_LENGTH = 16; // The actual regexps go on exports.re var re = exports.re = []; var src = exports.src = []; var R = 0; // The following Regular Expressions can be used for tokenizing, // validating, and parsing SemVer version strings. // ## Numeric Identifier // A single `0`, or a non-zero digit followed by zero or more digits. var NUMERICIDENTIFIER = R++; src[NUMERICIDENTIFIER] = '0|[1-9]\\d*'; var NUMERICIDENTIFIERLOOSE = R++; src[NUMERICIDENTIFIERLOOSE] = '[0-9]+'; // ## Non-numeric Identifier // Zero or more digits, followed by a letter or hyphen, and then zero or // more letters, digits, or hyphens. var NONNUMERICIDENTIFIER = R++; src[NONNUMERICIDENTIFIER] = '\\d*[a-zA-Z-][a-zA-Z0-9-]*'; // ## Main Version // Three dot-separated numeric identifiers. var MAINVERSION = R++; src[MAINVERSION] = '(' + src[NUMERICIDENTIFIER] + ')\\.' + '(' + src[NUMERICIDENTIFIER] + ')\\.' + '(' + src[NUMERICIDENTIFIER] + ')'; var MAINVERSIONLOOSE = R++; src[MAINVERSIONLOOSE] = '(' + src[NUMERICIDENTIFIERLOOSE] + ')\\.' + '(' + src[NUMERICIDENTIFIERLOOSE] + ')\\.' + '(' + src[NUMERICIDENTIFIERLOOSE] + ')'; // ## Pre-release Version Identifier // A numeric identifier, or a non-numeric identifier. var PRERELEASEIDENTIFIER = R++; src[PRERELEASEIDENTIFIER] = '(?:' + src[NUMERICIDENTIFIER] + '|' + src[NONNUMERICIDENTIFIER] + ')'; var PRERELEASEIDENTIFIERLOOSE = R++; src[PRERELEASEIDENTIFIERLOOSE] = '(?:' + src[NUMERICIDENTIFIERLOOSE] + '|' + src[NONNUMERICIDENTIFIER] + ')'; // ## Pre-release Version // Hyphen, followed by one or more dot-separated pre-release version // identifiers. var PRERELEASE = R++; src[PRERELEASE] = '(?:-(' + src[PRERELEASEIDENTIFIER] + '(?:\\.' + src[PRERELEASEIDENTIFIER] + ')*))'; var PRERELEASELOOSE = R++; src[PRERELEASELOOSE] = '(?:-?(' + src[PRERELEASEIDENTIFIERLOOSE] + '(?:\\.' + src[PRERELEASEIDENTIFIERLOOSE] + ')*))'; // ## Build Metadata Identifier // Any combination of digits, letters, or hyphens. var BUILDIDENTIFIER = R++; src[BUILDIDENTIFIER] = '[0-9A-Za-z-]+'; // ## Build Metadata // Plus sign, followed by one or more period-separated build metadata // identifiers. var BUILD = R++; src[BUILD] = '(?:\\+(' + src[BUILDIDENTIFIER] + '(?:\\.' + src[BUILDIDENTIFIER] + ')*))'; // ## Full Version String // A main version, followed optionally by a pre-release version and // build metadata. // Note that the only major, minor, patch, and pre-release sections of // the version string are capturing groups. The build metadata is not a // capturing group, because it should not ever be used in version // comparison. var FULL = R++; var FULLPLAIN = 'v?' + src[MAINVERSION] + src[PRERELEASE] + '?' + src[BUILD] + '?'; src[FULL] = '^' + FULLPLAIN + '$'; // like full, but allows v1.2.3 and =1.2.3, which people do sometimes. // also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty // common in the npm registry. var LOOSEPLAIN = '[v=\\s]*' + src[MAINVERSIONLOOSE] + src[PRERELEASELOOSE] + '?' + src[BUILD] + '?'; var LOOSE = R++; src[LOOSE] = '^' + LOOSEPLAIN + '$'; var GTLT = R++; src[GTLT] = '((?:<|>)?=?)'; // Something like "2.*" or "1.2.x". // Note that "x.x" is a valid xRange identifer, meaning "any version" // Only the first item is strictly required. var XRANGEIDENTIFIERLOOSE = R++; src[XRANGEIDENTIFIERLOOSE] = src[NUMERICIDENTIFIERLOOSE] + '|x|X|\\*'; var XRANGEIDENTIFIER = R++; src[XRANGEIDENTIFIER] = src[NUMERICIDENTIFIER] + '|x|X|\\*'; var XRANGEPLAIN = R++; src[XRANGEPLAIN] = '[v=\\s]*(' + src[XRANGEIDENTIFIER] + ')' + '(?:\\.(' + src[XRANGEIDENTIFIER] + ')' + '(?:\\.(' + src[XRANGEIDENTIFIER] + ')' + '(?:' + src[PRERELEASE] + ')?' + src[BUILD] + '?' + ')?)?'; var XRANGEPLAINLOOSE = R++; src[XRANGEPLAINLOOSE] = '[v=\\s]*(' + src[XRANGEIDENTIFIERLOOSE] + ')' + '(?:\\.(' + src[XRANGEIDENTIFIERLOOSE] + ')' + '(?:\\.(' + src[XRANGEIDENTIFIERLOOSE] + ')' + '(?:' + src[PRERELEASELOOSE] + ')?' + src[BUILD] + '?' + ')?)?'; var XRANGE = R++; src[XRANGE] = '^' + src[GTLT] + '\\s*' + src[XRANGEPLAIN] + '$'; var XRANGELOOSE = R++; src[XRANGELOOSE] = '^' + src[GTLT] + '\\s*' + src[XRANGEPLAINLOOSE] + '$'; // Coercion. // Extract anything that could conceivably be a part of a valid semver var COERCE = R++; src[COERCE] = '(?:^|[^\\d])' + '(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '})' + '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' + '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' + '(?:$|[^\\d])'; // Tilde ranges. // Meaning is "reasonably at or greater than" var LONETILDE = R++; src[LONETILDE] = '(?:~>?)'; var TILDETRIM = R++; src[TILDETRIM] = '(\\s*)' + src[LONETILDE] + '\\s+'; re[TILDETRIM] = new RegExp(src[TILDETRIM], 'g'); var tildeTrimReplace = '$1~'; var TILDE = R++; src[TILDE] = '^' + src[LONETILDE] + src[XRANGEPLAIN] + '$'; var TILDELOOSE = R++; src[TILDELOOSE] = '^' + src[LONETILDE] + src[XRANGEPLAINLOOSE] + '$'; // Caret ranges. // Meaning is "at least and backwards compatible with" var LONECARET = R++; src[LONECARET] = '(?:\\^)'; var CARETTRIM = R++; src[CARETTRIM] = '(\\s*)' + src[LONECARET] + '\\s+'; re[CARETTRIM] = new RegExp(src[CARETTRIM], 'g'); var caretTrimReplace = '$1^'; var CARET = R++; src[CARET] = '^' + src[LONECARET] + src[XRANGEPLAIN] + '$'; var CARETLOOSE = R++; src[CARETLOOSE] = '^' + src[LONECARET] + src[XRANGEPLAINLOOSE] + '$'; // A simple gt/lt/eq thing, or just "" to indicate "any version" var COMPARATORLOOSE = R++; src[COMPARATORLOOSE] = '^' + src[GTLT] + '\\s*(' + LOOSEPLAIN + ')$|^$'; var COMPARATOR = R++; src[COMPARATOR] = '^' + src[GTLT] + '\\s*(' + FULLPLAIN + ')$|^$'; // An expression to strip any whitespace between the gtlt and the thing // it modifies, so that `> 1.2.3` ==> `>1.2.3` var COMPARATORTRIM = R++; src[COMPARATORTRIM] = '(\\s*)' + src[GTLT] + '\\s*(' + LOOSEPLAIN + '|' + src[XRANGEPLAIN] + ')'; // this one has to use the /g flag re[COMPARATORTRIM] = new RegExp(src[COMPARATORTRIM], 'g'); var comparatorTrimReplace = '$1$2$3'; // Something like `1.2.3 - 1.2.4` // Note that these all use the loose form, because they'll be // checked against either the strict or loose comparator form // later. var HYPHENRANGE = R++; src[HYPHENRANGE] = '^\\s*(' + src[XRANGEPLAIN] + ')' + '\\s+-\\s+' + '(' + src[XRANGEPLAIN] + ')' + '\\s*$'; var HYPHENRANGELOOSE = R++; src[HYPHENRANGELOOSE] = '^\\s*(' + src[XRANGEPLAINLOOSE] + ')' + '\\s+-\\s+' + '(' + src[XRANGEPLAINLOOSE] + ')' + '\\s*$'; // Star ranges basically just allow anything at all. var STAR = R++; src[STAR] = '(<|>)?=?\\s*\\*'; // Compile to actual regexp objects. // All are flag-free, unless they were created above with a flag. for (var i = 0; i < R; i++) { debug(i, src[i]); if (!re[i]) re[i] = new RegExp(src[i]); } exports.parse = parse; function parse(version, loose) { if (version instanceof SemVer) return version; if (typeof version !== 'string') return null; if (version.length > MAX_LENGTH) return null; var r = loose ? re[LOOSE] : re[FULL]; if (!r.test(version)) return null; try { return new SemVer(version, loose); } catch (er) { return null; } } exports.valid = valid; function valid(version, loose) { var v = parse(version, loose); return v ? v.version : null; } exports.clean = clean; function clean(version, loose) { var s = parse(version.trim().replace(/^[=v]+/, ''), loose); return s ? s.version : null; } exports.SemVer = SemVer; function SemVer(version, loose) { if (version instanceof SemVer) { if (version.loose === loose) return version; else version = version.version; } else if (typeof version !== 'string') { throw new TypeError('Invalid Version: ' + version); } if (version.length > MAX_LENGTH) throw new TypeError('version is longer than ' + MAX_LENGTH + ' characters') if (!(this instanceof SemVer)) return new SemVer(version, loose); debug('SemVer', version, loose); this.loose = loose; var m = version.trim().match(loose ? re[LOOSE] : re[FULL]); if (!m) throw new TypeError('Invalid Version: ' + version); this.raw = version; // these are actually numbers this.major = +m[1]; this.minor = +m[2]; this.patch = +m[3]; if (this.major > MAX_SAFE_INTEGER || this.major < 0) throw new TypeError('Invalid major version') if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) throw new TypeError('Invalid minor version') if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) throw new TypeError('Invalid patch version') // numberify any prerelease numeric ids if (!m[4]) this.prerelease = []; else this.prerelease = m[4].split('.').map(function(id) { if (/^[0-9]+$/.test(id)) { var num = +id; if (num >= 0 && num < MAX_SAFE_INTEGER) return num; } return id; }); this.build = m[5] ? m[5].split('.') : []; this.format(); } SemVer.prototype.format = function() { this.version = this.major + '.' + this.minor + '.' + this.patch; if (this.prerelease.length) this.version += '-' + this.prerelease.join('.'); return this.version; }; SemVer.prototype.toString = function() { return this.version; }; SemVer.prototype.compare = function(other) { debug('SemVer.compare', this.version, this.loose, other); if (!(other instanceof SemVer)) other = new SemVer(other, this.loose); return this.compareMain(other) || this.comparePre(other); }; SemVer.prototype.compareMain = function(other) { if (!(other instanceof SemVer)) other = new SemVer(other, this.loose); return compareIdentifiers(this.major, other.major) || compareIdentifiers(this.minor, other.minor) || compareIdentifiers(this.patch, other.patch); }; SemVer.prototype.comparePre = function(other) { if (!(other instanceof SemVer)) other = new SemVer(other, this.loose); // NOT having a prerelease is > having one if (this.prerelease.length && !other.prerelease.length) return -1; else if (!this.prerelease.length && other.prerelease.length) return 1; else if (!this.prerelease.length && !other.prerelease.length) return 0; var i = 0; do { var a = this.prerelease[i]; var b = other.prerelease[i]; debug('prerelease compare', i, a, b); if (a === undefined && b === undefined) return 0; else if (b === undefined) return 1; else if (a === undefined) return -1; else if (a === b) continue; else return compareIdentifiers(a, b); } while (++i); }; // preminor will bump the version up to the next minor release, and immediately // down to pre-release. premajor and prepatch work the same way. SemVer.prototype.inc = function(release, identifier) { switch (release) { case 'premajor': this.prerelease.length = 0; this.patch = 0; this.minor = 0; this.major++; this.inc('pre', identifier); break; case 'preminor': this.prerelease.length = 0; this.patch = 0; this.minor++; this.inc('pre', identifier); break; case 'prepatch': // If this is already a prerelease, it will bump to the next version // drop any prereleases that might already exist, since they are not // relevant at this point. this.prerelease.length = 0; this.inc('patch', identifier); this.inc('pre', identifier); break; // If the input is a non-prerelease version, this acts the same as // prepatch. case 'prerelease': if (this.prerelease.length === 0) this.inc('patch', identifier); this.inc('pre', identifier); break; case 'major': // If this is a pre-major version, bump up to the same major version. // Otherwise increment major. // 1.0.0-5 bumps to 1.0.0 // 1.1.0 bumps to 2.0.0 if (this.minor !== 0 || this.patch !== 0 || this.prerelease.length === 0) this.major++; this.minor = 0; this.patch = 0; this.prerelease = []; break; case 'minor': // If this is a pre-minor version, bump up to the same minor version. // Otherwise increment minor. // 1.2.0-5 bumps to 1.2.0 // 1.2.1 bumps to 1.3.0 if (this.patch !== 0 || this.prerelease.length === 0) this.minor++; this.patch = 0; this.prerelease = []; break; case 'patch': // If this is not a pre-release version, it will increment the patch. // If it is a pre-release it will bump up to the same patch version. // 1.2.0-5 patches to 1.2.0 // 1.2.0 patches to 1.2.1 if (this.prerelease.length === 0) this.patch++; this.prerelease = []; break; // This probably shouldn't be used publicly. // 1.0.0 "pre" would become 1.0.0-0 which is the wrong direction. case 'pre': if (this.prerelease.length === 0) this.prerelease = [0]; else { var i = this.prerelease.length; while (--i >= 0) { if (typeof this.prerelease[i] === 'number') { this.prerelease[i]++; i = -2; } } if (i === -1) // didn't increment anything this.prerelease.push(0); } if (identifier) { // 1.2.0-beta.1 bumps to 1.2.0-beta.2, // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0 if (this.prerelease[0] === identifier) { if (isNaN(this.prerelease[1])) this.prerelease = [identifier, 0]; } else this.prerelease = [identifier, 0]; } break; default: throw new Error('invalid increment argument: ' + release); } this.format(); this.raw = this.version; return this; }; exports.inc = inc; function inc(version, release, loose, identifier) { if (typeof(loose) === 'string') { identifier = loose; loose = undefined; } try { return new SemVer(version, loose).inc(release, identifier).version; } catch (er) { return null; } } exports.diff = diff; function diff(version1, version2) { if (eq(version1, version2)) { return null; } else { var v1 = parse(version1); var v2 = parse(version2); if (v1.prerelease.length || v2.prerelease.length) { for (var key in v1) { if (key === 'major' || key === 'minor' || key === 'patch') { if (v1[key] !== v2[key]) { return 'pre'+key; } } } return 'prerelease'; } for (var key in v1) { if (key === 'major' || key === 'minor' || key === 'patch') { if (v1[key] !== v2[key]) { return key; } } } } } exports.compareIdentifiers = compareIdentifiers; var numeric = /^[0-9]+$/; function compareIdentifiers(a, b) { var anum = numeric.test(a); var bnum = numeric.test(b); if (anum && bnum) { a = +a; b = +b; } return (anum && !bnum) ? -1 : (bnum && !anum) ? 1 : a < b ? -1 : a > b ? 1 : 0; } exports.rcompareIdentifiers = rcompareIdentifiers; function rcompareIdentifiers(a, b) { return compareIdentifiers(b, a); } exports.major = major; function major(a, loose) { return new SemVer(a, loose).major; } exports.minor = minor; function minor(a, loose) { return new SemVer(a, loose).minor; } exports.patch = patch; function patch(a, loose) { return new SemVer(a, loose).patch; } exports.compare = compare; function compare(a, b, loose) { return new SemVer(a, loose).compare(new SemVer(b, loose)); } exports.compareLoose = compareLoose; function compareLoose(a, b) { return compare(a, b, true); } exports.rcompare = rcompare; function rcompare(a, b, loose) { return compare(b, a, loose); } exports.sort = sort; function sort(list, loose) { return list.sort(function(a, b) { return exports.compare(a, b, loose); }); } exports.rsort = rsort; function rsort(list, loose) { return list.sort(function(a, b) { return exports.rcompare(a, b, loose); }); } exports.gt = gt; function gt(a, b, loose) { return compare(a, b, loose) > 0; } exports.lt = lt; function lt(a, b, loose) { return compare(a, b, loose) < 0; } exports.eq = eq; function eq(a, b, loose) { return compare(a, b, loose) === 0; } exports.neq = neq; function neq(a, b, loose) { return compare(a, b, loose) !== 0; } exports.gte = gte; function gte(a, b, loose) { return compare(a, b, loose) >= 0; } exports.lte = lte; function lte(a, b, loose) { return compare(a, b, loose) <= 0; } exports.cmp = cmp; function cmp(a, op, b, loose) { var ret; switch (op) { case '===': if (typeof a === 'object') a = a.version; if (typeof b === 'object') b = b.version; ret = a === b; break; case '!==': if (typeof a === 'object') a = a.version; if (typeof b === 'object') b = b.version; ret = a !== b; break; case '': case '=': case '==': ret = eq(a, b, loose); break; case '!=': ret = neq(a, b, loose); break; case '>': ret = gt(a, b, loose); break; case '>=': ret = gte(a, b, loose); break; case '<': ret = lt(a, b, loose); break; case '<=': ret = lte(a, b, loose); break; default: throw new TypeError('Invalid operator: ' + op); } return ret; } exports.Comparator = Comparator; function Comparator(comp, loose) { if (comp instanceof Comparator) { if (comp.loose === loose) return comp; else comp = comp.value; } if (!(this instanceof Comparator)) return new Comparator(comp, loose); debug('comparator', comp, loose); this.loose = loose; this.parse(comp); if (this.semver === ANY) this.value = ''; else this.value = this.operator + this.semver.version; debug('comp', this); } var ANY = {}; Comparator.prototype.parse = function(comp) { var r = this.loose ? re[COMPARATORLOOSE] : re[COMPARATOR]; var m = comp.match(r); if (!m) throw new TypeError('Invalid comparator: ' + comp); this.operator = m[1]; if (this.operator === '=') this.operator = ''; // if it literally is just '>' or '' then allow anything. if (!m[2]) this.semver = ANY; else this.semver = new SemVer(m[2], this.loose); }; Comparator.prototype.toString = function() { return this.value; }; Comparator.prototype.test = function(version) { debug('Comparator.test', version, this.loose); if (this.semver === ANY) return true; if (typeof version === 'string') version = new SemVer(version, this.loose); return cmp(version, this.operator, this.semver, this.loose); }; Comparator.prototype.intersects = function(comp, loose) { if (!(comp instanceof Comparator)) { throw new TypeError('a Comparator is required'); } var rangeTmp; if (this.operator === '') { rangeTmp = new Range(comp.value, loose); return satisfies(this.value, rangeTmp, loose); } else if (comp.operator === '') { rangeTmp = new Range(this.value, loose); return satisfies(comp.semver, rangeTmp, loose); } var sameDirectionIncreasing = (this.operator === '>=' || this.operator === '>') && (comp.operator === '>=' || comp.operator === '>'); var sameDirectionDecreasing = (this.operator === '<=' || this.operator === '<') && (comp.operator === '<=' || comp.operator === '<'); var sameSemVer = this.semver.version === comp.semver.version; var differentDirectionsInclusive = (this.operator === '>=' || this.operator === '<=') && (comp.operator === '>=' || comp.operator === '<='); var oppositeDirectionsLessThan = cmp(this.semver, '<', comp.semver, loose) && ((this.operator === '>=' || this.operator === '>') && (comp.operator === '<=' || comp.operator === '<')); var oppositeDirectionsGreaterThan = cmp(this.semver, '>', comp.semver, loose) && ((this.operator === '<=' || this.operator === '<') && (comp.operator === '>=' || comp.operator === '>')); return sameDirectionIncreasing || sameDirectionDecreasing || (sameSemVer && differentDirectionsInclusive) || oppositeDirectionsLessThan || oppositeDirectionsGreaterThan; }; exports.Range = Range; function Range(range, loose) { if (range instanceof Range) { if (range.loose === loose) { return range; } else { return new Range(range.raw, loose); } } if (range instanceof Comparator) { return new Range(range.value, loose); } if (!(this instanceof Range)) return new Range(range, loose); this.loose = loose; // First, split based on boolean or || this.raw = range; this.set = range.split(/\s*\|\|\s*/).map(function(range) { return this.parseRange(range.trim()); }, this).filter(function(c) { // throw out any that are not relevant for whatever reason return c.length; }); if (!this.set.length) { throw new TypeError('Invalid SemVer Range: ' + range); } this.format(); } Range.prototype.format = function() { this.range = this.set.map(function(comps) { return comps.join(' ').trim(); }).join('||').trim(); return this.range; }; Range.prototype.toString = function() { return this.range; }; Range.prototype.parseRange = function(range) { var loose = this.loose; range = range.trim(); debug('range', range, loose); // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4` var hr = loose ? re[HYPHENRANGELOOSE] : re[HYPHENRANGE]; range = range.replace(hr, hyphenReplace); debug('hyphen replace', range); // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5` range = range.replace(re[COMPARATORTRIM], comparatorTrimReplace); debug('comparator trim', range, re[COMPARATORTRIM]); // `~ 1.2.3` => `~1.2.3` range = range.replace(re[TILDETRIM], tildeTrimReplace); // `^ 1.2.3` => `^1.2.3` range = range.replace(re[CARETTRIM], caretTrimReplace); // normalize spaces range = range.split(/\s+/).join(' '); // At this point, the range is completely trimmed and // ready to be split into comparators. var compRe = loose ? re[COMPARATORLOOSE] : re[COMPARATOR]; var set = range.split(' ').map(function(comp) { return parseComparator(comp, loose); }).join(' ').split(/\s+/); if (this.loose) { // in loose mode, throw out any that are not valid comparators set = set.filter(function(comp) { return !!comp.match(compRe); }); } set = set.map(function(comp) { return new Comparator(comp, loose); }); return set; }; Range.prototype.intersects = function(range, loose) { if (!(range instanceof Range)) { throw new TypeError('a Range is required'); } return this.set.some(function(thisComparators) { return thisComparators.every(function(thisComparator) { return range.set.some(function(rangeComparators) { return rangeComparators.every(function(rangeComparator) { return thisComparator.intersects(rangeComparator, loose); }); }); }); }); }; // Mostly just for testing and legacy API reasons exports.toComparators = toComparators; function toComparators(range, loose) { return new Range(range, loose).set.map(function(comp) { return comp.map(function(c) { return c.value; }).join(' ').trim().split(' '); }); } // comprised of xranges, tildes, stars, and gtlt's at this point. // already replaced the hyphen ranges // turn into a set of JUST comparators. function parseComparator(comp, loose) { debug('comp', comp); comp = replaceCarets(comp, loose); debug('caret', comp); comp = replaceTildes(comp, loose); debug('tildes', comp); comp = replaceXRanges(comp, loose); debug('xrange', comp); comp = replaceStars(comp, loose); debug('stars', comp); return comp; } function isX(id) { return !id || id.toLowerCase() === 'x' || id === '*'; } // ~, ~> --> * (any, kinda silly) // ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0 // ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0 // ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0 // ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0 // ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0 function replaceTildes(comp, loose) { return comp.trim().split(/\s+/).map(function(comp) { return replaceTilde(comp, loose); }).join(' '); } function replaceTilde(comp, loose) { var r = loose ? re[TILDELOOSE] : re[TILDE]; return comp.replace(r, function(_, M, m, p, pr) { debug('tilde', comp, _, M, m, p, pr); var ret; if (isX(M)) ret = ''; else if (isX(m)) ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'; else if (isX(p)) // ~1.2 == >=1.2.0 <1.3.0 ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'; else if (pr) { debug('replaceTilde pr', pr); if (pr.charAt(0) !== '-') pr = '-' + pr; ret = '>=' + M + '.' + m + '.' + p + pr + ' <' + M + '.' + (+m + 1) + '.0'; } else // ~1.2.3 == >=1.2.3 <1.3.0 ret = '>=' + M + '.' + m + '.' + p + ' <' + M + '.' + (+m + 1) + '.0'; debug('tilde return', ret); return ret; }); } // ^ --> * (any, kinda silly) // ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0 // ^2.0, ^2.0.x --> >=2.0.0 <3.0.0 // ^1.2, ^1.2.x --> >=1.2.0 <2.0.0 // ^1.2.3 --> >=1.2.3 <2.0.0 // ^1.2.0 --> >=1.2.0 <2.0.0 function replaceCarets(comp, loose) { return comp.trim().split(/\s+/).map(function(comp) { return replaceCaret(comp, loose); }).join(' '); } function replaceCaret(comp, loose) { debug('caret', comp, loose); var r = loose ? re[CARETLOOSE] : re[CARET]; return comp.replace(r, function(_, M, m, p, pr) { debug('caret', comp, _, M, m, p, pr); var ret; if (isX(M)) ret = ''; else if (isX(m)) ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'; else if (isX(p)) { if (M === '0') ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'; else ret = '>=' + M + '.' + m + '.0 <' + (+M + 1) + '.0.0'; } else if (pr) { debug('replaceCaret pr', pr); if (pr.charAt(0) !== '-') pr = '-' + pr; if (M === '0') { if (m === '0') ret = '>=' + M + '.' + m + '.' + p + pr + ' <' + M + '.' + m + '.' + (+p + 1); else ret = '>=' + M + '.' + m + '.' + p + pr + ' <' + M + '.' + (+m + 1) + '.0'; } else ret = '>=' + M + '.' + m + '.' + p + pr + ' <' + (+M + 1) + '.0.0'; } else { debug('no pr'); if (M === '0') { if (m === '0') ret = '>=' + M + '.' + m + '.' + p + ' <' + M + '.' + m + '.' + (+p + 1); else ret = '>=' + M + '.' + m + '.' + p + ' <' + M + '.' + (+m + 1) + '.0'; } else ret = '>=' + M + '.' + m + '.' + p + ' <' + (+M + 1) + '.0.0'; } debug('caret return', ret); return ret; }); } function replaceXRanges(comp, loose) { debug('replaceXRanges', comp, loose); return comp.split(/\s+/).map(function(comp) { return replaceXRange(comp, loose); }).join(' '); } function replaceXRange(comp, loose) { comp = comp.trim(); var r = loose ? re[XRANGELOOSE] : re[XRANGE]; return comp.replace(r, function(ret, gtlt, M, m, p, pr) { debug('xRange', comp, ret, gtlt, M, m, p, pr); var xM = isX(M); var xm = xM || isX(m); var xp = xm || isX(p); var anyX = xp; if (gtlt === '=' && anyX) gtlt = ''; if (xM) { if (gtlt === '>' || gtlt === '<') { // nothing is allowed ret = '<0.0.0'; } else { // nothing is forbidden ret = '*'; } } else if (gtlt && anyX) { // replace X with 0 if (xm) m = 0; if (xp) p = 0; if (gtlt === '>') { // >1 => >=2.0.0 // >1.2 => >=1.3.0 // >1.2.3 => >= 1.2.4 gtlt = '>='; if (xm) { M = +M + 1; m = 0; p = 0; } else if (xp) { m = +m + 1; p = 0; } } else if (gtlt === '<=') { // <=0.7.x is actually <0.8.0, since any 0.7.x should // pass. Similarly, <=7.x is actually <8.0.0, etc. gtlt = '<'; if (xm) M = +M + 1; else m = +m + 1; } ret = gtlt + M + '.' + m + '.' + p; } else if (xm) { ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'; } else if (xp) { ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'; } debug('xRange return', ret); return ret; }); } // Because * is AND-ed with everything else in the comparator, // and '' means "any version", just remove the *s entirely. function replaceStars(comp, loose) { debug('replaceStars', comp, loose); // Looseness is ignored here. star is always as loose as it gets! return comp.trim().replace(re[STAR], ''); } // This function is passed to string.replace(re[HYPHENRANGE]) // M, m, patch, prerelease, build // 1.2 - 3.4.5 => >=1.2.0 <=3.4.5 // 1.2.3 - 3.4 => >=1.2.0 <3.5.0 Any 3.4.x will do // 1.2 - 3.4 => >=1.2.0 <3.5.0 function hyphenReplace($0, from, fM, fm, fp, fpr, fb, to, tM, tm, tp, tpr, tb) { if (isX(fM)) from = ''; else if (isX(fm)) from = '>=' + fM + '.0.0'; else if (isX(fp)) from = '>=' + fM + '.' + fm + '.0'; else from = '>=' + from; if (isX(tM)) to = ''; else if (isX(tm)) to = '<' + (+tM + 1) + '.0.0'; else if (isX(tp)) to = '<' + tM + '.' + (+tm + 1) + '.0'; else if (tpr) to = '<=' + tM + '.' + tm + '.' + tp + '-' + tpr; else to = '<=' + to; return (from + ' ' + to).trim(); } // if ANY of the sets match ALL of its comparators, then pass Range.prototype.test = function(version) { if (!version) return false; if (typeof version === 'string') version = new SemVer(version, this.loose); for (var i = 0; i < this.set.length; i++) { if (testSet(this.set[i], version)) return true; } return false; }; function testSet(set, version) { for (var i = 0; i < set.length; i++) { if (!set[i].test(version)) return false; } if (version.prerelease.length) { // Find the set of versions that are allowed to have prereleases // For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0 // That should allow `1.2.3-pr.2` to pass. // However, `1.2.4-alpha.notready` should NOT be allowed, // even though it's within the range set by the comparators. for (var i = 0; i < set.length; i++) { debug(set[i].semver); if (set[i].semver === ANY) continue; if (set[i].semver.prerelease.length > 0) { var allowed = set[i].semver; if (allowed.major === version.major && allowed.minor === version.minor && allowed.patch === version.patch) return true; } } // Version has a -pre, but it's not one of the ones we like. return false; } return true; } exports.satisfies = satisfies; function satisfies(version, range, loose) { try { range = new Range(range, loose); } catch (er) { return false; } return range.test(version); } exports.maxSatisfying = maxSatisfying; function maxSatisfying(versions, range, loose) { var max = null; var maxSV = null; try { var rangeObj = new Range(range, loose); } catch (er) { return null; } versions.forEach(function (v) { if (rangeObj.test(v)) { // satisfies(v, range, loose) if (!max || maxSV.compare(v) === -1) { // compare(max, v, true) max = v; maxSV = new SemVer(max, loose); } } }) return max; } exports.minSatisfying = minSatisfying; function minSatisfying(versions, range, loose) { var min = null; var minSV = null; try { var rangeObj = new Range(range, loose); } catch (er) { return null; } versions.forEach(function (v) { if (rangeObj.test(v)) { // satisfies(v, range, loose) if (!min || minSV.compare(v) === 1) { // compare(min, v, true) min = v; minSV = new SemVer(min, loose); } } }) return min; } exports.validRange = validRange; function validRange(range, loose) { try { // Return '*' instead of '' so that truthiness works. // This will throw if it's invalid anyway return new Range(range, loose).range || '*'; } catch (er) { return null; } } // Determine if version is less than all the versions possible in the range exports.ltr = ltr; function ltr(version, range, loose) { return outside(version, range, '<', loose); } // Determine if version is greater than all the versions possible in the range. exports.gtr = gtr; function gtr(version, range, loose) { return outside(version, range, '>', loose); } exports.outside = outside; function outside(version, range, hilo, loose) { version = new SemVer(version, loose); range = new Range(range, loose); var gtfn, ltefn, ltfn, comp, ecomp; switch (hilo) { case '>': gtfn = gt; ltefn = lte; ltfn = lt; comp = '>'; ecomp = '>='; break; case '<': gtfn = lt; ltefn = gte; ltfn = gt; comp = '<'; ecomp = '<='; break; default: throw new TypeError('Must provide a hilo val of "<" or ">"'); } // If it satisifes the range it is not outside if (satisfies(version, range, loose)) { return false; } // From now on, variable terms are as if we're in "gtr" mode. // but note that everything is flipped for the "ltr" function. for (var i = 0; i < range.set.length; ++i) { var comparators = range.set[i]; var high = null; var low = null; comparators.forEach(function(comparator) { if (comparator.semver === ANY) { comparator = new Comparator('>=0.0.0') } high = high || comparator; low = low || comparator; if (gtfn(comparator.semver, high.semver, loose)) { high = comparator; } else if (ltfn(comparator.semver, low.semver, loose)) { low = comparator; } }); // If the edge version comparator has a operator then our version // isn't outside it if (high.operator === comp || high.operator === ecomp) { return false; } // If the lowest version comparator has an operator and our version // is less than it then it isn't higher than the range if ((!low.operator || low.operator === comp) && ltefn(version, low.semver)) { return false; } else if (low.operator === ecomp && ltfn(version, low.semver)) { return false; } } return true; } exports.prerelease = prerelease; function prerelease(version, loose) { var parsed = parse(version, loose); return (parsed && parsed.prerelease.length) ? parsed.prerelease : null; } exports.intersects = intersects; function intersects(r1, r2, loose) { r1 = new Range(r1, loose) r2 = new Range(r2, loose) return r1.intersects(r2) } exports.coerce = coerce; function coerce(version) { if (version instanceof SemVer) return version; if (typeof version !== 'string') return null; var match = version.match(re[COERCE]); if (match == null) return null; return parse((match[1] || '0') + '.' + (match[2] || '0') + '.' + (match[3] || '0')); } /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(54))) /***/ }, /* 58 */ /***/ function(module, exports, __webpack_require__) { /** * Copyright (c) 2015-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. * * */ 'use strict'; 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; }; 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 resolveBoxStyle = __webpack_require__(59); var styleOverridesByHostComponentId = {}; module.exports = function setupRNStyle(bridge, agent, resolveRNStyle) { bridge.onCall('rn-style:get', function (id) { var node = agent.elementData.get(id); if (!node || !node.props) { return null; } return resolveRNStyle(node.props.style); }); bridge.on('rn-style:measure', function (id) { measureStyle(agent, bridge, resolveRNStyle, id); }); bridge.on('rn-style:rename', function (_ref) { var id = _ref.id, oldName = _ref.oldName, newName = _ref.newName, val = _ref.val; renameStyle(agent, id, oldName, newName, val); setTimeout(function () { return measureStyle(agent, bridge, resolveRNStyle, id); }); }); bridge.on('rn-style:set', function (_ref2) { var id = _ref2.id, attr = _ref2.attr, val = _ref2.val; setStyle(agent, id, attr, val); setTimeout(function () { return measureStyle(agent, bridge, resolveRNStyle, id); }); }); }; var blank = { top: 0, left: 0, right: 0, bottom: 0 }; function measureStyle(agent, bridge, resolveRNStyle, id) { var node = agent.elementData.get(id); if (!node || !node.props) { bridge.send('rn-style:measure', {}); return; } var style = resolveRNStyle(node.props.style); // If it's a host component we edited before, amend styles. if (styleOverridesByHostComponentId[id]) { style = Object.assign({}, style, styleOverridesByHostComponentId[id]); } var instance = node.publicInstance; if (!instance || !instance.measure) { bridge.send('rn-style:measure', { style: style }); return; } instance.measure(function (x, y, width, height, left, top) { // RN Android sometimes returns undefined here. Don't send measurements in this case. // https://github.com/jhen0409/react-native-debugger/issues/84#issuecomment-304611817 if (typeof x !== 'number') { bridge.send('rn-style:measure', { style: style }); return; } var margin = style && resolveBoxStyle('margin', style) || blank; var padding = style && resolveBoxStyle('padding', style) || blank; bridge.send('rn-style:measure', { style: style, measuredLayout: { x: x, y: y, width: width, height: height, left: left, top: top, margin: margin, padding: padding } }); }); } function shallowClone(obj) { var nobj = {}; for (var n in obj) { nobj[n] = obj[n]; } return nobj; } function renameStyle(agent, id, oldName, newName, val) { var _ref3; var data = agent.elementData.get(id); var newStyle = newName ? (_ref3 = {}, _defineProperty(_ref3, oldName, undefined), _defineProperty(_ref3, newName, val), _ref3) : _defineProperty({}, oldName, undefined); if (data && data.updater && typeof data.updater.setInProps === 'function') { // First attempt: use setInProps(). // We do this for composite components, and it works relatively well. var style = data && data.props && data.props.style; var customStyle; if (Array.isArray(style)) { var lastLength = style.length - 1; if (_typeof(style[lastLength]) === 'object' && !Array.isArray(style[lastLength])) { customStyle = shallowClone(style[lastLength]); delete customStyle[oldName]; if (newName) { customStyle[newName] = val; } else { customStyle[oldName] = undefined; } // $FlowFixMe we know that updater is not null here data.updater.setInProps(['style', lastLength], customStyle); } else { style = style.concat([newStyle]); // $FlowFixMe we know that updater is not null here data.updater.setInProps(['style'], style); } } else { if ((typeof style === 'undefined' ? 'undefined' : _typeof(style)) === 'object') { customStyle = shallowClone(style); delete customStyle[oldName]; if (newName) { customStyle[newName] = val; } else { customStyle[oldName] = undefined; } // $FlowFixMe we know that updater is not null here data.updater.setInProps(['style'], customStyle); } else { style = [style, newStyle]; data.updater.setInProps(['style'], style); } } } else if (data && data.updater && typeof data.updater.setNativeProps === 'function') { // Fallback: use setNativeProps(). We're dealing with a host component. // Remember to "correct" resolved styles when we read them next time. if (!styleOverridesByHostComponentId[id]) { styleOverridesByHostComponentId[id] = newStyle; } else { Object.assign(styleOverridesByHostComponentId[id], newStyle); } data.updater.setNativeProps({ style: newStyle }); } else { return; } agent.emit('hideHighlight'); } function setStyle(agent, id, attr, val) { var data = agent.elementData.get(id); var newStyle = _defineProperty({}, attr, val); if (data && data.updater && typeof data.updater.setInProps === 'function') { // First attempt: use setInProps(). // We do this for composite components, and it works relatively well. var style = data.props && data.props.style; if (Array.isArray(style)) { var lastLength = style.length - 1; if (_typeof(style[lastLength]) === 'object' && !Array.isArray(style[lastLength])) { // $FlowFixMe we know that updater is not null here data.updater.setInProps(['style', lastLength, attr], val); } else { style = style.concat([newStyle]); // $FlowFixMe we know that updater is not null here data.updater.setInProps(['style'], style); } } else { style = [style, newStyle]; data.updater.setInProps(['style'], style); } } else if (data && data.updater && typeof data.updater.setNativeProps === 'function') { // Fallback: use setNativeProps(). We're dealing with a host component. // Remember to "correct" resolved styles when we read them next time. if (!styleOverridesByHostComponentId[id]) { styleOverridesByHostComponentId[id] = newStyle; } else { Object.assign(styleOverridesByHostComponentId[id], newStyle); } data.updater.setNativeProps({ style: newStyle }); } else { return; } agent.emit('hideHighlight'); } /***/ }, /* 59 */ /***/ function(module, exports) { 'use strict'; /** * Copyright (c) 2015-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. * * */ /** * This is mirror from * https://github.com/facebook/react-native/blob/master/Libraries/Inspector/resolveBoxStyle.js * * Resolve a style property into it's component parts, e.g. * * resolveBoxStyle('margin', {margin: 5, marginBottom: 10}) * -> * {top: 5, left: 5, right: 5, bottom: 10} * * If none are set, returns false. */ function resolveBoxStyle(prefix, style) { var res = {}; var subs = ['top', 'left', 'bottom', 'right']; var set = false; subs.forEach(function (sub) { res[sub] = style[prefix] || 0; }); if (style[prefix]) { set = true; } if (style[prefix + 'Vertical']) { res.top = res.bottom = style[prefix + 'Vertical']; set = true; } if (style[prefix + 'Horizontal']) { res.left = res.right = style[prefix + 'Horizontal']; set = true; } subs.forEach(function (sub) { var val = style[prefix + capFirst(sub)]; if (val) { res[sub] = val; set = true; } }); if (!set) { return null; } return res; } function capFirst(text) { return text[0].toUpperCase() + text.slice(1); } module.exports = resolveBoxStyle; /***/ }, /* 60 */ /***/ function(module, exports, __webpack_require__) { /** * Copyright (c) 2015-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. * * */ 'use strict'; var Highlighter = __webpack_require__(61); module.exports = function setup(agent) { var hl = new Highlighter(window, function (node) { agent.selectFromDOMNode(node); }); agent.on('highlight', function (data) { return hl.highlight(data.node, data.name); }); agent.on('highlightMany', function (nodes) { return hl.highlightMany(nodes); }); agent.on('hideHighlight', function () { return hl.hideHighlight(); }); agent.on('refreshMultiOverlay', function () { return hl.refreshMultiOverlay(); }); agent.on('startInspecting', function () { return hl.startInspecting(); }); agent.on('stopInspecting', function () { return hl.stopInspecting(); }); agent.on('shutdown', function () { hl.remove(); }); }; /***/ }, /* 61 */ /***/ function(module, exports, __webpack_require__) { /** * Copyright (c) 2015-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. * * */ 'use strict'; 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; }; }(); function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } var Overlay = __webpack_require__(62); var MultiOverlay = __webpack_require__(64); /** * Manages the highlighting of items on an html page, as well as * hover-to-inspect. */ var Highlighter = function () { function Highlighter(win, onSelect) { _classCallCheck(this, Highlighter); this._win = win; this._onSelect = onSelect; this._overlay = null; this._multiOverlay = null; this._subs = []; } _createClass(Highlighter, [{ key: 'startInspecting', value: function startInspecting() { this._inspecting = true; this._subs = [captureSubscription(this._win, 'mouseover', this.onHover.bind(this)), captureSubscription(this._win, 'mousedown', this.onMouseDown.bind(this)), captureSubscription(this._win, 'click', this.onClick.bind(this))]; } }, { key: 'stopInspecting', value: function stopInspecting() { this._subs.forEach(function (unsub) { return unsub(); }); this.hideHighlight(); } }, { key: 'remove', value: function remove() { this.stopInspecting(); if (this._button && this._button.parentNode) { this._button.parentNode.removeChild(this._button); } } }, { key: 'highlight', value: function highlight(node, name) { this.removeMultiOverlay(); if (node.nodeType !== Node.COMMENT_NODE) { if (!this._overlay) { this._overlay = new Overlay(this._win); } this._overlay.inspect(node, name); } } }, { key: 'highlightMany', value: function highlightMany(nodes) { this.removeOverlay(); if (!this._multiOverlay) { this._multiOverlay = new MultiOverlay(this._win); } this._multiOverlay.highlightMany(nodes); } }, { key: 'hideHighlight', value: function hideHighlight() { this._inspecting = false; this.removeOverlay(); this.removeMultiOverlay(); } }, { key: 'refreshMultiOverlay', value: function refreshMultiOverlay() { if (!this._multiOverlay) { return; } this._multiOverlay.refresh(); } }, { key: 'removeOverlay', value: function removeOverlay() { if (!this._overlay) { return; } this._overlay.remove(); this._overlay = null; } }, { key: 'removeMultiOverlay', value: function removeMultiOverlay() { if (!this._multiOverlay) { return; } this._multiOverlay.remove(); this._multiOverlay = null; } }, { key: 'onMouseDown', value: function onMouseDown(evt) { if (!this._inspecting) { return; } evt.preventDefault(); evt.stopPropagation(); evt.cancelBubble = true; this._onSelect(evt.target); } }, { key: 'onClick', value: function onClick(evt) { if (!this._inspecting) { return; } this._subs.forEach(function (unsub) { return unsub(); }); evt.preventDefault(); evt.stopPropagation(); evt.cancelBubble = true; this.hideHighlight(); } }, { key: 'onHover', value: function onHover(evt) { if (!this._inspecting) { return; } evt.preventDefault(); evt.stopPropagation(); evt.cancelBubble = true; this.highlight(evt.target); } }, { key: 'injectButton', value: function injectButton() { this._button = makeMagnifier(); this._button.onclick = this.startInspecting.bind(this); this._win.document.body.appendChild(this._button); } }]); return Highlighter; }(); function captureSubscription(obj, evt, cb) { obj.addEventListener(evt, cb, true); return function () { return obj.removeEventListener(evt, cb, true); }; } function makeMagnifier() { var button = window.document.createElement('button'); button.innerHTML = '🔍'; button.style.backgroundColor = 'transparent'; button.style.border = 'none'; button.style.outline = 'none'; button.style.cursor = 'pointer'; button.style.position = 'fixed'; button.style.bottom = '10px'; button.style.right = '10px'; button.style.fontSize = '30px'; button.style.zIndex = 10000000; return button; } module.exports = Highlighter; /***/ }, /* 62 */ /***/ function(module, exports, __webpack_require__) { /** * Copyright (c) 2015-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. * * */ 'use strict'; 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; }; }(); function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } var assign = __webpack_require__(7); var _require = __webpack_require__(63), monospace = _require.monospace; /** * Note that this component is not affected by the active Theme, * Because it highlights elements in the main Chrome window (outside of devtools). * The colors below were chosen to roughly match those used by Chrome devtools. */ var Overlay = function () { function Overlay(window) { _classCallCheck(this, Overlay); var doc = window.document; this.win = window; this.container = doc.createElement('div'); this.node = doc.createElement('div'); this.border = doc.createElement('div'); this.padding = doc.createElement('div'); this.content = doc.createElement('div'); this.border.style.borderColor = overlayStyles.border; this.padding.style.borderColor = overlayStyles.padding; this.content.style.backgroundColor = overlayStyles.background; assign(this.node.style, { borderColor: overlayStyles.margin, pointerEvents: 'none', position: 'fixed' }); this.tip = doc.createElement('div'); assign(this.tip.style, { backgroundColor: '#333740', borderRadius: '2px', fontFamily: monospace.family, fontWeight: 'bold', padding: '3px 5px', position: 'fixed', fontSize: monospace.sizes.normal + 'px' }); this.nameSpan = doc.createElement('span'); this.tip.appendChild(this.nameSpan); assign(this.nameSpan.style, { color: '#ee78e6', borderRight: '1px solid #aaaaaa', paddingRight: '0.5rem', marginRight: '0.5rem' }); this.dimSpan = doc.createElement('span'); this.tip.appendChild(this.dimSpan); assign(this.dimSpan.style, { color: '#d7d7d7' }); this.container.style.zIndex = 10000000; this.node.style.zIndex = 10000000; this.tip.style.zIndex = 10000000; this.container.appendChild(this.node); this.container.appendChild(this.tip); this.node.appendChild(this.border); this.border.appendChild(this.padding); this.padding.appendChild(this.content); doc.body.appendChild(this.container); } _createClass(Overlay, [{ key: 'remove', value: function remove() { if (this.container.parentNode) { this.container.parentNode.removeChild(this.container); } } }, { key: 'inspect', value: function inspect(node, name) { // We can't get the size of text nodes or comment nodes. React as of v15 // heavily uses comment nodes to delimit text. if (node.nodeType !== Node.ELEMENT_NODE) { return; } var box = getNestedBoundingClientRect(node, this.win); var dims = getElementDimensions(node); boxWrap(dims, 'margin', this.node); boxWrap(dims, 'border', this.border); boxWrap(dims, 'padding', this.padding); assign(this.content.style, { height: box.height - dims.borderTop - dims.borderBottom - dims.paddingTop - dims.paddingBottom + 'px', width: box.width - dims.borderLeft - dims.borderRight - dims.paddingLeft - dims.paddingRight + 'px' }); assign(this.node.style, { top: box.top - dims.marginTop + 'px', left: box.left - dims.marginLeft + 'px' }); this.nameSpan.textContent = name || node.nodeName.toLowerCase(); this.dimSpan.textContent = box.width + 'px × ' + box.height + 'px'; var tipPos = findTipPos({ top: box.top - dims.marginTop, left: box.left - dims.marginLeft, height: box.height + dims.marginTop + dims.marginBottom, width: box.width + dims.marginLeft + dims.marginRight }, this.win); assign(this.tip.style, tipPos); } }]); return Overlay; }(); function findTipPos(dims, win) { var tipHeight = 20; var margin = 5; var top; if (dims.top + dims.height + tipHeight <= win.innerHeight) { if (dims.top + dims.height < 0) { top = margin; } else { top = dims.top + dims.height + margin; } } else if (dims.top - tipHeight <= win.innerHeight) { if (dims.top - tipHeight - margin < margin) { top = margin; } else { top = dims.top - tipHeight - margin; } } else { top = win.innerHeight - tipHeight - margin; } top += 'px'; if (dims.left < 0) { return { top: top, left: margin }; } if (dims.left + 200 > win.innerWidth) { return { top: top, right: margin }; } return { top: top, left: dims.left + margin + 'px' }; } function getElementDimensions(domElement) { var calculatedStyle = window.getComputedStyle(domElement); return { borderLeft: +calculatedStyle.borderLeftWidth.match(/[0-9]*/)[0], borderRight: +calculatedStyle.borderRightWidth.match(/[0-9]*/)[0], borderTop: +calculatedStyle.borderTopWidth.match(/[0-9]*/)[0], borderBottom: +calculatedStyle.borderBottomWidth.match(/[0-9]*/)[0], marginLeft: +calculatedStyle.marginLeft.match(/[0-9]*/)[0], marginRight: +calculatedStyle.marginRight.match(/[0-9]*/)[0], marginTop: +calculatedStyle.marginTop.match(/[0-9]*/)[0], marginBottom: +calculatedStyle.marginBottom.match(/[0-9]*/)[0], paddingLeft: +calculatedStyle.paddingLeft.match(/[0-9]*/)[0], paddingRight: +calculatedStyle.paddingRight.match(/[0-9]*/)[0], paddingTop: +calculatedStyle.paddingTop.match(/[0-9]*/)[0], paddingBottom: +calculatedStyle.paddingBottom.match(/[0-9]*/)[0] }; } // Get the window object for the document that a node belongs to, // or return null if it cannot be found (node not attached to DOM, // etc). function getOwnerWindow(node) { if (!node.ownerDocument) { return null; } return node.ownerDocument.defaultView; } // Get the iframe containing a node, or return null if it cannot // be found (node not within iframe, etc). function getOwnerIframe(node) { var nodeWindow = getOwnerWindow(node); if (nodeWindow) { return nodeWindow.frameElement; } return null; } // Get a bounding client rect for a node, with an // offset added to compensate for its border. function getBoundingClientRectWithBorderOffset(node) { var dimensions = getElementDimensions(node); return mergeRectOffsets([node.getBoundingClientRect(), { top: dimensions.borderTop, left: dimensions.borderLeft, bottom: dimensions.borderBottom, right: dimensions.borderRight, // This width and height won't get used by mergeRectOffsets (since this // is not the first rect in the array), but we set them so that this // object typechecks as a DOMRect. width: 0, height: 0 }]); } // Add together the top, left, bottom, and right properties of // each DOMRect, but keep the width and height of the first one. function mergeRectOffsets(rects) { return rects.reduce(function (previousRect, rect) { if (previousRect == null) { return rect; } return { top: previousRect.top + rect.top, left: previousRect.left + rect.left, width: previousRect.width, height: previousRect.height, bottom: previousRect.bottom + rect.bottom, right: previousRect.right + rect.right }; }); } // Calculate a boundingClientRect for a node relative to boundaryWindow, // taking into account any offsets caused by intermediate iframes. function getNestedBoundingClientRect(node, boundaryWindow) { var ownerIframe = getOwnerIframe(node); if (ownerIframe && ownerIframe !== boundaryWindow) { var rects = [node.getBoundingClientRect()]; var currentIframe = ownerIframe; var onlyOneMore = false; while (currentIframe) { var rect = getBoundingClientRectWithBorderOffset(currentIframe); rects.push(rect); currentIframe = getOwnerIframe(currentIframe); if (onlyOneMore) { break; } // We don't want to calculate iframe offsets upwards beyond // the iframe containing the boundaryWindow, but we // need to calculate the offset relative to the boundaryWindow. if (currentIframe && getOwnerWindow(currentIframe) === boundaryWindow) { onlyOneMore = true; } } return mergeRectOffsets(rects); } else { return node.getBoundingClientRect(); } } function boxWrap(dims, what, node) { assign(node.style, { borderTopWidth: dims[what + 'Top'] + 'px', borderLeftWidth: dims[what + 'Left'] + 'px', borderRightWidth: dims[what + 'Right'] + 'px', borderBottomWidth: dims[what + 'Bottom'] + 'px', borderStyle: 'solid' }); } var overlayStyles = { background: 'rgba(120, 170, 210, 0.7)', padding: 'rgba(77, 200, 0, 0.3)', margin: 'rgba(255, 155, 0, 0.3)', border: 'rgba(255, 200, 50, 0.3)' }; module.exports = Overlay; /***/ }, /* 63 */ /***/ function(module, exports) { /** * Copyright (c) 2015-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. * * */ 'use strict'; module.exports = { monospace: { family: 'Menlo, Consolas, monospace', sizes: { normal: 11, large: 14 } }, sansSerif: { family: '"Helvetica Neue", "Lucida Grande", -apple-system, BlinkMacSystemFont, "Segoe UI", Ubuntu, sans-serif', sizes: { small: 10, normal: 12, large: 14 } } }; /***/ }, /* 64 */ /***/ function(module, exports, __webpack_require__) { /** * Copyright (c) 2015-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. * * */ 'use strict'; 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; }; }(); function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } var assign = __webpack_require__(7); var MultiOverlay = function () { function MultiOverlay(window) { _classCallCheck(this, MultiOverlay); this.win = window; var doc = window.document; this.container = doc.createElement('div'); doc.body.appendChild(this.container); this._currentNodes = null; } _createClass(MultiOverlay, [{ key: 'highlightMany', value: function highlightMany(nodes) { var _this = this; this._currentNodes = nodes; this.container.innerHTML = ''; nodes.forEach(function (node) { var div = _this.win.document.createElement('div'); if (typeof node.getBoundingClientRect !== 'function') { return; } var box = node.getBoundingClientRect(); if (box.bottom < 0 || box.top > window.innerHeight) { return; } assign(div.style, { top: box.top + 'px', left: box.left + 'px', width: box.width + 'px', height: box.height + 'px', border: '2px dotted rgba(200, 100, 100, .8)', boxSizing: 'border-box', backgroundColor: 'rgba(200, 100, 100, .2)', position: 'fixed', zIndex: 10000000, pointerEvents: 'none' }); _this.container.appendChild(div); }); } }, { key: 'refresh', value: function refresh() { if (this._currentNodes) { this.highlightMany(this._currentNodes); } } }, { key: 'remove', value: function remove() { if (this.container.parentNode) { this.container.parentNode.removeChild(this.container); this._currentNodes = null; } } }]); return MultiOverlay; }(); module.exports = MultiOverlay; /***/ }, /* 65 */ /***/ function(module, exports) { /** * Copyright (c) 2015-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. * * */ 'use strict'; var emptyFunction = function emptyFunction() {}; module.exports = function (bridge, agent, hook) { var checkIfProfilingIsSupported = function checkIfProfilingIsSupported() { var profilingIsSupported = false; // Feature detection for profiling mode. // The presence of an "treeBaseDuration" field signifies: // 1) This is a new enough version of React (e.g. > 16.4 which was the initial profiling release) // 2) This is a profiling capable bundle (e.g. DEV or PROFILING) agent.roots.forEach(function (rootId) { var root = agent.internalInstancesById.get(rootId); if (root.hasOwnProperty('treeBaseDuration')) { profilingIsSupported = true; } }); bridge.call('profiler:update', [profilingIsSupported], emptyFunction); }; // Wait for roots to be registered. // They might not yet exist at the time the plugin is initialized. // Also while the first root(s) may not be capable of profiling, later ones might. agent.on('root', checkIfProfilingIsSupported); agent.on('rootUnmounted', checkIfProfilingIsSupported); // Check once in case some roots have already been registered: checkIfProfilingIsSupported(); }; /***/ }, /* 66 */ /***/ function(module, exports) { /** * Copyright (c) 2015-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. * * */ 'use strict'; function decorate(obj, attr, fn) { var old = obj[attr]; obj[attr] = function () { var res = old.apply(this, arguments); fn.apply(this, arguments); return res; }; return function () { obj[attr] = old; }; } var subscriptionEnabled = false; module.exports = function (bridge, agent, hook) { var shouldEnable = !!hook._relayInternals; bridge.onCall('relay:check', function () { return shouldEnable; }); if (!shouldEnable) { return; } var _hook$_relayInternals = hook._relayInternals, DefaultStoreData = _hook$_relayInternals.DefaultStoreData, setRequestListener = _hook$_relayInternals.setRequestListener; function sendStoreData() { if (subscriptionEnabled) { bridge.send('relay:store', { id: 'relay:store', nodes: DefaultStoreData.getNodeData() }); } } bridge.onCall('relay:store:enable', function () { subscriptionEnabled = true; sendStoreData(); }); bridge.onCall('relay:store:disable', function () { subscriptionEnabled = false; }); sendStoreData(); decorate(DefaultStoreData, 'handleUpdatePayload', sendStoreData); decorate(DefaultStoreData, 'handleQueryPayload', sendStoreData); var removeListener = setRequestListener(function (event, data) { bridge.send(event, data); }); hook.on('shutdown', removeListener); }; /***/ } /******/ ]); ================================================ FILE: dev/react-dev-tools/build/background.js ================================================ !function(modules) { function __webpack_require__(moduleId) { if (installedModules[moduleId]) return installedModules[moduleId].exports; var module = installedModules[moduleId] = { exports: {}, id: moduleId, loaded: !1 }; return modules[moduleId].call(module.exports, module, module.exports, __webpack_require__), module.loaded = !0, module.exports; } var installedModules = {}; return __webpack_require__.m = modules, __webpack_require__.c = installedModules, __webpack_require__.p = "", __webpack_require__(0); }([ function(module, exports) { "use strict"; function isNumeric(str) { return +str + "" === str; } function installContentScript(tabId) { chrome.tabs.executeScript(tabId, { file: "/build/contentScript.js" }, function() {}); } function doublePipe(one, two) { function lOne(message) { two.postMessage(message); } function lTwo(message) { one.postMessage(message); } function shutdown() { one.onMessage.removeListener(lOne), two.onMessage.removeListener(lTwo), one.disconnect(), two.disconnect(); } one.onMessage.addListener(lOne), two.onMessage.addListener(lTwo), one.onDisconnect.addListener(shutdown), two.onDisconnect.addListener(shutdown); } function setIconAndPopup(reactBuildType, tabId) { chrome.browserAction.setIcon({ tabId: tabId, path: { "16": "icons/16-" + reactBuildType + ".png", "32": "icons/32-" + reactBuildType + ".png", "48": "icons/48-" + reactBuildType + ".png", "128": "icons/128-" + reactBuildType + ".png" } }), chrome.browserAction.setPopup({ tabId: tabId, popup: "popups/" + reactBuildType + ".html" }); } var ports = {}, IS_FIREFOX = navigator.userAgent.indexOf("Firefox") >= 0; chrome.runtime.onConnect.addListener(function(port) { var tab = null, name = null; isNumeric(port.name) ? (tab = port.name, name = "devtools", installContentScript(+port.name)) : (tab = port.sender.tab.id, name = "content-script"), ports[tab] || (ports[tab] = { devtools: null, "content-script": null }), ports[tab][name] = port, ports[tab].devtools && ports[tab]["content-script"] && doublePipe(ports[tab].devtools, ports[tab]["content-script"]); }), IS_FIREFOX && chrome.tabs.onUpdated.addListener(function(tabId, changeInfo, tab) { tab.active && "loading" === changeInfo.status && setIconAndPopup("disabled", tabId); }), chrome.runtime.onMessage.addListener(function(req, sender) { if (req.hasDetectedReact && sender.tab) { var reactBuildType = req.reactBuildType; sender.url.indexOf("facebook.github.io/react") !== -1 && (reactBuildType = "production"), setIconAndPopup(reactBuildType, sender.tab.id); } }); } ]); ================================================ FILE: dev/react-dev-tools/build/contentScript.js ================================================ !function(modules) { function __webpack_require__(moduleId) { if (installedModules[moduleId]) return installedModules[moduleId].exports; var module = installedModules[moduleId] = { exports: {}, id: moduleId, loaded: !1 }; return modules[moduleId].call(module.exports, module, module.exports, __webpack_require__), module.loaded = !0, module.exports; } var installedModules = {}; return __webpack_require__.m = modules, __webpack_require__.c = installedModules, __webpack_require__.p = "", __webpack_require__(0); }([ function(module, exports) { "use strict"; function handleMessageFromDevtools(message) { window.postMessage({ source: "react-devtools-content-script", payload: message }, "*"); } function handleMessageFromPage(evt) { evt.source === window && evt.data && "react-devtools-bridge" === evt.data.source && port.postMessage(evt.data.payload); } function handleDisconnect() { window.removeEventListener("message", handleMessageFromPage), window.postMessage({ source: "react-devtools-content-script", payload: { type: "event", evt: "shutdown" } }, "*"); } var port = chrome.runtime.connect({ name: "content-script" }); port.onMessage.addListener(handleMessageFromDevtools), port.onDisconnect.addListener(handleDisconnect), window.addEventListener("message", handleMessageFromPage), window.postMessage({ source: "react-devtools-content-script", hello: !0 }, "*"); } ]); ================================================ FILE: dev/react-dev-tools/build/inject.js ================================================ !function(modules) { function __webpack_require__(moduleId) { if (installedModules[moduleId]) return installedModules[moduleId].exports; var module = installedModules[moduleId] = { exports: {}, id: moduleId, loaded: !1 }; return modules[moduleId].call(module.exports, module, module.exports, __webpack_require__), module.loaded = !0, module.exports; } var installedModules = {}; return __webpack_require__.m = modules, __webpack_require__.c = installedModules, __webpack_require__.p = "", __webpack_require__(0); }([ function(module, exports, __webpack_require__) { "use strict"; var lastDetectionResult, installGlobalHook = __webpack_require__(1), installRelayHook = __webpack_require__(2), nullthrows = __webpack_require__(3)["default"]; window.addEventListener("message", function(evt) { evt.source === window && evt.data && "react-devtools-detector" === evt.data.source && (lastDetectionResult = { hasDetectedReact: !0, reactBuildType: evt.data.reactBuildType }, chrome.runtime.sendMessage(lastDetectionResult)); }), window.addEventListener("pageshow", function(evt) { lastDetectionResult && evt.target === window.document && chrome.runtime.sendMessage(lastDetectionResult); }); var detectReact = "\nwindow.__REACT_DEVTOOLS_GLOBAL_HOOK__.on('renderer', function(evt) {\n window.postMessage({\n source: 'react-devtools-detector',\n reactBuildType: evt.reactBuildType,\n }, '*');\n});\n", saveNativeValues = "\nwindow.__REACT_DEVTOOLS_GLOBAL_HOOK__.nativeObjectCreate = Object.create;\nwindow.__REACT_DEVTOOLS_GLOBAL_HOOK__.nativeMap = Map;\nwindow.__REACT_DEVTOOLS_GLOBAL_HOOK__.nativeWeakMap = WeakMap;\nwindow.__REACT_DEVTOOLS_GLOBAL_HOOK__.nativeSet = Set;\n", js = ";(" + installGlobalHook.toString() + "(window));(" + installRelayHook.toString() + "(window))" + saveNativeValues + detectReact, script = document.createElement("script"); script.textContent = js, nullthrows(document.documentElement).appendChild(script), nullthrows(script.parentNode).removeChild(script); }, function(module, exports) { "use strict"; function installGlobalHook(window) { function detectReactBuildType(renderer) { try { if ("string" == typeof renderer.version) return renderer.bundleType > 0 ? "development" : "production"; var toString = Function.prototype.toString; if (renderer.Mount && renderer.Mount._renderNewRootComponent) { var renderRootCode = toString.call(renderer.Mount._renderNewRootComponent); return 0 !== renderRootCode.indexOf("function") ? "production" : renderRootCode.indexOf("storedMeasure") !== -1 ? "development" : renderRootCode.indexOf("should be a pure function") !== -1 ? renderRootCode.indexOf("NODE_ENV") !== -1 ? "development" : renderRootCode.indexOf("development") !== -1 ? "development" : renderRootCode.indexOf("true") !== -1 ? "development" : renderRootCode.indexOf("nextElement") !== -1 || renderRootCode.indexOf("nextComponent") !== -1 ? "unminified" : "development" : renderRootCode.indexOf("nextElement") !== -1 || renderRootCode.indexOf("nextComponent") !== -1 ? "unminified" : "outdated"; } } catch (err) {} return "production"; } if (!window.__REACT_DEVTOOLS_GLOBAL_HOOK__) { var hasDetectedBadDCE = !1, hook = { _renderers: {}, helpers: {}, checkDCE: function(fn) { try { var toString = Function.prototype.toString, code = toString.call(fn); code.indexOf("^_^") > -1 && (hasDetectedBadDCE = !0, setTimeout(function() { throw new Error("React is running in production mode, but dead code elimination has not been applied. Read how to correctly configure React for production: https://fb.me/react-perf-use-the-production-build"); })); } catch (err) {} }, inject: function(renderer) { var id = Math.random().toString(16).slice(2); hook._renderers[id] = renderer; var reactBuildType = hasDetectedBadDCE ? "deadcode" : detectReactBuildType(renderer); return hook.emit("renderer", { id: id, renderer: renderer, reactBuildType: reactBuildType }), id; }, _listeners: {}, sub: function(evt, fn) { return hook.on(evt, fn), function() { return hook.off(evt, fn); }; }, on: function(evt, fn) { hook._listeners[evt] || (hook._listeners[evt] = []), hook._listeners[evt].push(fn); }, off: function(evt, fn) { if (hook._listeners[evt]) { var ix = hook._listeners[evt].indexOf(fn); ix !== -1 && hook._listeners[evt].splice(ix, 1), hook._listeners[evt].length || (hook._listeners[evt] = null); } }, emit: function(evt, data) { hook._listeners[evt] && hook._listeners[evt].map(function(fn) { return fn(data); }); }, supportsFiber: !0, _fiberRoots: {}, getFiberRoots: function(rendererID) { var roots = hook._fiberRoots; return roots[rendererID] || (roots[rendererID] = new Set()), roots[rendererID]; }, onCommitFiberUnmount: function(rendererID, fiber) { hook.helpers[rendererID] && hook.helpers[rendererID].handleCommitFiberUnmount(fiber); }, onCommitFiberRoot: function(rendererID, root) { var mountedRoots = hook.getFiberRoots(rendererID), current = root.current, isKnownRoot = mountedRoots.has(root), isUnmounting = null == current.memoizedState || null == current.memoizedState.element; isKnownRoot || isUnmounting ? isKnownRoot && isUnmounting && mountedRoots["delete"](root) : mountedRoots.add(root), hook.helpers[rendererID] && hook.helpers[rendererID].handleCommitFiberRoot(root); } }; Object.defineProperty(window, "__REACT_DEVTOOLS_GLOBAL_HOOK__", { value: hook }); } } module.exports = installGlobalHook; }, function(module, exports) { "use strict"; function installRelayHook(window) { function decorate(obj, attr, fn) { var old = obj[attr]; obj[attr] = function() { var res = old.apply(this, arguments); return fn.apply(this, arguments), res; }; } function emit(name, data) { _eventQueue.push({ name: name, data: data }), _listener && _listener(name, data); } function setRequestListener(listener) { if (_listener) throw new Error("Relay Devtools: Called only call setRequestListener once."); return _listener = listener, _eventQueue.forEach(function(_ref) { var name = _ref.name, data = _ref.data; listener(name, data); }), function() { _listener = null; }; } function recordRequest(type, start, request, requestNumber) { var id = Math.random().toString(16).substr(2); request.getPromise().then(function(response) { emit("relay:success", { id: id, end: performanceNow(), response: response.response }); }, function(error) { emit("relay:failure", { id: id, end: performanceNow(), error: error }); }); for (var textChunks = [], text = request.getQueryString(); text.length > 0; ) textChunks.push(text.substr(0, TEXT_CHUNK_LENGTH)), text = text.substr(TEXT_CHUNK_LENGTH); return { id: id, name: request.getDebugName(), requestNumber: requestNumber, start: start, text: textChunks, type: type, variables: request.getVariables() }; } function instrumentRelayRequests(relayInternals) { var NetworkLayer = relayInternals.NetworkLayer; decorate(NetworkLayer, "sendMutation", function(mutation) { requestNumber++, emit("relay:pending", [ recordRequest("mutation", performanceNow(), mutation, requestNumber) ]); }), decorate(NetworkLayer, "sendQueries", function(queries) { requestNumber++; var start = performanceNow(); emit("relay:pending", queries.map(function(query) { return recordRequest("query", start, query, requestNumber); })); }); var instrumented = {}; for (var key in relayInternals) relayInternals.hasOwnProperty(key) && (instrumented[key] = relayInternals[key]); return instrumented.setRequestListener = setRequestListener, instrumented; } var performanceNow, performance = window.performance; performanceNow = performance && "function" == typeof performance.now ? function() { return performance.now(); } : function() { return Date.now(); }; var TEXT_CHUNK_LENGTH = 500, hook = window.__REACT_DEVTOOLS_GLOBAL_HOOK__; if (hook) { var _eventQueue = [], _listener = null, requestNumber = 0, _relayInternals = null; Object.defineProperty(hook, "_relayInternals", { configurable: !0, set: function(relayInternals) { _relayInternals = instrumentRelayRequests(relayInternals); }, get: function() { return _relayInternals; } }); } } module.exports = installRelayHook; }, function(module, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: !0 }), exports["default"] = function(x) { if (null != x) return x; throw new Error("Got unexpected null or undefined"); }; } ]); ================================================ FILE: dev/react-dev-tools/build/main.js ================================================ !function(modules) { function __webpack_require__(moduleId) { if (installedModules[moduleId]) return installedModules[moduleId].exports; var module = installedModules[moduleId] = { exports: {}, id: moduleId, loaded: !1 }; return modules[moduleId].call(module.exports, module, module.exports, __webpack_require__), module.loaded = !0, module.exports; } var installedModules = {}; return __webpack_require__.m = modules, __webpack_require__.c = installedModules, __webpack_require__.p = "", __webpack_require__(0); }([ function(module, exports) { "use strict"; function createPanelIfReactLoaded() { panelCreated || chrome.devtools.inspectedWindow.eval("!!(\n (window.__REACT_DEVTOOLS_GLOBAL_HOOK__ && Object.keys(window.__REACT_DEVTOOLS_GLOBAL_HOOK__._renderers).length) || window.React\n )", function(pageHasReact, err) { pageHasReact && !panelCreated && (clearInterval(loadCheckInterval), panelCreated = !0, chrome.devtools.panels.create("React", "", "panel.html", function(panel) { var reactPanel = null; panel.onShown.addListener(function(window) { window.panel.getNewSelection(), reactPanel = window.panel, reactPanel.resumeTransfer(); }), panel.onHidden.addListener(function() { reactPanel && (reactPanel.hideHighlight(), reactPanel.pauseTransfer()); }); })); }); } var panelCreated = !1; chrome.devtools.network.onNavigated.addListener(function() { createPanelIfReactLoaded(); }); var loadCheckInterval = setInterval(function() { createPanelIfReactLoaded(); }, 1e3); createPanelIfReactLoaded(); } ]); ================================================ FILE: dev/react-dev-tools/build/panel.js ================================================ !function(modules) { function __webpack_require__(moduleId) { if (installedModules[moduleId]) return installedModules[moduleId].exports; var module = installedModules[moduleId] = { exports: {}, id: moduleId, loaded: !1 }; return modules[moduleId].call(module.exports, module, module.exports, __webpack_require__), module.loaded = !0, module.exports; } var installedModules = {}; return __webpack_require__.m = modules, __webpack_require__.c = installedModules, __webpack_require__.p = "", __webpack_require__(0); }([ function(module, exports, __webpack_require__) { "use strict"; function reload() { setTimeout(function() { ReactDOM.unmountComponentAtNode(node), node.innerHTML = "", ReactDOM.render(React.createElement(Panel, config), node); }, 100); } var checkForReact = __webpack_require__(4), _inject = __webpack_require__(5), IS_CHROME = navigator.userAgent.indexOf("Firefox") < 0, browserName = void 0, themeName = void 0; if (IS_CHROME) browserName = "Chrome", themeName = "dark" === chrome.devtools.panels.themeName ? "ChromeDark" : "ChromeDefault"; else if (browserName = "Firefox", themeName = "FirefoxLight", chrome.devtools && chrome.devtools.panels) switch (chrome.devtools.panels.themeName) { case "dark": themeName = "FirefoxDark"; break; case "firebug": themeName = "FirefoxFirebug"; } var config = { alreadyFoundReact: !1, browserName: browserName, checkForReact: checkForReact, reload: reload, themeName: themeName, reloadSubscribe: function(reloadFn) { return chrome.devtools.network.onNavigated.addListener(reloadFn), function() { chrome.devtools.network.onNavigated.removeListener(reloadFn); }; }, getNewSelection: function(bridge) { chrome.devtools.inspectedWindow.eval("window.__REACT_DEVTOOLS_GLOBAL_HOOK__.$0 = $0"), bridge.send("checkSelection"); }, selectElement: function(id, bridge) { bridge.send("putSelectedNode", id), setTimeout(function() { chrome.devtools.inspectedWindow.eval("inspect(window.__REACT_DEVTOOLS_GLOBAL_HOOK__.$node)"); }, 100); }, showComponentSource: function(globalPathToInst, globalPathToType) { var code = "\n if (\n window." + globalPathToType + " &&\n window." + globalPathToType + ".prototype &&\n window." + globalPathToType + ".prototype.isReactComponent\n ) {\n inspect(window." + globalPathToInst + ".render);\n } else {\n inspect(window." + globalPathToType + ");\n }\n "; chrome.devtools.inspectedWindow.eval(code, function(res, err) { err && console.error("Failed to inspect component", err); }); }, showAttrSource: function(path) { var attrs = "[" + path.map(function(m) { return JSON.stringify(m); }).join("][") + "]", code = "inspect(window.$r" + attrs + ")"; chrome.devtools.inspectedWindow.eval(code, function(res, err) { err && console.error("Failed to inspect source", err); }); }, executeFn: function(path) { var attrs = "[" + path.map(function(m) { return JSON.stringify(m); }).join("][") + "]", code = "window.$r" + attrs + "()"; chrome.devtools.inspectedWindow.eval(code, function(res, err) { err && console.error("Failed to call function", err); }); }, inject: function(done) { _inject(chrome.runtime.getURL("build/backend.js"), function() { var port = chrome.runtime.connect({ name: "" + chrome.devtools.inspectedWindow.tabId }), disconnected = !1, wall = { listen: function(fn) { port.onMessage.addListener(function(message) { return fn(message); }); }, send: function(data) { disconnected || port.postMessage(data); } }; port.onDisconnect.addListener(function() { disconnected = !0; }), done(wall, function() { return port.disconnect(); }); }); } }, Panel = __webpack_require__(6), React = __webpack_require__(12), ReactDOM = __webpack_require__(26), nullthrows = __webpack_require__(3)["default"], node = nullthrows(document.getElementById("container")); ReactDOM.render(React.createElement(Panel, config), node); }, , , function(module, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: !0 }), exports["default"] = function(x) { if (null != x) return x; throw new Error("Got unexpected null or undefined"); }; }, function(module, exports) { "use strict"; module.exports = function(done) { chrome.devtools.inspectedWindow.eval("!!(\n (window.__REACT_DEVTOOLS_GLOBAL_HOOK__ && Object.keys(window.__REACT_DEVTOOLS_GLOBAL_HOOK__._renderers).length) || window.React || (window.require && (require('react') || require('React')))\n )", function(pageHasReact, err) { done(pageHasReact); }); }; }, function(module, exports) { "use strict"; module.exports = function(scriptName, done) { var src = "\n // the prototype stuff is in case document.createElement has been modified\n (function () {\n var script = document.constructor.prototype.createElement.call(document, 'script');\n script.src = \"" + scriptName + '";\n script.charset = "utf-8";\n document.documentElement.appendChild(script);\n script.parentNode.removeChild(script);\n })()\n '; chrome.devtools.inspectedWindow.eval(src, function(res, err) { err && console.log(err), done(); }); }; }, function(module, exports, __webpack_require__) { "use strict"; 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; } return Array.from(arr); } 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 || "object" != typeof call && "function" != typeof call ? self : call; } function _inherits(subClass, superClass) { if ("function" != typeof superClass && null !== superClass) 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: !1, writable: !0, configurable: !0 } }), superClass && (Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass); } var _createClass = function() { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0, "value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor); } } return function(Constructor, protoProps, staticProps) { return protoProps && defineProperties(Constructor.prototype, protoProps), staticProps && defineProperties(Constructor, staticProps), Constructor; }; }(), PropTypes = __webpack_require__(7), React = __webpack_require__(12), Container = __webpack_require__(15), Store = __webpack_require__(327), keyboardNav = __webpack_require__(333), invariant = __webpack_require__(56), assign = __webpack_require__(19), Bridge = __webpack_require__(335), _require = __webpack_require__(17), sansSerif = _require.sansSerif, NativeStyler = __webpack_require__(342), ProfilerPlugin = __webpack_require__(346), RelayPlugin = __webpack_require__(377), Themes = __webpack_require__(318), ThemeStore = __webpack_require__(331), consts = __webpack_require__(32), Panel = function(_React$Component) { function Panel(props) { _classCallCheck(this, Panel); var _this = _possibleConstructorReturn(this, (Panel.__proto__ || Object.getPrototypeOf(Panel)).call(this, props)); return _this.state = { loading: !0, showTroubleshooting: !1, preferencesPanelShown: !1, isReact: props.alreadyFoundReact, themeKey: 0, themeName: props.themeName }, _this._unMounted = !1, window.panel = _this, _this.plugins = [], _this; } return _inherits(Panel, _React$Component), _createClass(Panel, [ { key: "getChildContext", value: function() { return { browserName: this.props.browserName || "", defaultThemeName: this._themeStore && this._themeStore.defaultThemeName || "", showHiddenThemes: !!this.props.showHiddenThemes, showInspectButton: this.props.showInspectButton !== !1, store: this._store, theme: this._themeStore && this._themeStore.theme || Themes.ChromeDefault, themeName: this._themeStore && this._themeStore.themeName || "", themes: this._themeStore && this._themeStore.themes || {} }; } }, { key: "componentDidMount", value: function() { var _this2 = this; this.props.alreadyFoundReact ? this.inject() : this.lookForReact(), this.props.reloadSubscribe && (this._unsub = this.props.reloadSubscribe(function() { return _this2.reload(); })), this.state.loading && (this._troubleshootingTimeout = setTimeout(function() { return _this2.setState({ showTroubleshooting: !0 }); }, 3e3)); } }, { key: "componentWillUnmount", value: function() { this._unMounted = !0, this._unsub && this._unsub(), this.teardown(), null !== this._troubleshootingTimeout && clearTimeout(this._troubleshootingTimeout); } }, { key: "pauseTransfer", value: function() { this._bridge && this._bridge.pause(); } }, { key: "resumeTransfer", value: function() { this._bridge && this._bridge.resume(); } }, { key: "reload", value: function() { this._unsub && this._unsub(), this.teardown(), this._unMounted || this.setState({ loading: !0 }, this.props.reload); } }, { key: "getNewSelection", value: function() { this._bridge && this.props.getNewSelection && this.props.getNewSelection(this._bridge); } }, { key: "hideHighlight", value: function() { this._store.hideHighlight(); } }, { key: "sendSelection", value: function(id) { this._bridge && (id || this._store.selected) && (invariant(this.props.selectElement, "cannot send selection if props.selectElement is not defined"), this.props.selectElement(id || this._store.selected, this._bridge)); } }, { key: "viewComponentSource", value: function(id) { var _this3 = this; this._bridge && (this._bridge.send("putSelectedInstance", id), setTimeout(function() { invariant(_this3.props.showComponentSource, "cannot view source if props.showComponentSource is not supplied"), _this3.props.showComponentSource("__REACT_DEVTOOLS_GLOBAL_HOOK__.$inst", "__REACT_DEVTOOLS_GLOBAL_HOOK__.$type"); }, 100)); } }, { key: "viewElementSource", value: function(id, source) { var _this4 = this; this._bridge && (this._bridge.send("putSelectedInstance", id), setTimeout(function() { invariant(_this4.props.showElementSource, "cannot view source if props.showElementSource is not supplied"), _this4.props.showElementSource(source); }, 100)); } }, { key: "teardown", value: function() { this.plugins.forEach(function(p) { return p.teardown(); }), this.plugins = [], this._keyListener && (window.removeEventListener("keydown", this._keyListener), this._keyListener = null), this._bridge && this._bridge.send("shutdown"), this._teardownWall && (this._teardownWall(), this._teardownWall = null); } }, { key: "inject", value: function() { var _this5 = this; this.props.inject(function(wall, teardown) { _this5._teardownWall = teardown, _this5._bridge = new Bridge(wall), _this5._themeStore = new ThemeStore(_this5.state.themeName), _this5._store = new Store(_this5._bridge, _this5._themeStore); var refresh = function() { return _this5.forceUpdate(); }; _this5.plugins = [ new RelayPlugin(_this5._store, _this5._bridge, refresh), new ProfilerPlugin(_this5._store, _this5._bridge, refresh) ], _this5._keyListener = keyboardNav(_this5._store, window), window.addEventListener("keydown", _this5._keyListener), _this5._store.on("connected", function() { _this5.setState({ loading: !1, themeName: _this5._themeStore.themeName }), _this5.getNewSelection(); }), _this5._store.on("preferencesPanelShown", function() { _this5.setState({ preferencesPanelShown: _this5._store.preferencesPanelShown }); }), _this5._store.on("theme", function() { _this5.setState(function(state) { return { themeKey: state.themeKey + 1, themeName: _this5._themeStore.theme.displayName }; }); }); }); } }, { key: "componentDidUpdate", value: function(prevProps, prevState) { var _this6 = this; this.state.isReact || this._checkTimeout || (this._checkTimeout = setTimeout(function() { _this6._checkTimeout = null, _this6.lookForReact(); }, 200)), prevState.loading && !this.state.loading ? null !== this._troubleshootingTimeout && clearTimeout(this._troubleshootingTimeout) : !prevState.loading && this.state.loading && (this._troubleshootingTimeout = setTimeout(function() { return _this6.setState({ showTroubleshooting: !0 }); }, 3e3)); } }, { key: "lookForReact", value: function() { var _this7 = this; "function" == typeof this.props.checkForReact && this.props.checkForReact(function(isReact) { isReact ? (_this7.setState({ isReact: !0, loading: !0 }), _this7.inject()) : (console.log("still looking..."), _this7.setState({ isReact: !1, loading: !1 })); }); } }, { key: "render", value: function() { var _ref, _this8 = this, theme = this._store ? this._themeStore.theme : Themes.ChromeDefault; if (this.state.loading) return React.createElement("div", { style: loadingStyle(theme) }, React.createElement("h2", null, "Connecting to React…"), React.createElement("br", null), this.state.showTroubleshooting && React.createElement("a", { style: { color: "gray", textDecoration: "underline", cursor: "pointer" }, onClick: function() { chrome.tabs.create({ active: !0, url: "https://github.com/facebook/react-devtools/blob/master/README.md#the-react-tab-doesnt-show-up" }); } }, "Click here for troubleshooting instructions")); if (!this.state.isReact) return React.createElement("div", { style: loadingStyle(theme) }, React.createElement("h2", null, "Looking for React…")); var extraTabs = assign.apply(null, [ {} ].concat(this.plugins.map(function(p) { return p.tabs(); }))), extraPanes = (_ref = []).concat.apply(_ref, _toConsumableArray(this.plugins.map(function(p) { return p.panes(); }))); return this._store.capabilities.rnStyle && extraPanes.push(panelRNStyle(this._bridge, this._store.capabilities.rnStyleMeasure, theme)), React.createElement(Container, { key: this.state.themeKey, reload: this.props.reload && this.reload.bind(this), menuItems: { attr: function(id, node, val, path) { if (val && "Composite" === node.get("nodeType") && "function" === val[consts.type]) return [ _this8.props.showAttrSource && { key: "showSource", title: "Show function source", action: function() { return _this8.props.showAttrSource(path); } }, _this8.props.executeFn && { key: "executeFunction", title: "Execute function", action: function() { return _this8.props.executeFn(path); } } ]; }, tree: function(id, node) { return [ _this8.props.selectElement && _this8._store.capabilities.dom && { key: "findDOMNode", title: "Find the DOM node", action: function() { return _this8.sendSelection(id); } }, _this8.props.showComponentSource && "Composite" === node.get("nodeType") && { key: "showComponentSource", title: "Show " + node.get("name") + " source", action: function() { return _this8.viewComponentSource(id); } }, _this8.props.showElementSource && node.get("source") && { key: "showElementSource", title: "Show <" + node.get("name") + " /> in source", action: function() { return _this8.viewElementSource(id, node.get("source")); } } ]; } }, extraPanes: extraPanes, extraTabs: extraTabs, preferencesPanelShown: this.state.preferencesPanelShown, theme: theme, onViewElementSource: this.props.showElementSource ? this.viewElementSource.bind(this) : null }); } } ]), Panel; }(React.Component); Panel.childContextTypes = { browserName: PropTypes.string.isRequired, defaultThemeName: PropTypes.string.isRequired, showHiddenThemes: PropTypes.bool.isRequired, showInspectButton: PropTypes.bool.isRequired, store: PropTypes.object, theme: PropTypes.object.isRequired, themeName: PropTypes.string.isRequired, themes: PropTypes.object.isRequired }; var panelRNStyle = function(bridge, supportsMeasure, theme) { return function(node, id) { var props = node.get("props"); return props && props.style ? React.createElement("div", { key: "rnstyle", style: containerStyle(theme) }, React.createElement("strong", null, "React Native Style Editor"), React.createElement(NativeStyler, { id: id, bridge: bridge, supportsMeasure: supportsMeasure })) : React.createElement("div", { key: "rnstyle", style: containerStyle(theme) }, React.createElement("strong", null, "No style")); }; }, containerStyle = function(theme) { return { borderTop: "1px solid " + theme.base01, padding: "0.25rem", marginBottom: "0.25rem", flexShrink: 0 }; }, loadingStyle = function(theme) { return { fontFamily: sansSerif.family, fontSize: sansSerif.sizes.large, textAlign: "center", padding: 30, flex: 1, color: "#aaa" }; }; module.exports = Panel; }, function(module, exports, __webpack_require__) { module.exports = __webpack_require__(8)(); }, function(module, exports, __webpack_require__) { "use strict"; var emptyFunction = __webpack_require__(9), invariant = __webpack_require__(10), ReactPropTypesSecret = __webpack_require__(11); module.exports = function() { function shim(props, propName, componentName, location, propFullName, secret) { secret !== ReactPropTypesSecret && invariant(!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 getShim() { return shim; } shim.isRequired = shim; 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 }; return ReactPropTypes.checkPropTypes = emptyFunction, ReactPropTypes.PropTypes = ReactPropTypes, ReactPropTypes; }; }, function(module, exports) { "use strict"; function makeEmptyFunction(arg) { return function() { return arg; }; } var emptyFunction = function() {}; emptyFunction.thatReturns = makeEmptyFunction, emptyFunction.thatReturnsFalse = makeEmptyFunction(!1), emptyFunction.thatReturnsTrue = makeEmptyFunction(!0), emptyFunction.thatReturnsNull = makeEmptyFunction(null), emptyFunction.thatReturnsThis = function() { return this; }, emptyFunction.thatReturnsArgument = function(arg) { return arg; }, module.exports = emptyFunction; }, function(module, exports, __webpack_require__) { "use strict"; function invariant(condition, format, a, b, c, d, e, f) { if (validateFormat(format), !condition) { var error; if (void 0 === format) 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 ], argIndex = 0; error = new Error(format.replace(/%s/g, function() { return args[argIndex++]; })), error.name = "Invariant Violation"; } throw error.framesToPop = 1, error; } } var validateFormat = function(format) {}; module.exports = invariant; }, function(module, exports) { "use strict"; var ReactPropTypesSecret = "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"; module.exports = ReactPropTypesSecret; }, function(module, exports, __webpack_require__) { "use strict"; module.exports = __webpack_require__(13); }, function(module, exports, __webpack_require__) { /** @license React v16.5.2 * react.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ "use strict"; function A(a, b, d, c, e, g, h, f) { if (!a) { if (a = void 0, void 0 === b) a = Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings."); else { var k = [ d, c, e, g, h, f ], l = 0; a = Error(b.replace(/%s/g, function() { return k[l++]; })), a.name = "Invariant Violation"; } throw a.framesToPop = 1, a; } } function B(a) { for (var b = arguments.length - 1, d = "https://reactjs.org/docs/error-decoder.html?invariant=" + a, c = 0; c < b; c++) d += "&args[]=" + encodeURIComponent(arguments[c + 1]); A(!1, "Minified React error #" + a + "; visit %s for the full message or use the non-minified dev environment for full errors and additional helpful warnings. ", d); } function E(a, b, d) { this.props = a, this.context = b, this.refs = D, this.updater = d || C; } function F() {} function G(a, b, d) { this.props = a, this.context = b, this.refs = D, this.updater = d || C; } function L(a, b, d) { var c = void 0, e = {}, g = null, h = null; if (null != b) for (c in void 0 !== b.ref && (h = b.ref), void 0 !== b.key && (g = "" + b.key), b) J.call(b, c) && !K.hasOwnProperty(c) && (e[c] = b[c]); var f = arguments.length - 2; if (1 === f) e.children = d; else if (1 < f) { for (var k = Array(f), l = 0; l < f; l++) k[l] = arguments[l + 2]; e.children = k; } if (a && a.defaultProps) for (c in f = a.defaultProps) void 0 === e[c] && (e[c] = f[c]); return { $$typeof: p, type: a, key: g, ref: h, props: e, _owner: I.current }; } function M(a, b) { return { $$typeof: p, type: a.type, key: b, ref: a.ref, props: a.props, _owner: a._owner }; } function N(a) { return "object" == typeof a && null !== a && a.$$typeof === p; } function escape(a) { var b = { "=": "=0", ":": "=2" }; return "$" + ("" + a).replace(/[=:]/g, function(a) { return b[a]; }); } function Q(a, b, d, c) { if (P.length) { var e = P.pop(); return e.result = a, e.keyPrefix = b, e.func = d, e.context = c, e.count = 0, e; } return { result: a, keyPrefix: b, func: d, context: c, count: 0 }; } function R(a) { a.result = null, a.keyPrefix = null, a.func = null, a.context = null, a.count = 0, 10 > P.length && P.push(a); } function S(a, b, d, c) { var e = typeof a; "undefined" !== e && "boolean" !== e || (a = null); var g = !1; if (null === a) g = !0; else switch (e) { case "string": case "number": g = !0; break; case "object": switch (a.$$typeof) { case p: case q: g = !0; } } if (g) return d(c, a, "" === b ? "." + T(a, 0) : b), 1; if (g = 0, b = "" === b ? "." : b + ":", Array.isArray(a)) for (var h = 0; h < a.length; h++) { e = a[h]; var f = b + T(e, h); g += S(e, f, d, c); } else if (null === a || "object" != typeof a ? f = null : (f = z && a[z] || a["@@iterator"], f = "function" == typeof f ? f : null), "function" == typeof f) for (a = f.call(a), h = 0; !(e = a.next()).done; ) e = e.value, f = b + T(e, h++), g += S(e, f, d, c); else "object" === e && (d = "" + a, B("31", "[object Object]" === d ? "object with keys {" + Object.keys(a).join(", ") + "}" : d, "")); return g; } function U(a, b, d) { return null == a ? 0 : S(a, "", b, d); } function T(a, b) { return "object" == typeof a && null !== a && null != a.key ? escape(a.key) : b.toString(36); } function V(a, b) { a.func.call(a.context, b, a.count++); } function aa(a, b, d) { var c = a.result, e = a.keyPrefix; a = a.func.call(a.context, b, a.count++), Array.isArray(a) ? W(a, c, d, function(a) { return a; }) : null != a && (N(a) && (a = M(a, e + (!a.key || b && b.key === a.key ? "" : ("" + a.key).replace(O, "$&/") + "/") + d)), c.push(a)); } function W(a, b, d, c, e) { var g = ""; null != d && (g = ("" + d).replace(O, "$&/") + "/"), b = Q(b, g, c, e), U(a, aa, b), R(b); } function ba(a, b) { var d = I.currentDispatcher; return null === d ? B("277") : void 0, d.readContext(a, b); } var m = __webpack_require__(14), n = "function" == typeof Symbol && Symbol["for"], p = n ? Symbol["for"]("react.element") : 60103, q = n ? Symbol["for"]("react.portal") : 60106, r = n ? Symbol["for"]("react.fragment") : 60107, t = n ? Symbol["for"]("react.strict_mode") : 60108, u = n ? Symbol["for"]("react.profiler") : 60114, v = n ? Symbol["for"]("react.provider") : 60109, w = n ? Symbol["for"]("react.context") : 60110, x = n ? Symbol["for"]("react.async_mode") : 60111, y = n ? Symbol["for"]("react.forward_ref") : 60112; n && Symbol["for"]("react.placeholder"); var z = "function" == typeof Symbol && Symbol.iterator, C = { isMounted: function() { return !1; }, enqueueForceUpdate: function() {}, enqueueReplaceState: function() {}, enqueueSetState: function() {} }, D = {}; E.prototype.isReactComponent = {}, E.prototype.setState = function(a, b) { "object" != typeof a && "function" != typeof a && null != a ? B("85") : void 0, this.updater.enqueueSetState(this, a, b, "setState"); }, E.prototype.forceUpdate = function(a) { this.updater.enqueueForceUpdate(this, a, "forceUpdate"); }, F.prototype = E.prototype; var H = G.prototype = new F(); H.constructor = G, m(H, E.prototype), H.isPureReactComponent = !0; var I = { current: null, currentDispatcher: null }, J = Object.prototype.hasOwnProperty, K = { key: !0, ref: !0, __self: !0, __source: !0 }, O = /\/+/g, P = [], X = { Children: { map: function(a, b, d) { if (null == a) return a; var c = []; return W(a, c, null, b, d), c; }, forEach: function(a, b, d) { return null == a ? a : (b = Q(null, null, b, d), U(a, V, b), void R(b)); }, count: function(a) { return U(a, function() { return null; }, null); }, toArray: function(a) { var b = []; return W(a, b, null, function(a) { return a; }), b; }, only: function(a) { return N(a) ? void 0 : B("143"), a; } }, createRef: function() { return { current: null }; }, Component: E, PureComponent: G, createContext: function(a, b) { return void 0 === b && (b = null), a = { $$typeof: w, _calculateChangedBits: b, _currentValue: a, _currentValue2: a, Provider: null, Consumer: null, unstable_read: null }, a.Provider = { $$typeof: v, _context: a }, a.Consumer = a, a.unstable_read = ba.bind(null, a), a; }, forwardRef: function(a) { return { $$typeof: y, render: a }; }, Fragment: r, StrictMode: t, unstable_AsyncMode: x, unstable_Profiler: u, createElement: L, cloneElement: function(a, b, d) { null === a || void 0 === a ? B("267", a) : void 0; var c = void 0, e = m({}, a.props), g = a.key, h = a.ref, f = a._owner; if (null != b) { void 0 !== b.ref && (h = b.ref, f = I.current), void 0 !== b.key && (g = "" + b.key); var k = void 0; a.type && a.type.defaultProps && (k = a.type.defaultProps); for (c in b) J.call(b, c) && !K.hasOwnProperty(c) && (e[c] = void 0 === b[c] && void 0 !== k ? k[c] : b[c]); } if (c = arguments.length - 2, 1 === c) e.children = d; else if (1 < c) { k = Array(c); for (var l = 0; l < c; l++) k[l] = arguments[l + 2]; e.children = k; } return { $$typeof: p, type: a.type, key: g, ref: h, props: e, _owner: f }; }, createFactory: function(a) { var b = L.bind(null, a); return b.type = a, b; }, isValidElement: N, version: "16.5.2", __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED: { ReactCurrentOwner: I, assign: m } }, Y = { "default": X }, Z = Y && X || Y; module.exports = Z["default"] || Z; }, function(module, exports) { /* object-assign (c) Sindre Sorhus @license MIT */ "use strict"; function toObject(val) { if (null === val || void 0 === val) throw new TypeError("Object.assign cannot be called with null or undefined"); return Object(val); } function shouldUseNative() { try { if (!Object.assign) return !1; var test1 = new String("abc"); if (test1[5] = "de", "5" === Object.getOwnPropertyNames(test1)[0]) return !1; for (var test2 = {}, i = 0; i < 10; i++) test2["_" + String.fromCharCode(i)] = i; var order2 = Object.getOwnPropertyNames(test2).map(function(n) { return test2[n]; }); if ("0123456789" !== order2.join("")) return !1; var test3 = {}; return "abcdefghijklmnopqrst".split("").forEach(function(letter) { test3[letter] = letter; }), "abcdefghijklmnopqrst" === Object.keys(Object.assign({}, test3)).join(""); } catch (err) { return !1; } } var getOwnPropertySymbols = Object.getOwnPropertySymbols, hasOwnProperty = Object.prototype.hasOwnProperty, propIsEnumerable = Object.prototype.propertyIsEnumerable; module.exports = shouldUseNative() ? Object.assign : function(target, source) { for (var from, symbols, to = toObject(target), s = 1; s < arguments.length; s++) { from = Object(arguments[s]); for (var key in from) hasOwnProperty.call(from, key) && (to[key] = from[key]); if (getOwnPropertySymbols) { symbols = getOwnPropertySymbols(from); for (var i = 0; i < symbols.length; i++) propIsEnumerable.call(from, symbols[i]) && (to[symbols[i]] = from[symbols[i]]); } } return to; }; }, function(module, exports, __webpack_require__) { "use strict"; 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 || "object" != typeof call && "function" != typeof call ? self : call; } function _inherits(subClass, superClass) { if ("function" != typeof superClass && null !== superClass) 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: !1, writable: !0, configurable: !0 } }), superClass && (Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass); } function shouldUseVerticalLayout(window) { return window.innerWidth < IS_VERTICAL_BREAKPOINT; } var _extends = Object.assign || function(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) Object.prototype.hasOwnProperty.call(source, key) && (target[key] = source[key]); } return target; }, _createClass = function() { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0, "value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor); } } return function(Constructor, protoProps, staticProps) { return protoProps && defineProperties(Constructor.prototype, protoProps), staticProps && defineProperties(Constructor, staticProps), Constructor; }; }(), ContextMenu = __webpack_require__(16), PropState = __webpack_require__(21), React = __webpack_require__(12), LeftPane = __webpack_require__(57), PreferencesPanel = __webpack_require__(67), SplitPane = __webpack_require__(324), TabbedPane = __webpack_require__(326), IS_VERTICAL_BREAKPOINT = 500, Container = function(_React$Component) { function Container(props) { _classCallCheck(this, Container); var _this = _possibleConstructorReturn(this, (Container.__proto__ || Object.getPrototypeOf(Container)).call(this, props)); return _this.handleResize = function(e) { _this.resizeTimeout || (_this.resizeTimeout = setTimeout(_this.handleResizeTimeout, 50)); }, _this.handleResizeTimeout = function() { _this.resizeTimeout = null, _this.setState({ isVertical: shouldUseVerticalLayout(window) }); }, _this.state = { isVertical: shouldUseVerticalLayout(window) }, _this; } return _inherits(Container, _React$Component), _createClass(Container, [ { key: "componentDidMount", value: function() { window.addEventListener("resize", this.handleResize, !1), this.setState({ isVertical: shouldUseVerticalLayout(window) }); } }, { key: "componentWillUnmount", value: function() { window.removeEventListener("resize", this.handleResize), null != this.resizeTimeout && clearTimeout(this.resizeTimeout); } }, { key: "render", value: function() { var _this2 = this, _props = this.props, preferencesPanelShown = _props.preferencesPanelShown, theme = _props.theme, tabs = _extends({ Elements: function() { return React.createElement(SplitPane, { initialWidth: 10, initialHeight: 10, left: function() { return React.createElement(LeftPane, { reload: _this2.props.reload }); }, right: function() { return React.createElement(PropState, { onViewElementSource: _this2.props.onViewElementSource, extraPanes: _this2.props.extraPanes }); }, isVertical: _this2.state.isVertical }); } }, this.props.extraTabs); return React.createElement("div", { style: containerStyle(preferencesPanelShown, theme) }, React.createElement(TabbedPane, { tabs: tabs }), React.createElement(PreferencesPanel, null), React.createElement(ContextMenu, { itemSources: [ DEFAULT_MENU_ITEMS, this.props.menuItems ] })); } } ]), Container; }(React.Component), DEFAULT_MENU_ITEMS = { tree: function(id, node, store) { var items = []; node.get("name") && items.push({ key: "showNodesOfType", title: "Show all " + node.get("name"), action: function() { return store.changeSearch(node.get("name")); } }), store.capabilities.scroll && items.push({ key: "scrollToNode", title: "Scroll to node", action: function() { return store.scrollToNode(id); } }), "Composite" === node.get("nodeType") && node.get("name") && items.push({ key: "copyNodeName", title: "Copy element name", action: function() { return store.copyNodeName(node.get("name")); } }); var props = node.get("props"); if (props) { var numKeys = Object.keys(props).filter(function(key) { return "children" !== key; }).length; numKeys > 0 && items.push({ key: "copyNodeProps", title: "Copy element props", action: function() { return store.copyNodeProps(props); } }); } return items; }, attr: function(id, node, val, path, name, store) { return [ { key: "storeAsGlobal", title: "Store as global variable", action: function() { return store.makeGlobal(id, path); } } ]; } }, containerStyle = function(preferencesPanelShown, theme) { return { backgroundColor: theme.base00, color: theme.base05, flex: 1, display: "flex", minWidth: 0, position: preferencesPanelShown ? "relative" : null }; }; module.exports = Container; }, function(module, exports, __webpack_require__) { "use strict"; 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; } return Array.from(arr); } 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 || "object" != typeof call && "function" != typeof call ? self : call; } function _inherits(subClass, superClass) { if ("function" != typeof superClass && null !== superClass) 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: !1, writable: !0, configurable: !0 } }), superClass && (Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass); } var _createClass = function() { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0, "value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor); } } return function(Constructor, protoProps, staticProps) { return protoProps && defineProperties(Constructor.prototype, protoProps), staticProps && defineProperties(Constructor, staticProps), Constructor; }; }(), PropTypes = __webpack_require__(7), React = __webpack_require__(12), nullthrows = __webpack_require__(3)["default"], _require = __webpack_require__(17), sansSerif = _require.sansSerif, HighlightHover = __webpack_require__(18), decorate = __webpack_require__(20), ContextMenu = function(_React$Component) { function ContextMenu(props) { _classCallCheck(this, ContextMenu); var _this = _possibleConstructorReturn(this, (ContextMenu.__proto__ || Object.getPrototypeOf(ContextMenu)).call(this, props)); return _this.state = { elementHeight: 0, windowHeight: 0 }, _this._setRef = function(element) { if (element) { var elementHeight = nullthrows(element.querySelector("ul")).clientHeight, windowHeight = window.innerHeight; _this.state.elementHeight === elementHeight && _this.state.windowHeight === windowHeight || _this.setState({ elementHeight: elementHeight, windowHeight: windowHeight }); } }, _this.handleBackdropClick = _this.handleBackdropClick.bind(_this), _this; } return _inherits(ContextMenu, _React$Component), _createClass(ContextMenu, [ { key: "onClick", value: function(i, evt) { this.props.items[i].action(); } }, { key: "handleBackdropClick", value: function(evt) { evt.preventDefault(), this.props.hideContextMenu(); } }, { key: "render", value: function() { var _this2 = this, theme = this.context.theme, _props = this.props, items = _props.items, open = _props.open, pos = _props.pos, _state = this.state, elementHeight = _state.elementHeight, windowHeight = _state.windowHeight; return pos && pos.y + elementHeight > windowHeight && (pos.y -= elementHeight), open ? React.createElement("div", { style: styles.backdrop, onClick: this.handleBackdropClick, ref: this._setRef }, React.createElement("ul", { style: containerStyle(pos.x, pos.y, theme) }, !items.length && React.createElement("li", { style: emptyStyle(theme) }, "No actions"), items.map(function(item, i) { return item && React.createElement("li", { style: listItemStyle(theme), key: item.key, onClick: function(evt) { return _this2.onClick(i, evt); } }, React.createElement(HighlightHover, { style: styles.highlightHoverItem }, item.title)); }))) : React.createElement("div", { style: styles.hidden }); } } ]), ContextMenu; }(React.Component); ContextMenu.contextTypes = { theme: PropTypes.object.isRequired }; var Wrapped = decorate({ listeners: function() { return [ "contextMenu" ]; }, props: function(store, _props2) { if (!store.contextMenu) return { open: !1 }; var _store$contextMenu = store.contextMenu, x = _store$contextMenu.x, y = _store$contextMenu.y, type = _store$contextMenu.type, args = _store$contextMenu.args, items = []; return args.push(store), _props2.itemSources.forEach(function(source) { if (source && source[type]) { var newItems = source[type].apply(source, _toConsumableArray(args)); newItems && (items = items.concat(newItems.filter(function(v) { return !!v; }))); } }), { open: !0, pos: { x: x, y: y }, hideContextMenu: function() { return store.hideContextMenu(); }, items: items }; } }, ContextMenu), containerStyle = function(xPos, yPos, theme) { return { top: yPos + "px", left: xPos + "px", position: "fixed", listStyle: "none", margin: 0, padding: "0.25rem 0", fontSize: sansSerif.sizes.large, fontFamily: sansSerif.family, borderRadius: "0.25rem", overflow: "hidden", zIndex: 1, backgroundColor: theme.base01 }; }, emptyStyle = function(theme) { return { padding: "0.25rem 0.5rem", color: theme.base03 }; }, listItemStyle = function(theme) { return { color: theme.base05 }; }, styles = { hidden: { display: "none" }, backdrop: { position: "fixed", left: 0, right: 0, top: 0, bottom: 0, zIndex: 1 }, highlightHoverItem: { padding: "0.25rem 0.5rem", cursor: "default", WebkitUserSelect: "none", MozUserSelect: "none", userSelect: "none" } }; module.exports = Wrapped; }, function(module, exports) { "use strict"; module.exports = { monospace: { family: "Menlo, Consolas, monospace", sizes: { normal: 11, large: 14 } }, sansSerif: { family: '"Helvetica Neue", "Lucida Grande", -apple-system, BlinkMacSystemFont, "Segoe UI", Ubuntu, sans-serif', sizes: { small: 10, normal: 12, large: 14 } } }; }, function(module, exports, __webpack_require__) { "use strict"; 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 || "object" != typeof call && "function" != typeof call ? self : call; } function _inherits(subClass, superClass) { if ("function" != typeof superClass && null !== superClass) 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: !1, writable: !0, configurable: !0 } }), superClass && (Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass); } var _createClass = function() { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0, "value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor); } } return function(Constructor, protoProps, staticProps) { return protoProps && defineProperties(Constructor.prototype, protoProps), staticProps && defineProperties(Constructor, staticProps), Constructor; }; }(), PropTypes = __webpack_require__(7), React = __webpack_require__(12), assign = __webpack_require__(19), HighlightHover = function(_React$Component) { function HighlightHover(props) { _classCallCheck(this, HighlightHover); var _this = _possibleConstructorReturn(this, (HighlightHover.__proto__ || Object.getPrototypeOf(HighlightHover)).call(this, props)); return _this.state = { hover: !1 }, _this; } return _inherits(HighlightHover, _React$Component), _createClass(HighlightHover, [ { key: "render", value: function() { var _this2 = this, theme = this.context.theme; return React.createElement("div", { onMouseOver: function() { return !_this2.state.hover && _this2.setState({ hover: !0 }); }, onMouseOut: function() { return _this2.state.hover && _this2.setState({ hover: !1 }); }, style: assign({}, this.props.style, { backgroundColor: this.state.hover ? theme.base02 : "transparent" }) }, this.props.children); } } ]), HighlightHover; }(React.Component); HighlightHover.contextTypes = { theme: PropTypes.object.isRequired }, module.exports = HighlightHover; }, function(module, exports) { "use strict"; function toObject(val) { if (null === val || void 0 === val) throw new TypeError("Object.assign cannot be called with null or undefined"); return Object(val); } var hasOwnProperty = Object.prototype.hasOwnProperty, propIsEnumerable = Object.prototype.propertyIsEnumerable; module.exports = Object.assign || function(target, source) { for (var from, symbols, to = toObject(target), s = 1; s < arguments.length; s++) { from = Object(arguments[s]); for (var key in from) hasOwnProperty.call(from, key) && (to[key] = from[key]); if (Object.getOwnPropertySymbols) { symbols = Object.getOwnPropertySymbols(from); for (var i = 0; i < symbols.length; i++) propIsEnumerable.call(from, symbols[i]) && (to[symbols[i]] = from[symbols[i]]); } } return to; }; }, function(module, exports, __webpack_require__) { "use strict"; function _defineProperty(obj, key, value) { return key in obj ? Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }) : obj[key] = value, 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 || "object" != typeof call && "function" != typeof call ? self : call; } function _inherits(subClass, superClass) { if ("function" != typeof superClass && null !== superClass) 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: !1, writable: !0, configurable: !0 } }), superClass && (Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass); } function arrayDiff(array, oldArray) { for (var names = new Set(), missing = [], i = 0; i < array.length; i++) names.add(array[i]); for (var j = 0; j < oldArray.length; j++) names.has(oldArray[j]) ? names["delete"](oldArray[j]) : missing.push(oldArray[j]); return { missing: missing, newItems: setToArray(names) }; } function setToArray(set) { var res = [], _iteratorNormalCompletion = !0, _didIteratorError = !1, _iteratorError = void 0; try { for (var _step, _iterator = set[Symbol.iterator](); !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0) { var val = _step.value; res.push(val); } } catch (err) { _didIteratorError = !0, _iteratorError = err; } finally { try { !_iteratorNormalCompletion && _iterator["return"] && _iterator["return"](); } finally { if (_didIteratorError) throw _iteratorError; } } return res; } var _extends = Object.assign || function(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) Object.prototype.hasOwnProperty.call(source, key) && (target[key] = source[key]); } return target; }, _createClass = function() { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0, "value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor); } } return function(Constructor, protoProps, staticProps) { return protoProps && defineProperties(Constructor.prototype, protoProps), staticProps && defineProperties(Constructor, staticProps), Constructor; }; }(), PropTypes = __webpack_require__(7), React = __webpack_require__(12); module.exports = function(options, Component) { var storeKey = options.store || "store", Wrapper = function(_React$Component) { function Wrapper(props) { _classCallCheck(this, Wrapper); var _this = _possibleConstructorReturn(this, (Wrapper.__proto__ || Object.getPrototypeOf(Wrapper)).call(this, props)); return _this.state = {}, _this; } return _inherits(Wrapper, _React$Component), _createClass(Wrapper, [ { key: "componentWillMount", value: function() { var _this2 = this; return this.context[storeKey] ? (this._update = function() { return _this2.forceUpdate(); }, void (options.listeners && (this._listeners = options.listeners(this.props, this.context[storeKey]), this._listeners.forEach(function(evt) { _this2.context[storeKey].on(evt, _this2._update); })))) : void console.warn("no store on context..."); } }, { key: "componentWillUnmount", value: function() { var _this3 = this; return this.context[storeKey] ? void this._listeners.forEach(function(evt) { _this3.context[storeKey].off(evt, _this3._update); }) : void console.warn("no store on context..."); } }, { key: "shouldComponentUpdate", value: function(nextProps, nextState) { return nextState !== this.state || !!options.shouldUpdate && options.shouldUpdate(nextProps, this.props); } }, { key: "componentWillUpdate", value: function(nextProps, nextState) { var _this4 = this; if (!this.context[storeKey]) return void console.warn("no store on context..."); if (options.listeners) { var listeners = options.listeners(this.props, this.context[storeKey]), diff = arrayDiff(listeners, this._listeners); diff.missing.forEach(function(name) { _this4.context[storeKey].off(name, _this4._update); }), diff.newItems.forEach(function(name) { _this4.context[storeKey].on(name, _this4._update); }), this._listeners = listeners; } } }, { key: "render", value: function() { var store = this.context[storeKey], props = store && options.props(store, this.props); return React.createElement(Component, _extends({}, props, this.props)); } } ]), Wrapper; }(React.Component); return Wrapper.contextTypes = _defineProperty({}, storeKey, PropTypes.object), Wrapper.displayName = "Wrapper(" + Component.name + ")", Wrapper; }; }, function(module, exports, __webpack_require__) { "use strict"; 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 || "object" != typeof call && "function" != typeof call ? self : call; } function _inherits(subClass, superClass) { if ("function" != typeof superClass && null !== superClass) 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: !1, writable: !0, configurable: !0 } }), superClass && (Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass); } var _createClass = function() { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0, "value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor); } } return function(Constructor, protoProps, staticProps) { return protoProps && defineProperties(Constructor.prototype, protoProps), staticProps && defineProperties(Constructor, staticProps), Constructor; }; }(), BlurInput = __webpack_require__(22), DataView = __webpack_require__(24), DetailPane = __webpack_require__(52), DetailPaneSection = __webpack_require__(53), _require = __webpack_require__(17), sansSerif = _require.sansSerif, PropVal = __webpack_require__(54), PropTypes = __webpack_require__(7), React = __webpack_require__(12), decorate = __webpack_require__(20), invariant = __webpack_require__(56), PropState = function(_React$Component) { function PropState() { return _classCallCheck(this, PropState), _possibleConstructorReturn(this, (PropState.__proto__ || Object.getPrototypeOf(PropState)).apply(this, arguments)); } return _inherits(PropState, _React$Component), _createClass(PropState, [ { key: "getChildContext", value: function() { var _this2 = this; return { onChange: function(path, val) { _this2.props.onChange(path, val); } }; } }, { key: "renderSource", value: function() { var theme = this.context.theme, _props = this.props, id = _props.id, node = _props.node, onViewElementSource = _props.onViewElementSource, source = node.get("source"); if (!source) return null; var onClick = void 0; return onViewElementSource && (onClick = function() { return onViewElementSource(id, source); }), React.createElement("div", { style: sourceStyle(!!onViewElementSource, theme), onClick: onClick }, source.fileName, React.createElement("span", { style: sourcePosStyle(theme) }, ":", source.lineNumber)); } }, { key: "render", value: function() { var _this3 = this, theme = this.context.theme; if (!this.props.node) return React.createElement("span", { style: emptyStyle(theme) }, "No selection"); var nodeType = this.props.node.get("nodeType"); if ("Text" === nodeType) return this.props.canEditTextContent ? React.createElement(DetailPane, null, React.createElement(BlurInput, { value: this.props.node.get("text"), onChange: this.props.onChangeText })) : React.createElement(DetailPane, { header: "Text Node" }, React.createElement("span", { style: noPropsStateStyle(theme) }, "No props/state.")); if ("Empty" === nodeType) return React.createElement(DetailPane, { header: "Empty Node" }, React.createElement("span", { style: noPropsStateStyle(theme) }, "No props/state.")); var editTextContent = null; this.props.canEditTextContent && "string" == typeof this.props.node.get("children") && (editTextContent = React.createElement(BlurInput, { value: this.props.node.get("children"), onChange: this.props.onChangeText })); var key = this.props.node.get("key"), ref = this.props.node.get("ref"), state = this.props.node.get("state"), context = this.props.node.get("context"), propsReadOnly = !this.props.node.get("canUpdate"); return React.createElement(DetailPane, { theme: theme }, key && React.createElement(DetailPaneSection, { title: "Key", key: this.props.id + "-key" }, React.createElement(PropVal, { val: key })), ref && React.createElement(DetailPaneSection, { title: "Ref", key: this.props.id + "-ref" }, React.createElement(PropVal, { val: ref })), editTextContent, React.createElement(DetailPaneSection, { hint: propsReadOnly ? "read-only" : null, title: "Props" }, React.createElement(DataView, { path: [ "props" ], readOnly: propsReadOnly, inspect: this.props.inspect, showMenu: this.props.showMenu, key: this.props.id + "-props", data: this.props.node.get("props") })), state && React.createElement(DetailPaneSection, { title: "State" }, React.createElement(DataView, { data: state, path: [ "state" ], inspect: this.props.inspect, showMenu: this.props.showMenu, key: this.props.id + "-state" })), context && React.createElement(DetailPaneSection, { title: "Context" }, React.createElement(DataView, { data: context, path: [ "context" ], inspect: this.props.inspect, showMenu: this.props.showMenu, key: this.props.id + "-context" })), this.props.extraPanes && this.props.extraPanes.map(function(fn) { return fn && fn(_this3.props.node, _this3.props.id); }), React.createElement("div", { style: { flex: 1 } }), this.renderSource()); } } ]), PropState; }(React.Component); PropState.contextTypes = { theme: PropTypes.object.isRequired }, PropState.childContextTypes = { onChange: PropTypes.func }; var WrappedPropState = decorate({ listeners: function(props, store) { return [ "selected", store.selected ]; }, props: function(store) { var node = store.selected ? store.get(store.selected) : null; return { id: store.selected, node: node, canEditTextContent: store.capabilities.editTextContent, onChangeText: function(text) { store.changeTextContent(store.selected, text); }, onChange: function(path, val) { "props" === path[0] ? store.setProps(store.selected, path.slice(1), val) : "state" === path[0] ? store.setState(store.selected, path.slice(1), val) : "context" === path[0] ? store.setContext(store.selected, path.slice(1), val) : invariant(!1, "the path to change() must start wth props, state, or context"); }, showMenu: function(e, val, path, name) { store.showContextMenu("attr", e, store.selected, node, val, path, name); }, inspect: store.inspect.bind(store, store.selected) }; } }, PropState), emptyStyle = function(theme) { return { fontFamily: sansSerif.family, fontSize: sansSerif.sizes.large, fontStyle: "italic", margin: "auto", color: theme.base04 }; }, sourceStyle = function(hasViewElementSource, theme) { return { padding: "0.25rem 0.5rem", color: theme.base05, overflowWrap: "break-word", cursor: hasViewElementSource ? "pointer" : "default" }; }, sourcePosStyle = function(theme) { return { color: theme.base03 }; }, noPropsStateStyle = function(theme) { return { fontFamily: sansSerif.family, fontSize: sansSerif.sizes.normal, color: theme.base03, textAlign: "center", fontStyle: "italic", padding: "0.5rem" }; }; module.exports = WrappedPropState; }, function(module, exports, __webpack_require__) { "use strict"; 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 || "object" != typeof call && "function" != typeof call ? self : call; } function _inherits(subClass, superClass) { if ("function" != typeof superClass && null !== superClass) 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: !1, writable: !0, configurable: !0 } }), superClass && (Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass); } var _createClass = function() { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0, "value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor); } } return function(Constructor, protoProps, staticProps) { return protoProps && defineProperties(Constructor.prototype, protoProps), staticProps && defineProperties(Constructor, staticProps), Constructor; }; }(), React = __webpack_require__(12), Input = __webpack_require__(23), BlurInput = function(_React$Component) { function BlurInput(props) { _classCallCheck(this, BlurInput); var _this = _possibleConstructorReturn(this, (BlurInput.__proto__ || Object.getPrototypeOf(BlurInput)).call(this, props)); return _this.state = { text: _this.props.value || "" }, _this; } return _inherits(BlurInput, _React$Component), _createClass(BlurInput, [ { key: "componentWillReceiveProps", value: function(nextProps) { nextProps.value !== this.props.value && this.setState({ text: "" + nextProps.value }); } }, { key: "done", value: function() { this.state.text !== (this.props.value || "") && this.props.onChange(this.state.text); } }, { key: "onKeyDown", value: function(e) { "Enter" === e.key && this.done(); } }, { key: "render", value: function() { var _this2 = this; return React.createElement(Input, { value: this.state.text, innerRef: function(i) { return _this2.node = i; }, onChange: function(e) { return _this2.setState({ text: e.target.value }); }, onBlur: this.done.bind(this), onKeyDown: function(e) { return _this2.onKeyDown(e); } }); } } ]), BlurInput; }(React.Component); module.exports = BlurInput; }, function(module, exports, __webpack_require__) { "use strict"; function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) keys.indexOf(i) >= 0 || Object.prototype.hasOwnProperty.call(obj, i) && (target[i] = obj[i]); return target; } var _extends = Object.assign || function(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) Object.prototype.hasOwnProperty.call(source, key) && (target[key] = source[key]); } return target; }, PropTypes = __webpack_require__(7), React = __webpack_require__(12), Input = function(props, context) { var _props$style = props.style, style = void 0 === _props$style ? {} : _props$style, theme = props.theme, innerRef = props.innerRef, rest = _objectWithoutProperties(props, [ "style", "theme", "innerRef" ]), chosenTheme = theme ? theme : context.theme; return React.createElement("input", _extends({ style: _extends({}, inputStyle(chosenTheme), style), ref: innerRef }, rest)); }; Input.contextTypes = { theme: PropTypes.object.isRequired }; var inputStyle = function(theme) { return { backgroundColor: theme.base00, color: theme.base05 }; }; module.exports = Input; }, function(module, exports, __webpack_require__) { "use strict"; 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 || "object" != typeof call && "function" != typeof call ? self : call; } function _inherits(subClass, superClass) { if ("function" != typeof superClass && null !== superClass) 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: !1, writable: !0, configurable: !0 } }), superClass && (Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass); } function alphanumericSort(a, b) { return "" + +a === a ? "" + +b !== b ? -1 : +a < +b ? -1 : 1 : a < b ? -1 : 1; } var _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj) { return typeof obj; } : function(obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _createClass = function() { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0, "value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor); } } return function(Constructor, protoProps, staticProps) { return protoProps && defineProperties(Constructor.prototype, protoProps), staticProps && defineProperties(Constructor, staticProps), Constructor; }; }(), PropTypes = __webpack_require__(7), React = __webpack_require__(12), Simple = __webpack_require__(25), nullthrows = __webpack_require__(3)["default"], consts = __webpack_require__(32), previewComplex = __webpack_require__(51), DataView = function(_React$Component) { function DataView() { return _classCallCheck(this, DataView), _possibleConstructorReturn(this, (DataView.__proto__ || Object.getPrototypeOf(DataView)).apply(this, arguments)); } return _inherits(DataView, _React$Component), _createClass(DataView, [ { key: "renderSparseArrayHole", value: function(count, key) { var theme = this.context.theme; return React.createElement("li", { key: key }, React.createElement("div", { style: styles.head }, React.createElement("div", { style: sparseArrayHoleStyle(theme) }, "undefined × ", count))); } }, { key: "renderItem", value: function(name, key) { var data = nullthrows(this.props.data); return React.createElement(DataItem, { key: key, name: name, path: this.props.path.concat([ name ]), startOpen: this.props.startOpen, inspect: this.props.inspect, showMenu: this.props.showMenu, readOnly: this.props.readOnly, value: data[name] }); } }, { key: "render", value: function() { var _this2 = this, theme = this.context.theme, data = this.props.data; if (!data) return React.createElement("div", { style: missingStyle(theme) }, "null"); var isArray = Array.isArray(data), elements = []; if (isArray) { var lastIndex = -1; if (data.forEach(function(item, i) { if (lastIndex < i - 1) { var holeCount = i - 1 - lastIndex; elements.push(_this2.renderSparseArrayHole(holeCount, i + "-hole")); } elements.push(_this2.renderItem(i, i)), lastIndex = i; }), lastIndex < data.length - 1) { var holeCount = data.length - 1 - lastIndex; elements.push(this.renderSparseArrayHole(holeCount, lastIndex + "-hole")); } } else { var names = Object.keys(data); this.props.noSort || names.sort(alphanumericSort), names.forEach(function(name, i) { elements.push(_this2.renderItem(name, name)); }); } return elements.length ? React.createElement("ul", { style: styles.container }, data[consts.proto] && React.createElement(DataItem, { key: "__proto__", name: "__proto__", path: this.props.path.concat([ "__proto__" ]), startOpen: this.props.startOpen, inspect: this.props.inspect, showMenu: this.props.showMenu, readOnly: this.props.readOnly, value: data[consts.proto] }), elements) : React.createElement("div", { style: emptyStyle(theme) }, isArray ? "Empty array" : "Empty object"); } } ]), DataView; }(React.Component); DataView.contextTypes = { theme: PropTypes.object.isRequired }; var DataItem = function(_React$Component2) { function DataItem(props) { _classCallCheck(this, DataItem); var _this3 = _possibleConstructorReturn(this, (DataItem.__proto__ || Object.getPrototypeOf(DataItem)).call(this, props)); return _this3.state = { open: !!_this3.props.startOpen, loading: !1 }, _this3; } return _inherits(DataItem, _React$Component2), _createClass(DataItem, [ { key: "componentDidMount", value: function() { this.state.open && this.props.value && this.props.value[consts.inspected] === !1 && this.inspect(); } }, { key: "componentWillReceiveProps", value: function(nextProps) { this.state.open && nextProps.value && nextProps.value[consts.inspected] === !1 && this.inspect(); } }, { key: "inspect", value: function() { var _this4 = this; this.setState({ loading: !0, open: !0 }), this.props.inspect(this.props.path, function() { _this4.setState({ loading: !1 }); }); } }, { key: "toggleOpen", value: function() { if (!this.state.loading) return this.props.value && this.props.value[consts.inspected] === !1 ? void this.inspect() : void this.setState({ open: !this.state.open }); } }, { key: "toggleBooleanValue", value: function(e) { this.context.onChange(this.props.path, e.target.checked); } }, { key: "render", value: function() { var preview, _this5 = this, theme = this.context.theme, data = this.props.value, otype = "undefined" == typeof data ? "undefined" : _typeof(data), complex = !0; "number" === otype || "string" === otype || null == data || "boolean" === otype ? (preview = React.createElement(Simple, { readOnly: this.props.readOnly, path: this.props.path, data: data }), complex = !1) : preview = previewComplex(data, theme); var inspectable = !data || !data[consts.meta] || !data[consts.meta].uninspectable, open = inspectable && this.state.open && (!data || data[consts.inspected] !== !1), opener = null; complex && inspectable ? opener = React.createElement("div", { onClick: this.toggleOpen.bind(this), style: styles.opener }, open ? React.createElement("span", { style: expandedArrowStyle(theme) }) : React.createElement("span", { style: collapsedArrowStyle(theme) })) : "boolean" !== otype || this.props.readOnly || (opener = React.createElement("input", { checked: data, onChange: this.toggleBooleanValue.bind(this), style: styles.toggler, type: "checkbox" })); var children = null; if (complex && open) { var readOnly = this.props.readOnly || data[consts.meta] && data[consts.meta].readOnly; children = React.createElement("div", { style: styles.children }, React.createElement(DataView, { data: data, path: this.props.path, inspect: this.props.inspect, showMenu: this.props.showMenu, readOnly: readOnly })); } var name = this.props.name; return name.length > 50 && (name = name.slice(0, 50) + "…"), React.createElement("li", null, React.createElement("div", { style: styles.head }, opener, React.createElement("div", { style: nameStyle(complex, theme), onClick: inspectable && this.toggleOpen.bind(this) }, name, ":"), React.createElement("div", { onContextMenu: function(e) { "function" == typeof _this5.props.showMenu && _this5.props.showMenu(e, _this5.props.value, _this5.props.path, name); }, style: previewStyle(theme) }, preview)), children); } } ]), DataItem; }(React.Component); DataItem.contextTypes = { onChange: PropTypes.func, theme: PropTypes.object.isRequired }; var nameStyle = function(isComplex, theme) { return { cursor: isComplex ? "pointer" : "default", color: theme.special03, margin: "0 0.25rem" }; }, previewStyle = function(theme) { return { display: "flex", whiteSpace: "pre", wordBreak: "break-word", flex: 1, color: theme.special01 }; }, emptyStyle = function(theme) { return { lineHeight: "1.25rem", color: theme.base04, paddingLeft: "1rem" }; }, missingStyle = function(theme) { return { fontWeight: "bold", lineHeight: "1.25rem", color: theme.base03, paddingLeft: "1rem" }; }, collapsedArrowStyle = function(theme) { return { borderColor: "transparent transparent transparent " + theme.base03, borderStyle: "solid", borderWidth: "4px 0 4px 6px", display: "inline-block", verticalAlign: "middle" }; }, expandedArrowStyle = function(theme) { return { borderColor: theme.base03 + " transparent transparent transparent", borderStyle: "solid", borderWidth: "6px 4px 0 4px", display: "inline-block", verticalAlign: "middle" }; }, sparseArrayHoleStyle = function(theme) { return { fontStyle: "italic", color: theme.base03, margin: "2px 3px" }; }, styles = { container: { listStyle: "none", margin: 0, padding: 0, marginLeft: "0.75rem" }, children: {}, opener: { cursor: "pointer", marginLeft: -10, position: "absolute" }, toggler: { left: -15, position: "absolute", top: -1 }, head: { display: "flex", position: "relative", lineHeight: "1.25rem" }, value: {} }; module.exports = DataView; }, function(module, exports, __webpack_require__) { "use strict"; 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 || "object" != typeof call && "function" != typeof call ? self : call; } function _inherits(subClass, superClass) { if ("function" != typeof superClass && null !== superClass) 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: !1, writable: !0, configurable: !0 } }), superClass && (Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass); } function textToValue(txt) { if (!txt.length) return BAD_INPUT; if ("undefined" !== txt) try { return JSON.parse(txt); } catch (e) { return BAD_INPUT; } } function valueToText(value) { return void 0 === value ? "undefined" : "number" == typeof value ? value.toString() : JSON.stringify(value); } var _createClass = function() { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0, "value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor); } } return function(Constructor, protoProps, staticProps) { return protoProps && defineProperties(Constructor.prototype, protoProps), staticProps && defineProperties(Constructor, staticProps), Constructor; }; }(), PropTypes = __webpack_require__(7), React = __webpack_require__(12), ReactDOM = __webpack_require__(26), Input = __webpack_require__(23), flash = __webpack_require__(31), _require = __webpack_require__(17), monospace = _require.monospace, Simple = function(_React$Component) { function Simple(props) { _classCallCheck(this, Simple); var _this = _possibleConstructorReturn(this, (Simple.__proto__ || Object.getPrototypeOf(Simple)).call(this, props)); return _this.state = { text: "", editing: !1 }, _this; } return _inherits(Simple, _React$Component), _createClass(Simple, [ { key: "onChange", value: function(e) { this.setState({ text: e.target.value }); } }, { key: "onKeyDown", value: function(e) { "Enter" === e.key && (this.onSubmit(!0), this.setState({ editing: !1 })), "Escape" === e.key && this.setState({ editing: !1 }); } }, { key: "onSubmit", value: function(editing) { if (this.state.text === valueToText(this.props.data)) return void this.setState({ editing: editing }); var value = textToValue(this.state.text); return value === BAD_INPUT ? void this.setState({ text: valueToText(this.props.data), editing: editing }) : (this.context.onChange(this.props.path, value), void this.setState({ editing: editing })); } }, { key: "startEditing", value: function() { this.props.readOnly || this.setState({ editing: !0, text: valueToText(this.props.data) }); } }, { key: "selectAll", value: function() { var input = this.input; input.selectionStart = 0, input.selectionEnd = input.value.length; } }, { key: "componentDidUpdate", value: function(prevProps, prevState) { this.state.editing && !prevState.editing && this.selectAll(), this.state.editing || this.props.data === prevProps.data || flash(ReactDOM.findDOMNode(this), this.context.theme.state04, "transparent", 1); } }, { key: "render", value: function() { var _this2 = this, theme = this.context.theme, readOnly = this.props.readOnly, _state = this.state, editing = _state.editing, text = _state.text; if (editing) return React.createElement(Input, { autoFocus: !0, innerRef: function(i) { return _this2.input = i; }, style: inputStyle(theme), onChange: function(e) { return _this2.onChange(e); }, onBlur: function() { return _this2.onSubmit(!1); }, onKeyDown: this.onKeyDown.bind(this), value: text }); var data = this.props.data; return "string" == typeof data && data.length > 200 && (data = data.slice(0, 200) + "…"), React.createElement("div", { onClick: this.startEditing.bind(this), style: simpleStyle(readOnly, theme) }, valueToText(data)); } } ]), Simple; }(React.Component); Simple.propTypes = { data: PropTypes.any, path: PropTypes.array, readOnly: PropTypes.bool }, Simple.contextTypes = { onChange: PropTypes.func, theme: PropTypes.object.isRequired }; var inputStyle = function(theme) { return { flex: 1, minWidth: 50, boxSizing: "border-box", border: "none", padding: 0, outline: "none", boxShadow: "0 0 3px " + theme.base02, fontFamily: monospace.family, fontSize: "inherit" }; }, simpleStyle = function(readOnly, theme) { return { display: "flex", flex: 1, whiteSpace: "pre-wrap", cursor: readOnly ? "default" : "pointer" }; }, BAD_INPUT = Symbol("bad input"); module.exports = Simple; }, function(module, exports, __webpack_require__) { "use strict"; function checkDCE() { if ("undefined" != typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" == typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE) try { __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(checkDCE); } catch (err) { console.error(err); } } checkDCE(), module.exports = __webpack_require__(27); }, function(module, exports, __webpack_require__) { /** @license React v16.5.2 * react-dom.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ "use strict"; function ca(a, b, c, d, e, f, g, h) { if (!a) { if (a = void 0, void 0 === b) a = Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings."); else { var k = [ c, d, e, f, g, h ], l = 0; a = Error(b.replace(/%s/g, function() { return k[l++]; })), a.name = "Invariant Violation"; } throw a.framesToPop = 1, a; } } function t(a) { for (var b = arguments.length - 1, c = "https://reactjs.org/docs/error-decoder.html?invariant=" + a, d = 0; d < b; d++) c += "&args[]=" + encodeURIComponent(arguments[d + 1]); ca(!1, "Minified React error #" + a + "; visit %s for the full message or use the non-minified dev environment for full errors and additional helpful warnings. ", c); } function da(a, b, c, d, e, f, g, h, k) { var l = Array.prototype.slice.call(arguments, 3); try { b.apply(c, l); } catch (m) { this.onError(m); } } function ka(a, b, c, d, e, f, g, h, k) { ea = !1, fa = null, da.apply(ja, arguments); } function la(a, b, c, d, e, f, g, h, k) { if (ka.apply(this, arguments), ea) { if (ea) { var l = fa; ea = !1, fa = null; } else t("198"), l = void 0; ha || (ha = !0, ia = l); } } function oa() { if (ma) for (var a in na) { var b = na[a], c = ma.indexOf(a); if (-1 < c ? void 0 : t("96", a), !pa[c]) { b.extractEvents ? void 0 : t("97", a), pa[c] = b, c = b.eventTypes; for (var d in c) { var e = void 0, f = c[d], g = b, h = d; qa.hasOwnProperty(h) ? t("99", h) : void 0, qa[h] = f; var k = f.phasedRegistrationNames; if (k) { for (e in k) k.hasOwnProperty(e) && ra(k[e], g, h); e = !0; } else f.registrationName ? (ra(f.registrationName, g, h), e = !0) : e = !1; e ? void 0 : t("98", d, a); } } } } function ra(a, b, c) { sa[a] ? t("100", a) : void 0, sa[a] = b, ta[a] = b.eventTypes[c].dependencies; } function xa(a, b, c, d) { b = a.type || "unknown-event", a.currentTarget = wa(d), la(b, c, void 0, a), a.currentTarget = null; } function ya(a, b) { return null == b ? t("30") : void 0, null == a ? b : Array.isArray(a) ? Array.isArray(b) ? (a.push.apply(a, b), a) : (a.push(b), a) : Array.isArray(b) ? [ a ].concat(b) : [ a, b ]; } function za(a, b, c) { Array.isArray(a) ? a.forEach(b, c) : a && b.call(c, a); } function Ba(a, b) { if (a) { var c = a._dispatchListeners, d = a._dispatchInstances; if (Array.isArray(c)) for (var e = 0; e < c.length && !a.isPropagationStopped(); e++) xa(a, b, c[e], d[e]); else c && xa(a, b, c, d); a._dispatchListeners = null, a._dispatchInstances = null, a.isPersistent() || a.constructor.release(a); } } function Ca(a) { return Ba(a, !0); } function Da(a) { return Ba(a, !1); } function Fa(a, b) { var c = a.stateNode; if (!c) return null; var d = ua(c); if (!d) return null; c = d[b]; a: switch (b) { case "onClick": case "onClickCapture": case "onDoubleClick": case "onDoubleClickCapture": case "onMouseDown": case "onMouseDownCapture": case "onMouseMove": case "onMouseMoveCapture": case "onMouseUp": case "onMouseUpCapture": (d = !d.disabled) || (a = a.type, d = !("button" === a || "input" === a || "select" === a || "textarea" === a)), a = !d; break a; default: a = !1; } return a ? null : (c && "function" != typeof c ? t("231", b, typeof c) : void 0, c); } function Ga(a, b) { if (null !== a && (Aa = ya(Aa, a)), a = Aa, Aa = null, a && (b ? za(a, Ca) : za(a, Da), Aa ? t("95") : void 0, ha)) throw b = ia, ha = !1, ia = null, b; } function Ka(a) { if (a[Ia]) return a[Ia]; for (;!a[Ia]; ) { if (!a.parentNode) return null; a = a.parentNode; } return a = a[Ia], 7 === a.tag || 8 === a.tag ? a : null; } function La(a) { return a = a[Ia], !a || 7 !== a.tag && 8 !== a.tag ? null : a; } function Ma(a) { return 7 === a.tag || 8 === a.tag ? a.stateNode : void t("33"); } function Na(a) { return a[Ja] || null; } function Oa(a) { do a = a["return"]; while (a && 7 !== a.tag); return a ? a : null; } function Pa(a, b, c) { (b = Fa(a, c.dispatchConfig.phasedRegistrationNames[b])) && (c._dispatchListeners = ya(c._dispatchListeners, b), c._dispatchInstances = ya(c._dispatchInstances, a)); } function Qa(a) { if (a && a.dispatchConfig.phasedRegistrationNames) { for (var b = a._targetInst, c = []; b; ) c.push(b), b = Oa(b); for (b = c.length; 0 < b--; ) Pa(c[b], "captured", a); for (b = 0; b < c.length; b++) Pa(c[b], "bubbled", a); } } function Ra(a, b, c) { a && c && c.dispatchConfig.registrationName && (b = Fa(a, c.dispatchConfig.registrationName)) && (c._dispatchListeners = ya(c._dispatchListeners, b), c._dispatchInstances = ya(c._dispatchInstances, a)); } function Ta(a) { a && a.dispatchConfig.registrationName && Ra(a._targetInst, null, a); } function Ua(a) { za(a, Qa); } function Wa(a, b) { var c = {}; return c[a.toLowerCase()] = b.toLowerCase(), c["Webkit" + a] = "webkit" + b, c["Moz" + a] = "moz" + b, c; } function ab(a) { if (Za[a]) return Za[a]; if (!Ya[a]) return a; var c, b = Ya[a]; for (c in b) if (b.hasOwnProperty(c) && c in $a) return Za[a] = b[c]; return a; } function jb() { if (ib) return ib; var a, d, b = hb, c = b.length, e = "value" in gb ? gb.value : gb.textContent, f = e.length; for (a = 0; a < c && b[a] === e[a]; a++) ; var g = c - a; for (d = 1; d <= g && b[c - d] === e[f - d]; d++) ; return ib = e.slice(a, 1 < d ? 1 - d : void 0); } function kb() { return !0; } function lb() { return !1; } function z(a, b, c, d) { this.dispatchConfig = a, this._targetInst = b, this.nativeEvent = c, a = this.constructor.Interface; for (var e in a) a.hasOwnProperty(e) && ((b = a[e]) ? this[e] = b(c) : "target" === e ? this.target = d : this[e] = c[e]); return this.isDefaultPrevented = (null != c.defaultPrevented ? c.defaultPrevented : !1 === c.returnValue) ? kb : lb, this.isPropagationStopped = lb, this; } function nb(a, b, c, d) { if (this.eventPool.length) { var e = this.eventPool.pop(); return this.call(e, a, b, c, d), e; } return new this(a, b, c, d); } function ob(a) { a instanceof this ? void 0 : t("279"), a.destructor(), 10 > this.eventPool.length && this.eventPool.push(a); } function mb(a) { a.eventPool = [], a.getPooled = nb, a.release = ob; } function zb(a, b) { switch (a) { case "keyup": return -1 !== rb.indexOf(b.keyCode); case "keydown": return 229 !== b.keyCode; case "keypress": case "mousedown": case "blur": return !0; default: return !1; } } function Ab(a) { return a = a.detail, "object" == typeof a && "data" in a ? a.data : null; } function Cb(a, b) { switch (a) { case "compositionend": return Ab(b); case "keypress": return 32 !== b.which ? null : (yb = !0, wb); case "textInput": return a = b.data, a === wb && yb ? null : a; default: return null; } } function Db(a, b) { if (Bb) return "compositionend" === a || !sb && zb(a, b) ? (a = jb(), ib = hb = gb = null, Bb = !1, a) : null; switch (a) { case "paste": return null; case "keypress": if (!(b.ctrlKey || b.altKey || b.metaKey) || b.ctrlKey && b.altKey) { if (b["char"] && 1 < b["char"].length) return b["char"]; if (b.which) return String.fromCharCode(b.which); } return null; case "compositionend": return vb && "ko" !== b.locale ? null : b.data; default: return null; } } function Ib(a) { if (a = va(a)) { "function" != typeof Fb ? t("280") : void 0; var b = ua(a.stateNode); Fb(a.stateNode, a.type, b); } } function Jb(a) { Gb ? Hb ? Hb.push(a) : Hb = [ a ] : Gb = a; } function Kb() { if (Gb) { var a = Gb, b = Hb; if (Hb = Gb = null, Ib(a), b) for (a = 0; a < b.length; a++) Ib(b[a]); } } function Lb(a, b) { return a(b); } function Mb(a, b, c) { return a(b, c); } function Nb() {} function Pb(a, b) { if (Ob) return a(b); Ob = !0; try { return Lb(a, b); } finally { Ob = !1, (null !== Gb || null !== Hb) && (Nb(), Kb()); } } function Rb(a) { var b = a && a.nodeName && a.nodeName.toLowerCase(); return "input" === b ? !!Qb[a.type] : "textarea" === b; } function Sb(a) { return a = a.target || a.srcElement || window, a.correspondingUseElement && (a = a.correspondingUseElement), 3 === a.nodeType ? a.parentNode : a; } function Tb(a) { if (!Va) return !1; a = "on" + a; var b = a in document; return b || (b = document.createElement("div"), b.setAttribute(a, "return;"), b = "function" == typeof b[a]), b; } function Ub(a) { var b = a.type; return (a = a.nodeName) && "input" === a.toLowerCase() && ("checkbox" === b || "radio" === b); } function Vb(a) { var b = Ub(a) ? "checked" : "value", c = Object.getOwnPropertyDescriptor(a.constructor.prototype, b), d = "" + a[b]; if (!a.hasOwnProperty(b) && "undefined" != typeof c && "function" == typeof c.get && "function" == typeof c.set) { var e = c.get, f = c.set; return Object.defineProperty(a, b, { configurable: !0, get: function() { return e.call(this); }, set: function(a) { d = "" + a, f.call(this, a); } }), Object.defineProperty(a, b, { enumerable: c.enumerable }), { getValue: function() { return d; }, setValue: function(a) { d = "" + a; }, stopTracking: function() { a._valueTracker = null, delete a[b]; } }; } } function Wb(a) { a._valueTracker || (a._valueTracker = Vb(a)); } function Xb(a) { if (!a) return !1; var b = a._valueTracker; if (!b) return !0; var c = b.getValue(), d = ""; return a && (d = Ub(a) ? a.checked ? "true" : "false" : a.value), a = d, a !== c && (b.setValue(a), !0); } function kc(a) { return null === a || "object" != typeof a ? null : (a = jc && a[jc] || a["@@iterator"], "function" == typeof a ? a : null); } function lc(a) { if (null == a) return null; if ("function" == typeof a) return a.displayName || a.name || null; if ("string" == typeof a) return a; switch (a) { case gc: return "AsyncMode"; case bc: return "Fragment"; case ac: return "Portal"; case dc: return "Profiler"; case cc: return "StrictMode"; case ic: return "Placeholder"; } if ("object" == typeof a) { switch (a.$$typeof) { case fc: return "Context.Consumer"; case ec: return "Context.Provider"; case hc: var b = a.render; return b = b.displayName || b.name || "", a.displayName || ("" !== b ? "ForwardRef(" + b + ")" : "ForwardRef"); } if ("function" == typeof a.then && (a = 1 === a._reactStatus ? a._reactResult : null)) return lc(a); } return null; } function mc(a) { var b = ""; do { a: switch (a.tag) { case 4: case 0: case 1: case 2: case 3: case 7: case 10: var c = a._debugOwner, d = a._debugSource, e = lc(a.type), f = null; c && (f = lc(c.type)), c = e, e = "", d ? e = " (at " + d.fileName.replace(Zb, "") + ":" + d.lineNumber + ")" : f && (e = " (created by " + f + ")"), f = "\n in " + (c || "Unknown") + e; break a; default: f = ""; } b += f, a = a["return"]; } while (a); return b; } function sc(a) { return !!pc.call(rc, a) || !pc.call(qc, a) && (nc.test(a) ? rc[a] = !0 : (qc[a] = !0, !1)); } function tc(a, b, c, d) { if (null !== c && 0 === c.type) return !1; switch (typeof b) { case "function": case "symbol": return !0; case "boolean": return !d && (null !== c ? !c.acceptsBooleans : (a = a.toLowerCase().slice(0, 5), "data-" !== a && "aria-" !== a)); default: return !1; } } function uc(a, b, c, d) { if (null === b || "undefined" == typeof b || tc(a, b, c, d)) return !0; if (d) return !1; if (null !== c) switch (c.type) { case 3: return !b; case 4: return !1 === b; case 5: return isNaN(b); case 6: return isNaN(b) || 1 > b; } return !1; } function D(a, b, c, d, e) { this.acceptsBooleans = 2 === b || 3 === b || 4 === b, this.attributeName = d, this.attributeNamespace = e, this.mustUseProperty = c, this.propertyName = a, this.type = b; } function wc(a) { return a[1].toUpperCase(); } function xc(a, b, c, d) { var e = E.hasOwnProperty(b) ? E[b] : null, f = null !== e ? 0 === e.type : !d && (2 < b.length && ("o" === b[0] || "O" === b[0]) && ("n" === b[1] || "N" === b[1])); f || (uc(b, c, e, d) && (c = null), d || null === e ? sc(b) && (null === c ? a.removeAttribute(b) : a.setAttribute(b, "" + c)) : e.mustUseProperty ? a[e.propertyName] = null === c ? 3 !== e.type && "" : c : (b = e.attributeName, d = e.attributeNamespace, null === c ? a.removeAttribute(b) : (e = e.type, c = 3 === e || 4 === e && !0 === c ? "" : "" + c, d ? a.setAttributeNS(d, b, c) : a.setAttribute(b, c)))); } function yc(a) { switch (typeof a) { case "boolean": case "number": case "object": case "string": case "undefined": return a; default: return ""; } } function zc(a, b) { var c = b.checked; return n({}, b, { defaultChecked: void 0, defaultValue: void 0, value: void 0, checked: null != c ? c : a._wrapperState.initialChecked }); } function Bc(a, b) { var c = null == b.defaultValue ? "" : b.defaultValue, d = null != b.checked ? b.checked : b.defaultChecked; c = yc(null != b.value ? b.value : c), a._wrapperState = { initialChecked: d, initialValue: c, controlled: "checkbox" === b.type || "radio" === b.type ? null != b.checked : null != b.value }; } function Cc(a, b) { b = b.checked, null != b && xc(a, "checked", b, !1); } function Dc(a, b) { Cc(a, b); var c = yc(b.value), d = b.type; if (null != c) "number" === d ? (0 === c && "" === a.value || a.value != c) && (a.value = "" + c) : a.value !== "" + c && (a.value = "" + c); else if ("submit" === d || "reset" === d) return void a.removeAttribute("value"); b.hasOwnProperty("value") ? Ec(a, b.type, c) : b.hasOwnProperty("defaultValue") && Ec(a, b.type, yc(b.defaultValue)), null == b.checked && null != b.defaultChecked && (a.defaultChecked = !!b.defaultChecked); } function Fc(a, b, c) { if (b.hasOwnProperty("value") || b.hasOwnProperty("defaultValue")) { var d = b.type; if (!("submit" !== d && "reset" !== d || void 0 !== b.value && null !== b.value)) return; b = "" + a._wrapperState.initialValue, c || b === a.value || (a.value = b), a.defaultValue = b; } c = a.name, "" !== c && (a.name = ""), a.defaultChecked = !a.defaultChecked, a.defaultChecked = !!a._wrapperState.initialChecked, "" !== c && (a.name = c); } function Ec(a, b, c) { "number" === b && a.ownerDocument.activeElement === a || (null == c ? a.defaultValue = "" + a._wrapperState.initialValue : a.defaultValue !== "" + c && (a.defaultValue = "" + c)); } function Hc(a, b, c) { return a = z.getPooled(Gc.change, a, b, c), a.type = "change", Jb(c), Ua(a), a; } function Kc(a) { Ga(a, !1); } function Lc(a) { var b = Ma(a); if (Xb(b)) return a; } function Mc(a, b) { if ("change" === a) return b; } function Oc() { Ic && (Ic.detachEvent("onpropertychange", Pc), Jc = Ic = null); } function Pc(a) { "value" === a.propertyName && Lc(Jc) && (a = Hc(Jc, a, Sb(a)), Pb(Kc, a)); } function Qc(a, b, c) { "focus" === a ? (Oc(), Ic = b, Jc = c, Ic.attachEvent("onpropertychange", Pc)) : "blur" === a && Oc(); } function Rc(a) { if ("selectionchange" === a || "keyup" === a || "keydown" === a) return Lc(Jc); } function Sc(a, b) { if ("click" === a) return Lc(b); } function Tc(a, b) { if ("input" === a || "change" === a) return Lc(b); } function Xc(a) { var b = this.nativeEvent; return b.getModifierState ? b.getModifierState(a) : !!(a = Wc[a]) && !!b[a]; } function Yc() { return Xc; } function hd(a, b) { return a === b ? 0 !== a || 0 !== b || 1 / a === 1 / b : a !== a && b !== b; } function id(a, b) { if (hd(a, b)) return !0; if ("object" != typeof a || null === a || "object" != typeof b || null === b) return !1; var c = Object.keys(a), d = Object.keys(b); if (c.length !== d.length) return !1; for (d = 0; d < c.length; d++) if (!gd.call(b, c[d]) || !hd(a[c[d]], b[c[d]])) return !1; return !0; } function jd(a) { var b = a; if (a.alternate) for (;b["return"]; ) b = b["return"]; else { if (0 !== (2 & b.effectTag)) return 1; for (;b["return"]; ) if (b = b["return"], 0 !== (2 & b.effectTag)) return 1; } return 5 === b.tag ? 2 : 3; } function kd(a) { 2 !== jd(a) ? t("188") : void 0; } function ld(a) { var b = a.alternate; if (!b) return b = jd(a), 3 === b ? t("188") : void 0, 1 === b ? null : a; for (var c = a, d = b; ;) { var e = c["return"], f = e ? e.alternate : null; if (!e || !f) break; if (e.child === f.child) { for (var g = e.child; g; ) { if (g === c) return kd(e), a; if (g === d) return kd(e), b; g = g.sibling; } t("188"); } if (c["return"] !== d["return"]) c = e, d = f; else { g = !1; for (var h = e.child; h; ) { if (h === c) { g = !0, c = e, d = f; break; } if (h === d) { g = !0, d = e, c = f; break; } h = h.sibling; } if (!g) { for (h = f.child; h; ) { if (h === c) { g = !0, c = f, d = e; break; } if (h === d) { g = !0, d = f, c = e; break; } h = h.sibling; } g ? void 0 : t("189"); } } c.alternate !== d ? t("190") : void 0; } return 5 !== c.tag ? t("188") : void 0, c.stateNode.current === c ? a : b; } function md(a) { if (a = ld(a), !a) return null; for (var b = a; ;) { if (7 === b.tag || 8 === b.tag) return b; if (b.child) b.child["return"] = b, b = b.child; else { if (b === a) break; for (;!b.sibling; ) { if (!b["return"] || b["return"] === a) return null; b = b["return"]; } b.sibling["return"] = b["return"], b = b.sibling; } } return null; } function qd(a) { var b = a.keyCode; return "charCode" in a ? (a = a.charCode, 0 === a && 13 === b && (a = 13)) : a = b, 10 === a && (a = 13), 32 <= a || 13 === a ? a : 0; } function Bd(a, b) { var c = a[0]; a = a[1]; var d = "on" + (a[0].toUpperCase() + a.slice(1)); b = { phasedRegistrationNames: { bubbled: d, captured: d + "Capture" }, dependencies: [ c ], isInteractive: b }, zd[a] = b, Ad[c] = b; } function Fd(a) { var b = a.targetInst, c = b; do { if (!c) { a.ancestors.push(c); break; } var d; for (d = c; d["return"]; ) d = d["return"]; if (d = 5 !== d.tag ? null : d.stateNode.containerInfo, !d) break; a.ancestors.push(c), c = Ka(d); } while (c); for (c = 0; c < a.ancestors.length; c++) { b = a.ancestors[c]; var e = Sb(a.nativeEvent); d = a.topLevelType; for (var f = a.nativeEvent, g = null, h = 0; h < pa.length; h++) { var k = pa[h]; k && (k = k.extractEvents(d, b, f, e)) && (g = ya(g, k)); } Ga(g, !1); } } function F(a, b) { if (!b) return null; var c = (Dd(a) ? Hd : Id).bind(null, a); b.addEventListener(a, c, !1); } function Jd(a, b) { if (!b) return null; var c = (Dd(a) ? Hd : Id).bind(null, a); b.addEventListener(a, c, !0); } function Hd(a, b) { Mb(Id, a, b); } function Id(a, b) { if (Gd) { var c = Sb(b); if (c = Ka(c), null === c || "number" != typeof c.tag || 2 === jd(c) || (c = null), Ed.length) { var d = Ed.pop(); d.topLevelType = a, d.nativeEvent = b, d.targetInst = c, a = d; } else a = { topLevelType: a, nativeEvent: b, targetInst: c, ancestors: [] }; try { Pb(Fd, a); } finally { a.topLevelType = null, a.nativeEvent = null, a.targetInst = null, a.ancestors.length = 0, 10 > Ed.length && Ed.push(a); } } } function Nd(a) { return Object.prototype.hasOwnProperty.call(a, Md) || (a[Md] = Ld++, Kd[a[Md]] = {}), Kd[a[Md]]; } function Od(a) { if (a = a || ("undefined" != typeof document ? document : void 0), "undefined" == typeof a) return null; try { return a.activeElement || a.body; } catch (b) { return a.body; } } function Qd(a) { for (;a && a.firstChild; ) a = a.firstChild; return a; } function Rd(a, b) { var c = Qd(a); a = 0; for (var d; c; ) { if (3 === c.nodeType) { if (d = a + c.textContent.length, a <= b && d >= b) return { node: c, offset: b - a }; a = d; } a: { for (;c; ) { if (c.nextSibling) { c = c.nextSibling; break a; } c = c.parentNode; } c = void 0; } c = Qd(c); } } function Sd(a, b) { return !(!a || !b) && (a === b || (!a || 3 !== a.nodeType) && (b && 3 === b.nodeType ? Sd(a, b.parentNode) : "contains" in a ? a.contains(b) : !!a.compareDocumentPosition && !!(16 & a.compareDocumentPosition(b)))); } function Td() { for (var a = window, b = Od(); b instanceof a.HTMLIFrameElement; ) { try { a = b.contentDocument.defaultView; } catch (c) { break; } b = Od(a.document); } return b; } function Ud(a) { var b = a && a.nodeName && a.nodeName.toLowerCase(); return b && ("input" === b && ("text" === a.type || "search" === a.type || "tel" === a.type || "url" === a.type || "password" === a.type) || "textarea" === b || "true" === a.contentEditable); } function ae(a, b) { var c = b.window === b ? b.document : 9 === b.nodeType ? b : b.ownerDocument; return $d || null == Xd || Xd !== Od(c) ? null : (c = Xd, "selectionStart" in c && Ud(c) ? c = { start: c.selectionStart, end: c.selectionEnd } : (c = (c.ownerDocument && c.ownerDocument.defaultView || window).getSelection(), c = { anchorNode: c.anchorNode, anchorOffset: c.anchorOffset, focusNode: c.focusNode, focusOffset: c.focusOffset }), Zd && id(Zd, c) ? null : (Zd = c, a = z.getPooled(Wd.select, Yd, a, b), a.type = "select", a.target = Xd, Ua(a), a)); } function ce(a) { var b = ""; return aa.Children.forEach(a, function(a) { null != a && (b += a); }), b; } function de(a, b) { return a = n({ children: void 0 }, b), (b = ce(b.children)) && (a.children = b), a; } function ee(a, b, c, d) { if (a = a.options, b) { b = {}; for (var e = 0; e < c.length; e++) b["$" + c[e]] = !0; for (c = 0; c < a.length; c++) e = b.hasOwnProperty("$" + a[c].value), a[c].selected !== e && (a[c].selected = e), e && d && (a[c].defaultSelected = !0); } else { for (c = "" + yc(c), b = null, e = 0; e < a.length; e++) { if (a[e].value === c) return a[e].selected = !0, void (d && (a[e].defaultSelected = !0)); null !== b || a[e].disabled || (b = a[e]); } null !== b && (b.selected = !0); } } function fe(a, b) { return null != b.dangerouslySetInnerHTML ? t("91") : void 0, n({}, b, { value: void 0, defaultValue: void 0, children: "" + a._wrapperState.initialValue }); } function ge(a, b) { var c = b.value; null == c && (c = b.defaultValue, b = b.children, null != b && (null != c ? t("92") : void 0, Array.isArray(b) && (1 >= b.length ? void 0 : t("93"), b = b[0]), c = b), null == c && (c = "")), a._wrapperState = { initialValue: yc(c) }; } function he(a, b) { var c = yc(b.value), d = yc(b.defaultValue); null != c && (c = "" + c, c !== a.value && (a.value = c), null == b.defaultValue && a.defaultValue !== c && (a.defaultValue = c)), null != d && (a.defaultValue = "" + d); } function ie(a) { var b = a.textContent; b === a._wrapperState.initialValue && (a.value = b); } function ke(a) { switch (a) { case "svg": return "http://www.w3.org/2000/svg"; case "math": return "http://www.w3.org/1998/Math/MathML"; default: return "http://www.w3.org/1999/xhtml"; } } function le(a, b) { return null == a || "http://www.w3.org/1999/xhtml" === a ? ke(b) : "http://www.w3.org/2000/svg" === a && "foreignObject" === b ? "http://www.w3.org/1999/xhtml" : a; } function oe(a, b) { if (b) { var c = a.firstChild; if (c && c === a.lastChild && 3 === c.nodeType) return void (c.nodeValue = b); } a.textContent = b; } function re(a, b) { a = a.style; for (var c in b) if (b.hasOwnProperty(c)) { var d = 0 === c.indexOf("--"), e = c, f = b[c]; e = null == f || "boolean" == typeof f || "" === f ? "" : d || "number" != typeof f || 0 === f || pe.hasOwnProperty(e) && pe[e] ? ("" + f).trim() : f + "px", "float" === c && (c = "cssFloat"), d ? a.setProperty(c, e) : a[c] = e; } } function te(a, b) { b && (se[a] && (null != b.children || null != b.dangerouslySetInnerHTML ? t("137", a, "") : void 0), null != b.dangerouslySetInnerHTML && (null != b.children ? t("60") : void 0, "object" == typeof b.dangerouslySetInnerHTML && "__html" in b.dangerouslySetInnerHTML ? void 0 : t("61")), null != b.style && "object" != typeof b.style ? t("62", "") : void 0); } function ue(a, b) { if (-1 === a.indexOf("-")) return "string" == typeof b.is; switch (a) { case "annotation-xml": case "color-profile": case "font-face": case "font-face-src": case "font-face-uri": case "font-face-format": case "font-face-name": case "missing-glyph": return !1; default: return !0; } } function ve(a, b) { a = 9 === a.nodeType || 11 === a.nodeType ? a : a.ownerDocument; var c = Nd(a); b = ta[b]; for (var d = 0; d < b.length; d++) { var e = b[d]; if (!c.hasOwnProperty(e) || !c[e]) { switch (e) { case "scroll": Jd("scroll", a); break; case "focus": case "blur": Jd("focus", a), Jd("blur", a), c.blur = !0, c.focus = !0; break; case "cancel": case "close": Tb(e) && Jd(e, a); break; case "invalid": case "submit": case "reset": break; default: -1 === fb.indexOf(e) && F(e, a); } c[e] = !0; } } } function we() {} function ze(a, b) { switch (a) { case "button": case "input": case "select": case "textarea": return !!b.autoFocus; } return !1; } function Ae(a, b) { return "textarea" === a || "option" === a || "noscript" === a || "string" == typeof b.children || "number" == typeof b.children || "object" == typeof b.dangerouslySetInnerHTML && null !== b.dangerouslySetInnerHTML && null != b.dangerouslySetInnerHTML.__html; } function Be(a) { for (a = a.nextSibling; a && 1 !== a.nodeType && 3 !== a.nodeType; ) a = a.nextSibling; return a; } function Ce(a) { for (a = a.firstChild; a && 1 !== a.nodeType && 3 !== a.nodeType; ) a = a.nextSibling; return a; } function G(a) { 0 > Ee || (a.current = De[Ee], De[Ee] = null, Ee--); } function H(a, b) { Ee++, De[Ee] = a.current, a.current = b; } function He(a, b) { var c = a.type.contextTypes; if (!c) return Fe; var d = a.stateNode; if (d && d.__reactInternalMemoizedUnmaskedChildContext === b) return d.__reactInternalMemoizedMaskedChildContext; var f, e = {}; for (f in c) e[f] = b[f]; return d && (a = a.stateNode, a.__reactInternalMemoizedUnmaskedChildContext = b, a.__reactInternalMemoizedMaskedChildContext = e), e; } function K(a) { return a = a.childContextTypes, null !== a && void 0 !== a; } function Ie(a) { G(J, a), G(I, a); } function Je(a) { G(J, a), G(I, a); } function Ke(a, b, c) { I.current !== Fe ? t("168") : void 0, H(I, b, a), H(J, c, a); } function Le(a, b, c) { var d = a.stateNode; if (a = b.childContextTypes, "function" != typeof d.getChildContext) return c; d = d.getChildContext(); for (var e in d) e in a ? void 0 : t("108", lc(b) || "Unknown", e); return n({}, c, d); } function Me(a) { var b = a.stateNode; return b = b && b.__reactInternalMemoizedMergedChildContext || Fe, Ge = I.current, H(I, b, a), H(J, J.current, a), !0; } function Ne(a, b, c) { var d = a.stateNode; d ? void 0 : t("169"), c ? (b = Le(a, b, Ge), d.__reactInternalMemoizedMergedChildContext = b, G(J, a), G(I, a), H(I, b, a)) : G(J, a), H(J, c, a); } function Qe(a) { return function(b) { try { return a(b); } catch (c) {} }; } function Re(a) { if ("undefined" == typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) return !1; var b = __REACT_DEVTOOLS_GLOBAL_HOOK__; if (b.isDisabled || !b.supportsFiber) return !0; try { var c = b.inject(a); Oe = Qe(function(a) { return b.onCommitFiberRoot(c, a); }), Pe = Qe(function(a) { return b.onCommitFiberUnmount(c, a); }); } catch (d) {} return !0; } function Se(a, b, c, d) { this.tag = a, this.key = c, this.sibling = this.child = this["return"] = this.stateNode = this.type = null, this.index = 0, this.ref = null, this.pendingProps = b, this.firstContextDependency = this.memoizedState = this.updateQueue = this.memoizedProps = null, this.mode = d, this.effectTag = 0, this.lastEffect = this.firstEffect = this.nextEffect = null, this.childExpirationTime = this.expirationTime = 0, this.alternate = null; } function Te(a) { return a = a.prototype, !(!a || !a.isReactComponent); } function Ue(a, b, c) { var d = a.alternate; return null === d ? (d = new Se(a.tag, b, a.key, a.mode), d.type = a.type, d.stateNode = a.stateNode, d.alternate = a, a.alternate = d) : (d.pendingProps = b, d.effectTag = 0, d.nextEffect = null, d.firstEffect = null, d.lastEffect = null), d.childExpirationTime = a.childExpirationTime, d.expirationTime = b !== a.pendingProps ? c : a.expirationTime, d.child = a.child, d.memoizedProps = a.memoizedProps, d.memoizedState = a.memoizedState, d.updateQueue = a.updateQueue, d.firstContextDependency = a.firstContextDependency, d.sibling = a.sibling, d.index = a.index, d.ref = a.ref, d; } function Ve(a, b, c) { var d = a.type, e = a.key; a = a.props; var f = void 0; if ("function" == typeof d) f = Te(d) ? 2 : 4; else if ("string" == typeof d) f = 7; else a: switch (d) { case bc: return We(a.children, b, c, e); case gc: f = 10, b |= 3; break; case cc: f = 10, b |= 2; break; case dc: return d = new Se(15, a, e, 4 | b), d.type = dc, d.expirationTime = c, d; case ic: f = 16; break; default: if ("object" == typeof d && null !== d) switch (d.$$typeof) { case ec: f = 12; break a; case fc: f = 11; break a; case hc: f = 13; break a; default: if ("function" == typeof d.then) { f = 4; break a; } } t("130", null == d ? d : typeof d, ""); } return b = new Se(f, a, e, b), b.type = d, b.expirationTime = c, b; } function We(a, b, c, d) { return a = new Se(9, a, d, b), a.expirationTime = c, a; } function Xe(a, b, c) { return a = new Se(8, a, null, b), a.expirationTime = c, a; } function Ye(a, b, c) { return b = new Se(6, null !== a.children ? a.children : [], a.key, b), b.expirationTime = c, b.stateNode = { containerInfo: a.containerInfo, pendingChildren: null, implementation: a.implementation }, b; } function Ze(a, b) { a.didError = !1; var c = a.earliestPendingTime; 0 === c ? a.earliestPendingTime = a.latestPendingTime = b : c > b ? a.earliestPendingTime = b : a.latestPendingTime < b && (a.latestPendingTime = b), $e(b, a); } function $e(a, b) { var c = b.earliestSuspendedTime, d = b.latestSuspendedTime, e = b.earliestPendingTime, f = b.latestPingedTime; e = 0 !== e ? e : f, 0 === e && (0 === a || d > a) && (e = d), a = e, 0 !== a && 0 !== c && c < a && (a = c), b.nextExpirationTimeToWorkOn = e, b.expirationTime = a; } function bf(a) { return { baseState: a, firstUpdate: null, lastUpdate: null, firstCapturedUpdate: null, lastCapturedUpdate: null, firstEffect: null, lastEffect: null, firstCapturedEffect: null, lastCapturedEffect: null }; } function cf(a) { return { baseState: a.baseState, firstUpdate: a.firstUpdate, lastUpdate: a.lastUpdate, firstCapturedUpdate: null, lastCapturedUpdate: null, firstEffect: null, lastEffect: null, firstCapturedEffect: null, lastCapturedEffect: null }; } function df(a) { return { expirationTime: a, tag: 0, payload: null, callback: null, next: null, nextEffect: null }; } function ef(a, b) { null === a.lastUpdate ? a.firstUpdate = a.lastUpdate = b : (a.lastUpdate.next = b, a.lastUpdate = b); } function ff(a, b) { var c = a.alternate; if (null === c) { var d = a.updateQueue, e = null; null === d && (d = a.updateQueue = bf(a.memoizedState)); } else d = a.updateQueue, e = c.updateQueue, null === d ? null === e ? (d = a.updateQueue = bf(a.memoizedState), e = c.updateQueue = bf(c.memoizedState)) : d = a.updateQueue = cf(e) : null === e && (e = c.updateQueue = cf(d)); null === e || d === e ? ef(d, b) : null === d.lastUpdate || null === e.lastUpdate ? (ef(d, b), ef(e, b)) : (ef(d, b), e.lastUpdate = b); } function gf(a, b) { var c = a.updateQueue; c = null === c ? a.updateQueue = bf(a.memoizedState) : hf(a, c), null === c.lastCapturedUpdate ? c.firstCapturedUpdate = c.lastCapturedUpdate = b : (c.lastCapturedUpdate.next = b, c.lastCapturedUpdate = b); } function hf(a, b) { var c = a.alternate; return null !== c && b === c.updateQueue && (b = a.updateQueue = cf(b)), b; } function jf(a, b, c, d, e, f) { switch (c.tag) { case 1: return a = c.payload, "function" == typeof a ? a.call(f, d, e) : a; case 3: a.effectTag = a.effectTag & -1025 | 64; case 0: if (a = c.payload, e = "function" == typeof a ? a.call(f, d, e) : a, null === e || void 0 === e) break; return n({}, d, e); case 2: af = !0; } return d; } function kf(a, b, c, d, e) { af = !1, b = hf(a, b); for (var f = b.baseState, g = null, h = 0, k = b.firstUpdate, l = f; null !== k; ) { var m = k.expirationTime; m > e ? (null === g && (g = k, f = l), (0 === h || h > m) && (h = m)) : (l = jf(a, b, k, l, c, d), null !== k.callback && (a.effectTag |= 32, k.nextEffect = null, null === b.lastEffect ? b.firstEffect = b.lastEffect = k : (b.lastEffect.nextEffect = k, b.lastEffect = k))), k = k.next; } for (m = null, k = b.firstCapturedUpdate; null !== k; ) { var r = k.expirationTime; r > e ? (null === m && (m = k, null === g && (f = l)), (0 === h || h > r) && (h = r)) : (l = jf(a, b, k, l, c, d), null !== k.callback && (a.effectTag |= 32, k.nextEffect = null, null === b.lastCapturedEffect ? b.firstCapturedEffect = b.lastCapturedEffect = k : (b.lastCapturedEffect.nextEffect = k, b.lastCapturedEffect = k))), k = k.next; } null === g && (b.lastUpdate = null), null === m ? b.lastCapturedUpdate = null : a.effectTag |= 32, null === g && null === m && (f = l), b.baseState = f, b.firstUpdate = g, b.firstCapturedUpdate = m, a.expirationTime = h, a.memoizedState = l; } function lf(a, b, c) { null !== b.firstCapturedUpdate && (null !== b.lastUpdate && (b.lastUpdate.next = b.firstCapturedUpdate, b.lastUpdate = b.lastCapturedUpdate), b.firstCapturedUpdate = b.lastCapturedUpdate = null), mf(b.firstEffect, c), b.firstEffect = b.lastEffect = null, mf(b.firstCapturedEffect, c), b.firstCapturedEffect = b.lastCapturedEffect = null; } function mf(a, b) { for (;null !== a; ) { var c = a.callback; if (null !== c) { a.callback = null; var d = b; "function" != typeof c ? t("191", c) : void 0, c.call(d); } a = a.nextEffect; } } function nf(a, b) { return { value: a, source: b, stack: mc(b) }; } function sf(a, b) { var c = a.type._context; H(of, c._currentValue, a), c._currentValue = b; } function tf(a) { var b = of.current; G(of, a), a.type._context._currentValue = b; } function uf(a) { pf = a, rf = qf = null, a.firstContextDependency = null; } function vf(a, b) { return rf !== a && !1 !== b && 0 !== b && ("number" == typeof b && 1073741823 !== b || (rf = a, b = 1073741823), b = { context: a, observedBits: b, next: null }, null === qf ? (null === pf ? t("277") : void 0, pf.firstContextDependency = qf = b) : qf = qf.next = b), a._currentValue; } function zf(a) { return a === wf ? t("174") : void 0, a; } function Af(a, b) { H(yf, b, a), H(xf, a, a), H(L, wf, a); var c = b.nodeType; switch (c) { case 9: case 11: b = (b = b.documentElement) ? b.namespaceURI : le(null, ""); break; default: c = 8 === c ? b.parentNode : b, b = c.namespaceURI || null, c = c.tagName, b = le(b, c); } G(L, a), H(L, b, a); } function Bf(a) { G(L, a), G(xf, a), G(yf, a); } function Cf(a) { zf(yf.current); var b = zf(L.current), c = le(b, a.type); b !== c && (H(xf, a, a), H(L, c, a)); } function Df(a) { xf.current === a && (G(L, a), G(xf, a)); } function Ff(a, b, c, d) { b = a.memoizedState, c = c(d, b), c = null === c || void 0 === c ? b : n({}, b, c), a.memoizedState = c, d = a.updateQueue, null !== d && 0 === a.expirationTime && (d.baseState = c); } function Kf(a, b, c, d, e, f, g) { return a = a.stateNode, "function" == typeof a.shouldComponentUpdate ? a.shouldComponentUpdate(d, f, g) : !b.prototype || !b.prototype.isPureReactComponent || (!id(c, d) || !id(e, f)); } function Lf(a, b, c, d) { a = b.state, "function" == typeof b.componentWillReceiveProps && b.componentWillReceiveProps(c, d), "function" == typeof b.UNSAFE_componentWillReceiveProps && b.UNSAFE_componentWillReceiveProps(c, d), b.state !== a && Jf.enqueueReplaceState(b, b.state, null); } function Mf(a, b, c, d) { var e = a.stateNode, f = K(b) ? Ge : I.current; e.props = c, e.state = a.memoizedState, e.refs = Ef, e.context = He(a, f), f = a.updateQueue, null !== f && (kf(a, f, c, e, d), e.state = a.memoizedState), f = b.getDerivedStateFromProps, "function" == typeof f && (Ff(a, b, f, c), e.state = a.memoizedState), "function" == typeof b.getDerivedStateFromProps || "function" == typeof e.getSnapshotBeforeUpdate || "function" != typeof e.UNSAFE_componentWillMount && "function" != typeof e.componentWillMount || (b = e.state, "function" == typeof e.componentWillMount && e.componentWillMount(), "function" == typeof e.UNSAFE_componentWillMount && e.UNSAFE_componentWillMount(), b !== e.state && Jf.enqueueReplaceState(e, e.state, null), f = a.updateQueue, null !== f && (kf(a, f, c, e, d), e.state = a.memoizedState)), "function" == typeof e.componentDidMount && (a.effectTag |= 4); } function Of(a, b, c) { if (a = c.ref, null !== a && "function" != typeof a && "object" != typeof a) { if (c._owner) { c = c._owner; var d = void 0; c && (2 !== c.tag && 3 !== c.tag ? t("110") : void 0, d = c.stateNode), d ? void 0 : t("147", a); var e = "" + a; return null !== b && null !== b.ref && "function" == typeof b.ref && b.ref._stringRef === e ? b.ref : (b = function(a) { var b = d.refs; b === Ef && (b = d.refs = {}), null === a ? delete b[e] : b[e] = a; }, b._stringRef = e, b); } "string" != typeof a ? t("284") : void 0, c._owner ? void 0 : t("254", a); } return a; } function Pf(a, b) { "textarea" !== a.type && t("31", "[object Object]" === Object.prototype.toString.call(b) ? "object with keys {" + Object.keys(b).join(", ") + "}" : b, ""); } function Qf(a) { function b(b, c) { if (a) { var d = b.lastEffect; null !== d ? (d.nextEffect = c, b.lastEffect = c) : b.firstEffect = b.lastEffect = c, c.nextEffect = null, c.effectTag = 8; } } function c(c, d) { if (!a) return null; for (;null !== d; ) b(c, d), d = d.sibling; return null; } function d(a, b) { for (a = new Map(); null !== b; ) null !== b.key ? a.set(b.key, b) : a.set(b.index, b), b = b.sibling; return a; } function e(a, b, c) { return a = Ue(a, b, c), a.index = 0, a.sibling = null, a; } function f(b, c, d) { return b.index = d, a ? (d = b.alternate, null !== d ? (d = d.index, d < c ? (b.effectTag = 2, c) : d) : (b.effectTag = 2, c)) : c; } function g(b) { return a && null === b.alternate && (b.effectTag = 2), b; } function h(a, b, c, d) { return null === b || 8 !== b.tag ? (b = Xe(c, a.mode, d), b["return"] = a, b) : (b = e(b, c, d), b["return"] = a, b); } function k(a, b, c, d) { return null !== b && b.type === c.type ? (d = e(b, c.props, d), d.ref = Of(a, b, c), d["return"] = a, d) : (d = Ve(c, a.mode, d), d.ref = Of(a, b, c), d["return"] = a, d); } function l(a, b, c, d) { return null === b || 6 !== b.tag || b.stateNode.containerInfo !== c.containerInfo || b.stateNode.implementation !== c.implementation ? (b = Ye(c, a.mode, d), b["return"] = a, b) : (b = e(b, c.children || [], d), b["return"] = a, b); } function m(a, b, c, d, f) { return null === b || 9 !== b.tag ? (b = We(c, a.mode, d, f), b["return"] = a, b) : (b = e(b, c, d), b["return"] = a, b); } function r(a, b, c) { if ("string" == typeof b || "number" == typeof b) return b = Xe("" + b, a.mode, c), b["return"] = a, b; if ("object" == typeof b && null !== b) { switch (b.$$typeof) { case $b: return c = Ve(b, a.mode, c), c.ref = Of(a, null, b), c["return"] = a, c; case ac: return b = Ye(b, a.mode, c), b["return"] = a, b; } if (Nf(b) || kc(b)) return b = We(b, a.mode, c, null), b["return"] = a, b; Pf(a, b); } return null; } function A(a, b, c, d) { var e = null !== b ? b.key : null; if ("string" == typeof c || "number" == typeof c) return null !== e ? null : h(a, b, "" + c, d); if ("object" == typeof c && null !== c) { switch (c.$$typeof) { case $b: return c.key === e ? c.type === bc ? m(a, b, c.props.children, d, e) : k(a, b, c, d) : null; case ac: return c.key === e ? l(a, b, c, d) : null; } if (Nf(c) || kc(c)) return null !== e ? null : m(a, b, c, d, null); Pf(a, c); } return null; } function S(a, b, c, d, e) { if ("string" == typeof d || "number" == typeof d) return a = a.get(c) || null, h(b, a, "" + d, e); if ("object" == typeof d && null !== d) { switch (d.$$typeof) { case $b: return a = a.get(null === d.key ? c : d.key) || null, d.type === bc ? m(b, a, d.props.children, e, d.key) : k(b, a, d, e); case ac: return a = a.get(null === d.key ? c : d.key) || null, l(b, a, d, e); } if (Nf(d) || kc(d)) return a = a.get(c) || null, m(b, a, d, e, null); Pf(b, d); } return null; } function B(e, g, h, k) { for (var l = null, m = null, p = g, u = g = 0, q = null; null !== p && u < h.length; u++) { p.index > u ? (q = p, p = null) : q = p.sibling; var v = A(e, p, h[u], k); if (null === v) { null === p && (p = q); break; } a && p && null === v.alternate && b(e, p), g = f(v, g, u), null === m ? l = v : m.sibling = v, m = v, p = q; } if (u === h.length) return c(e, p), l; if (null === p) { for (;u < h.length; u++) (p = r(e, h[u], k)) && (g = f(p, g, u), null === m ? l = p : m.sibling = p, m = p); return l; } for (p = d(e, p); u < h.length; u++) (q = S(p, e, u, h[u], k)) && (a && null !== q.alternate && p["delete"](null === q.key ? u : q.key), g = f(q, g, u), null === m ? l = q : m.sibling = q, m = q); return a && p.forEach(function(a) { return b(e, a); }), l; } function P(e, g, h, k) { var l = kc(h); "function" != typeof l ? t("150") : void 0, h = l.call(h), null == h ? t("151") : void 0; for (var m = l = null, p = g, u = g = 0, q = null, v = h.next(); null !== p && !v.done; u++, v = h.next()) { p.index > u ? (q = p, p = null) : q = p.sibling; var x = A(e, p, v.value, k); if (null === x) { p || (p = q); break; } a && p && null === x.alternate && b(e, p), g = f(x, g, u), null === m ? l = x : m.sibling = x, m = x, p = q; } if (v.done) return c(e, p), l; if (null === p) { for (;!v.done; u++, v = h.next()) v = r(e, v.value, k), null !== v && (g = f(v, g, u), null === m ? l = v : m.sibling = v, m = v); return l; } for (p = d(e, p); !v.done; u++, v = h.next()) v = S(p, e, u, v.value, k), null !== v && (a && null !== v.alternate && p["delete"](null === v.key ? u : v.key), g = f(v, g, u), null === m ? l = v : m.sibling = v, m = v); return a && p.forEach(function(a) { return b(e, a); }), l; } return function(a, d, f, h) { var k = "object" == typeof f && null !== f && f.type === bc && null === f.key; k && (f = f.props.children); var l = "object" == typeof f && null !== f; if (l) switch (f.$$typeof) { case $b: a: { for (l = f.key, k = d; null !== k; ) { if (k.key === l) { if (9 === k.tag ? f.type === bc : k.type === f.type) { c(a, k.sibling), d = e(k, f.type === bc ? f.props.children : f.props, h), d.ref = Of(a, k, f), d["return"] = a, a = d; break a; } c(a, k); break; } b(a, k), k = k.sibling; } f.type === bc ? (d = We(f.props.children, a.mode, h, f.key), d["return"] = a, a = d) : (h = Ve(f, a.mode, h), h.ref = Of(a, d, f), h["return"] = a, a = h); } return g(a); case ac: a: { for (k = f.key; null !== d; ) { if (d.key === k) { if (6 === d.tag && d.stateNode.containerInfo === f.containerInfo && d.stateNode.implementation === f.implementation) { c(a, d.sibling), d = e(d, f.children || [], h), d["return"] = a, a = d; break a; } c(a, d); break; } b(a, d), d = d.sibling; } d = Ye(f, a.mode, h), d["return"] = a, a = d; } return g(a); } if ("string" == typeof f || "number" == typeof f) return f = "" + f, null !== d && 8 === d.tag ? (c(a, d.sibling), d = e(d, f, h), d["return"] = a, a = d) : (c(a, d), d = Xe(f, a.mode, h), d["return"] = a, a = d), g(a); if (Nf(f)) return B(a, d, f, h); if (kc(f)) return P(a, d, f, h); if (l && Pf(a, f), "undefined" == typeof f && !k) switch (a.tag) { case 2: case 3: case 0: h = a.type, t("152", h.displayName || h.name || "Component"); } return c(a, d); }; } function Wf(a, b) { var c = new Se(7, null, null, 0); c.type = "DELETED", c.stateNode = b, c["return"] = a, c.effectTag = 8, null !== a.lastEffect ? (a.lastEffect.nextEffect = c, a.lastEffect = c) : a.firstEffect = a.lastEffect = c; } function Xf(a, b) { switch (a.tag) { case 7: var c = a.type; return b = 1 !== b.nodeType || c.toLowerCase() !== b.nodeName.toLowerCase() ? null : b, null !== b && (a.stateNode = b, !0); case 8: return b = "" === a.pendingProps || 3 !== b.nodeType ? null : b, null !== b && (a.stateNode = b, !0); default: return !1; } } function Yf(a) { if (Vf) { var b = Uf; if (b) { var c = b; if (!Xf(a, b)) { if (b = Be(c), !b || !Xf(a, b)) return a.effectTag |= 2, Vf = !1, void (Tf = a); Wf(Tf, c); } Tf = a, Uf = Ce(b); } else a.effectTag |= 2, Vf = !1, Tf = a; } } function Zf(a) { for (a = a["return"]; null !== a && 7 !== a.tag && 5 !== a.tag; ) a = a["return"]; Tf = a; } function $f(a) { if (a !== Tf) return !1; if (!Vf) return Zf(a), Vf = !0, !1; var b = a.type; if (7 !== a.tag || "head" !== b && "body" !== b && !Ae(b, a.memoizedProps)) for (b = Uf; b; ) Wf(a, b), b = Be(b); return Zf(a), Uf = Tf ? Be(a.stateNode) : null, !0; } function ag() { Uf = Tf = null, Vf = !1; } function bg(a) { switch (a._reactStatus) { case 1: return a._reactResult; case 2: throw a._reactResult; case 0: throw a; default: throw a._reactStatus = 0, a.then(function(b) { if (0 === a._reactStatus) { if (a._reactStatus = 1, "object" == typeof b && null !== b) { var c = b["default"]; b = void 0 !== c && null !== c ? c : b; } a._reactResult = b; } }, function(b) { 0 === a._reactStatus && (a._reactStatus = 2, a._reactResult = b); }), a; } } function M(a, b, c, d) { b.child = null === a ? Sf(b, null, c, d) : Rf(b, a.child, c, d); } function dg(a, b, c, d, e) { c = c.render; var f = b.ref; return J.current || b.memoizedProps !== d || f !== (null !== a ? a.ref : null) ? (c = c(d, f), M(a, b, c, e), b.memoizedProps = d, b.child) : eg(a, b, e); } function fg(a, b) { var c = b.ref; (null === a && null !== c || null !== a && a.ref !== c) && (b.effectTag |= 128); } function gg(a, b, c, d, e) { var f = K(c) ? Ge : I.current; return f = He(b, f), uf(b, e), c = c(d, f), b.effectTag |= 1, M(a, b, c, e), b.memoizedProps = d, b.child; } function hg(a, b, c, d, e) { if (K(c)) { var f = !0; Me(b); } else f = !1; if (uf(b, e), null === a) if (null === b.stateNode) { var g = K(c) ? Ge : I.current, h = c.contextTypes, k = null !== h && void 0 !== h; h = k ? He(b, g) : Fe; var l = new c(d, h); b.memoizedState = null !== l.state && void 0 !== l.state ? l.state : null, l.updater = Jf, b.stateNode = l, l._reactInternalFiber = b, k && (k = b.stateNode, k.__reactInternalMemoizedUnmaskedChildContext = g, k.__reactInternalMemoizedMaskedChildContext = h), Mf(b, c, d, e), d = !0; } else { g = b.stateNode, h = b.memoizedProps, g.props = h; var m = g.context; k = K(c) ? Ge : I.current, k = He(b, k); var r = c.getDerivedStateFromProps; (l = "function" == typeof r || "function" == typeof g.getSnapshotBeforeUpdate) || "function" != typeof g.UNSAFE_componentWillReceiveProps && "function" != typeof g.componentWillReceiveProps || (h !== d || m !== k) && Lf(b, g, d, k), af = !1; var A = b.memoizedState; m = g.state = A; var S = b.updateQueue; null !== S && (kf(b, S, d, g, e), m = b.memoizedState), h !== d || A !== m || J.current || af ? ("function" == typeof r && (Ff(b, c, r, d), m = b.memoizedState), (h = af || Kf(b, c, h, d, A, m, k)) ? (l || "function" != typeof g.UNSAFE_componentWillMount && "function" != typeof g.componentWillMount || ("function" == typeof g.componentWillMount && g.componentWillMount(), "function" == typeof g.UNSAFE_componentWillMount && g.UNSAFE_componentWillMount()), "function" == typeof g.componentDidMount && (b.effectTag |= 4)) : ("function" == typeof g.componentDidMount && (b.effectTag |= 4), b.memoizedProps = d, b.memoizedState = m), g.props = d, g.state = m, g.context = k, d = h) : ("function" == typeof g.componentDidMount && (b.effectTag |= 4), d = !1); } else g = b.stateNode, h = b.memoizedProps, g.props = h, m = g.context, k = K(c) ? Ge : I.current, k = He(b, k), r = c.getDerivedStateFromProps, (l = "function" == typeof r || "function" == typeof g.getSnapshotBeforeUpdate) || "function" != typeof g.UNSAFE_componentWillReceiveProps && "function" != typeof g.componentWillReceiveProps || (h !== d || m !== k) && Lf(b, g, d, k), af = !1, m = b.memoizedState, A = g.state = m, S = b.updateQueue, null !== S && (kf(b, S, d, g, e), A = b.memoizedState), h !== d || m !== A || J.current || af ? ("function" == typeof r && (Ff(b, c, r, d), A = b.memoizedState), (r = af || Kf(b, c, h, d, m, A, k)) ? (l || "function" != typeof g.UNSAFE_componentWillUpdate && "function" != typeof g.componentWillUpdate || ("function" == typeof g.componentWillUpdate && g.componentWillUpdate(d, A, k), "function" == typeof g.UNSAFE_componentWillUpdate && g.UNSAFE_componentWillUpdate(d, A, k)), "function" == typeof g.componentDidUpdate && (b.effectTag |= 4), "function" == typeof g.getSnapshotBeforeUpdate && (b.effectTag |= 256)) : ("function" != typeof g.componentDidUpdate || h === a.memoizedProps && m === a.memoizedState || (b.effectTag |= 4), "function" != typeof g.getSnapshotBeforeUpdate || h === a.memoizedProps && m === a.memoizedState || (b.effectTag |= 256), b.memoizedProps = d, b.memoizedState = A), g.props = d, g.state = A, g.context = k, d = r) : ("function" != typeof g.componentDidUpdate || h === a.memoizedProps && m === a.memoizedState || (b.effectTag |= 4), "function" != typeof g.getSnapshotBeforeUpdate || h === a.memoizedProps && m === a.memoizedState || (b.effectTag |= 256), d = !1); return ig(a, b, c, d, f, e); } function ig(a, b, c, d, e, f) { fg(a, b); var g = 0 !== (64 & b.effectTag); if (!d && !g) return e && Ne(b, c, !1), eg(a, b, f); d = b.stateNode, cg.current = b; var h = g ? null : d.render(); return b.effectTag |= 1, null !== a && g && (M(a, b, null, f), b.child = null), M(a, b, h, f), b.memoizedState = d.state, b.memoizedProps = d.props, e && Ne(b, c, !0), b.child; } function jg(a) { var b = a.stateNode; b.pendingContext ? Ke(a, b.pendingContext, b.pendingContext !== b.context) : b.context && Ke(a, b.context, !1), Af(a, b.containerInfo); } function ng(a, b) { if (a && a.defaultProps) { b = n({}, b), a = a.defaultProps; for (var c in a) void 0 === b[c] && (b[c] = a[c]); } return b; } function og(a, b, c, d) { null !== a ? t("155") : void 0; var e = b.pendingProps; if ("object" == typeof c && null !== c && "function" == typeof c.then) { c = bg(c); var f = c; f = "function" == typeof f ? Te(f) ? 3 : 1 : void 0 !== f && null !== f && f.$$typeof ? 14 : 4, f = b.tag = f; var g = ng(c, e); switch (f) { case 1: return gg(a, b, c, g, d); case 3: return hg(a, b, c, g, d); case 14: return dg(a, b, c, g, d); default: t("283", c); } } if (f = He(b, I.current), uf(b, d), f = c(e, f), b.effectTag |= 1, "object" == typeof f && null !== f && "function" == typeof f.render && void 0 === f.$$typeof) { b.tag = 2, K(c) ? (g = !0, Me(b)) : g = !1, b.memoizedState = null !== f.state && void 0 !== f.state ? f.state : null; var h = c.getDerivedStateFromProps; return "function" == typeof h && Ff(b, c, h, e), f.updater = Jf, b.stateNode = f, f._reactInternalFiber = b, Mf(b, c, e, d), ig(a, b, c, !0, g, d); } return b.tag = 0, M(a, b, f, d), b.memoizedProps = e, b.child; } function eg(a, b, c) { null !== a && (b.firstContextDependency = a.firstContextDependency); var d = b.childExpirationTime; if (0 === d || d > c) return null; if (null !== a && b.child !== a.child ? t("153") : void 0, null !== b.child) { for (a = b.child, c = Ue(a, a.pendingProps, a.expirationTime), b.child = c, c["return"] = b; null !== a.sibling; ) a = a.sibling, c = c.sibling = Ue(a, a.pendingProps, a.expirationTime), c["return"] = b; c.sibling = null; } return b.child; } function pg(a, b, c) { var d = b.expirationTime; if (!J.current && (0 === d || d > c)) { switch (b.tag) { case 5: jg(b), ag(); break; case 7: Cf(b); break; case 2: K(b.type) && Me(b); break; case 3: K(b.type._reactResult) && Me(b); break; case 6: Af(b, b.stateNode.containerInfo); break; case 12: sf(b, b.memoizedProps.value); } return eg(a, b, c); } switch (b.expirationTime = 0, b.tag) { case 4: return og(a, b, b.type, c); case 0: return gg(a, b, b.type, b.pendingProps, c); case 1: var e = b.type._reactResult; return d = b.pendingProps, a = gg(a, b, e, ng(e, d), c), b.memoizedProps = d, a; case 2: return hg(a, b, b.type, b.pendingProps, c); case 3: return e = b.type._reactResult, d = b.pendingProps, a = hg(a, b, e, ng(e, d), c), b.memoizedProps = d, a; case 5: return jg(b), d = b.updateQueue, null === d ? t("282") : void 0, e = b.memoizedState, e = null !== e ? e.element : null, kf(b, d, b.pendingProps, null, c), d = b.memoizedState.element, d === e ? (ag(), b = eg(a, b, c)) : (e = b.stateNode, (e = (null === a || null === a.child) && e.hydrate) && (Uf = Ce(b.stateNode.containerInfo), Tf = b, e = Vf = !0), e ? (b.effectTag |= 2, b.child = Sf(b, null, d, c)) : (M(a, b, d, c), ag()), b = b.child), b; case 7: Cf(b), null === a && Yf(b), d = b.type, e = b.pendingProps; var f = null !== a ? a.memoizedProps : null, g = e.children; return Ae(d, e) ? g = null : null !== f && Ae(d, f) && (b.effectTag |= 16), fg(a, b), 1073741823 !== c && 1 & b.mode && e.hidden ? (b.expirationTime = 1073741823, b.memoizedProps = e, b = null) : (M(a, b, g, c), b.memoizedProps = e, b = b.child), b; case 8: return null === a && Yf(b), b.memoizedProps = b.pendingProps, null; case 16: return null; case 6: return Af(b, b.stateNode.containerInfo), d = b.pendingProps, null === a ? b.child = Rf(b, null, d, c) : M(a, b, d, c), b.memoizedProps = d, b.child; case 13: return dg(a, b, b.type, b.pendingProps, c); case 14: return e = b.type._reactResult, d = b.pendingProps, a = dg(a, b, e, ng(e, d), c), b.memoizedProps = d, a; case 9: return d = b.pendingProps, M(a, b, d, c), b.memoizedProps = d, b.child; case 10: return d = b.pendingProps.children, M(a, b, d, c), b.memoizedProps = d, b.child; case 15: return d = b.pendingProps, M(a, b, d.children, c), b.memoizedProps = d, b.child; case 12: a: { if (d = b.type._context, e = b.pendingProps, g = b.memoizedProps, f = e.value, b.memoizedProps = e, sf(b, f), null !== g) { var h = g.value; if (f = h === f && (0 !== h || 1 / h === 1 / f) || h !== h && f !== f ? 0 : 0 | ("function" == typeof d._calculateChangedBits ? d._calculateChangedBits(h, f) : 1073741823), 0 === f) { if (g.children === e.children && !J.current) { b = eg(a, b, c); break a; } } else for (g = b.child, null !== g && (g["return"] = b); null !== g; ) { if (h = g.firstContextDependency, null !== h) { do { if (h.context === d && 0 !== (h.observedBits & f)) { if (2 === g.tag || 3 === g.tag) { var k = df(c); k.tag = 2, ff(g, k); } (0 === g.expirationTime || g.expirationTime > c) && (g.expirationTime = c), k = g.alternate, null !== k && (0 === k.expirationTime || k.expirationTime > c) && (k.expirationTime = c); for (var l = g["return"]; null !== l; ) { if (k = l.alternate, 0 === l.childExpirationTime || l.childExpirationTime > c) l.childExpirationTime = c, null !== k && (0 === k.childExpirationTime || k.childExpirationTime > c) && (k.childExpirationTime = c); else { if (null === k || !(0 === k.childExpirationTime || k.childExpirationTime > c)) break; k.childExpirationTime = c; } l = l["return"]; } } k = g.child, h = h.next; } while (null !== h); } else k = 12 === g.tag && g.type === b.type ? null : g.child; if (null !== k) k["return"] = g; else for (k = g; null !== k; ) { if (k === b) { k = null; break; } if (g = k.sibling, null !== g) { g["return"] = k["return"], k = g; break; } k = k["return"]; } g = k; } } M(a, b, e.children, c), b = b.child; } return b; case 11: return f = b.type, d = b.pendingProps, e = d.children, uf(b, c), f = vf(f, d.unstable_observedBits), e = e(f), b.effectTag |= 1, M(a, b, e, c), b.memoizedProps = d, b.child; default: t("156"); } } function qg(a) { a.effectTag |= 4; } function ug(a, b) { var c = b.source, d = b.stack; null === d && null !== c && (d = mc(c)), null !== c && lc(c.type), b = b.value, null !== a && 2 === a.tag && lc(a.type); try { console.error(b); } catch (e) { setTimeout(function() { throw e; }); } } function vg(a) { var b = a.ref; if (null !== b) if ("function" == typeof b) try { b(null); } catch (c) { wg(a, c); } else b.current = null; } function xg(a) { switch ("function" == typeof Pe && Pe(a), a.tag) { case 2: case 3: vg(a); var b = a.stateNode; if ("function" == typeof b.componentWillUnmount) try { b.props = a.memoizedProps, b.state = a.memoizedState, b.componentWillUnmount(); } catch (c) { wg(a, c); } break; case 7: vg(a); break; case 6: yg(a); } } function zg(a) { return 7 === a.tag || 5 === a.tag || 6 === a.tag; } function Ag(a) { a: { for (var b = a["return"]; null !== b; ) { if (zg(b)) { var c = b; break a; } b = b["return"]; } t("160"), c = void 0; } var d = b = void 0; switch (c.tag) { case 7: b = c.stateNode, d = !1; break; case 5: b = c.stateNode.containerInfo, d = !0; break; case 6: b = c.stateNode.containerInfo, d = !0; break; default: t("161"); } 16 & c.effectTag && (oe(b, ""), c.effectTag &= -17); a: b: for (c = a; ;) { for (;null === c.sibling; ) { if (null === c["return"] || zg(c["return"])) { c = null; break a; } c = c["return"]; } for (c.sibling["return"] = c["return"], c = c.sibling; 7 !== c.tag && 8 !== c.tag; ) { if (2 & c.effectTag) continue b; if (null === c.child || 6 === c.tag) continue b; c.child["return"] = c, c = c.child; } if (!(2 & c.effectTag)) { c = c.stateNode; break a; } } for (var e = a; ;) { if (7 === e.tag || 8 === e.tag) if (c) if (d) { var f = b, g = e.stateNode, h = c; 8 === f.nodeType ? f.parentNode.insertBefore(g, h) : f.insertBefore(g, h); } else b.insertBefore(e.stateNode, c); else d ? (f = b, g = e.stateNode, 8 === f.nodeType ? (h = f.parentNode, h.insertBefore(g, f)) : (h = f, h.appendChild(g)), null === h.onclick && (h.onclick = we)) : b.appendChild(e.stateNode); else if (6 !== e.tag && null !== e.child) { e.child["return"] = e, e = e.child; continue; } if (e === a) break; for (;null === e.sibling; ) { if (null === e["return"] || e["return"] === a) return; e = e["return"]; } e.sibling["return"] = e["return"], e = e.sibling; } } function yg(a) { for (var b = a, c = !1, d = void 0, e = void 0; ;) { if (!c) { c = b["return"]; a: for (;;) { switch (null === c ? t("160") : void 0, c.tag) { case 7: d = c.stateNode, e = !1; break a; case 5: d = c.stateNode.containerInfo, e = !0; break a; case 6: d = c.stateNode.containerInfo, e = !0; break a; } c = c["return"]; } c = !0; } if (7 === b.tag || 8 === b.tag) { a: for (var f = b, g = f; ;) if (xg(g), null !== g.child && 6 !== g.tag) g.child["return"] = g, g = g.child; else { if (g === f) break; for (;null === g.sibling; ) { if (null === g["return"] || g["return"] === f) break a; g = g["return"]; } g.sibling["return"] = g["return"], g = g.sibling; } e ? (f = d, g = b.stateNode, 8 === f.nodeType ? f.parentNode.removeChild(g) : f.removeChild(g)) : d.removeChild(b.stateNode); } else if (6 === b.tag ? (d = b.stateNode.containerInfo, e = !0) : xg(b), null !== b.child) { b.child["return"] = b, b = b.child; continue; } if (b === a) break; for (;null === b.sibling; ) { if (null === b["return"] || b["return"] === a) return; b = b["return"], 6 === b.tag && (c = !1); } b.sibling["return"] = b["return"], b = b.sibling; } } function Bg(a, b) { switch (b.tag) { case 2: case 3: break; case 7: var c = b.stateNode; if (null != c) { var d = b.memoizedProps, e = null !== a ? a.memoizedProps : d; a = b.type; var f = b.updateQueue; if (b.updateQueue = null, null !== f) { for (c[Ja] = d, "input" === a && "radio" === d.type && null != d.name && Cc(c, d), ue(a, e), b = ue(a, d), e = 0; e < f.length; e += 2) { var g = f[e], h = f[e + 1]; "style" === g ? re(c, h) : "dangerouslySetInnerHTML" === g ? ne(c, h) : "children" === g ? oe(c, h) : xc(c, g, h, b); } switch (a) { case "input": Dc(c, d); break; case "textarea": he(c, d); break; case "select": a = c._wrapperState.wasMultiple, c._wrapperState.wasMultiple = !!d.multiple, f = d.value, null != f ? ee(c, !!d.multiple, f, !1) : a !== !!d.multiple && (null != d.defaultValue ? ee(c, !!d.multiple, d.defaultValue, !0) : ee(c, !!d.multiple, d.multiple ? [] : "", !1)); } } } break; case 8: null === b.stateNode ? t("162") : void 0, b.stateNode.nodeValue = b.memoizedProps; break; case 5: break; case 15: break; case 16: break; default: t("163"); } } function Cg(a, b, c) { c = df(c), c.tag = 3, c.payload = { element: null }; var d = b.value; return c.callback = function() { Dg(d), ug(a, b); }, c; } function Eg(a, b, c) { c = df(c), c.tag = 3; var d = a.stateNode; return null !== d && "function" == typeof d.componentDidCatch && (c.callback = function() { null === Fg ? Fg = new Set([ this ]) : Fg.add(this); var c = b.value, d = b.stack; ug(a, b), this.componentDidCatch(c, { componentStack: null !== d ? d : "" }); }), c; } function Gg(a) { switch (a.tag) { case 2: K(a.type) && Ie(a); var b = a.effectTag; return 1024 & b ? (a.effectTag = b & -1025 | 64, a) : null; case 3: return K(a.type._reactResult) && Ie(a), b = a.effectTag, 1024 & b ? (a.effectTag = b & -1025 | 64, a) : null; case 5: return Bf(a), Je(a), b = a.effectTag, 0 !== (64 & b) ? t("285") : void 0, a.effectTag = b & -1025 | 64, a; case 7: return Df(a), null; case 16: return b = a.effectTag, 1024 & b ? (a.effectTag = b & -1025 | 64, a) : null; case 6: return Bf(a), null; case 12: return tf(a), null; default: return null; } } function Pg() { if (null !== N) for (var a = N["return"]; null !== a; ) { var b = a; switch (b.tag) { case 2: var c = b.type.childContextTypes; null !== c && void 0 !== c && Ie(b); break; case 3: c = b.type._reactResult.childContextTypes, null !== c && void 0 !== c && Ie(b); break; case 5: Bf(b), Je(b); break; case 7: Df(b); break; case 6: Bf(b); break; case 12: tf(b); } a = a["return"]; } Mg = null, O = 0, Ng = !1, N = null; } function Qg(a) { for (;;) { var b = a.alternate, c = a["return"], d = a.sibling; if (0 === (512 & a.effectTag)) { var e = b; b = a; var f = b.pendingProps; switch (b.tag) { case 0: case 1: break; case 2: K(b.type) && Ie(b); break; case 3: K(b.type._reactResult) && Ie(b); break; case 5: Bf(b), Je(b), f = b.stateNode, f.pendingContext && (f.context = f.pendingContext, f.pendingContext = null), null !== e && null !== e.child || ($f(b), b.effectTag &= -3), rg(b); break; case 7: Df(b); var g = zf(yf.current), h = b.type; if (null !== e && null != b.stateNode) sg(e, b, h, f, g), e.ref !== b.ref && (b.effectTag |= 128); else if (f) { var k = zf(L.current); if ($f(b)) { f = b, e = f.stateNode; var l = f.type, m = f.memoizedProps, r = g; switch (e[Ia] = f, e[Ja] = m, h = void 0, g = l) { case "iframe": case "object": F("load", e); break; case "video": case "audio": for (l = 0; l < fb.length; l++) F(fb[l], e); break; case "source": F("error", e); break; case "img": case "image": case "link": F("error", e), F("load", e); break; case "form": F("reset", e), F("submit", e); break; case "details": F("toggle", e); break; case "input": Bc(e, m), F("invalid", e), ve(r, "onChange"); break; case "select": e._wrapperState = { wasMultiple: !!m.multiple }, F("invalid", e), ve(r, "onChange"); break; case "textarea": ge(e, m), F("invalid", e), ve(r, "onChange"); } te(g, m), l = null; for (h in m) m.hasOwnProperty(h) && (k = m[h], "children" === h ? "string" == typeof k ? e.textContent !== k && (l = [ "children", k ]) : "number" == typeof k && e.textContent !== "" + k && (l = [ "children", "" + k ]) : sa.hasOwnProperty(h) && null != k && ve(r, h)); switch (g) { case "input": Wb(e), Fc(e, m, !0); break; case "textarea": Wb(e), ie(e, m); break; case "select": case "option": break; default: "function" == typeof m.onClick && (e.onclick = we); } h = l, f.updateQueue = h, f = null !== h, f && qg(b); } else { m = b, e = h, r = f, l = 9 === g.nodeType ? g : g.ownerDocument, k === je.html && (k = ke(e)), k === je.html ? "script" === e ? (e = l.createElement("div"), e.innerHTML = "", l = e.removeChild(e.firstChild)) : "string" == typeof r.is ? l = l.createElement(e, { is: r.is }) : (l = l.createElement(e), "select" === e && r.multiple && (l.multiple = !0)) : l = l.createElementNS(k, e), e = l, e[Ia] = m, e[Ja] = f; a: for (m = e, r = b, l = r.child; null !== l; ) { if (7 === l.tag || 8 === l.tag) m.appendChild(l.stateNode); else if (6 !== l.tag && null !== l.child) { l.child["return"] = l, l = l.child; continue; } if (l === r) break; for (;null === l.sibling; ) { if (null === l["return"] || l["return"] === r) break a; l = l["return"]; } l.sibling["return"] = l["return"], l = l.sibling; } r = e, l = h, m = f; var A = g, S = ue(l, m); switch (l) { case "iframe": case "object": F("load", r), g = m; break; case "video": case "audio": for (g = 0; g < fb.length; g++) F(fb[g], r); g = m; break; case "source": F("error", r), g = m; break; case "img": case "image": case "link": F("error", r), F("load", r), g = m; break; case "form": F("reset", r), F("submit", r), g = m; break; case "details": F("toggle", r), g = m; break; case "input": Bc(r, m), g = zc(r, m), F("invalid", r), ve(A, "onChange"); break; case "option": g = de(r, m); break; case "select": r._wrapperState = { wasMultiple: !!m.multiple }, g = n({}, m, { value: void 0 }), F("invalid", r), ve(A, "onChange"); break; case "textarea": ge(r, m), g = fe(r, m), F("invalid", r), ve(A, "onChange"); break; default: g = m; } te(l, g), k = void 0; var B = l, P = r, v = g; for (k in v) if (v.hasOwnProperty(k)) { var p = v[k]; "style" === k ? re(P, p) : "dangerouslySetInnerHTML" === k ? (p = p ? p.__html : void 0, null != p && ne(P, p)) : "children" === k ? "string" == typeof p ? ("textarea" !== B || "" !== p) && oe(P, p) : "number" == typeof p && oe(P, "" + p) : "suppressContentEditableWarning" !== k && "suppressHydrationWarning" !== k && "autoFocus" !== k && (sa.hasOwnProperty(k) ? null != p && ve(A, k) : null != p && xc(P, k, p, S)); } switch (l) { case "input": Wb(r), Fc(r, m, !1); break; case "textarea": Wb(r), ie(r, m); break; case "option": null != m.value && r.setAttribute("value", "" + yc(m.value)); break; case "select": g = r, g.multiple = !!m.multiple, r = m.value, null != r ? ee(g, !!m.multiple, r, !1) : null != m.defaultValue && ee(g, !!m.multiple, m.defaultValue, !0); break; default: "function" == typeof g.onClick && (r.onclick = we); } (f = ze(h, f)) && qg(b), b.stateNode = e; } null !== b.ref && (b.effectTag |= 128); } else null === b.stateNode ? t("166") : void 0; break; case 8: e && null != b.stateNode ? tg(e, b, e.memoizedProps, f) : ("string" != typeof f && (null === b.stateNode ? t("166") : void 0), e = zf(yf.current), zf(L.current), $f(b) ? (f = b, h = f.stateNode, e = f.memoizedProps, h[Ia] = f, (f = h.nodeValue !== e) && qg(b)) : (h = b, f = (9 === e.nodeType ? e : e.ownerDocument).createTextNode(f), f[Ia] = h, b.stateNode = f)); break; case 13: case 14: break; case 16: break; case 9: break; case 10: break; case 15: break; case 6: Bf(b), rg(b); break; case 12: tf(b); break; case 11: break; case 4: t("167"); default: t("156"); } if (b = N = null, f = a, 1073741823 === O || 1073741823 !== f.childExpirationTime) { for (h = 0, e = f.child; null !== e; ) g = e.expirationTime, m = e.childExpirationTime, (0 === h || 0 !== g && g < h) && (h = g), (0 === h || 0 !== m && m < h) && (h = m), e = e.sibling; f.childExpirationTime = h; } if (null !== b) return b; null !== c && 0 === (512 & c.effectTag) && (null === c.firstEffect && (c.firstEffect = a.firstEffect), null !== a.lastEffect && (null !== c.lastEffect && (c.lastEffect.nextEffect = a.firstEffect), c.lastEffect = a.lastEffect), 1 < a.effectTag && (null !== c.lastEffect ? c.lastEffect.nextEffect = a : c.firstEffect = a, c.lastEffect = a)); } else { if (a = Gg(a, O), null !== a) return a.effectTag &= 511, a; null !== c && (c.firstEffect = c.lastEffect = null, c.effectTag |= 512); } if (null !== d) return d; if (null === c) break; a = c; } return null; } function Rg(a) { var b = pg(a.alternate, a, O); return null === b && (b = Qg(a)), Ig.current = null, b; } function Sg(a, b, c) { Lg ? t("243") : void 0, Lg = !0, Ig.currentDispatcher = Hg; var d = a.nextExpirationTimeToWorkOn; d === O && a === Mg && null !== N || (Pg(), Mg = a, O = d, N = Ue(Mg.current, null, O), a.pendingCommitExpirationTime = 0); for (var e = !1; ;) { try { if (b) for (;null !== N && !Tg(); ) N = Rg(N); else for (;null !== N; ) N = Rg(N); } catch (r) { if (null === N) e = !0, Dg(r); else { null === N ? t("271") : void 0; var f = N, g = f["return"]; if (null !== g) { a: { var h = g, k = f, l = r; g = O, k.effectTag |= 512, k.firstEffect = k.lastEffect = null, Ng = !0, l = nf(l, k); do { switch (h.tag) { case 5: h.effectTag |= 1024, h.expirationTime = g, g = Cg(h, l, g), gf(h, g); break a; case 2: case 3: k = l; var m = h.stateNode; if (0 === (64 & h.effectTag) && null !== m && "function" == typeof m.componentDidCatch && (null === Fg || !Fg.has(m))) { h.effectTag |= 1024, h.expirationTime = g, g = Eg(h, k, g), gf(h, g); break a; } } h = h["return"]; } while (null !== h); } N = Qg(f); continue; } e = !0, Dg(r); } } break; } if (Lg = !1, rf = qf = pf = Ig.currentDispatcher = null, e) Mg = null, a.finishedWork = null; else if (null !== N) a.finishedWork = null; else { if (b = a.current.alternate, null === b ? t("281") : void 0, Mg = null, Ng) { if (e = a.latestPendingTime, f = a.latestSuspendedTime, g = a.latestPingedTime, 0 !== e && e > d || 0 !== f && f > d || 0 !== g && g > d) return a.didError = !1, c = a.latestPingedTime, 0 !== c && c <= d && (a.latestPingedTime = 0), c = a.earliestPendingTime, b = a.latestPendingTime, c === d ? a.earliestPendingTime = b === d ? a.latestPendingTime = 0 : b : b === d && (a.latestPendingTime = c), c = a.earliestSuspendedTime, b = a.latestSuspendedTime, 0 === c ? a.earliestSuspendedTime = a.latestSuspendedTime = d : c > d ? a.earliestSuspendedTime = d : b < d && (a.latestSuspendedTime = d), $e(d, a), void (a.expirationTime = a.expirationTime); if (!a.didError && !c) return a.didError = !0, a.nextExpirationTimeToWorkOn = d, d = a.expirationTime = 1, void (a.expirationTime = d); } a.pendingCommitExpirationTime = d, a.finishedWork = b; } } function wg(a, b) { var c; a: { for (Lg && !Og ? t("263") : void 0, c = a["return"]; null !== c; ) { switch (c.tag) { case 2: case 3: var d = c.stateNode; if ("function" == typeof c.type.getDerivedStateFromCatch || "function" == typeof d.componentDidCatch && (null === Fg || !Fg.has(d))) { a = nf(b, a), a = Eg(c, a, 1), ff(c, a), If(c, 1), c = void 0; break a; } break; case 5: a = nf(b, a), a = Cg(c, a, 1), ff(c, a), If(c, 1), c = void 0; break a; } c = c["return"]; } 5 === a.tag && (c = nf(b, a), c = Cg(a, c, 1), ff(a, c), If(a, 1)), c = void 0; } return c; } function Hf(a, b) { return 0 !== Kg ? a = Kg : Lg ? a = Og ? 1 : O : 1 & b.mode ? (a = Ug ? 2 + 10 * (((a - 2 + 15) / 10 | 0) + 1) : 2 + 25 * (((a - 2 + 500) / 25 | 0) + 1), null !== Mg && a === O && (a += 1)) : a = 1, Ug && (0 === Vg || a > Vg) && (Vg = a), a; } function If(a, b) { a: { (0 === a.expirationTime || a.expirationTime > b) && (a.expirationTime = b); var c = a.alternate; null !== c && (0 === c.expirationTime || c.expirationTime > b) && (c.expirationTime = b); var d = a["return"]; if (null === d && 5 === a.tag) a = a.stateNode; else { for (;null !== d; ) { if (c = d.alternate, (0 === d.childExpirationTime || d.childExpirationTime > b) && (d.childExpirationTime = b), null !== c && (0 === c.childExpirationTime || c.childExpirationTime > b) && (c.childExpirationTime = b), null === d["return"] && 5 === d.tag) { a = d.stateNode; break a; } d = d["return"]; } a = null; } } null !== a && (!Lg && 0 !== O && b < O && Pg(), Ze(a, b), Lg && !Og && Mg === a || (b = a, a = a.expirationTime, null === b.nextScheduledRoot ? (b.expirationTime = a, null === T ? (U = T = b, b.nextScheduledRoot = b) : (T = T.nextScheduledRoot = b, T.nextScheduledRoot = U)) : (c = b.expirationTime, (0 === c || a < c) && (b.expirationTime = a)), V || (W ? Wg && (Y = b, Z = 1, Xg(b, 1, !0)) : 1 === a ? Yg(1, null) : Zg(b, a))), $g > ah && ($g = 0, t("185"))); } function bh(a, b, c, d, e) { var f = Kg; Kg = 1; try { return a(b, c, d, e); } finally { Kg = f; } } function oh() { kh = ((ba.unstable_now() - jh) / 10 | 0) + 2; } function Zg(a, b) { if (0 !== ch) { if (b > ch) return; null !== dh && ba.unstable_cancelScheduledWork(dh); } ch = b, a = ba.unstable_now() - jh, dh = ba.unstable_scheduleWork(ph, { timeout: 10 * (b - 2) - a }); } function Gf() { return V ? lh : (qh(), 0 !== Z && 1073741823 !== Z || (oh(), lh = kh), lh); } function qh() { var a = 0, b = null; if (null !== T) for (var c = T, d = U; null !== d; ) { var e = d.expirationTime; if (0 === e) { if (null === c || null === T ? t("244") : void 0, d === d.nextScheduledRoot) { U = T = d.nextScheduledRoot = null; break; } if (d === U) U = e = d.nextScheduledRoot, T.nextScheduledRoot = e, d.nextScheduledRoot = null; else { if (d === T) { T = c, T.nextScheduledRoot = U, d.nextScheduledRoot = null; break; } c.nextScheduledRoot = d.nextScheduledRoot, d.nextScheduledRoot = null; } d = c.nextScheduledRoot; } else { if ((0 === a || e < a) && (a = e, b = d), d === T) break; if (1 === a) break; c = d, d = d.nextScheduledRoot; } } Y = b, Z = a; } function ph(a) { if (a.didTimeout && null !== U) { oh(); var b = U; do { var c = b.expirationTime; 0 !== c && kh >= c && (b.nextExpirationTimeToWorkOn = kh), b = b.nextScheduledRoot; } while (b !== U); } Yg(0, a); } function Yg(a, b) { if (hh = b, qh(), null !== hh) for (oh(), lh = kh; null !== Y && 0 !== Z && (0 === a || a >= Z) && (!eh || kh >= Z); ) Xg(Y, Z, kh >= Z), qh(), oh(), lh = kh; else for (;null !== Y && 0 !== Z && (0 === a || a >= Z); ) Xg(Y, Z, !0), qh(); if (null !== hh && (ch = 0, dh = null), 0 !== Z && Zg(Y, Z), hh = null, eh = !1, $g = 0, mh = null, null !== ih) for (a = ih, ih = null, b = 0; b < a.length; b++) { var c = a[b]; try { c._onComplete(); } catch (d) { fh || (fh = !0, gh = d); } } if (fh) throw a = gh, gh = null, fh = !1, a; } function Xg(a, b, c) { if (V ? t("245") : void 0, V = !0, null === hh || c) { var d = a.finishedWork; null !== d ? rh(a, d, b) : (a.finishedWork = null, Sg(a, !1, c), d = a.finishedWork, null !== d && rh(a, d, b)); } else d = a.finishedWork, null !== d ? rh(a, d, b) : (a.finishedWork = null, Sg(a, !0, c), d = a.finishedWork, null !== d && (Tg() ? a.finishedWork = d : rh(a, d, b))); V = !1; } function rh(a, b, c) { var d = a.firstBatch; if (null !== d && d._expirationTime <= c && (null === ih ? ih = [ d ] : ih.push(d), d._defer)) return a.finishedWork = b, void (a.expirationTime = 0); a.finishedWork = null, a === mh ? $g++ : (mh = a, $g = 0), Og = Lg = !0, a.current === b ? t("177") : void 0, c = a.pendingCommitExpirationTime, 0 === c ? t("261") : void 0, a.pendingCommitExpirationTime = 0, d = b.expirationTime; var e = b.childExpirationTime; if (d = 0 === d || 0 !== e && e < d ? e : d, a.didError = !1, 0 === d ? (a.earliestPendingTime = 0, a.latestPendingTime = 0, a.earliestSuspendedTime = 0, a.latestSuspendedTime = 0, a.latestPingedTime = 0) : (e = a.latestPendingTime, 0 !== e && (e < d ? a.earliestPendingTime = a.latestPendingTime = 0 : a.earliestPendingTime < d && (a.earliestPendingTime = a.latestPendingTime)), e = a.earliestSuspendedTime, 0 === e ? Ze(a, d) : d > a.latestSuspendedTime ? (a.earliestSuspendedTime = 0, a.latestSuspendedTime = 0, a.latestPingedTime = 0, Ze(a, d)) : d < e && Ze(a, d)), $e(0, a), Ig.current = null, 1 < b.effectTag ? null !== b.lastEffect ? (b.lastEffect.nextEffect = b, d = b.firstEffect) : d = b : d = b.firstEffect, xe = Gd, e = Td(), Ud(e)) { if ("selectionStart" in e) var f = { start: e.selectionStart, end: e.selectionEnd }; else a: { f = (f = e.ownerDocument) && f.defaultView || window; var g = f.getSelection && f.getSelection(); if (g && 0 !== g.rangeCount) { f = g.anchorNode; var h = g.anchorOffset, k = g.focusNode; g = g.focusOffset; try { f.nodeType, k.nodeType; } catch (Xa) { f = null; break a; } var l = 0, m = -1, r = -1, A = 0, S = 0, B = e, P = null; b: for (;;) { for (var v; B !== f || 0 !== h && 3 !== B.nodeType || (m = l + h), B !== k || 0 !== g && 3 !== B.nodeType || (r = l + g), 3 === B.nodeType && (l += B.nodeValue.length), null !== (v = B.firstChild); ) P = B, B = v; for (;;) { if (B === e) break b; if (P === f && ++A === h && (m = l), P === k && ++S === g && (r = l), null !== (v = B.nextSibling)) break; B = P, P = B.parentNode; } B = v; } f = -1 === m || -1 === r ? null : { start: m, end: r }; } else f = null; } f = f || { start: 0, end: 0 }; } else f = null; for (ye = { focusedElem: e, selectionRange: f }, Gd = !1, Q = d; null !== Q; ) { e = !1, f = void 0; try { for (;null !== Q; ) { if (256 & Q.effectTag) { var p = Q.alternate; a: switch (h = Q, h.tag) { case 2: case 3: if (256 & h.effectTag && null !== p) { var u = p.memoizedProps, x = p.memoizedState, R = h.stateNode; R.props = h.memoizedProps, R.state = h.memoizedState; var yh = R.getSnapshotBeforeUpdate(u, x); R.__reactInternalSnapshotBeforeUpdate = yh; } break a; case 5: case 7: case 8: case 6: break a; default: t("163"); } } Q = Q.nextEffect; } } catch (Xa) { e = !0, f = Xa; } e && (null === Q ? t("178") : void 0, wg(Q, f), null !== Q && (Q = Q.nextEffect)); } for (Q = d; null !== Q; ) { p = !1, u = void 0; try { for (;null !== Q; ) { var w = Q.effectTag; if (16 & w && oe(Q.stateNode, ""), 128 & w) { var y = Q.alternate; if (null !== y) { var q = y.ref; null !== q && ("function" == typeof q ? q(null) : q.current = null); } } switch (14 & w) { case 2: Ag(Q), Q.effectTag &= -3; break; case 6: Ag(Q), Q.effectTag &= -3, Bg(Q.alternate, Q); break; case 4: Bg(Q.alternate, Q); break; case 8: x = Q, yg(x), x["return"] = null, x.child = null, x.alternate && (x.alternate.child = null, x.alternate["return"] = null); } Q = Q.nextEffect; } } catch (Xa) { p = !0, u = Xa; } p && (null === Q ? t("178") : void 0, wg(Q, u), null !== Q && (Q = Q.nextEffect)); } if (q = ye, y = Td(), w = q.focusedElem, u = q.selectionRange, y !== w && w && w.ownerDocument && Sd(w.ownerDocument.documentElement, w)) { null !== u && Ud(w) && (y = u.start, q = u.end, void 0 === q && (q = y), "selectionStart" in w ? (w.selectionStart = y, w.selectionEnd = Math.min(q, w.value.length)) : (p = w.ownerDocument || document, y = (p && p.defaultView || window).getSelection(), x = w.textContent.length, q = Math.min(u.start, x), u = void 0 === u.end ? q : Math.min(u.end, x), !y.extend && q > u && (x = u, u = q, q = x), x = Rd(w, q), R = Rd(w, u), x && R && (1 !== y.rangeCount || y.anchorNode !== x.node || y.anchorOffset !== x.offset || y.focusNode !== R.node || y.focusOffset !== R.offset) && (p = p.createRange(), p.setStart(x.node, x.offset), y.removeAllRanges(), q > u ? (y.addRange(p), y.extend(R.node, R.offset)) : (p.setEnd(R.node, R.offset), y.addRange(p))))), y = []; for (q = w; q = q.parentNode; ) 1 === q.nodeType && y.push({ element: q, left: q.scrollLeft, top: q.scrollTop }); for ("function" == typeof w.focus && w.focus(), w = 0; w < y.length; w++) q = y[w], q.element.scrollLeft = q.left, q.element.scrollTop = q.top; } for (ye = null, Gd = !!xe, xe = null, a.current = b, Q = d; null !== Q; ) { d = !1, w = void 0; try { for (y = c; null !== Q; ) { var Sa = Q.effectTag; if (36 & Sa) { var oc = Q.alternate; switch (q = Q, p = y, q.tag) { case 2: case 3: var X = q.stateNode; if (4 & q.effectTag) if (null === oc) X.props = q.memoizedProps, X.state = q.memoizedState, X.componentDidMount(); else { var Ih = oc.memoizedProps, Jh = oc.memoizedState; X.props = q.memoizedProps, X.state = q.memoizedState, X.componentDidUpdate(Ih, Jh, X.__reactInternalSnapshotBeforeUpdate); } var kg = q.updateQueue; null !== kg && (X.props = q.memoizedProps, X.state = q.memoizedState, lf(q, kg, X, p)); break; case 5: var lg = q.updateQueue; if (null !== lg) { if (u = null, null !== q.child) switch (q.child.tag) { case 7: u = q.child.stateNode; break; case 2: case 3: u = q.child.stateNode; } lf(q, lg, u, p); } break; case 7: var Kh = q.stateNode; null === oc && 4 & q.effectTag && ze(q.type, q.memoizedProps) && Kh.focus(); break; case 8: break; case 6: break; case 15: break; case 16: break; default: t("163"); } } if (128 & Sa) { var Ac = Q.ref; if (null !== Ac) { var mg = Q.stateNode; switch (Q.tag) { case 7: var Pd = mg; break; default: Pd = mg; } "function" == typeof Ac ? Ac(Pd) : Ac.current = Pd; } } var Lh = Q.nextEffect; Q.nextEffect = null, Q = Lh; } } catch (Xa) { d = !0, w = Xa; } d && (null === Q ? t("178") : void 0, wg(Q, w), null !== Q && (Q = Q.nextEffect)); } Lg = Og = !1, "function" == typeof Oe && Oe(b.stateNode), Sa = b.expirationTime, b = b.childExpirationTime, b = 0 === Sa || 0 !== b && b < Sa ? b : Sa, 0 === b && (Fg = null), a.expirationTime = b, a.finishedWork = null; } function Tg() { return !!eh || !(null === hh || hh.timeRemaining() > nh) && (eh = !0); } function Dg(a) { null === Y ? t("246") : void 0, Y.expirationTime = 0, fh || (fh = !0, gh = a); } function sh(a, b) { var c = W; W = !0; try { return a(b); } finally { (W = c) || V || Yg(1, null); } } function th(a, b) { if (W && !Wg) { Wg = !0; try { return a(b); } finally { Wg = !1; } } return a(b); } function uh(a, b, c) { if (Ug) return a(b, c); W || V || 0 === Vg || (Yg(Vg, null), Vg = 0); var d = Ug, e = W; W = Ug = !0; try { return a(b, c); } finally { Ug = d, (W = e) || V || Yg(1, null); } } function vh(a) { if (!a) return Fe; a = a._reactInternalFiber; a: { 2 !== jd(a) || 2 !== a.tag && 3 !== a.tag ? t("170") : void 0; var b = a; do { switch (b.tag) { case 5: b = b.stateNode.context; break a; case 2: if (K(b.type)) { b = b.stateNode.__reactInternalMemoizedMergedChildContext; break a; } break; case 3: if (K(b.type._reactResult)) { b = b.stateNode.__reactInternalMemoizedMergedChildContext; break a; } } b = b["return"]; } while (null !== b); t("171"), b = void 0; } if (2 === a.tag) { var c = a.type; if (K(c)) return Le(a, c, b); } else if (3 === a.tag && (c = a.type._reactResult, K(c))) return Le(a, c, b); return b; } function wh(a, b, c, d, e) { var f = b.current; return c = vh(c), null === b.context ? b.context = c : b.pendingContext = c, b = e, e = df(d), e.payload = { element: a }, b = void 0 === b ? null : b, null !== b && (e.callback = b), ff(f, e), If(f, d), d; } function xh(a, b, c, d) { var e = b.current, f = Gf(); return e = Hf(f, e), wh(a, b, c, e, d); } function zh(a) { if (a = a.current, !a.child) return null; switch (a.child.tag) { case 7: return a.child.stateNode; default: return a.child.stateNode; } } function Ah(a, b, c) { var d = 3 < arguments.length && void 0 !== arguments[3] ? arguments[3] : null; return { $$typeof: ac, key: null == d ? null : "" + d, children: a, containerInfo: b, implementation: c }; } function Bh(a) { var b = 2 + 25 * (((Gf() - 2 + 500) / 25 | 0) + 1); b <= Jg && (b = Jg + 1), this._expirationTime = Jg = b, this._root = a, this._callbacks = this._next = null, this._hasChildren = this._didComplete = !1, this._children = null, this._defer = !0; } function Ch() { this._callbacks = null, this._didCommit = !1, this._onCommit = this._onCommit.bind(this); } function Dh(a, b, c) { b = new Se(5, null, null, b ? 3 : 0), a = { current: b, containerInfo: a, pendingChildren: null, earliestPendingTime: 0, latestPendingTime: 0, earliestSuspendedTime: 0, latestSuspendedTime: 0, latestPingedTime: 0, didError: !1, pendingCommitExpirationTime: 0, finishedWork: null, timeoutHandle: -1, context: null, pendingContext: null, hydrate: c, nextExpirationTimeToWorkOn: 0, expirationTime: 0, firstBatch: null, nextScheduledRoot: null }, this._internalRoot = b.stateNode = a; } function Eh(a) { return !(!a || 1 !== a.nodeType && 9 !== a.nodeType && 11 !== a.nodeType && (8 !== a.nodeType || " react-mount-point-unstable " !== a.nodeValue)); } function Fh(a, b) { if (b || (b = a ? 9 === a.nodeType ? a.documentElement : a.firstChild : null, b = !(!b || 1 !== b.nodeType || !b.hasAttribute("data-reactroot"))), !b) for (var c; c = a.lastChild; ) a.removeChild(c); return new Dh(a, (!1), b); } function Gh(a, b, c, d, e) { Eh(c) ? void 0 : t("200"); var f = c._reactRootContainer; if (f) { if ("function" == typeof e) { var g = e; e = function() { var a = zh(f._internalRoot); g.call(a); }; } null != a ? f.legacy_renderSubtreeIntoContainer(a, b, e) : f.render(b, e); } else { if (f = c._reactRootContainer = Fh(c, d), "function" == typeof e) { var h = e; e = function() { var a = zh(f._internalRoot); h.call(a); }; } th(function() { null != a ? f.legacy_renderSubtreeIntoContainer(a, b, e) : f.render(b, e); }); } return zh(f._internalRoot); } function Hh(a, b) { var c = 2 < arguments.length && void 0 !== arguments[2] ? arguments[2] : null; return Eh(b) ? void 0 : t("200"), Ah(a, b, null, c); } var aa = __webpack_require__(12), n = __webpack_require__(28), ba = __webpack_require__(29); aa ? void 0 : t("227"); var ea = !1, fa = null, ha = !1, ia = null, ja = { onError: function(a) { ea = !0, fa = a; } }, ma = null, na = {}, pa = [], qa = {}, sa = {}, ta = {}, ua = null, va = null, wa = null, Aa = null, Ea = { injectEventPluginOrder: function(a) { ma ? t("101") : void 0, ma = Array.prototype.slice.call(a), oa(); }, injectEventPluginsByName: function(a) { var c, b = !1; for (c in a) if (a.hasOwnProperty(c)) { var d = a[c]; na.hasOwnProperty(c) && na[c] === d || (na[c] ? t("102", c) : void 0, na[c] = d, b = !0); } b && oa(); } }, Ha = Math.random().toString(36).slice(2), Ia = "__reactInternalInstance$" + Ha, Ja = "__reactEventHandlers$" + Ha, Va = !("undefined" == typeof window || !window.document || !window.document.createElement), Ya = { animationend: Wa("Animation", "AnimationEnd"), animationiteration: Wa("Animation", "AnimationIteration"), animationstart: Wa("Animation", "AnimationStart"), transitionend: Wa("Transition", "TransitionEnd") }, Za = {}, $a = {}; Va && ($a = document.createElement("div").style, "AnimationEvent" in window || (delete Ya.animationend.animation, delete Ya.animationiteration.animation, delete Ya.animationstart.animation), "TransitionEvent" in window || delete Ya.transitionend.transition); var bb = ab("animationend"), cb = ab("animationiteration"), db = ab("animationstart"), eb = ab("transitionend"), fb = "abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange seeked seeking stalled suspend timeupdate volumechange waiting".split(" "), gb = null, hb = null, ib = null; n(z.prototype, { preventDefault: function() { this.defaultPrevented = !0; var a = this.nativeEvent; a && (a.preventDefault ? a.preventDefault() : "unknown" != typeof a.returnValue && (a.returnValue = !1), this.isDefaultPrevented = kb); }, stopPropagation: function() { var a = this.nativeEvent; a && (a.stopPropagation ? a.stopPropagation() : "unknown" != typeof a.cancelBubble && (a.cancelBubble = !0), this.isPropagationStopped = kb); }, persist: function() { this.isPersistent = kb; }, isPersistent: lb, destructor: function() { var b, a = this.constructor.Interface; for (b in a) this[b] = null; this.nativeEvent = this._targetInst = this.dispatchConfig = null, this.isPropagationStopped = this.isDefaultPrevented = lb, this._dispatchInstances = this._dispatchListeners = null; } }), z.Interface = { type: null, target: null, currentTarget: function() { return null; }, eventPhase: null, bubbles: null, cancelable: null, timeStamp: function(a) { return a.timeStamp || Date.now(); }, defaultPrevented: null, isTrusted: null }, z.extend = function(a) { function b() {} function c() { return d.apply(this, arguments); } var d = this; b.prototype = d.prototype; var e = new b(); return n(e, c.prototype), c.prototype = e, c.prototype.constructor = c, c.Interface = n({}, d.Interface, a), c.extend = d.extend, mb(c), c; }, mb(z); var pb = z.extend({ data: null }), qb = z.extend({ data: null }), rb = [ 9, 13, 27, 32 ], sb = Va && "CompositionEvent" in window, tb = null; Va && "documentMode" in document && (tb = document.documentMode); var ub = Va && "TextEvent" in window && !tb, vb = Va && (!sb || tb && 8 < tb && 11 >= tb), wb = String.fromCharCode(32), xb = { beforeInput: { phasedRegistrationNames: { bubbled: "onBeforeInput", captured: "onBeforeInputCapture" }, dependencies: [ "compositionend", "keypress", "textInput", "paste" ] }, compositionEnd: { phasedRegistrationNames: { bubbled: "onCompositionEnd", captured: "onCompositionEndCapture" }, dependencies: "blur compositionend keydown keypress keyup mousedown".split(" ") }, compositionStart: { phasedRegistrationNames: { bubbled: "onCompositionStart", captured: "onCompositionStartCapture" }, dependencies: "blur compositionstart keydown keypress keyup mousedown".split(" ") }, compositionUpdate: { phasedRegistrationNames: { bubbled: "onCompositionUpdate", captured: "onCompositionUpdateCapture" }, dependencies: "blur compositionupdate keydown keypress keyup mousedown".split(" ") } }, yb = !1, Bb = !1, Eb = { eventTypes: xb, extractEvents: function(a, b, c, d) { var e = void 0, f = void 0; if (sb) b: { switch (a) { case "compositionstart": e = xb.compositionStart; break b; case "compositionend": e = xb.compositionEnd; break b; case "compositionupdate": e = xb.compositionUpdate; break b; } e = void 0; } else Bb ? zb(a, c) && (e = xb.compositionEnd) : "keydown" === a && 229 === c.keyCode && (e = xb.compositionStart); return e ? (vb && "ko" !== c.locale && (Bb || e !== xb.compositionStart ? e === xb.compositionEnd && Bb && (f = jb()) : (gb = d, hb = "value" in gb ? gb.value : gb.textContent, Bb = !0)), e = pb.getPooled(e, b, c, d), f ? e.data = f : (f = Ab(c), null !== f && (e.data = f)), Ua(e), f = e) : f = null, (a = ub ? Cb(a, c) : Db(a, c)) ? (b = qb.getPooled(xb.beforeInput, b, c, d), b.data = a, Ua(b)) : b = null, null === f ? b : null === b ? f : [ f, b ]; } }, Fb = null, Gb = null, Hb = null, Ob = !1, Qb = { color: !0, date: !0, datetime: !0, "datetime-local": !0, email: !0, month: !0, number: !0, password: !0, range: !0, search: !0, tel: !0, text: !0, time: !0, url: !0, week: !0 }, Yb = aa.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED, Zb = /^(.*)[\\\/]/, C = "function" == typeof Symbol && Symbol["for"], $b = C ? Symbol["for"]("react.element") : 60103, ac = C ? Symbol["for"]("react.portal") : 60106, bc = C ? Symbol["for"]("react.fragment") : 60107, cc = C ? Symbol["for"]("react.strict_mode") : 60108, dc = C ? Symbol["for"]("react.profiler") : 60114, ec = C ? Symbol["for"]("react.provider") : 60109, fc = C ? Symbol["for"]("react.context") : 60110, gc = C ? Symbol["for"]("react.async_mode") : 60111, hc = C ? Symbol["for"]("react.forward_ref") : 60112, ic = C ? Symbol["for"]("react.placeholder") : 60113, jc = "function" == typeof Symbol && Symbol.iterator, nc = /^[: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][: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\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/, pc = Object.prototype.hasOwnProperty, qc = {}, rc = {}, E = {}; "children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(a) { E[a] = new D(a, 0, (!1), a, null); }), [ [ "acceptCharset", "accept-charset" ], [ "className", "class" ], [ "htmlFor", "for" ], [ "httpEquiv", "http-equiv" ] ].forEach(function(a) { var b = a[0]; E[b] = new D(b, 1, (!1), a[1], null); }), [ "contentEditable", "draggable", "spellCheck", "value" ].forEach(function(a) { E[a] = new D(a, 2, (!1), a.toLowerCase(), null); }), [ "autoReverse", "externalResourcesRequired", "focusable", "preserveAlpha" ].forEach(function(a) { E[a] = new D(a, 2, (!1), a, null); }), "allowFullScreen async autoFocus autoPlay controls default defer disabled formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(a) { E[a] = new D(a, 3, (!1), a.toLowerCase(), null); }), [ "checked", "multiple", "muted", "selected" ].forEach(function(a) { E[a] = new D(a, 3, (!0), a, null); }), [ "capture", "download" ].forEach(function(a) { E[a] = new D(a, 4, (!1), a, null); }), [ "cols", "rows", "size", "span" ].forEach(function(a) { E[a] = new D(a, 6, (!1), a, null); }), [ "rowSpan", "start" ].forEach(function(a) { E[a] = new D(a, 5, (!1), a.toLowerCase(), null); }); var vc = /[\-:]([a-z])/g; "accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(a) { var b = a.replace(vc, wc); E[b] = new D(b, 1, (!1), a, null); }), "xlink:actuate xlink:arcrole xlink:href xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(a) { var b = a.replace(vc, wc); E[b] = new D(b, 1, (!1), a, "http://www.w3.org/1999/xlink"); }), [ "xml:base", "xml:lang", "xml:space" ].forEach(function(a) { var b = a.replace(vc, wc); E[b] = new D(b, 1, (!1), a, "http://www.w3.org/XML/1998/namespace"); }), E.tabIndex = new D("tabIndex", 1, (!1), "tabindex", null); var Gc = { change: { phasedRegistrationNames: { bubbled: "onChange", captured: "onChangeCapture" }, dependencies: "blur change click focus input keydown keyup selectionchange".split(" ") } }, Ic = null, Jc = null, Nc = !1; Va && (Nc = Tb("input") && (!document.documentMode || 9 < document.documentMode)); var Uc = { eventTypes: Gc, _isInputEventSupported: Nc, extractEvents: function(a, b, c, d) { var e = b ? Ma(b) : window, f = void 0, g = void 0, h = e.nodeName && e.nodeName.toLowerCase(); return "select" === h || "input" === h && "file" === e.type ? f = Mc : Rb(e) ? Nc ? f = Tc : (f = Rc, g = Qc) : (h = e.nodeName) && "input" === h.toLowerCase() && ("checkbox" === e.type || "radio" === e.type) && (f = Sc), f && (f = f(a, b)) ? Hc(f, c, d) : (g && g(a, e, b), void ("blur" === a && (a = e._wrapperState) && a.controlled && "number" === e.type && Ec(e, "number", e.value))); } }, Vc = z.extend({ view: null, detail: null }), Wc = { Alt: "altKey", Control: "ctrlKey", Meta: "metaKey", Shift: "shiftKey" }, Zc = 0, $c = 0, ad = !1, bd = !1, cd = Vc.extend({ screenX: null, screenY: null, clientX: null, clientY: null, pageX: null, pageY: null, ctrlKey: null, shiftKey: null, altKey: null, metaKey: null, getModifierState: Yc, button: null, buttons: null, relatedTarget: function(a) { return a.relatedTarget || (a.fromElement === a.srcElement ? a.toElement : a.fromElement); }, movementX: function(a) { if ("movementX" in a) return a.movementX; var b = Zc; return Zc = a.screenX, ad ? "mousemove" === a.type ? a.screenX - b : 0 : (ad = !0, 0); }, movementY: function(a) { if ("movementY" in a) return a.movementY; var b = $c; return $c = a.screenY, bd ? "mousemove" === a.type ? a.screenY - b : 0 : (bd = !0, 0); } }), dd = cd.extend({ pointerId: null, width: null, height: null, pressure: null, tangentialPressure: null, tiltX: null, tiltY: null, twist: null, pointerType: null, isPrimary: null }), ed = { mouseEnter: { registrationName: "onMouseEnter", dependencies: [ "mouseout", "mouseover" ] }, mouseLeave: { registrationName: "onMouseLeave", dependencies: [ "mouseout", "mouseover" ] }, pointerEnter: { registrationName: "onPointerEnter", dependencies: [ "pointerout", "pointerover" ] }, pointerLeave: { registrationName: "onPointerLeave", dependencies: [ "pointerout", "pointerover" ] } }, fd = { eventTypes: ed, extractEvents: function(a, b, c, d) { var e = "mouseover" === a || "pointerover" === a, f = "mouseout" === a || "pointerout" === a; if (e && (c.relatedTarget || c.fromElement) || !f && !e) return null; if (e = d.window === d ? d : (e = d.ownerDocument) ? e.defaultView || e.parentWindow : window, f ? (f = b, b = (b = c.relatedTarget || c.toElement) ? Ka(b) : null) : f = null, f === b) return null; var g = void 0, h = void 0, k = void 0, l = void 0; "mouseout" === a || "mouseover" === a ? (g = cd, h = ed.mouseLeave, k = ed.mouseEnter, l = "mouse") : "pointerout" !== a && "pointerover" !== a || (g = dd, h = ed.pointerLeave, k = ed.pointerEnter, l = "pointer"); var m = null == f ? e : Ma(f); if (e = null == b ? e : Ma(b), a = g.getPooled(h, f, c, d), a.type = l + "leave", a.target = m, a.relatedTarget = e, c = g.getPooled(k, b, c, d), c.type = l + "enter", c.target = e, c.relatedTarget = m, d = b, f && d) a: { for (b = f, e = d, l = 0, g = b; g; g = Oa(g)) l++; for (g = 0, k = e; k; k = Oa(k)) g++; for (;0 < l - g; ) b = Oa(b), l--; for (;0 < g - l; ) e = Oa(e), g--; for (;l--; ) { if (b === e || b === e.alternate) break a; b = Oa(b), e = Oa(e); } b = null; } else b = null; for (e = b, b = []; f && f !== e && (l = f.alternate, null === l || l !== e); ) b.push(f), f = Oa(f); for (f = []; d && d !== e && (l = d.alternate, null === l || l !== e); ) f.push(d), d = Oa(d); for (d = 0; d < b.length; d++) Ra(b[d], "bubbled", a); for (d = f.length; 0 < d--; ) Ra(f[d], "captured", c); return [ a, c ]; } }, gd = Object.prototype.hasOwnProperty, nd = z.extend({ animationName: null, elapsedTime: null, pseudoElement: null }), od = z.extend({ clipboardData: function(a) { return "clipboardData" in a ? a.clipboardData : window.clipboardData; } }), pd = Vc.extend({ relatedTarget: null }), rd = { Esc: "Escape", Spacebar: " ", Left: "ArrowLeft", Up: "ArrowUp", Right: "ArrowRight", Down: "ArrowDown", Del: "Delete", Win: "OS", Menu: "ContextMenu", Apps: "ContextMenu", Scroll: "ScrollLock", MozPrintableKey: "Unidentified" }, sd = { 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" }, td = Vc.extend({ key: function(a) { if (a.key) { var b = rd[a.key] || a.key; if ("Unidentified" !== b) return b; } return "keypress" === a.type ? (a = qd(a), 13 === a ? "Enter" : String.fromCharCode(a)) : "keydown" === a.type || "keyup" === a.type ? sd[a.keyCode] || "Unidentified" : ""; }, location: null, ctrlKey: null, shiftKey: null, altKey: null, metaKey: null, repeat: null, locale: null, getModifierState: Yc, charCode: function(a) { return "keypress" === a.type ? qd(a) : 0; }, keyCode: function(a) { return "keydown" === a.type || "keyup" === a.type ? a.keyCode : 0; }, which: function(a) { return "keypress" === a.type ? qd(a) : "keydown" === a.type || "keyup" === a.type ? a.keyCode : 0; } }), ud = cd.extend({ dataTransfer: null }), vd = Vc.extend({ touches: null, targetTouches: null, changedTouches: null, altKey: null, metaKey: null, ctrlKey: null, shiftKey: null, getModifierState: Yc }), wd = z.extend({ propertyName: null, elapsedTime: null, pseudoElement: null }), xd = cd.extend({ deltaX: function(a) { return "deltaX" in a ? a.deltaX : "wheelDeltaX" in a ? -a.wheelDeltaX : 0; }, deltaY: function(a) { return "deltaY" in a ? a.deltaY : "wheelDeltaY" in a ? -a.wheelDeltaY : "wheelDelta" in a ? -a.wheelDelta : 0; }, deltaZ: null, deltaMode: null }), yd = [ [ "abort", "abort" ], [ bb, "animationEnd" ], [ cb, "animationIteration" ], [ db, "animationStart" ], [ "canplay", "canPlay" ], [ "canplaythrough", "canPlayThrough" ], [ "drag", "drag" ], [ "dragenter", "dragEnter" ], [ "dragexit", "dragExit" ], [ "dragleave", "dragLeave" ], [ "dragover", "dragOver" ], [ "durationchange", "durationChange" ], [ "emptied", "emptied" ], [ "encrypted", "encrypted" ], [ "ended", "ended" ], [ "error", "error" ], [ "gotpointercapture", "gotPointerCapture" ], [ "load", "load" ], [ "loadeddata", "loadedData" ], [ "loadedmetadata", "loadedMetadata" ], [ "loadstart", "loadStart" ], [ "lostpointercapture", "lostPointerCapture" ], [ "mousemove", "mouseMove" ], [ "mouseout", "mouseOut" ], [ "mouseover", "mouseOver" ], [ "playing", "playing" ], [ "pointermove", "pointerMove" ], [ "pointerout", "pointerOut" ], [ "pointerover", "pointerOver" ], [ "progress", "progress" ], [ "scroll", "scroll" ], [ "seeking", "seeking" ], [ "stalled", "stalled" ], [ "suspend", "suspend" ], [ "timeupdate", "timeUpdate" ], [ "toggle", "toggle" ], [ "touchmove", "touchMove" ], [ eb, "transitionEnd" ], [ "waiting", "waiting" ], [ "wheel", "wheel" ] ], zd = {}, Ad = {}; [ [ "blur", "blur" ], [ "cancel", "cancel" ], [ "click", "click" ], [ "close", "close" ], [ "contextmenu", "contextMenu" ], [ "copy", "copy" ], [ "cut", "cut" ], [ "auxclick", "auxClick" ], [ "dblclick", "doubleClick" ], [ "dragend", "dragEnd" ], [ "dragstart", "dragStart" ], [ "drop", "drop" ], [ "focus", "focus" ], [ "input", "input" ], [ "invalid", "invalid" ], [ "keydown", "keyDown" ], [ "keypress", "keyPress" ], [ "keyup", "keyUp" ], [ "mousedown", "mouseDown" ], [ "mouseup", "mouseUp" ], [ "paste", "paste" ], [ "pause", "pause" ], [ "play", "play" ], [ "pointercancel", "pointerCancel" ], [ "pointerdown", "pointerDown" ], [ "pointerup", "pointerUp" ], [ "ratechange", "rateChange" ], [ "reset", "reset" ], [ "seeked", "seeked" ], [ "submit", "submit" ], [ "touchcancel", "touchCancel" ], [ "touchend", "touchEnd" ], [ "touchstart", "touchStart" ], [ "volumechange", "volumeChange" ] ].forEach(function(a) { Bd(a, !0); }), yd.forEach(function(a) { Bd(a, !1); }); var Cd = { eventTypes: zd, isInteractiveTopLevelEventType: function(a) { return a = Ad[a], void 0 !== a && !0 === a.isInteractive; }, extractEvents: function(a, b, c, d) { var e = Ad[a]; if (!e) return null; switch (a) { case "keypress": if (0 === qd(c)) return null; case "keydown": case "keyup": a = td; break; case "blur": case "focus": a = pd; break; case "click": if (2 === c.button) return null; case "auxclick": case "dblclick": case "mousedown": case "mousemove": case "mouseup": case "mouseout": case "mouseover": case "contextmenu": a = cd; break; case "drag": case "dragend": case "dragenter": case "dragexit": case "dragleave": case "dragover": case "dragstart": case "drop": a = ud; break; case "touchcancel": case "touchend": case "touchmove": case "touchstart": a = vd; break; case bb: case cb: case db: a = nd; break; case eb: a = wd; break; case "scroll": a = Vc; break; case "wheel": a = xd; break; case "copy": case "cut": case "paste": a = od; break; case "gotpointercapture": case "lostpointercapture": case "pointercancel": case "pointerdown": case "pointermove": case "pointerout": case "pointerover": case "pointerup": a = dd; break; default: a = z; } return b = a.getPooled(e, b, c, d), Ua(b), b; } }, Dd = Cd.isInteractiveTopLevelEventType, Ed = [], Gd = !0, Kd = {}, Ld = 0, Md = "_reactListenersID" + ("" + Math.random()).slice(2), Vd = Va && "documentMode" in document && 11 >= document.documentMode, Wd = { select: { phasedRegistrationNames: { bubbled: "onSelect", captured: "onSelectCapture" }, dependencies: "blur contextmenu dragend focus keydown keyup mousedown mouseup selectionchange".split(" ") } }, Xd = null, Yd = null, Zd = null, $d = !1, be = { eventTypes: Wd, extractEvents: function(a, b, c, d) { var f, e = d.window === d ? d.document : 9 === d.nodeType ? d : d.ownerDocument; if (!(f = !e)) { a: { e = Nd(e), f = ta.onSelect; for (var g = 0; g < f.length; g++) { var h = f[g]; if (!e.hasOwnProperty(h) || !e[h]) { e = !1; break a; } } e = !0; } f = !e; } if (f) return null; switch (e = b ? Ma(b) : window, a) { case "focus": (Rb(e) || "true" === e.contentEditable) && (Xd = e, Yd = b, Zd = null); break; case "blur": Zd = Yd = Xd = null; break; case "mousedown": $d = !0; break; case "contextmenu": case "mouseup": case "dragend": return $d = !1, ae(c, d); case "selectionchange": if (Vd) break; case "keydown": case "keyup": return ae(c, d); } return null; } }; Ea.injectEventPluginOrder("ResponderEventPlugin SimpleEventPlugin EnterLeaveEventPlugin ChangeEventPlugin SelectEventPlugin BeforeInputEventPlugin".split(" ")), ua = Na, va = La, wa = Ma, Ea.injectEventPluginsByName({ SimpleEventPlugin: Cd, EnterLeaveEventPlugin: fd, ChangeEventPlugin: Uc, SelectEventPlugin: be, BeforeInputEventPlugin: Eb }); var je = { html: "http://www.w3.org/1999/xhtml", mathml: "http://www.w3.org/1998/Math/MathML", svg: "http://www.w3.org/2000/svg" }, me = void 0, ne = function(a) { return "undefined" != typeof MSApp && MSApp.execUnsafeLocalFunction ? function(b, c, d, e) { MSApp.execUnsafeLocalFunction(function() { return a(b, c, d, e); }); } : a; }(function(a, b) { if (a.namespaceURI !== je.svg || "innerHTML" in a) a.innerHTML = b; else { for (me = me || document.createElement("div"), me.innerHTML = "" + b + "", b = me.firstChild; a.firstChild; ) a.removeChild(a.firstChild); for (;b.firstChild; ) a.appendChild(b.firstChild); } }), pe = { animationIterationCount: !0, borderImageOutset: !0, borderImageSlice: !0, borderImageWidth: !0, boxFlex: !0, boxFlexGroup: !0, boxOrdinalGroup: !0, columnCount: !0, columns: !0, flex: !0, flexGrow: !0, flexPositive: !0, flexShrink: !0, flexNegative: !0, flexOrder: !0, gridArea: !0, gridRow: !0, gridRowEnd: !0, gridRowSpan: !0, gridRowStart: !0, gridColumn: !0, gridColumnEnd: !0, gridColumnSpan: !0, gridColumnStart: !0, fontWeight: !0, lineClamp: !0, lineHeight: !0, opacity: !0, order: !0, orphans: !0, tabSize: !0, widows: !0, zIndex: !0, zoom: !0, fillOpacity: !0, floodOpacity: !0, stopOpacity: !0, strokeDasharray: !0, strokeDashoffset: !0, strokeMiterlimit: !0, strokeOpacity: !0, strokeWidth: !0 }, qe = [ "Webkit", "ms", "Moz", "O" ]; Object.keys(pe).forEach(function(a) { qe.forEach(function(b) { b = b + a.charAt(0).toUpperCase() + a.substring(1), pe[b] = pe[a]; }); }); var se = n({ menuitem: !0 }, { area: !0, base: !0, br: !0, col: !0, embed: !0, hr: !0, img: !0, input: !0, keygen: !0, link: !0, meta: !0, param: !0, source: !0, track: !0, wbr: !0 }), xe = null, ye = null; new Set(); var De = [], Ee = -1, Fe = {}, I = { current: Fe }, J = { current: !1 }, Ge = Fe, Oe = null, Pe = null, af = !1, of = { current: null }, pf = null, qf = null, rf = null, wf = {}, L = { current: wf }, xf = { current: wf }, yf = { current: wf }, Ef = new aa.Component().refs, Jf = { isMounted: function(a) { return !!(a = a._reactInternalFiber) && 2 === jd(a); }, enqueueSetState: function(a, b, c) { a = a._reactInternalFiber; var d = Gf(); d = Hf(d, a); var e = df(d); e.payload = b, void 0 !== c && null !== c && (e.callback = c), ff(a, e), If(a, d); }, enqueueReplaceState: function(a, b, c) { a = a._reactInternalFiber; var d = Gf(); d = Hf(d, a); var e = df(d); e.tag = 1, e.payload = b, void 0 !== c && null !== c && (e.callback = c), ff(a, e), If(a, d); }, enqueueForceUpdate: function(a, b) { a = a._reactInternalFiber; var c = Gf(); c = Hf(c, a); var d = df(c); d.tag = 2, void 0 !== b && null !== b && (d.callback = b), ff(a, d), If(a, c); } }, Nf = Array.isArray, Rf = Qf(!0), Sf = Qf(!1), Tf = null, Uf = null, Vf = !1, cg = Yb.ReactCurrentOwner, rg = void 0, sg = void 0, tg = void 0; rg = function() {}, sg = function(a, b, c, d, e) { var f = a.memoizedProps; if (f !== d) { var g = b.stateNode; switch (zf(L.current), a = null, c) { case "input": f = zc(g, f), d = zc(g, d), a = []; break; case "option": f = de(g, f), d = de(g, d), a = []; break; case "select": f = n({}, f, { value: void 0 }), d = n({}, d, { value: void 0 }), a = []; break; case "textarea": f = fe(g, f), d = fe(g, d), a = []; break; default: "function" != typeof f.onClick && "function" == typeof d.onClick && (g.onclick = we); } te(c, d), g = c = void 0; var h = null; for (c in f) if (!d.hasOwnProperty(c) && f.hasOwnProperty(c) && null != f[c]) if ("style" === c) { var k = f[c]; for (g in k) k.hasOwnProperty(g) && (h || (h = {}), h[g] = ""); } else "dangerouslySetInnerHTML" !== c && "children" !== c && "suppressContentEditableWarning" !== c && "suppressHydrationWarning" !== c && "autoFocus" !== c && (sa.hasOwnProperty(c) ? a || (a = []) : (a = a || []).push(c, null)); for (c in d) { var l = d[c]; if (k = null != f ? f[c] : void 0, d.hasOwnProperty(c) && l !== k && (null != l || null != k)) if ("style" === c) if (k) { for (g in k) !k.hasOwnProperty(g) || l && l.hasOwnProperty(g) || (h || (h = {}), h[g] = ""); for (g in l) l.hasOwnProperty(g) && k[g] !== l[g] && (h || (h = {}), h[g] = l[g]); } else h || (a || (a = []), a.push(c, h)), h = l; else "dangerouslySetInnerHTML" === c ? (l = l ? l.__html : void 0, k = k ? k.__html : void 0, null != l && k !== l && (a = a || []).push(c, "" + l)) : "children" === c ? k === l || "string" != typeof l && "number" != typeof l || (a = a || []).push(c, "" + l) : "suppressContentEditableWarning" !== c && "suppressHydrationWarning" !== c && (sa.hasOwnProperty(c) ? (null != l && ve(e, c), a || k === l || (a = [])) : (a = a || []).push(c, l)); } h && (a = a || []).push("style", h), e = a, (b.updateQueue = e) && qg(b); } }, tg = function(a, b, c, d) { c !== d && qg(b); }; var Hg = { readContext: vf }, Ig = Yb.ReactCurrentOwner, Jg = 0, Kg = 0, Lg = !1, N = null, Mg = null, O = 0, Ng = !1, Q = null, Og = !1, Fg = null, U = null, T = null, ch = 0, dh = void 0, V = !1, Y = null, Z = 0, Vg = 0, eh = !1, fh = !1, gh = null, hh = null, W = !1, Wg = !1, Ug = !1, ih = null, jh = ba.unstable_now(), kh = (jh / 10 | 0) + 2, lh = kh, ah = 50, $g = 0, mh = null, nh = 1; Fb = function(a, b, c) { switch (b) { case "input": if (Dc(a, c), b = c.name, "radio" === c.type && null != b) { for (c = a; c.parentNode; ) c = c.parentNode; for (c = c.querySelectorAll("input[name=" + JSON.stringify("" + b) + '][type="radio"]'), b = 0; b < c.length; b++) { var d = c[b]; if (d !== a && d.form === a.form) { var e = Na(d); e ? void 0 : t("90"), Xb(d), Dc(d, e); } } } break; case "textarea": he(a, c); break; case "select": b = c.value, null != b && ee(a, !!c.multiple, b, !1); } }, Bh.prototype.render = function(a) { this._defer ? void 0 : t("250"), this._hasChildren = !0, this._children = a; var b = this._root._internalRoot, c = this._expirationTime, d = new Ch(); return wh(a, b, null, c, d._onCommit), d; }, Bh.prototype.then = function(a) { if (this._didComplete) a(); else { var b = this._callbacks; null === b && (b = this._callbacks = []), b.push(a); } }, Bh.prototype.commit = function() { var a = this._root._internalRoot, b = a.firstBatch; if (this._defer && null !== b ? void 0 : t("251"), this._hasChildren) { var c = this._expirationTime; if (b !== this) { this._hasChildren && (c = this._expirationTime = b._expirationTime, this.render(this._children)); for (var d = null, e = b; e !== this; ) d = e, e = e._next; null === d ? t("251") : void 0, d._next = e._next, this._next = b, a.firstBatch = this; } this._defer = !1, b = c, V ? t("253") : void 0, Y = a, Z = b, Xg(a, b, !0), Yg(1, null), b = this._next, this._next = null, b = a.firstBatch = b, null !== b && b._hasChildren && b.render(b._children); } else this._next = null, this._defer = !1; }, Bh.prototype._onComplete = function() { if (!this._didComplete) { this._didComplete = !0; var a = this._callbacks; if (null !== a) for (var b = 0; b < a.length; b++) (0, a[b])(); } }, Ch.prototype.then = function(a) { if (this._didCommit) a(); else { var b = this._callbacks; null === b && (b = this._callbacks = []), b.push(a); } }, Ch.prototype._onCommit = function() { if (!this._didCommit) { this._didCommit = !0; var a = this._callbacks; if (null !== a) for (var b = 0; b < a.length; b++) { var c = a[b]; "function" != typeof c ? t("191", c) : void 0, c(); } } }, Dh.prototype.render = function(a, b) { var c = this._internalRoot, d = new Ch(); return b = void 0 === b ? null : b, null !== b && d.then(b), xh(a, c, null, d._onCommit), d; }, Dh.prototype.unmount = function(a) { var b = this._internalRoot, c = new Ch(); return a = void 0 === a ? null : a, null !== a && c.then(a), xh(null, b, null, c._onCommit), c; }, Dh.prototype.legacy_renderSubtreeIntoContainer = function(a, b, c) { var d = this._internalRoot, e = new Ch(); return c = void 0 === c ? null : c, null !== c && e.then(c), xh(b, d, a, e._onCommit), e; }, Dh.prototype.createBatch = function() { var a = new Bh(this), b = a._expirationTime, c = this._internalRoot, d = c.firstBatch; if (null === d) c.firstBatch = a, a._next = null; else { for (c = null; null !== d && d._expirationTime <= b; ) c = d, d = d._next; a._next = d, null !== c && (c._next = a); } return a; }, Lb = sh, Mb = uh, Nb = function() { V || 0 === Vg || (Yg(Vg, null), Vg = 0); }; var Mh = { createPortal: Hh, findDOMNode: function(a) { if (null == a) return null; if (1 === a.nodeType) return a; var b = a._reactInternalFiber; return void 0 === b && ("function" == typeof a.render ? t("188") : t("268", Object.keys(a))), a = md(b), a = null === a ? null : a.stateNode; }, hydrate: function(a, b, c) { return Gh(null, a, b, !0, c); }, render: function(a, b, c) { return Gh(null, a, b, !1, c); }, unstable_renderSubtreeIntoContainer: function(a, b, c, d) { return null == a || void 0 === a._reactInternalFiber ? t("38") : void 0, Gh(a, b, c, !1, d); }, unmountComponentAtNode: function(a) { return Eh(a) ? void 0 : t("40"), !!a._reactRootContainer && (th(function() { Gh(null, null, a, !1, function() { a._reactRootContainer = null; }); }), !0); }, unstable_createPortal: function() { return Hh.apply(void 0, arguments); }, unstable_batchedUpdates: sh, unstable_interactiveUpdates: uh, flushSync: function(a, b) { V ? t("187") : void 0; var c = W; W = !0; try { return bh(a, b); } finally { W = c, Yg(1, null); } }, unstable_flushControlled: function(a) { var b = W; W = !0; try { bh(a); } finally { (W = b) || V || Yg(1, null); } }, __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED: { Events: [ La, Ma, Na, Ea.injectEventPluginsByName, qa, Ua, function(a) { za(a, Ta); }, Jb, Kb, Id, Ga ] }, unstable_createRoot: function(a, b) { return Eh(a) ? void 0 : t("278"), new Dh(a, (!0), null != b && !0 === b.hydrate); } }; !function(a) { var b = a.findFiberByHostInstance; return Re(n({}, a, { findHostInstanceByFiber: function(a) { return a = md(a), null === a ? null : a.stateNode; }, findFiberByHostInstance: function(a) { return b ? b(a) : null; } })); }({ findFiberByHostInstance: Ka, bundleType: 0, version: "16.5.2", rendererPackageName: "react-dom" }); var Nh = { "default": Mh }, Oh = Nh && Mh || Nh; module.exports = Oh["default"] || Oh; }, function(module, exports) { /* object-assign (c) Sindre Sorhus @license MIT */ "use strict"; function toObject(val) { if (null === val || void 0 === val) throw new TypeError("Object.assign cannot be called with null or undefined"); return Object(val); } function shouldUseNative() { try { if (!Object.assign) return !1; var test1 = new String("abc"); if (test1[5] = "de", "5" === Object.getOwnPropertyNames(test1)[0]) return !1; for (var test2 = {}, i = 0; i < 10; i++) test2["_" + String.fromCharCode(i)] = i; var order2 = Object.getOwnPropertyNames(test2).map(function(n) { return test2[n]; }); if ("0123456789" !== order2.join("")) return !1; var test3 = {}; return "abcdefghijklmnopqrst".split("").forEach(function(letter) { test3[letter] = letter; }), "abcdefghijklmnopqrst" === Object.keys(Object.assign({}, test3)).join(""); } catch (err) { return !1; } } var getOwnPropertySymbols = Object.getOwnPropertySymbols, hasOwnProperty = Object.prototype.hasOwnProperty, propIsEnumerable = Object.prototype.propertyIsEnumerable; module.exports = shouldUseNative() ? Object.assign : function(target, source) { for (var from, symbols, to = toObject(target), s = 1; s < arguments.length; s++) { from = Object(arguments[s]); for (var key in from) hasOwnProperty.call(from, key) && (to[key] = from[key]); if (getOwnPropertySymbols) { symbols = getOwnPropertySymbols(from); for (var i = 0; i < symbols.length; i++) propIsEnumerable.call(from, symbols[i]) && (to[symbols[i]] = from[symbols[i]]); } } return to; }; }, function(module, exports, __webpack_require__) { "use strict"; module.exports = __webpack_require__(30); }, function(module, exports) { /** @license React v16.5.2 * schedule.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ "use strict"; function m() { if (!e) { var a = c.timesOutAt; f ? n() : f = !0, p(q, a); } } function r() { var a = c, b = c.next; if (c === b) c = null; else { var d = c.previous; c = d.next = b, b.previous = d; } a.next = a.previous = null, (a = a.callback)(l); } function q(a) { e = !0, l.didTimeout = a; try { if (a) for (;null !== c; ) { var b = exports.unstable_now(); if (!(c.timesOutAt <= b)) break; do r(); while (null !== c && c.timesOutAt <= b); } else if (null !== c) do r(); while (null !== c && 0 < h() - exports.unstable_now()); } finally { e = !1, null !== c ? m(c) : f = !1; } } function A(a) { y = w(function(b) { v(z), a(b); }), z = u(function() { x(y), a(exports.unstable_now()); }, 100); } Object.defineProperty(exports, "__esModule", { value: !0 }); var y, z, c = null, e = !1, f = !1, g = "object" == typeof performance && "function" == typeof performance.now, l = { timeRemaining: g ? function() { var a = h() - performance.now(); return 0 < a ? a : 0; } : function() { var a = h() - Date.now(); return 0 < a ? a : 0; }, didTimeout: !1 }, t = Date, u = "function" == typeof setTimeout ? setTimeout : void 0, v = "function" == typeof clearTimeout ? clearTimeout : void 0, w = "function" == typeof requestAnimationFrame ? requestAnimationFrame : void 0, x = "function" == typeof cancelAnimationFrame ? cancelAnimationFrame : void 0; if (g) { var B = performance; exports.unstable_now = function() { return B.now(); }; } else exports.unstable_now = function() { return t.now(); }; var p, n, h; if ("undefined" == typeof window) { var C = -1; p = function(a) { C = setTimeout(a, 0, !0); }, n = function() { clearTimeout(C); }, h = function() { return 0; }; } else if (window._schedMock) { var D = window._schedMock; p = D[0], n = D[1], h = D[2]; } else { "undefined" != typeof console && ("function" != typeof w && console.error("This browser doesn't support requestAnimationFrame. Make sure that you load a polyfill in older browsers. https://fb.me/react-polyfills"), "function" != typeof x && console.error("This browser doesn't support cancelAnimationFrame. Make sure that you load a polyfill in older browsers. https://fb.me/react-polyfills")); var E = null, F = !1, G = -1, H = !1, I = !1, J = 0, K = 33, L = 33; h = function() { return J; }; var M = "__reactIdleCallback$" + Math.random().toString(36).slice(2); window.addEventListener("message", function(a) { if (a.source === window && a.data === M) { F = !1; var b = exports.unstable_now(); if (a = !1, 0 >= J - b) { if (!(-1 !== G && G <= b)) return void (H || (H = !0, A(N))); a = !0; } if (G = -1, b = E, E = null, null !== b) { I = !0; try { b(a); } finally { I = !1; } } } }, !1); var N = function(a) { H = !1; var b = a - J + L; b < L && K < L ? (8 > b && (b = 8), L = b < K ? K : b) : K = b, J = a + L, F || (F = !0, window.postMessage(M, "*")); }; p = function(a, b) { E = a, G = b, I ? window.postMessage(M, "*") : H || (H = !0, A(N)); }, n = function() { E = null, F = !1, G = -1; }; } exports.unstable_scheduleWork = function(a, b) { var d = exports.unstable_now(); if (b = void 0 !== b && null !== b && null !== b.timeout && void 0 !== b.timeout ? d + b.timeout : d + 5e3, a = { callback: a, timesOutAt: b, next: null, previous: null }, null === c) c = a.next = a.previous = a, m(c); else { d = null; var k = c; do { if (k.timesOutAt > b) { d = k; break; } k = k.next; } while (k !== c); null === d ? d = c : d === c && (c = a, m(c)), b = d.previous, b.next = d.previous = a, a.next = d, a.previous = b; } return a; }, exports.unstable_cancelScheduledWork = function(a) { var b = a.next; if (null !== b) { if (b === a) c = null; else { a === c && (c = b); var d = a.previous; d.next = b, b.previous = d; } a.next = a.previous = null; } }; }, function(module, exports) { "use strict"; function flash(node, flashColor, baseColor, duration) { node.style.transition = "none", node.style.backgroundColor = flashColor, void node.offsetTop, node.style.transition = "background-color " + duration + "s ease", node.style.backgroundColor = baseColor; } module.exports = flash; }, function(module, exports, __webpack_require__) { "use strict"; var _Symbol = __webpack_require__(33); module.exports = { name: _Symbol("name"), type: _Symbol("type"), inspected: _Symbol("inspected"), meta: _Symbol("meta"), proto: _Symbol("proto") }; }, function(module, exports, __webpack_require__) { "use strict"; module.exports = __webpack_require__(34)() ? Symbol : __webpack_require__(35); }, function(module, exports) { "use strict"; module.exports = function() { var symbol; if ("function" != typeof Symbol) return !1; symbol = Symbol("test symbol"); try { String(symbol); } catch (e) { return !1; } return "symbol" == typeof Symbol.iterator || "object" == typeof Symbol.isConcatSpreadable && ("object" == typeof Symbol.iterator && ("object" == typeof Symbol.toPrimitive && ("object" == typeof Symbol.toStringTag && "object" == typeof Symbol.unscopables))); }; }, function(module, exports, __webpack_require__) { "use strict"; var NativeSymbol, SymbolPolyfill, HiddenSymbol, d = __webpack_require__(36), validateSymbol = __webpack_require__(49), create = Object.create, defineProperties = Object.defineProperties, defineProperty = Object.defineProperty, objPrototype = Object.prototype, globalSymbols = create(null); "function" == typeof Symbol && (NativeSymbol = Symbol); var generateName = function() { var created = create(null); return function(desc) { for (var name, ie11BugWorkaround, postfix = 0; created[desc + (postfix || "")]; ) ++postfix; return desc += postfix || "", created[desc] = !0, name = "@@" + desc, defineProperty(objPrototype, name, d.gs(null, function(value) { ie11BugWorkaround || (ie11BugWorkaround = !0, defineProperty(this, name, d(value)), ie11BugWorkaround = !1); })), name; }; }(); HiddenSymbol = function(description) { if (this instanceof HiddenSymbol) throw new TypeError("TypeError: Symbol is not a constructor"); return SymbolPolyfill(description); }, module.exports = SymbolPolyfill = function Symbol(description) { var symbol; if (this instanceof Symbol) throw new TypeError("TypeError: Symbol is not a constructor"); return symbol = create(HiddenSymbol.prototype), description = void 0 === description ? "" : String(description), defineProperties(symbol, { __description__: d("", description), __name__: d("", generateName(description)) }); }, defineProperties(SymbolPolyfill, { "for": d(function(key) { return globalSymbols[key] ? globalSymbols[key] : globalSymbols[key] = SymbolPolyfill(String(key)); }), keyFor: d(function(s) { var key; validateSymbol(s); for (key in globalSymbols) if (globalSymbols[key] === s) return key; }), hasInstance: d("", NativeSymbol && NativeSymbol.hasInstance || SymbolPolyfill("hasInstance")), isConcatSpreadable: d("", NativeSymbol && NativeSymbol.isConcatSpreadable || SymbolPolyfill("isConcatSpreadable")), iterator: d("", NativeSymbol && NativeSymbol.iterator || SymbolPolyfill("iterator")), match: d("", NativeSymbol && NativeSymbol.match || SymbolPolyfill("match")), replace: d("", NativeSymbol && NativeSymbol.replace || SymbolPolyfill("replace")), search: d("", NativeSymbol && NativeSymbol.search || SymbolPolyfill("search")), species: d("", NativeSymbol && NativeSymbol.species || SymbolPolyfill("species")), split: d("", NativeSymbol && NativeSymbol.split || SymbolPolyfill("split")), toPrimitive: d("", NativeSymbol && NativeSymbol.toPrimitive || SymbolPolyfill("toPrimitive")), toStringTag: d("", NativeSymbol && NativeSymbol.toStringTag || SymbolPolyfill("toStringTag")), unscopables: d("", NativeSymbol && NativeSymbol.unscopables || SymbolPolyfill("unscopables")) }), defineProperties(HiddenSymbol.prototype, { constructor: d(SymbolPolyfill), toString: d("", function() { return this.__name__; }) }), defineProperties(SymbolPolyfill.prototype, { toString: d(function() { return "Symbol (" + validateSymbol(this).__description__ + ")"; }), valueOf: d(function() { return validateSymbol(this); }) }), defineProperty(SymbolPolyfill.prototype, SymbolPolyfill.toPrimitive, d("", function() { return validateSymbol(this); })), defineProperty(SymbolPolyfill.prototype, SymbolPolyfill.toStringTag, d("c", "Symbol")), defineProperty(HiddenSymbol.prototype, SymbolPolyfill.toStringTag, d("c", SymbolPolyfill.prototype[SymbolPolyfill.toStringTag])), defineProperty(HiddenSymbol.prototype, SymbolPolyfill.toPrimitive, d("c", SymbolPolyfill.prototype[SymbolPolyfill.toPrimitive])); }, function(module, exports, __webpack_require__) { "use strict"; var d, assign = __webpack_require__(37), normalizeOpts = __webpack_require__(44), isCallable = __webpack_require__(45), contains = __webpack_require__(46); d = module.exports = function(dscr, value) { var c, e, w, options, desc; return arguments.length < 2 || "string" != typeof dscr ? (options = value, value = dscr, dscr = null) : options = arguments[2], null == dscr ? (c = w = !0, e = !1) : (c = contains.call(dscr, "c"), e = contains.call(dscr, "e"), w = contains.call(dscr, "w")), desc = { value: value, configurable: c, enumerable: e, writable: w }, options ? assign(normalizeOpts(options), desc) : desc; }, d.gs = function(dscr, get, set) { var c, e, options, desc; return "string" != typeof dscr ? (options = set, set = get, get = dscr, dscr = null) : options = arguments[3], null == get ? get = void 0 : isCallable(get) ? null == set ? set = void 0 : isCallable(set) || (options = set, set = void 0) : (options = get, get = set = void 0), null == dscr ? (c = !0, e = !1) : (c = contains.call(dscr, "c"), e = contains.call(dscr, "e")), desc = { get: get, set: set, configurable: c, enumerable: e }, options ? assign(normalizeOpts(options), desc) : desc; }; }, function(module, exports, __webpack_require__) { "use strict"; module.exports = __webpack_require__(38)() ? Object.assign : __webpack_require__(39); }, function(module, exports) { "use strict"; module.exports = function() { var obj, assign = Object.assign; return "function" == typeof assign && (obj = { foo: "raz" }, assign(obj, { bar: "dwa" }, { trzy: "trzy" }), obj.foo + obj.bar + obj.trzy === "razdwatrzy"); }; }, function(module, exports, __webpack_require__) { "use strict"; var keys = __webpack_require__(40), value = __webpack_require__(43), max = Math.max; module.exports = function(dest, src) { var error, i, assign, l = max(arguments.length, 2); for (dest = Object(value(dest)), assign = function(key) { try { dest[key] = src[key]; } catch (e) { error || (error = e); } }, i = 1; i < l; ++i) src = arguments[i], keys(src).forEach(assign); if (void 0 !== error) throw error; return dest; }; }, function(module, exports, __webpack_require__) { "use strict"; module.exports = __webpack_require__(41)() ? Object.keys : __webpack_require__(42); }, function(module, exports) { "use strict"; module.exports = function() { try { return Object.keys("primitive"), !0; } catch (e) { return !1; } }; }, function(module, exports) { "use strict"; var keys = Object.keys; module.exports = function(object) { return keys(null == object ? object : Object(object)); }; }, function(module, exports) { "use strict"; module.exports = function(value) { if (null == value) throw new TypeError("Cannot use null or undefined"); return value; }; }, function(module, exports) { "use strict"; var forEach = Array.prototype.forEach, create = Object.create, process = function(src, obj) { var key; for (key in src) obj[key] = src[key]; }; module.exports = function(options) { var result = create(null); return forEach.call(arguments, function(options) { null != options && process(Object(options), result); }), result; }; }, function(module, exports) { "use strict"; module.exports = function(obj) { return "function" == typeof obj; }; }, function(module, exports, __webpack_require__) { "use strict"; module.exports = __webpack_require__(47)() ? String.prototype.contains : __webpack_require__(48); }, function(module, exports) { "use strict"; var str = "razdwatrzy"; module.exports = function() { return "function" == typeof str.contains && (str.contains("dwa") === !0 && str.contains("foo") === !1); }; }, function(module, exports) { "use strict"; var indexOf = String.prototype.indexOf; module.exports = function(searchString) { return indexOf.call(this, searchString, arguments[1]) > -1; }; }, function(module, exports, __webpack_require__) { "use strict"; var isSymbol = __webpack_require__(50); module.exports = function(value) { if (!isSymbol(value)) throw new TypeError(value + " is not a symbol"); return value; }; }, function(module, exports) { "use strict"; module.exports = function(x) { return x && ("symbol" == typeof x || "Symbol" === x["@@toStringTag"]) || !1; }; }, function(module, exports, __webpack_require__) { "use strict"; function previewComplex(data, theme) { var style = { color: theme.special04 }; if (Array.isArray(data)) return React.createElement("span", { style: style }, "Array[", data.length, "]"); switch (data[consts.type]) { case "function": return React.createElement("span", { style: style }, data[consts.name] || "fn", "()"); case "object": return React.createElement("span", { style: style }, data[consts.name] + "{…}"); case "date": return React.createElement("span", { style: style }, data[consts.name]); case "symbol": return React.createElement("span", { style: style }, data[consts.name]); case "iterator": return React.createElement("span", { style: style }, data[consts.name] + "(…)"); case "array_buffer": case "data_view": case "array": case "typed_array": return React.createElement("span", { style: style }, data[consts.name] + "[" + data[consts.meta].length + "]"); case void 0: case null: return "{…}"; } return null; } var React = __webpack_require__(12), consts = __webpack_require__(32); module.exports = previewComplex; }, function(module, exports, __webpack_require__) { "use strict"; 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 || "object" != typeof call && "function" != typeof call ? self : call; } function _inherits(subClass, superClass) { if ("function" != typeof superClass && null !== superClass) 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: !1, writable: !0, configurable: !0 } }), superClass && (Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass); } var _createClass = function() { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0, "value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor); } } return function(Constructor, protoProps, staticProps) { return protoProps && defineProperties(Constructor.prototype, protoProps), staticProps && defineProperties(Constructor, staticProps), Constructor; }; }(), _require = __webpack_require__(17), monospace = _require.monospace, React = __webpack_require__(12), DetailPane = function(_React$Component) { function DetailPane() { return _classCallCheck(this, DetailPane), _possibleConstructorReturn(this, (DetailPane.__proto__ || Object.getPrototypeOf(DetailPane)).apply(this, arguments)); } return _inherits(DetailPane, _React$Component), _createClass(DetailPane, [ { key: "render", value: function() { return React.createElement("div", { style: styles.container }, this.props.children); } } ]), DetailPane; }(React.Component), styles = { container: { fontSize: monospace.sizes.normal, fontFamily: monospace.family, overflow: "auto", flex: 1, display: "flex", flexDirection: "column" } }; module.exports = DetailPane; }, function(module, exports, __webpack_require__) { "use strict"; 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 || "object" != typeof call && "function" != typeof call ? self : call; } function _inherits(subClass, superClass) { if ("function" != typeof superClass && null !== superClass) 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: !1, writable: !0, configurable: !0 } }), superClass && (Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass); } var _createClass = function() { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0, "value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor); } } return function(Constructor, protoProps, staticProps) { return protoProps && defineProperties(Constructor.prototype, protoProps), staticProps && defineProperties(Constructor, staticProps), Constructor; }; }(), PropTypes = __webpack_require__(7), React = __webpack_require__(12), DetailPaneSection = function(_React$Component) { function DetailPaneSection() { return _classCallCheck(this, DetailPaneSection), _possibleConstructorReturn(this, (DetailPaneSection.__proto__ || Object.getPrototypeOf(DetailPaneSection)).apply(this, arguments)); } return _inherits(DetailPaneSection, _React$Component), _createClass(DetailPaneSection, [ { key: "render", value: function() { var theme = this.context.theme, _props = this.props, children = _props.children, hint = _props.hint; return React.createElement("div", { style: sectionStyle(theme) }, React.createElement("strong", { style: styles.title }, this.props.title), hint, children); } } ]), DetailPaneSection; }(React.Component); DetailPaneSection.contextTypes = { theme: PropTypes.object.isRequired }; var sectionStyle = function(theme) { return { borderTop: "1px solid " + theme.base01, padding: "0.5rem", flexShrink: 0 }; }, styles = { title: { display: "inline-block", marginRight: "0.5rem", lineHeight: "1.5rem" } }; module.exports = DetailPaneSection; }, function(module, exports, __webpack_require__) { "use strict"; 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 || "object" != typeof call && "function" != typeof call ? self : call; } function _inherits(subClass, superClass) { if ("function" != typeof superClass && null !== superClass) 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: !1, writable: !0, configurable: !0 } }), superClass && (Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass); } function previewProp(val, nested, inverted, theme) { var style = { color: inverted ? getInvertedWeak(theme.state02) : theme.special01 }; if ("number" == typeof val) return React.createElement("span", { style: style }, val); if ("string" == typeof val) return style = { color: inverted ? getInvertedWeak(theme.state02) : theme.special02 }, val.length > 50 && (val = val.slice(0, 50) + "…"), React.createElement("span", { style: style }, '"', val, '"'); if ("boolean" == typeof val) return React.createElement("span", { style: style }, "" + val); if (Array.isArray(val)) return style = { color: inverted ? getInvertedWeak(theme.state02) : theme.special02 }, nested ? React.createElement("span", { style: style }, "[(", val.length, ")]") : previewArray(val, inverted, theme); if (!val) return style = { color: inverted ? getInvertedWeak(theme.state02) : theme.base03 }, React.createElement("span", { style: style }, "" + val); if ("object" !== ("undefined" == typeof val ? "undefined" : _typeof(val))) return style = { color: inverted ? getInvertedWeak(theme.state02) : theme.special04 }, React.createElement("span", { style: style }, "…"); switch (val[consts.type]) { case "date": return React.createElement("span", { style: style }, val[consts.name]); case "function": return style = { color: inverted ? getInvertedWeak(theme.state02) : theme.special04 }, React.createElement("span", { style: style }, val[consts.name] || "fn", "()"); case "object": return React.createElement("span", { style: style }, val[consts.name] + "{…}"); case "array": return style = { color: inverted ? getInvertedWeak(theme.state02) : theme.special02 }, React.createElement("span", { style: style }, "Array[", val[consts.meta].length, "]"); case "typed_array": case "array_buffer": case "data_view": return style = { color: inverted ? getInvertedWeak(theme.state02) : theme.special02 }, React.createElement("span", { style: style }, val[consts.name] + "[" + val[consts.meta].length + "]"); case "iterator": return style = { color: inverted ? getInvertedWeak(theme.state02) : theme.base05 }, React.createElement("span", { style: style }, val[consts.name] + "(…)"); case "symbol": return style = { color: inverted ? getInvertedWeak(theme.state02) : theme.base05 }, React.createElement("span", { style: style }, val[consts.name]); } return nested ? (style = { color: inverted ? getInvertedWeak(theme.state02) : theme.base05 }, React.createElement("span", { style: style }, "{…}")) : previewObject(val, inverted, theme); } function previewArray(val, inverted, theme) { var items = []; val.slice(0, 3).forEach(function(item, i) { i > 0 && items.push(", "), items.push(React.createElement(PropVal, { key: i, val: item, nested: !0, inverted: inverted, theme: theme })); }); var style = { color: inverted ? theme.base03 : theme.special01 }; return React.createElement("span", { style: style }, "[", items, val.length > 3 ? ", …" : "", "]"); } function previewObject(val, inverted, theme) { var names = Object.keys(val), items = [], attrStyle = { color: inverted ? getInvertedWeak(theme.state02) : theme.special06 }; names.slice(0, 3).forEach(function(name, i) { items.push(React.createElement("span", { key: i }, i > 0 ? ", " : "", React.createElement("span", { style: attrStyle }, name), ": ", React.createElement(PropVal, { val: val[name], nested: !0, inverted: inverted, theme: theme }))); }); var style = { color: inverted ? getInvertedWeak(theme.state02) : theme.special01 }; return React.createElement("span", { style: style }, "{", items, names.length > 3 ? ", …" : "", "}"); } var _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj) { return typeof obj; } : function(obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _createClass = function() { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0, "value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor); } } return function(Constructor, protoProps, staticProps) { return protoProps && defineProperties(Constructor.prototype, protoProps), staticProps && defineProperties(Constructor, staticProps), Constructor; }; }(), React = __webpack_require__(12), ReactDOM = __webpack_require__(26), PropTypes = __webpack_require__(7), consts = __webpack_require__(32), _require = __webpack_require__(55), getInvertedWeak = _require.getInvertedWeak, flash = __webpack_require__(31), PropVal = function(_React$Component) { function PropVal() { return _classCallCheck(this, PropVal), _possibleConstructorReturn(this, (PropVal.__proto__ || Object.getPrototypeOf(PropVal)).apply(this, arguments)); } return _inherits(PropVal, _React$Component), _createClass(PropVal, [ { key: "componentDidUpdate", value: function(prevProps) { if (!(this.props.val === prevProps.val || this.props.val && prevProps.val && "object" === _typeof(this.props.val) && "object" === _typeof(prevProps.val))) { var node = ReactDOM.findDOMNode(this); flash(node, this.context.theme.state04, "transparent", 1); } } }, { key: "render", value: function() { return previewProp(this.props.val, !!this.props.nested, !!this.props.inverted, this.context.theme); } } ]), PropVal; }(React.Component); PropVal.contextTypes = { theme: PropTypes.object.isRequired }, module.exports = PropVal; }, function(module, exports) { "use strict"; function getBrightness(hex) { var _getRgb = getRgb(hex), r = _getRgb.r, g = _getRgb.g, b = _getRgb.b; return Math.round((299 * r + 587 * g + 114 * b) / 1e3); } function getInvertedMid(hex) { return hexToRgba(hex, .8); } function getInvertedWeak(hex) { return hexToRgba(hex, .65); } function getRgb() { var hex = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : ""; hex = hex.replace("#", ""), 3 === hex.length && (hex = hex.charAt(0) + hex.charAt(0) + hex.charAt(1) + hex.charAt(1) + hex.charAt(2) + hex.charAt(2)); var r = parseInt(hex.substring(0, 2), 16), g = parseInt(hex.substring(2, 4), 16), b = parseInt(hex.substring(4, 6), 16); return { r: r, g: g, b: b }; } function hexToRgba(hex, alpha) { var _getRgb2 = getRgb(hex), r = _getRgb2.r, g = _getRgb2.g, b = _getRgb2.b; return "rgba(" + r + ", " + g + ", " + b + ", " + alpha + ")"; } function isBright(hex) { return getBrightness(hex) > 125; } module.exports = { getBrightness: getBrightness, getInvertedMid: getInvertedMid, getInvertedWeak: getInvertedWeak, getRgb: getRgb, hexToRgba: hexToRgba, isBright: isBright }; }, function(module, exports, __webpack_require__) { "use strict"; var __DEV__ = !1, invariant = function(condition, format, a, b, c, d, e, f) { if (__DEV__ && void 0 === format) throw new Error("invariant requires an error message argument"); if (!condition) { var error; if (void 0 === format) 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 ], argIndex = 0; error = new Error("Invariant Violation: " + format.replace(/%s/g, function() { return args[argIndex++]; })); } throw error.framesToPop = 1, error; } }; module.exports = invariant; }, function(module, exports, __webpack_require__) { "use strict"; 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 || "object" != typeof call && "function" != typeof call ? self : call; } function _inherits(subClass, superClass) { if ("function" != typeof superClass && null !== superClass) 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: !1, writable: !0, configurable: !0 } }), superClass && (Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass); } var _createClass = function() { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0, "value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor); } } return function(Constructor, protoProps, staticProps) { return protoProps && defineProperties(Constructor.prototype, protoProps), staticProps && defineProperties(Constructor, staticProps), Constructor; }; }(), PropTypes = __webpack_require__(7), React = __webpack_require__(12), SettingsPane = __webpack_require__(58), TreeView = __webpack_require__(63), LeftPane = function(_React$Component) { function LeftPane() { return _classCallCheck(this, LeftPane), _possibleConstructorReturn(this, (LeftPane.__proto__ || Object.getPrototypeOf(LeftPane)).apply(this, arguments)); } return _inherits(LeftPane, _React$Component), _createClass(LeftPane, [ { key: "render", value: function() { return React.createElement("div", { style: styles.container }, React.createElement(SettingsPane, null), React.createElement(TreeView, { reload: this.props.reload })); } } ]), LeftPane; }(React.Component); LeftPane.propTypes = { reload: PropTypes.func }; var styles = { container: { flex: 1, display: "flex", flexDirection: "column", minWidth: 0 } }; module.exports = LeftPane; }, function(module, exports, __webpack_require__) { "use strict"; 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 || "object" != typeof call && "function" != typeof call ? self : call; } function _inherits(subClass, superClass) { if ("function" != typeof superClass && null !== superClass) 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: !1, writable: !0, configurable: !0 } }), superClass && (Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass); } function SearchIcon(_ref4) { var theme = _ref4.theme; return React.createElement(SvgIcon, { style: searchIconStyle(theme), path: Icons.SEARCH }); } var _extends = Object.assign || function(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) Object.prototype.hasOwnProperty.call(source, key) && (target[key] = source[key]); } return target; }, _createClass = function() { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0, "value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor); } } return function(Constructor, protoProps, staticProps) { return protoProps && defineProperties(Constructor.prototype, protoProps), staticProps && defineProperties(Constructor, staticProps), Constructor; }; }(), PropTypes = __webpack_require__(7), React = __webpack_require__(12), ReactDOM = __webpack_require__(26), _require = __webpack_require__(17), sansSerif = _require.sansSerif, SearchUtils = __webpack_require__(59), SvgIcon = __webpack_require__(60), Icons = __webpack_require__(61), Input = __webpack_require__(23), Hoverable = __webpack_require__(62), decorate = __webpack_require__(20), SettingsPane = function(_React$Component) { function SettingsPane(props) { _classCallCheck(this, SettingsPane); var _this = _possibleConstructorReturn(this, (SettingsPane.__proto__ || Object.getPrototypeOf(SettingsPane)).call(this, props)); return _this.state = { focused: !1 }, _this; } return _inherits(SettingsPane, _React$Component), _createClass(SettingsPane, [ { key: "componentDidMount", value: function() { this._key = this.onDocumentKeyDown.bind(this); var doc = ReactDOM.findDOMNode(this).ownerDocument; doc.addEventListener("keydown", this._key, !0); } }, { key: "componentWillUnmount", value: function() { var doc = ReactDOM.findDOMNode(this).ownerDocument; doc.removeEventListener("keydown", this._key, !0); } }, { key: "onDocumentKeyDown", value: function(e) { if (191 === e.keyCode && "INPUT" !== e.target.nodeName && !e.target.isContentEditable && this.input && (this.input.focus(), e.preventDefault()), 27 === e.keyCode) { if (!this.props.searchText && !this.state.focused) return; e.stopPropagation(), e.preventDefault(), this.cancel(); } } }, { key: "cancel", value: function() { this.props.onChangeSearch(""), this.input && this.input.blur(); } }, { key: "onKeyDown", value: function(key) { "Enter" === key && this.input && (this.input.blur(), this.props.selectFirstSearchResult()); } }, { key: "render", value: function() { var inputStyle, _this2 = this, theme = this.context.theme, searchText = this.props.searchText; return inputStyle = searchText && SearchUtils.shouldSearchUseRegex(searchText) && !SearchUtils.isValidRegex(searchText) ? errorInputStyle(theme) : searchText || this.state.focused ? highlightedInputStyle(theme) : baseInputStyle(theme), React.createElement("div", { style: settingsPaneStyle(theme) }, this.context.showInspectButton && React.createElement(InspectMenuButton, { isInspectEnabled: this.props.isInspectEnabled, onClick: this.props.toggleInspectEnabled, theme: theme }), React.createElement("div", { style: styles.searchInputWrapper }, React.createElement(Input, { style: inputStyle, innerRef: function(i) { return _this2.input = i; }, value: searchText, onFocus: function() { return _this2.setState({ focused: !0 }); }, onBlur: function() { return _this2.setState({ focused: !1 }); }, onKeyDown: function(e) { return _this2.onKeyDown(e.key); }, placeholder: "Search (text or /regex/)", onChange: function(e) { return _this2.props.onChangeSearch(e.target.value); }, title: "Search by React component name or text" }), React.createElement(SearchIcon, { theme: theme }), !!searchText && React.createElement(ClearSearchButton, { onClick: this.cancel.bind(this), theme: theme })), React.createElement(SettingsMenuButton, { onClick: this.props.showPreferencesPanel, theme: theme })); } } ]), SettingsPane; }(React.Component); SettingsPane.contextTypes = { showInspectButton: PropTypes.bool.isRequired, theme: PropTypes.object.isRequired }, SettingsPane.propTypes = { isInspectEnabled: PropTypes.bool, isRecording: PropTypes.bool, searchText: PropTypes.string, selectFirstSearchResult: PropTypes.func, toggleRecord: PropTypes.func, onChangeSearch: PropTypes.func, toggleInspectEnabled: PropTypes.func }; var Wrapped = decorate({ listeners: function(props) { return [ "isInspectEnabled", "isRecording", "searchText" ]; }, props: function(store) { return { isInspectEnabled: store.isInspectEnabled, isRecording: store.isRecording, onChangeSearch: function(text) { return store.changeSearch(text); }, searchText: store.searchText, selectFirstSearchResult: store.selectFirstSearchResult.bind(store), showPreferencesPanel: function() { store.showPreferencesPanel(); }, toggleInspectEnabled: function() { return store.setInspectEnabled(!store.isInspectEnabled); }, toggleRecord: function() { return store.setIsRecording(!store.isRecording); } }; } }, SettingsPane), ClearSearchButton = Hoverable(function(_ref) { var isHovered = _ref.isHovered, onClick = _ref.onClick, onMouseEnter = _ref.onMouseEnter, onMouseLeave = _ref.onMouseLeave, theme = _ref.theme; return React.createElement("div", { onClick: onClick, onMouseEnter: onMouseEnter, onMouseLeave: onMouseLeave, style: clearSearchButtonStyle(isHovered, theme) }, "×"); }), InspectMenuButton = Hoverable(function(_ref2) { var isHovered = _ref2.isHovered, isInspectEnabled = _ref2.isInspectEnabled, onClick = _ref2.onClick, onMouseEnter = _ref2.onMouseEnter, onMouseLeave = _ref2.onMouseLeave, theme = _ref2.theme; return React.createElement("button", { onClick: onClick, onMouseEnter: onMouseEnter, onMouseLeave: onMouseLeave, style: inspectMenuButtonStyle(isInspectEnabled, isHovered, theme), title: "Select a React element in the page to inspect it" }, React.createElement(SvgIcon, { path: Icons.INSPECT })); }), SettingsMenuButton = Hoverable(function(_ref3) { var isHovered = _ref3.isHovered, onClick = _ref3.onClick, onMouseEnter = _ref3.onMouseEnter, onMouseLeave = _ref3.onMouseLeave, theme = _ref3.theme; return React.createElement("button", { onClick: onClick, onMouseEnter: onMouseEnter, onMouseLeave: onMouseLeave, style: settingsMenuButtonStyle(isHovered, theme), title: "Customize React DevTools" }, React.createElement(SvgIcon, { path: Icons.SETTINGS })); }), settingsPaneStyle = function(theme) { return { display: "flex", flexWrap: "wrap", flexShrink: 0, alignItems: "center", position: "relative", backgroundColor: theme.base01, borderBottom: "1px solid " + theme.base03 }; }, clearSearchButtonStyle = function(isHovered, theme) { return { fontSize: sansSerif.sizes.large, padding: "0 0.5rem", position: "absolute", cursor: "default", right: 0, lineHeight: "28px", color: isHovered ? theme.base04 : theme.base02 }; }, inspectMenuButtonStyle = function(isInspectEnabled, isHovered, theme) { var color = void 0; return color = isInspectEnabled ? theme.state00 : isHovered ? theme.state06 : "inherit", { display: "flex", background: "none", border: "none", outline: "none", marginLeft: "0.25rem", color: color }; }, searchIconStyle = function(theme) { return { position: "absolute", display: "inline-block", pointerEvents: "none", left: "0.5rem", top: 0, width: "1em", height: "100%", strokeWidth: 0, stroke: theme.base03, fill: theme.base03, lineHeight: "28px", fontSize: sansSerif.sizes.normal }; }, settingsMenuButtonStyle = function(isHovered, theme) { return { display: "flex", background: "none", border: "none", outline: "none", marginRight: "0.5rem", color: isHovered ? theme.state06 : "inherit" }; }, baseInputStyle = function(theme) { return { fontSize: sansSerif.sizes.normal, padding: "0.25rem", margin: "0.25rem", marginLeft: "1.75rem", backgroundColor: "transparent", border: "none", outline: "none", width: "100%" }; }, highlightedInputStyle = function(theme) { return _extends({}, baseInputStyle(theme), { backgroundColor: theme.base00 }); }, errorInputStyle = function(theme) { return _extends({}, baseInputStyle(theme)); }, styles = { growToFill: { flexGrow: 1 }, searchInputWrapper: { display: "flex", alignItems: "center", flexGrow: 1, flexShrink: 0, position: "relative" } }; module.exports = Wrapped; }, function(module, exports) { "use strict"; function isValidRegex(needle) { var isValid = !0; if (needle) try { searchTextToRegExp(needle); } catch (error) { isValid = !1; } return isValid; } function searchTextToRegExp(needle) { return new RegExp(trimSearchText(needle), "gi"); } function shouldSearchUseRegex(needle) { return !!needle && "/" === needle.charAt(0) && trimSearchText(needle).length > 0; } function trimSearchText(needle) { return "/" === needle.charAt(0) && (needle = needle.substr(1)), "/" === needle.charAt(needle.length - 1) && (needle = needle.substr(0, needle.length - 1)), needle; } module.exports = { isValidRegex: isValidRegex, searchTextToRegExp: searchTextToRegExp, shouldSearchUseRegex: shouldSearchUseRegex, trimSearchText: trimSearchText }; }, function(module, exports, __webpack_require__) { "use strict"; var _extends = Object.assign || function(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) Object.prototype.hasOwnProperty.call(source, key) && (target[key] = source[key]); } return target; }, React = __webpack_require__(12), SvgIcon = function(_ref) { var path = _ref.path, style = _ref.style; return React.createElement("svg", { style: _extends({}, DEFAULT_STYLE, style), viewBox: "0 0 24 24" }, React.createElement("path", { d: path })); }, DEFAULT_STYLE = { flex: "0 0 1rem", width: "1rem", height: "1rem", fill: "currentColor" }; module.exports = SvgIcon; }, function(module, exports) { "use strict"; var Icons = { BACK: "\n M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z\n ", BARS: "\n M5 9.2h3V19H5zM10.6 5h2.8v14h-2.8zm5.6 8H19v6h-2.8z\n ", CHECK: "\n M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z\n ", CLOSE: "\n M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41\n 17.59 19 19 17.59 13.41 12z\n ", COPY: "\n M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,\n 0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z\n ", DOM_ELEMENT: "\n M9.4 16.6L4.8 12l4.6-4.6L8 6l-6 6 6 6 1.4-1.4zm5.2 0l4.6-4.6-4.6-4.6L16 6l6 6-6 6-1.4-1.4z\n ", EDIT: "\n M20.71,7.04C21.1,6.65 21.1,6 20.71,5.63L18.37,3.29C18,2.9 17.35,2.9 16.96,3.29L15.12,\n 5.12L18.87,8.87M3,17.25V21H6.75L17.81,9.93L14.06,6.18L3,17.25Z\n ", FLAME_CHART: "\n M10.0650893,21.5040462 C7.14020814,20.6850349 5,18.0558698 5,14.9390244 C5,14.017627\n 5,9.81707317 7.83333333,7.37804878 C7.83333333,7.37804878 7.58333333,11.199187 10,\n 10.6300813 C11.125,10.326087 13.0062497,7.63043487 8.91666667,2.5 C14.1666667,3.06910569\n 19,9.32926829 19,14.9390244 C19,18.0558698 16.8597919,20.6850349 13.9349107,21.5040462\n C14.454014,21.0118505 14.7765152,20.3233394 14.7765152,19.5613412 C14.7765152,17.2826087\n 12,15.0875871 12,15.0875871 C12,15.0875871 9.22348485,17.2826087 9.22348485,19.5613412\n C9.22348485,20.3233394 9.54598603,21.0118505 10.0650893,21.5040462 Z M12.0833333,20.6514763\n C11.3814715,20.6514763 10.8125,20.1226027 10.8125,19.4702042 C10.8125,18.6069669\n 12.0833333,16.9347829 12.0833333,16.9347829 C12.0833333,16.9347829 13.3541667,18.6069669\n 13.3541667,19.4702042 C13.3541667,20.1226027 12.7851952,20.6514763 12.0833333,20.6514763 Z\n ", FORWARD: "\n M12 4l-1.41 1.41L16.17 11H4v2h12.17l-5.58 5.59L12 20l8-8z\n ", INSPECT: "\n M12,8A4,4 0 0,1 16,12A4,4 0 0,1 12,16A4,4 0 0,1 8,12A4,4 0 0,1 12,8M3.05,\n 13H1V11H3.05C3.5,6.83 6.83,3.5 11,3.05V1H13V3.05C17.17,3.5 20.5,6.83 20.95,\n 11H23V13H20.95C20.5,17.17 17.17,20.5 13,20.95V23H11V20.95C6.83,20.5 3.5,17.17 3.05,\n 13M12,5A7,7 0 0,0 5,12A7,7 0 0,0 12,19A7,7 0 0,0 19,12A7,7 0 0,0 12,5Z\n ", INTERACTION: "\n M23 8c0 1.1-.9 2-2 2-.18 0-.35-.02-.51-.07l-3.56 3.55c.05.16.07.34.07.52 0 1.1-.9 2-2\n 2s-2-.9-2-2c0-.18.02-.36.07-.52l-2.55-2.55c-.16.05-.34.07-.52.07s-.36-.02-.52-.07l-4.55\n 4.56c.05.16.07.33.07.51 0 1.1-.9 2-2 2s-2-.9-2-2 .9-2 2-2c.18 0 .35.02.51.07l4.56-4.55C8.02\n 9.36 8 9.18 8 9c0-1.1.9-2 2-2s2 .9 2 2c0 .18-.02.36-.07.52l2.55\n 2.55c.16-.05.34-.07.52-.07s.36.02.52.07l3.55-3.56C19.02 8.35 19 8.18 19 8c0-1.1.9-2 2-2s2 .9 2 2z\n ", RANKED_CHART: "\n M3 5h18v3H3zM3 10.5h13v3H3zM3 16h8v3H3z\n ", RECORD: "\n M4,12a8,8 0 1,0 16,0a8,8 0 1,0 -16,0\n ", REFRESH: "\n M17.65 6.35C16.2 4.9 14.21 4 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0\n 6.84-2.55 7.73-6h-2.08c-.82 2.33-3.04 4-5.65 4-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0\n 3.14.69 4.22 1.78L13 11h7V4l-2.35 2.35z\n ", SEARCH: "\n M31.008 27.231l-7.58-6.447c-0.784-0.705-1.622-1.029-2.299-0.998 1.789-2.096 2.87-4.815\n 2.87-7.787 0-6.627-5.373-12-12-12s-12 5.373-12 12 5.373 12 12 12c2.972 0 5.691-1.081\n 7.787-2.87-0.031 0.677 0.293 1.515 0.998 2.299l6.447 7.58c1.104 1.226 2.907 1.33 4.007\n 0.23s0.997-2.903-0.23-4.007zM12 20c-4.418 0-8-3.582-8-8s3.582-8 8-8 8 3.582 8 8-3.582\n 8-8 8z\n ", SETTINGS: "\n M12,15.5A3.5,3.5 0 0,1 8.5,12A3.5,3.5 0 0,1 12,8.5A3.5,3.5 0 0,1 15.5,12A3.5,3.5 0 0,\n 1 12,15.5M19.43,12.97C19.47,12.65 19.5,12.33 19.5,12C19.5,11.67 19.47,11.34 19.43,\n 11L21.54,9.37C21.73,9.22 21.78,8.95 21.66,8.73L19.66,5.27C19.54,5.05 19.27,4.96 19.05,\n 5.05L16.56,6.05C16.04,5.66 15.5,5.32 14.87,5.07L14.5,2.42C14.46,2.18 14.25,2 14,\n 2H10C9.75,2 9.54,2.18 9.5,2.42L9.13,5.07C8.5,5.32 7.96,5.66 7.44,6.05L4.95,5.05C4.73,\n 4.96 4.46,5.05 4.34,5.27L2.34,8.73C2.21,8.95 2.27,9.22 2.46,9.37L4.57,11C4.53,11.34 4.5,\n 11.67 4.5,12C4.5,12.33 4.53,12.65 4.57,12.97L2.46,14.63C2.27,14.78 2.21,15.05 2.34,\n 15.27L4.34,18.73C4.46,18.95 4.73,19.03 4.95,18.95L7.44,17.94C7.96,18.34 8.5,18.68 9.13,\n 18.93L9.5,21.58C9.54,21.82 9.75,22 10,22H14C14.25,22 14.46,21.82 14.5,21.58L14.87,\n 18.93C15.5,18.67 16.04,18.34 16.56,17.94L19.05,18.95C19.27,19.03 19.54,18.95 19.66,\n 18.73L21.66,15.27C21.78,15.05 21.73,14.78 21.54,14.63L19.43,12.97Z\n ", SHARE: "\n M18,16.08C17.24,16.08 16.56,16.38 16.04,16.85L8.91,12.7C8.96,12.47 9,12.24 9,12C9,\n 11.76 8.96,11.53 8.91,11.3L15.96,7.19C16.5,7.69 17.21,8 18,8A3,3 0 0,0 21,5A3,\n 3 0 0,0 18,2A3,3 0 0,0 15,5C15,5.24 15.04,5.47 15.09,5.7L8.04,9.81C7.5,9.31 6.79,\n 9 6,9A3,3 0 0,0 3,12A3,3 0 0,0 6,15C6.79,15 7.5,14.69 8.04,14.19L15.16,18.34C15.11,\n 18.55 15.08,18.77 15.08,19C15.08,20.61 16.39,21.91 18,21.91C19.61,21.91 20.92,\n 20.61 20.92,19A2.92,2.92 0 0,0 18,16.08Z\n ", VIEW_DETAILS: "\n M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5\n 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01\n 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z\n " }; module.exports = Icons; }, function(module, exports, __webpack_require__) { "use strict"; 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 || "object" != typeof call && "function" != typeof call ? self : call; } function _inherits(subClass, superClass) { if ("function" != typeof superClass && null !== superClass) 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: !1, writable: !0, configurable: !0 } }), superClass && (Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass); } var _extends = Object.assign || function(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) Object.prototype.hasOwnProperty.call(source, key) && (target[key] = source[key]); } return target; }, _createClass = function() { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0, "value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor); } } return function(Constructor, protoProps, staticProps) { return protoProps && defineProperties(Constructor.prototype, protoProps), staticProps && defineProperties(Constructor, staticProps), Constructor; }; }(), React = __webpack_require__(12), Hoverable = function(Component) { var HoverableImplementation = function(_React$Component) { function HoverableImplementation() { var _ref, _temp, _this, _ret; _classCallCheck(this, HoverableImplementation); for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) args[_key] = arguments[_key]; return _temp = _this = _possibleConstructorReturn(this, (_ref = HoverableImplementation.__proto__ || Object.getPrototypeOf(HoverableImplementation)).call.apply(_ref, [ this ].concat(args))), _this.state = { isHovered: !1, isPressed: !1 }, _this._onMouseDown = function(event) { _this.setState({ isPressed: !0 }); }, _this._onMouseEnter = function(event) { _this.setState({ isHovered: !0 }); }, _this._onMouseLeave = function(event) { _this.setState({ isHovered: !1, isPressed: !1 }); }, _this._onMouseUp = function(event) { _this.setState({ isPressed: !1 }); }, _ret = _temp, _possibleConstructorReturn(_this, _ret); } return _inherits(HoverableImplementation, _React$Component), _createClass(HoverableImplementation, [ { key: "render", value: function() { var _state = this.state, isHovered = _state.isHovered, isPressed = _state.isPressed; return React.createElement(Component, _extends({}, this.props, { isHovered: isHovered, isPressed: isPressed, onMouseDown: this._onMouseDown, onMouseEnter: this._onMouseEnter, onMouseLeave: this._onMouseLeave, onMouseUp: this._onMouseUp })); } } ]), HoverableImplementation; }(React.Component); return HoverableImplementation; }; module.exports = Hoverable; }, function(module, exports, __webpack_require__) { "use strict"; 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 || "object" != typeof call && "function" != typeof call ? self : call; } function _inherits(subClass, superClass) { if ("function" != typeof superClass && null !== superClass) 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: !1, writable: !0, configurable: !0 } }), superClass && (Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass); } var _createClass = function() { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0, "value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor); } } return function(Constructor, protoProps, staticProps) { return protoProps && defineProperties(Constructor.prototype, protoProps), staticProps && defineProperties(Constructor, staticProps), Constructor; }; }(), Node = __webpack_require__(64), PropTypes = __webpack_require__(7), React = __webpack_require__(12), SearchUtils = __webpack_require__(59), Breadcrumb = __webpack_require__(66), decorate = __webpack_require__(20), _require = __webpack_require__(17), monospace = _require.monospace, sansSerif = _require.sansSerif, MAX_SEARCH_ROOTS = 200, TreeView = function(_React$Component) { function TreeView() { return _classCallCheck(this, TreeView), _possibleConstructorReturn(this, (TreeView.__proto__ || Object.getPrototypeOf(TreeView)).apply(this, arguments)); } return _inherits(TreeView, _React$Component), _createClass(TreeView, [ { key: "getChildContext", value: function() { return { scrollTo: this.scrollTo.bind(this) }; } }, { key: "scrollTo", value: function(toNode) { if (this.node) { for (var val = 0, height = toNode.offsetHeight; toNode && this.node.contains(toNode); ) val += toNode.offsetTop, toNode = toNode.offsetParent; var top = this.node.scrollTop, rel = val - this.node.offsetTop, margin = 40; top > rel - margin ? this.node.scrollTop = rel - margin : top + this.node.offsetHeight < rel + height + margin && (this.node.scrollTop = rel - this.node.offsetHeight + height + margin); } } }, { key: "render", value: function() { var _this2 = this, theme = this.context.theme; if (!this.props.roots.count()) return this.props.searching ? React.createElement("div", { style: styles.container }, React.createElement("span", { style: noSearchResultsStyle(theme) }, "No search results")) : React.createElement("div", { style: styles.container }, React.createElement("div", { ref: function(n) { return _this2.node = n; }, style: styles.scroll }, React.createElement("div", { style: styles.scrollContents }, "Waiting for roots to load...", this.props.reload && React.createElement("span", null, "to reload the inspector ", React.createElement("button", { onClick: this.props.reload }, " click here"))))); var searchText = this.props.searchText, searchRegExp = SearchUtils.isValidRegex(searchText) ? SearchUtils.searchTextToRegExp(searchText) : null; return this.props.searching && this.props.roots.count() > MAX_SEARCH_ROOTS ? React.createElement("div", { style: styles.container }, React.createElement("div", { ref: function(n) { return _this2.node = n; }, style: styles.scroll }, React.createElement("div", { style: styles.scrollContents }, this.props.roots.slice(0, MAX_SEARCH_ROOTS).map(function(id) { return React.createElement(Node, { depth: 0, id: id, key: id, searchRegExp: searchRegExp }); }).toJS(), React.createElement("span", null, "Some results not shown. Narrow your search criteria to find them")))) : React.createElement("div", { style: styles.container }, React.createElement("div", { ref: function(n) { return _this2.node = n; }, style: styles.scroll }, React.createElement("div", { style: styles.scrollContents }, this.props.roots.map(function(id) { return React.createElement(Node, { depth: 0, id: id, key: id, searchRegExp: searchRegExp }); }).toJS())), React.createElement(Breadcrumb, null)); } } ]), TreeView; }(React.Component); TreeView.childContextTypes = { scrollTo: PropTypes.func }, TreeView.contextTypes = { theme: PropTypes.object.isRequired }; var noSearchResultsStyle = function(theme) { return { color: theme.base04, fontFamily: sansSerif.family, fontSize: sansSerif.sizes.large, fontStyle: "italic", padding: "0.5rem" }; }, styles = { container: { fontFamily: monospace.family, fontSize: monospace.sizes.normal, lineHeight: 1.5, flex: 1, display: "flex", flexDirection: "column", minHeight: 0, WebkitUserSelect: "none", MozUserSelect: "none", userSelect: "none" }, scroll: { overflow: "auto", minHeight: 0, flex: 1, display: "flex", flexDirection: "column", alignItems: "flex-start", padding: "0.5rem 0.25rem" }, scrollContents: { flexDirection: "column", flex: 1, display: "flex", alignItems: "stretch", width: "100%" } }, WrappedTreeView = decorate({ listeners: function(props) { return [ "searchRoots", "roots" ]; }, props: function(store, _props) { return { roots: store.searchRoots || store.roots, searching: !!store.searchRoots, searchText: store.searchText }; } }, TreeView); module.exports = WrappedTreeView; }, function(module, exports, __webpack_require__) { "use strict"; 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 || "object" != typeof call && "function" != typeof call ? self : call; } function _inherits(subClass, superClass) { if ("function" != typeof superClass && null !== superClass) 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: !1, writable: !0, configurable: !0 } }), superClass && (Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass); } var _extends = Object.assign || function(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) Object.prototype.hasOwnProperty.call(source, key) && (target[key] = source[key]); } return target; }, _createClass = function() { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0, "value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor); } } return function(Constructor, protoProps, staticProps) { return protoProps && defineProperties(Constructor.prototype, protoProps), staticProps && defineProperties(Constructor, staticProps), Constructor; }; }(), PropTypes = __webpack_require__(7), React = __webpack_require__(12), nullthrows = __webpack_require__(3)["default"], decorate = __webpack_require__(20), Props = __webpack_require__(65), _require = __webpack_require__(55), getInvertedWeak = _require.getInvertedWeak, hexToRgba = _require.hexToRgba, Fragment = React.Fragment, Node = function(_React$Component) { function Node() { var _ref, _temp, _this, _ret; _classCallCheck(this, Node); for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) args[_key] = arguments[_key]; return _temp = _this = _possibleConstructorReturn(this, (_ref = Node.__proto__ || Object.getPrototypeOf(Node)).call.apply(_ref, [ this ].concat(args))), _this.state = { isWindowFocused: !0 }, _this._handleWindowFocus = function() { setTimeout(function() { if (_this._ownerWindow) { var doc = _this._ownerWindow.document; _this.setState({ isWindowFocused: doc.hasFocus() }); } }, 50); }, _this._handleWindowBlur = function() { _this.setState({ isWindowFocused: !1 }); }, _this._setTailRef = function(tail) { _this._tail = tail; }, _this._setHeadRef = function(head) { _this._head = head; }, _ret = _temp, _possibleConstructorReturn(_this, _ret); } return _inherits(Node, _React$Component), _createClass(Node, [ { key: "shouldComponentUpdate", value: function(nextProps, nextState) { return nextProps !== this.props || nextState.isWindowFocused !== this.state.isWindowFocused; } }, { key: "componentDidMount", value: function() { this.props.selected && (this.ensureInView(), this.subscribeToWindowFocus()); } }, { key: "componentDidUpdate", value: function(prevProps) { this.props.selected && !prevProps.selected ? (this.ensureInView(), this.subscribeToWindowFocus()) : !this.props.selected && prevProps.selected && this.unsubscribeFromWindowFocus(); } }, { key: "componentWillUnmount", value: function() { this.props.selected && this.unsubscribeFromWindowFocus(), this._ownerWindow = null; } }, { key: "findOwnerWindow", value: function() { if (!this._head) return null; var doc = this._head.ownerDocument; if (!doc) return null; var win = doc.defaultView; return win ? win : null; } }, { key: "subscribeToWindowFocus", value: function() { if (this._ownerWindow || (this._ownerWindow = this.findOwnerWindow(), this._ownerWindow)) { var win = this._ownerWindow; win.addEventListener("focus", this._handleWindowFocus), win.addEventListener("blur", this._handleWindowBlur), this.props.selected && this.setState({ isWindowFocused: win.document.hasFocus() }); } } }, { key: "unsubscribeFromWindowFocus", value: function() { if (this._ownerWindow) { var win = this._ownerWindow; win.removeEventListener("focus", this._handleWindowFocus), win.removeEventListener("blur", this._handleWindowBlur); } } }, { key: "ensureInView", value: function() { var node = this.props.isBottomTagSelected ? this._tail : this._head; null != node && ("function" == typeof node.scrollIntoViewIfNeeded ? node.scrollIntoViewIfNeeded() : "function" == typeof node.scrollIntoView && node.scrollIntoView({ block: "nearest", inline: "start" })); } }, { key: "render", value: function() { var theme = this.context.theme, _props = this.props, depth = _props.depth, hovered = _props.hovered, isBottomTagHovered = _props.isBottomTagHovered, isBottomTagSelected = _props.isBottomTagSelected, node = _props.node, onContextMenu = _props.onContextMenu, onHover = _props.onHover, onHoverBottom = _props.onHoverBottom, onSelect = _props.onSelect, onSelectBottom = _props.onSelectBottom, onToggleCollapse = _props.onToggleCollapse, searchRegExp = _props.searchRegExp, selected = _props.selected, wrappedChildren = _props.wrappedChildren, isWindowFocused = this.state.isWindowFocused; if (!node) return "Node was deleted"; var children = node.get("children"); if ("Wrapper" === node.get("nodeType")) return children.map(function(child) { return React.createElement(WrappedNode, { key: child, id: child, depth: depth }); }); "NativeWrapper" === node.get("nodeType") && (children = wrappedChildren); var collapsed = node.get("collapsed"), inverted = selected && isWindowFocused, headWrapperStyle = wrapperStyle(depth, inverted && !isBottomTagSelected, theme), sharedHeadStyle = headStyle({ depth: depth, isBottomTagHovered: isBottomTagHovered, isBottomTagSelected: isBottomTagSelected, isCollapsed: collapsed, isHovered: hovered, isSelected: selected, isWindowFocused: isWindowFocused, theme: theme }), headEvents = { onContextMenu: onContextMenu, onDoubleClick: onToggleCollapse, onMouseOver: function() { return onHover(!0); }, onMouseOut: function() { return onHover(!1); }, onMouseDown: onSelect }, tailEvents = { onContextMenu: onContextMenu, onDoubleClick: onToggleCollapse, onMouseOver: function() { return onHoverBottom(!0); }, onMouseOut: function() { return onHoverBottom(!1); }, onMouseDown: onSelectBottom }, nodeType = node.get("nodeType"); if ("Text" === nodeType || "Empty" === nodeType) { var tag = void 0; if ("Text" === nodeType) { var text = node.get("text"); tag = React.createElement("span", { style: tagTextStyle(inverted, theme) }, '"', text, '"'); } else "Empty" === nodeType && (tag = React.createElement("span", { style: tagTextStyle(inverted, theme) }, React.createElement("span", { style: styles.falseyLiteral }, "null"))); return React.createElement("div", _extends({ ref: this._setHeadRef, style: sharedHeadStyle }, headEvents), tag); } var name = node.get("name") + ""; if (searchRegExp) { for (var unmatched = name.split(searchRegExp), matched = name.match(searchRegExp), pieces = [ React.createElement("span", { key: 0 }, unmatched.shift()) ]; unmatched.length > 0; ) pieces.push(React.createElement("span", { key: pieces.length, style: highlightStyle(theme) }, nullthrows(matched).shift())), pieces.push(React.createElement("span", { key: pieces.length }, unmatched.shift())); name = pieces; } var dollarRStyle = { color: isWindowFocused ? getInvertedWeak(theme.state02) : "inherit" }; if (!children || "string" == typeof children || !children.length) { var jsxSingleLineTagStyle = jsxTagStyle(inverted, nodeType, theme), content = children, _isCollapsed = null === content || void 0 === content; return React.createElement("div", { style: headWrapperStyle }, React.createElement("div", _extends({ style: sharedHeadStyle }, headEvents), "<", React.createElement("span", { ref: this._setHeadRef, style: jsxSingleLineTagStyle }, name), node.get("key") && React.createElement(Props, { key: "key", props: { key: node.get("key") }, inverted: inverted }), node.get("props") && React.createElement(Props, { key: "props", props: node.get("props"), inverted: inverted }), _isCollapsed ? " />" : ">", !_isCollapsed && [ React.createElement(Fragment, { key: "content" }, content), React.createElement("span", { key: "close" }, "") ], selected && React.createElement("span", { style: dollarRStyle }, " == $r"))); } var jsxCloseTagStyle = jsxTagStyle(inverted && (isBottomTagSelected || collapsed), nodeType, theme), closeTag = React.createElement(Fragment, null, "", selected && (collapsed && !this.props.isBottomTagSelected || this.props.isBottomTagSelected) && React.createElement("span", { style: dollarRStyle }, " == $r")), headInverted = inverted && (!isBottomTagSelected || collapsed), jsxOpenTagStyle = jsxTagStyle(inverted && (!isBottomTagSelected || collapsed), nodeType, theme), head = React.createElement("div", _extends({ style: sharedHeadStyle }, headEvents), React.createElement("span", { onClick: onToggleCollapse, style: { width: "1rem", textAlign: "center", marginLeft: "-1rem" } }, collapsed ? "▶" : "▼"), "<", React.createElement("span", { ref: this._setHeadRef, style: jsxOpenTagStyle }, name), node.get("key") && React.createElement(Props, { key: "key", props: { key: node.get("key") }, inverted: headInverted }), node.get("props") && React.createElement(Props, { key: "props", props: node.get("props"), inverted: headInverted }), ">", selected && !collapsed && !this.props.isBottomTagSelected && React.createElement("span", { style: dollarRStyle }, " == $r"), collapsed && "…", collapsed && closeTag); if (collapsed) return head; var tailStyleActual = tailStyle({ depth: depth, isBottomTagHovered: isBottomTagHovered, isBottomTagSelected: isBottomTagSelected, isHovered: hovered, isSelected: selected, isWindowFocused: isWindowFocused, theme: theme }); return React.createElement("div", { style: headWrapperStyle }, head, React.createElement("div", { style: guidelineStyle(depth, selected, hovered, isBottomTagHovered, theme) }), React.createElement("div", { style: { paddingLeft: "1rem", color: theme.special07, display: "inline-flex", flexDirection: "column", minWidth: "100%", boxSizing: "border-box" } }, children.map(function(id) { return React.createElement(WrappedNode, { key: id, depth: depth + 1, id: id }); })), React.createElement("div", _extends({ style: tailStyleActual }, tailEvents), closeTag)); } } ]), Node; }(React.Component); Node.contextTypes = { scrollTo: PropTypes.func, theme: PropTypes.object.isRequired }; var WrappedNode = decorate({ listeners: function(props) { return [ props.id ]; }, props: function(store, _props2) { var node = store.get(_props2.id), wrappedChildren = null; if (node && "NativeWrapper" === node.get("nodeType")) { var child = store.get(node.get("children")[0]); wrappedChildren = child && child.get("children"); } return { node: node, wrappedChildren: wrappedChildren, selected: store.selected === _props2.id, isBottomTagSelected: store.isBottomTagSelected, isBottomTagHovered: store.isBottomTagHovered, hovered: store.hovered === _props2.id, searchRegExp: _props2.searchRegExp, onToggleCollapse: function(e) { e.preventDefault(), store.toggleCollapse(_props2.id); }, onHover: function(isHovered) { return store.setHover(_props2.id, isHovered, !1); }, onHoverBottom: function(isHovered) { return store.setHover(_props2.id, isHovered, !0); }, onSelect: function(e) { store.selectTop(_props2.id); }, onSelectBottom: function(e) { store.selectBottom(_props2.id); }, onContextMenu: function(e) { store.showContextMenu("tree", e, _props2.id, node); } }; }, shouldUpdate: function(nextProps, prevProps) { return nextProps.id !== prevProps.id || nextProps.searchRegExp !== prevProps.searchRegExp; } }, Node), paddingRight = 5, headStyle = function(_ref2) { var isBottomTagHovered = (_ref2.depth, _ref2.isBottomTagHovered), isBottomTagSelected = _ref2.isBottomTagSelected, isCollapsed = _ref2.isCollapsed, isHovered = _ref2.isHovered, isSelected = _ref2.isSelected, isWindowFocused = _ref2.isWindowFocused, theme = _ref2.theme, backgroundColor = void 0; !isSelected || !isCollapsed && isBottomTagSelected ? !isHovered || !isCollapsed && isBottomTagHovered || (backgroundColor = theme.state03) : backgroundColor = isWindowFocused ? theme.state00 : theme.state01; var isInverted = isSelected && isWindowFocused && (isCollapsed || !isBottomTagSelected), color = isInverted ? theme.state02 : void 0; return { cursor: "default", borderTop: "1px solid transparent", position: "relative", display: "flex", flexShrink: 0, flexWrap: "wrap", borderRadius: "0.125rem", paddingLeft: "1rem", paddingRight: paddingRight, backgroundColor: backgroundColor, color: color }; }, jsxTagStyle = function(inverted, nodeType, theme) { var color = void 0; return color = inverted ? theme.state02 : "Special" === nodeType ? theme.special01 : "Composite" === nodeType ? theme.special00 : theme.special07, { color: color }; }, tagTextStyle = function(inverted, theme) { return { flex: 1, color: inverted ? getInvertedWeak(theme.state02) : theme.special06 }; }, wrapperStyle = function(depth, inverted, theme) { return { position: "relative", color: inverted ? getInvertedWeak(theme.state02) : theme.special07 }; }, highlightStyle = function(theme) { return { backgroundColor: theme.state04, color: theme.state05 }; }, tailStyle = function(_ref3) { var isBottomTagHovered = (_ref3.depth, _ref3.isBottomTagHovered), isBottomTagSelected = _ref3.isBottomTagSelected, isHovered = _ref3.isHovered, isSelected = _ref3.isSelected, isWindowFocused = _ref3.isWindowFocused, theme = _ref3.theme, backgroundColor = void 0; isSelected && isBottomTagSelected ? backgroundColor = isWindowFocused ? theme.state00 : theme.state01 : isHovered && isBottomTagHovered && (backgroundColor = theme.state03); var isInverted = isSelected && isWindowFocused && isBottomTagSelected, color = isInverted ? theme.state02 : theme.base04; return { borderTop: "1px solid transparent", cursor: "default", paddingLeft: "1rem", paddingRight: paddingRight, backgroundColor: backgroundColor, color: color }; }, guidelineStyle = function(depth, isSelected, isHovered, isBottomTagHovered, theme) { var borderLeftColor = "transparent"; return isSelected ? borderLeftColor = hexToRgba(theme.state00, .45) : isHovered && !isBottomTagHovered && (borderLeftColor = hexToRgba(theme.base04, .2)), { position: "absolute", width: "1px", borderLeft: "1px solid " + borderLeftColor, top: "1rem", bottom: 0, left: "0.5rem", zIndex: isSelected ? 1 : 0 }; }, styles = { falseyLiteral: { fontStyle: "italic" } }; module.exports = WrappedNode; }, function(module, exports, __webpack_require__) { "use strict"; 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 || "object" != typeof call && "function" != typeof call ? self : call; } function _inherits(subClass, superClass) { if ("function" != typeof superClass && null !== superClass) 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: !1, writable: !0, configurable: !0 } }), superClass && (Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass); } var _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj) { return typeof obj; } : function(obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _createClass = function() { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0, "value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor); } } return function(Constructor, protoProps, staticProps) { return protoProps && defineProperties(Constructor.prototype, protoProps), staticProps && defineProperties(Constructor, staticProps), Constructor; }; }(), PropTypes = __webpack_require__(7), React = __webpack_require__(12), _require = __webpack_require__(55), getInvertedMid = _require.getInvertedMid, getInvertedWeak = _require.getInvertedWeak, Fragment = React.Fragment, Props = function(_React$Component) { function Props() { return _classCallCheck(this, Props), _possibleConstructorReturn(this, (Props.__proto__ || Object.getPrototypeOf(Props)).apply(this, arguments)); } return _inherits(Props, _React$Component), _createClass(Props, [ { key: "shouldComponentUpdate", value: function(nextProps) { return nextProps.props !== this.props.props || nextProps.inverted !== this.props.inverted; } }, { key: "render", value: function() { var theme = this.context.theme, _props = this.props, inverted = _props.inverted, props = _props.props; if (!props || "object" !== ("undefined" == typeof props ? "undefined" : _typeof(props))) return null; var propKeys = Object.keys(props), names = propKeys.filter(function(name) { var value = props[name]; return "_" !== name[0] && "children" !== name && ("boolean" == typeof value || "string" == typeof value || "number" == typeof value || null == value); }), items = []; return names.forEach(function(name) { var valueIsString = "string" == typeof props[name], displayValue = props[name]; void 0 === displayValue ? displayValue = "undefined" : null === displayValue ? displayValue = "null" : "boolean" == typeof displayValue ? displayValue = displayValue ? "true" : "false" : valueIsString && displayValue.length > 50 && (displayValue = displayValue.slice(0, 50) + "…"), items.push(React.createElement(Fragment, { key: "prop-" + name }, " ", React.createElement("span", { style: { color: inverted ? getInvertedMid(theme.state02) : theme.special06 } }, name), valueIsString ? '="' : "={", React.createElement("span", { style: { color: inverted ? getInvertedWeak(theme.state02) : theme.special02 } }, displayValue), valueIsString ? '"' : "}")); }), items; } } ]), Props; }(React.Component); Props.contextTypes = { theme: PropTypes.object.isRequired }, module.exports = Props; }, function(module, exports, __webpack_require__) { "use strict"; 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 || "object" != typeof call && "function" != typeof call ? self : call; } function _inherits(subClass, superClass) { if ("function" != typeof superClass && null !== superClass) 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: !1, writable: !0, configurable: !0 } }), superClass && (Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass); } function getBreadcrumbPath(store) { for (var path = [], current = store.breadcrumbHead; current; ) path.unshift({ id: current, node: store.get(current) }), current = store.skipWrapper(store.getParent(current), !0); return path; } var _createClass = function() { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0, "value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor); } } return function(Constructor, protoProps, staticProps) { return protoProps && defineProperties(Constructor.prototype, protoProps), staticProps && defineProperties(Constructor, staticProps), Constructor; }; }(), _require = __webpack_require__(17), sansSerif = _require.sansSerif, PropTypes = __webpack_require__(7), React = __webpack_require__(12), decorate = __webpack_require__(20), Breadcrumb = function(_React$Component) { function Breadcrumb(props) { _classCallCheck(this, Breadcrumb); var _this = _possibleConstructorReturn(this, (Breadcrumb.__proto__ || Object.getPrototypeOf(Breadcrumb)).call(this, props)); return _this.selectedListItem = React.createRef(), _this.state = { hovered: null }, _this; } return _inherits(Breadcrumb, _React$Component), _createClass(Breadcrumb, [ { key: "componentDidMount", value: function() { this.props.selected && this.ensureInView(); } }, { key: "componentDidUpdate", value: function(prevProps, prevState) { this.props.selected !== prevProps.selected && this.ensureInView(); } }, { key: "handleCrumbMouseOver", value: function(id) { this.setState({ hovered: id }), this.props.hover(id, !0); } }, { key: "handleCrumbMouseOut", value: function(id) { this.setState({ hovered: null }), this.props.hover(id, !1); } }, { key: "render", value: function() { var _this2 = this, theme = this.context.theme, _props = this.props, path = _props.path, selected = _props.selected; return React.createElement("ul", { style: containerStyle(theme) }, path.map(function(_ref) { var id = _ref.id, node = _ref.node, isSelected = id === selected, style = itemStyle(isSelected, node.get("nodeType"), theme); return React.createElement("li", { style: style, key: id, onMouseOver: function() { return _this2.handleCrumbMouseOver(id); }, onMouseOut: function() { return _this2.handleCrumbMouseOut(id); }, onClick: isSelected ? null : function() { return _this2.props.select(id); }, ref: isSelected ? _this2.selectedListItem : void 0 }, node.get("name") || '"' + node.get("text") + '"'); })); } }, { key: "ensureInView", value: function() { var selectedListItem = this.selectedListItem.current; null != selectedListItem && ("function" == typeof selectedListItem.scrollIntoViewIfNeeded ? selectedListItem.scrollIntoViewIfNeeded({ inline: "nearest" }) : "function" == typeof selectedListItem.scrollIntoView && selectedListItem.scrollIntoView({ inline: "nearest" })); } } ]), Breadcrumb; }(React.Component); Breadcrumb.contextTypes = { theme: PropTypes.object.isRequired }; var containerStyle = function(theme) { return { fontFamily: sansSerif.family, listStyle: "none", padding: "0 0.5rem", margin: 0, maxHeight: "80px", backgroundColor: theme.base01, borderTop: "1px solid " + theme.base03, whiteSpace: "nowrap", overflow: "auto" }; }, itemStyle = function(isSelected, nodeType, theme) { var color = void 0; return isSelected ? color = theme.state02 : "Special" === nodeType ? color = theme.special01 : "Composite" === nodeType && (color = theme.special05), { backgroundColor: isSelected ? theme.state00 : "transparent", color: color, cursor: isSelected ? "default" : "pointer", padding: "0.25rem 0.5rem", WebkitUserSelect: "none", MozUserSelect: "none", userSelect: "none", display: "inline-block" }; }; module.exports = decorate({ listeners: function() { return [ "breadcrumbHead", "selected" ]; }, props: function(store, _props2) { return { select: function(id) { return store.selectBreadcrumb(id); }, hover: function(id, isHovered) { return store.setHover(id, isHovered, !1); }, selected: store.selected, path: getBreadcrumbPath(store) }; } }, Breadcrumb); }, function(module, exports, __webpack_require__) { "use strict"; 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 || "object" != typeof call && "function" != typeof call ? self : call; } function _inherits(subClass, superClass) { if ("function" != typeof superClass && null !== superClass) 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: !1, writable: !0, configurable: !0 } }), superClass && (Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass); } var _createClass = function() { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0, "value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor); } } return function(Constructor, protoProps, staticProps) { return protoProps && defineProperties(Constructor.prototype, protoProps), staticProps && defineProperties(Constructor, staticProps), Constructor; }; }(), PropTypes = __webpack_require__(7), React = __webpack_require__(12), decorate = __webpack_require__(20), _require = __webpack_require__(17), sansSerif = _require.sansSerif, _require2 = __webpack_require__(68), CUSTOM_THEME_NAME = _require2.CUSTOM_THEME_NAME, Icons = __webpack_require__(61), SvgIcon = __webpack_require__(60), ThemeEditor = __webpack_require__(69), Hoverable = __webpack_require__(62), TraceUpdatesFrontendControl = __webpack_require__(321), ColorizerFrontendControl = __webpack_require__(323), PreferencesPanel = function(_React$Component) { function PreferencesPanel(props, context) { _classCallCheck(this, PreferencesPanel); var _this = _possibleConstructorReturn(this, (PreferencesPanel.__proto__ || Object.getPrototypeOf(PreferencesPanel)).call(this, props, context)); return _this._changeTheme = function(event) { var changeTheme = _this.props.changeTheme; changeTheme(event.target.value); }, _this._hide = function() { var hide = _this.props.hide, editMode = _this.state.editMode; editMode ? _this.setState({ editMode: !1 }) : hide(); }, _this._onEditCustomThemeClick = function() { _this.setState({ editMode: !0 }); }, _this._onKeyUp = function(_ref) { var key = _ref.key; "Escape" === key && _this.props.hide(); }, _this._setSelectRef = function(ref) { _this._selectRef = ref; }, _this.state = { editMode: !1 }, _this; } return _inherits(PreferencesPanel, _React$Component), _createClass(PreferencesPanel, [ { key: "componentDidMount", value: function(prevProps, prevState) { this.props.open && this._selectRef.focus(); } }, { key: "componentDidUpdate", value: function(prevProps, prevState) { this.props.open && !prevProps.open && this._selectRef.focus(); } }, { key: "render", value: function() { var _context = this.context, browserName = _context.browserName, showHiddenThemes = _context.showHiddenThemes, theme = _context.theme, themeName = _context.themeName, themes = _context.themes, _props = this.props, hasCustomTheme = _props.hasCustomTheme, hide = _props.hide, open = _props.open, editMode = this.state.editMode; if (!open) return null; var content = void 0; if (editMode) content = React.createElement(ThemeEditor, { hide: this._hide, theme: theme }); else { var themeNames = Object.keys(themes); showHiddenThemes || (themeNames = themeNames.filter(function(key) { return !themes[key].hidden; })), content = React.createElement("div", { style: panelStyle(theme), onClick: blockClick }, React.createElement("h4", { style: styles.header }, "Preferences"), React.createElement("div", { style: styles.preference }, React.createElement(TraceUpdatesFrontendControl, null)), React.createElement("div", { style: styles.preference }, React.createElement(ColorizerFrontendControl, null)), React.createElement("h4", { style: styles.header }, "Theme"), React.createElement("div", { style: styles.selectAndPreviewRow }, React.createElement("select", { onChange: this._changeTheme, onKeyUp: this._onKeyUp, ref: this._setSelectRef, value: themeName }, browserName && React.createElement("option", { value: "" }, browserName), hasCustomTheme && React.createElement("option", { value: CUSTOM_THEME_NAME }, "Custom"), (browserName || hasCustomTheme) && React.createElement("option", { disabled: "disabled" }, "---"), themeNames.map(function(key) { return React.createElement("option", { key: key, value: key }, themes[key].displayName); })), React.createElement(EditButton, { onClick: this._onEditCustomThemeClick, theme: theme }, React.createElement(EditIcon, null))), React.createElement("div", { style: styles.buttonBar }, React.createElement("button", { onClick: hide, style: styles.button }, "Close"))); } return React.createElement("div", { style: styles.backdrop, onClick: this._hide }, content); } } ]), PreferencesPanel; }(React.Component); PreferencesPanel.contextTypes = { browserName: PropTypes.string.isRequired, showHiddenThemes: PropTypes.bool.isRequired, theme: PropTypes.object.isRequired, themeName: PropTypes.string.isRequired, themes: PropTypes.object.isRequired }, PreferencesPanel.propTypes = { changeTheme: PropTypes.func, hide: PropTypes.func, open: PropTypes.bool }; var EditButton = Hoverable(function(_ref2) { var isHovered = _ref2.isHovered, onClick = _ref2.onClick, onMouseEnter = _ref2.onMouseEnter, onMouseLeave = _ref2.onMouseLeave, theme = _ref2.theme; return React.createElement("button", { onClick: onClick, onMouseEnter: onMouseEnter, onMouseLeave: onMouseLeave, style: buttonStyle(isHovered, theme) }, React.createElement(EditIcon, null)); }), EditIcon = function() { return React.createElement(SvgIcon, { path: Icons.EDIT }); }, blockClick = function(event) { return event.stopPropagation(); }, WrappedPreferencesPanel = decorate({ listeners: function() { return [ "preferencesPanelShown" ]; }, props: function(store, _props2) { return { changeTheme: function(themeName) { return store.changeTheme(themeName); }, hasCustomTheme: !!store.themeStore.customTheme, hide: function() { return store.hidePreferencesPanel(); }, open: store.preferencesPanelShown }; } }, PreferencesPanel), panelStyle = function(theme) { return { maxWidth: "100%", margin: "0.5rem", padding: "0.5rem", borderRadius: "0.25rem", display: "flex", flexDirection: "column", alignItems: "flex-start", zIndex: 1, fontFamily: sansSerif.family, backgroundColor: theme.base01, border: "1px solid " + theme.base03, color: theme.base05 }; }, buttonStyle = function(isHovered, theme) { return { padding: "0.25rem", marginLeft: "0.25rem", height: "1.5rem", background: "none", border: "none", color: isHovered ? theme.state06 : "inherit" }; }, styles = { backdrop: { position: "fixed", zIndex: 1, width: "100%", height: "100%", top: 0, left: 0, display: "flex", justifyContent: "center", alignItems: "center", backgroundColor: "rgba(0,0,0,0)" }, header: { margin: "0 0 0.5rem" }, buttonBar: { flexDirection: "row" }, button: { marginTop: "0.5rem", marginRight: "0.25rem", padding: "0.25rem" }, preference: { margin: "0 0 0.5rem", fontSize: sansSerif.sizes.normal }, selectAndPreviewRow: { display: "flex", direction: "row", alignItems: "center" } }; module.exports = WrappedPreferencesPanel; }, function(module, exports) { "use strict"; var CUSTOM_THEME_NAME = "Custom"; module.exports = { CUSTOM_THEME_NAME: CUSTOM_THEME_NAME }; }, function(module, exports, __webpack_require__) { "use strict"; 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 || "object" != typeof call && "function" != typeof call ? self : call; } function _inherits(subClass, superClass) { if ("function" != typeof superClass && null !== superClass) 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: !1, writable: !0, configurable: !0 } }), superClass && (Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass); } var _createClass = function() { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0, "value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor); } } return function(Constructor, protoProps, staticProps) { return protoProps && defineProperties(Constructor.prototype, protoProps), staticProps && defineProperties(Constructor, staticProps), Constructor; }; }(), _require = __webpack_require__(70), copy = _require.copy, decorate = __webpack_require__(20), PropTypes = __webpack_require__(7), React = __webpack_require__(12), ColorInput = __webpack_require__(73), ColorGroups = __webpack_require__(315), Hoverable = __webpack_require__(62), Icons = __webpack_require__(61), Input = __webpack_require__(23), _require2 = __webpack_require__(17), monospace = _require2.monospace, sansSerif = _require2.sansSerif, Preview = __webpack_require__(316), SvgIcon = __webpack_require__(60), Themes = __webpack_require__(318), TimerSafe = __webpack_require__(319), _require3 = __webpack_require__(320), deserialize = _require3.deserialize, serialize = _require3.serialize, _require4 = __webpack_require__(68), CUSTOM_THEME_NAME = _require4.CUSTOM_THEME_NAME, THEME_SITE_URL = "http://facebook.github.io/react-devtools/?theme=", safeTheme = Themes.ChromeDefault, colors = Object.assign({}, ColorGroups.Base, ColorGroups.Selection, ColorGroups.Syntax), Editor = function(_React$Component) { function Editor(props, context) { _classCallCheck(this, Editor); var _this = _possibleConstructorReturn(this, (Editor.__proto__ || Object.getPrototypeOf(Editor)).call(this, props, context)); return _this._copyTheme = function() { var serializedTheme = encodeURI(serialize(_this._customTheme)); copy(THEME_SITE_URL + serializedTheme), _this.setState({ showCopyConfirmation: !0 }, function() { _this.props.setTimeout(function() { return _this.setState({ showCopyConfirmation: !1 }); }, 2500); }); }, _this._onShareChange = function(event) { _this._customTheme = deserialize(event.target.value, _this.props.theme), _this._sanitizeCustomTheme(), _this._udpatePreview(); }, _this._udpatePreview = function() { _this.setState(function(state) { return { isResetEnabled: _this._serializedPropsTheme !== serialize(_this._customTheme), updateCounter: state.updateCounter + 1 }; }); }, _this._reset = function() { _this._customTheme = Object.assign({}, _this.props.theme), _this._udpatePreview(); }, _this._save = function() { var _this$props = _this.props, changeTheme = _this$props.changeTheme, hide = _this$props.hide, saveTheme = _this$props.saveTheme; saveTheme(_this._customTheme), changeTheme(CUSTOM_THEME_NAME), hide(); }, _this.state = { isResetEnabled: !1, showCopyConfirmation: !1, updateCounter: 0 }, _this._serializedPropsTheme = serialize(props.theme), _this._reset(), _this._sanitizeCustomTheme(), _this; } return _inherits(Editor, _React$Component), _createClass(Editor, [ { key: "getChildContext", value: function() { return { theme: this._customTheme }; } }, { key: "render", value: function() { var _this2 = this, hide = this.props.hide, _state = this.state, isResetEnabled = _state.isResetEnabled, showCopyConfirmation = _state.showCopyConfirmation, updateCounter = _state.updateCounter; return React.createElement("div", { onClick: function(event) { return event.stopPropagation(); }, style: editorStyle(safeTheme) }, React.createElement("h3", { style: styles.header }, "Custom Theme"), React.createElement("div", { style: styles.middleRow }, React.createElement("div", { style: groupStyle(safeTheme) }, Object.keys(colors).map(function(key) { return React.createElement(ColorInput, { descriptions: colors[key], customTheme: _this2._customTheme, key: key, label: colors[key], propertyName: key, udpatePreview: _this2._udpatePreview, theme: safeTheme }); })), React.createElement("div", { style: previewWrapperStyle(this._customTheme) }, React.createElement(Preview, { key: updateCounter, theme: this._customTheme }))), React.createElement("div", { style: styles.bottomRow }, React.createElement("div", { style: styles.buttons }, React.createElement("button", { onClick: hide }, "Cancel"), " ", React.createElement("button", { disabled: !isResetEnabled, onClick: this._reset }, "Reset"), " ", React.createElement("button", { onClick: this._save }, "Save")), React.createElement("div", { style: styles.importExportRow }, React.createElement(CopyThemeButton, { onClick: this._copyTheme, showCopyConfirmation: showCopyConfirmation, title: "Copy theme to clipboard", theme: safeTheme }), React.createElement(SvgIcon, { path: Icons.SHARE }), React.createElement("label", { style: styles.shareLabel }, "Import/export:"), React.createElement(Input, { onChange: this._onShareChange, style: shareInput(safeTheme), theme: safeTheme, type: "text", value: serialize(this._customTheme) })))); } }, { key: "_sanitizeCustomTheme", value: function() { this._customTheme.displayName = CUSTOM_THEME_NAME, delete this._customTheme.hidden; } } ]), Editor; }(React.Component); Editor.childContextTypes = { theme: PropTypes.object }; var WrappedEditor = decorate({ listeners: function() { return []; }, props: function(store, _props) { return { changeTheme: function(themeName) { return store.changeTheme(themeName); }, defaultThemeName: store.themeStore.defaultThemeName, saveTheme: function(theme) { return store.saveCustomTheme(theme); } }; } }, TimerSafe(Editor)), CopyThemeButton = Hoverable(function(_ref) { var isHovered = _ref.isHovered, isPressed = _ref.isPressed, onClick = _ref.onClick, onMouseDown = _ref.onMouseDown, onMouseEnter = _ref.onMouseEnter, onMouseLeave = _ref.onMouseLeave, onMouseUp = _ref.onMouseUp, showCopyConfirmation = _ref.showCopyConfirmation, theme = _ref.theme; return React.createElement("button", { onClick: onClick, onMouseDown: onMouseDown, onMouseEnter: onMouseEnter, onMouseLeave: onMouseLeave, onMouseUp: onMouseUp, style: copyThemeButtonStyle(isHovered, isPressed, theme), title: "Copy theme to clipboard" }, React.createElement(SvgIcon, { path: showCopyConfirmation ? Icons.CHECK : Icons.COPY }), React.createElement("label", { style: styles.copyLabel }, showCopyConfirmation ? "Copied" : "Copy")); }), editorStyle = function(theme) { return { display: "flex", flexDirection: "column", maxWidth: "calc(100vw - 2rem)", maxHeight: "calc(100vh - 2rem)", boxSizing: "border-box", zIndex: 1, padding: "0.5rem", borderRadius: "0.25rem", backgroundColor: theme.base01, color: theme.base05, border: "1px solid " + theme.base03, fontFamily: sansSerif.family, fontSize: sansSerif.sizes.normal }; }, groupStyle = function(theme) { return { display: "flex", flexDirection: "row", flexWrap: "wrap", overflowY: "auto", borderRadius: "0.25rem" }; }, previewWrapperStyle = function(theme) { return { display: "inline-flex", flex: "1 0 auto", marginLeft: "0.5rem", alignItems: "stretch", borderRadius: "0.25rem", border: "1px solid " + theme.base03 }; }, shareInput = function(theme) { return { flex: "0 1 15rem", padding: "0.25rem", border: "1px solid " + theme.base03, borderRadius: "0.25rem", fontFamily: monospace.family, fontSize: monospace.sizes.normal, color: "inherit" }; }, copyThemeButtonStyle = function(isHovered, isPressed, theme) { return { flex: "0 0 auto", display: "flex", alignItems: "center", padding: "0.25rem", margin: "0 0.25rem", height: "1.5rem", background: isPressed ? theme.state01 : "none", border: "none", color: isHovered ? theme.state06 : "inherit" }; }, styles = { header: { flex: "0 0 auto", marginTop: 0, marginBottom: "0.5rem" }, bottomRow: { flex: "0 0 auto", display: "flex", flexDirection: "row", alignItems: "center", marginTop: "0.5rem" }, buttons: { flex: "1 0 auto", marginTop: "0.5rem" }, copyLabel: { flex: "0 0 auto", marginLeft: "0.25rem" }, middleRow: { display: "flex", flexDirection: "row", flex: "0 1 auto", overflowY: "auto" }, column: { display: "flex", flexDirection: "column" }, importExportRow: { display: "flex", flexDirection: "row", alignItems: "center", flex: "0 0 auto", marginTop: "0.5rem" }, shareLabel: { flex: "0 0 auto", margin: "0 0.25rem" } }; module.exports = WrappedEditor; }, function(module, exports, __webpack_require__) { (function(setImmediate) { !function(name, definition) { module.exports = definition(); }("clipboard", function() { if ("undefined" == typeof document || !document.addEventListener) return null; var clipboard = {}; /*! promise-polyfill 2.0.1 */ return clipboard.copy = function() { function cleanup() { _intercept = !1, _data = null, _bogusSelection && window.getSelection().removeAllRanges(), _bogusSelection = !1; } function bogusSelect() { var sel = document.getSelection(); if (!document.queryCommandEnabled("copy") && sel.isCollapsed) { var range = document.createRange(); range.selectNodeContents(document.body), sel.removeAllRanges(), sel.addRange(range), _bogusSelection = !0; } } var _intercept = !1, _data = null, _bogusSelection = !1; return document.addEventListener("copy", function(e) { if (_intercept) { for (var key in _data) e.clipboardData.setData(key, _data[key]); e.preventDefault(); } }), function(data) { return new Promise(function(resolve, reject) { function triggerCopy(tryBogusSelect) { try { if (document.execCommand("copy")) cleanup(), resolve(); else { if (tryBogusSelect) throw new Error("Unable to copy. Perhaps it's not available in your browser?"); bogusSelect(), triggerCopy(!0); } } catch (e) { cleanup(), reject(e); } } _intercept = !0, _data = "string" == typeof data ? { "text/plain": data } : data instanceof Node ? { "text/html": new XMLSerializer().serializeToString(data) } : data, triggerCopy(!1); }); }; }(), clipboard.paste = function() { var _resolve, _dataType, _intercept = !1; return document.addEventListener("paste", function(e) { if (_intercept) { _intercept = !1, e.preventDefault(); var resolve = _resolve; _resolve = null, resolve(e.clipboardData.getData(_dataType)); } }), function(dataType) { return new Promise(function(resolve, reject) { _intercept = !0, _resolve = resolve, _dataType = dataType || "text/plain"; try { document.execCommand("paste") || (_intercept = !1, reject(new Error("Unable to paste. Pasting only works in Internet Explorer at the moment."))); } catch (e) { _intercept = !1, reject(new Error(e)); } }); }; }(), "undefined" == typeof ClipboardEvent && "undefined" != typeof window.clipboardData && "undefined" != typeof window.clipboardData.setData && (!function(a) { function b(a, b) { return function() { a.apply(b, arguments); }; } function c(a) { if ("object" != typeof this) throw new TypeError("Promises must be constructed via new"); if ("function" != typeof a) throw new TypeError("not a function"); this._state = null, this._value = null, this._deferreds = [], i(a, b(e, this), b(f, this)); } function d(a) { var b = this; return null === this._state ? void this._deferreds.push(a) : void j(function() { var c = b._state ? a.onFulfilled : a.onRejected; if (null === c) return void (b._state ? a.resolve : a.reject)(b._value); var d; try { d = c(b._value); } catch (e) { return void a.reject(e); } a.resolve(d); }); } function e(a) { try { if (a === this) throw new TypeError("A promise cannot be resolved with itself."); if (a && ("object" == typeof a || "function" == typeof a)) { var c = a.then; if ("function" == typeof c) return void i(b(c, a), b(e, this), b(f, this)); } this._state = !0, this._value = a, g.call(this); } catch (d) { f.call(this, d); } } function f(a) { this._state = !1, this._value = a, g.call(this); } function g() { for (var a = 0, b = this._deferreds.length; b > a; a++) d.call(this, this._deferreds[a]); this._deferreds = null; } function h(a, b, c, d) { this.onFulfilled = "function" == typeof a ? a : null, this.onRejected = "function" == typeof b ? b : null, this.resolve = c, this.reject = d; } function i(a, b, c) { var d = !1; try { a(function(a) { d || (d = !0, b(a)); }, function(a) { d || (d = !0, c(a)); }); } catch (e) { if (d) return; d = !0, c(e); } } var j = c.immediateFn || "function" == typeof setImmediate && setImmediate || function(a) { setTimeout(a, 1); }, k = Array.isArray || function(a) { return "[object Array]" === Object.prototype.toString.call(a); }; c.prototype["catch"] = function(a) { return this.then(null, a); }, c.prototype.then = function(a, b) { var e = this; return new c(function(c, f) { d.call(e, new h(a, b, c, f)); }); }, c.all = function() { var a = Array.prototype.slice.call(1 === arguments.length && k(arguments[0]) ? arguments[0] : arguments); return new c(function(b, c) { function d(f, g) { try { if (g && ("object" == typeof g || "function" == typeof g)) { var h = g.then; if ("function" == typeof h) return void h.call(g, function(a) { d(f, a); }, c); } a[f] = g, 0 === --e && b(a); } catch (i) { c(i); } } if (0 === a.length) return b([]); for (var e = a.length, f = 0; f < a.length; f++) d(f, a[f]); }); }, c.resolve = function(a) { return a && "object" == typeof a && a.constructor === c ? a : new c(function(b) { b(a); }); }, c.reject = function(a) { return new c(function(b, c) { c(a); }); }, c.race = function(a) { return new c(function(b, c) { for (var d = 0, e = a.length; e > d; d++) a[d].then(b, c); }); }, "undefined" != typeof module && module.exports ? module.exports = c : a.Promise || (a.Promise = c); }(this), clipboard.copy = function(data) { return new Promise(function(resolve, reject) { if ("string" != typeof data && !("text/plain" in data)) throw new Error("You must provide a text/plain type."); var strData = "string" == typeof data ? data : data["text/plain"], copySucceeded = window.clipboardData.setData("Text", strData); copySucceeded ? resolve() : reject(new Error("Copying was rejected.")); }); }, clipboard.paste = function() { return new Promise(function(resolve, reject) { var strData = window.clipboardData.getData("Text"); strData ? resolve(strData) : reject(new Error("Pasting was rejected.")); }); }), clipboard; }); }).call(exports, __webpack_require__(71).setImmediate); }, function(module, exports, __webpack_require__) { (function(setImmediate, clearImmediate) { function Timeout(id, clearFn) { this._id = id, this._clearFn = clearFn; } var nextTick = __webpack_require__(72).nextTick, apply = Function.prototype.apply, slice = Array.prototype.slice, immediateIds = {}, nextImmediateId = 0; exports.setTimeout = function() { return new Timeout(apply.call(setTimeout, window, arguments), clearTimeout); }, exports.setInterval = function() { return new Timeout(apply.call(setInterval, window, arguments), clearInterval); }, exports.clearTimeout = exports.clearInterval = function(timeout) { timeout.close(); }, Timeout.prototype.unref = Timeout.prototype.ref = function() {}, Timeout.prototype.close = function() { this._clearFn.call(window, this._id); }, exports.enroll = function(item, msecs) { clearTimeout(item._idleTimeoutId), item._idleTimeout = msecs; }, exports.unenroll = function(item) { clearTimeout(item._idleTimeoutId), item._idleTimeout = -1; }, exports._unrefActive = exports.active = function(item) { clearTimeout(item._idleTimeoutId); var msecs = item._idleTimeout; msecs >= 0 && (item._idleTimeoutId = setTimeout(function() { item._onTimeout && item._onTimeout(); }, msecs)); }, exports.setImmediate = "function" == typeof setImmediate ? setImmediate : function(fn) { var id = nextImmediateId++, args = !(arguments.length < 2) && slice.call(arguments, 1); return immediateIds[id] = !0, nextTick(function() { immediateIds[id] && (args ? fn.apply(null, args) : fn.call(null), exports.clearImmediate(id)); }), id; }, exports.clearImmediate = "function" == typeof clearImmediate ? clearImmediate : function(id) { delete immediateIds[id]; }; }).call(exports, __webpack_require__(71).setImmediate, __webpack_require__(71).clearImmediate); }, function(module, exports) { function defaultSetTimout() { throw new Error("setTimeout has not been defined"); } function defaultClearTimeout() { throw new Error("clearTimeout has not been defined"); } function runTimeout(fun) { if (cachedSetTimeout === setTimeout) return setTimeout(fun, 0); if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) return cachedSetTimeout = setTimeout, setTimeout(fun, 0); try { return cachedSetTimeout(fun, 0); } catch (e) { try { return cachedSetTimeout.call(null, fun, 0); } catch (e) { return cachedSetTimeout.call(this, fun, 0); } } } function runClearTimeout(marker) { if (cachedClearTimeout === clearTimeout) return clearTimeout(marker); if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) return cachedClearTimeout = clearTimeout, clearTimeout(marker); try { return cachedClearTimeout(marker); } catch (e) { try { return cachedClearTimeout.call(null, marker); } catch (e) { return cachedClearTimeout.call(this, marker); } } } function cleanUpNextTick() { draining && currentQueue && (draining = !1, currentQueue.length ? queue = currentQueue.concat(queue) : queueIndex = -1, queue.length && drainQueue()); } function drainQueue() { if (!draining) { var timeout = runTimeout(cleanUpNextTick); draining = !0; for (var len = queue.length; len; ) { for (currentQueue = queue, queue = []; ++queueIndex < len; ) currentQueue && currentQueue[queueIndex].run(); queueIndex = -1, len = queue.length; } currentQueue = null, draining = !1, runClearTimeout(timeout); } } function Item(fun, array) { this.fun = fun, this.array = array; } function noop() {} var cachedSetTimeout, cachedClearTimeout, process = module.exports = {}; !function() { try { cachedSetTimeout = "function" == typeof setTimeout ? setTimeout : defaultSetTimout; } catch (e) { cachedSetTimeout = defaultSetTimout; } try { cachedClearTimeout = "function" == typeof clearTimeout ? clearTimeout : defaultClearTimeout; } catch (e) { cachedClearTimeout = defaultClearTimeout; } }(); var currentQueue, queue = [], draining = !1, queueIndex = -1; 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)), 1 !== queue.length || draining || runTimeout(drainQueue); }, Item.prototype.run = function() { this.fun.apply(null, this.array); }, process.title = "browser", process.browser = !0, process.env = {}, process.argv = [], process.version = "", process.versions = {}, process.on = noop, process.addListener = noop, process.once = noop, process.off = noop, process.removeListener = noop, process.removeAllListeners = noop, process.emit = noop, 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; }; }, function(module, exports, __webpack_require__) { "use strict"; 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 || "object" != typeof call && "function" != typeof call ? self : call; } function _inherits(subClass, superClass) { if ("function" != typeof superClass && null !== superClass) 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: !1, writable: !0, configurable: !0 } }), superClass && (Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass); } var _createClass = function() { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0, "value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor); } } return function(Constructor, protoProps, staticProps) { return protoProps && defineProperties(Constructor.prototype, protoProps), staticProps && defineProperties(Constructor, staticProps), Constructor; }; }(), React = __webpack_require__(12), Portal = __webpack_require__(74), nullthrows = __webpack_require__(3)["default"], ColorPicker = __webpack_require__(80), Input = __webpack_require__(23), _require = __webpack_require__(17), monospace = _require.monospace, _require2 = __webpack_require__(55), getBrightness = _require2.getBrightness, isBright = _require2.isBright, ColorInput = function(_React$Component) { function ColorInput(props, context) { _classCallCheck(this, ColorInput); var _this = _possibleConstructorReturn(this, (ColorInput.__proto__ || Object.getPrototypeOf(ColorInput)).call(this, props, context)); _initialiseProps.call(_this); var customTheme = props.customTheme, propertyName = props.propertyName; return _this.state = { color: customTheme[propertyName], isColorPickerOpen: !1, maxHeight: null, targetPosition: { left: 0, top: 0 } }, _this; } return _inherits(ColorInput, _React$Component), _createClass(ColorInput, [ { key: "componentWillReceiveProps", value: function(nextProps) { var customTheme = nextProps.customTheme, propertyName = nextProps.propertyName; this.setState({ color: customTheme[propertyName] }); } }, { key: "render", value: function() { var _props = this.props, label = _props.label, theme = _props.theme, _state = this.state, color = _state.color, isColorPickerOpen = _state.isColorPickerOpen, maxHeight = _state.maxHeight, targetPosition = _state.targetPosition, backgroundIsBright = isBright(theme.base00), chipIsBright = isBright(color), showColorChipBorder = backgroundIsBright === chipIsBright && getBrightness(color) > getBrightness(theme.base03); return React.createElement("div", { ref: this._setContainerRef, style: containerStyle(maxHeight) }, React.createElement("label", { style: styles.label }, label), React.createElement("div", { style: inputContainerStyle(theme) }, React.createElement("div", { onClick: this._onClick, ref: this._setColorChipRef, style: colorChipStyle(theme, color, showColorChipBorder) }), React.createElement(Input, { onChange: this._onChange, style: styles.input, theme: theme, type: "text", value: color || "" })), React.createElement(Portal, { closeOnEsc: !0, closeOnOutsideClick: !0, isOpened: isColorPickerOpen, onClose: this._onClose }, React.createElement("div", { style: colorPickerPosition(targetPosition) }, React.createElement(ColorPicker, { color: color, theme: theme, updateColor: this._updateColor })))); } } ]), ColorInput; }(React.Component), _initialiseProps = function() { var _this2 = this; this._onChange = function(_ref) { var target = _ref.target; _this2._updateColor(target.value); }, this._onClick = function(event) { var container = nullthrows(_this2._containerRef), targetPosition = nullthrows(_this2._colorChipRef).getBoundingClientRect(); _this2.setState({ isColorPickerOpen: !0, maxHeight: container.offsetHeight, targetPosition: targetPosition }); }, this._onClose = function() { _this2.setState({ isColorPickerOpen: !1 }); }, this._setColorChipRef = function(ref) { _this2._colorChipRef = ref; }, this._setContainerRef = function(ref) { _this2._containerRef = ref; }, this._updateColor = function(color) { var _props2 = _this2.props, customTheme = _props2.customTheme, propertyName = _props2.propertyName, udpatePreview = _props2.udpatePreview; customTheme[propertyName] = color, _this2.setState({ color: color }), udpatePreview(); }; }, colorPickerPosition = function(position) { return { position: "absolute", left: position.left + "px", top: position.top + "px" }; }, containerStyle = function(maxHeight) { return { margin: "0.25rem", minWidth: "7.5rem", maxHeight: maxHeight }; }, colorChipStyle = function(theme) { var color = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : "", showBorder = arguments.length > 2 && void 0 !== arguments[2] && arguments[2]; return { height: "1.25rem", width: "1.25rem", borderRadius: "2px", backgroundColor: color, boxSizing: "border-box", border: showBorder ? "1px solid " + theme.base03 : "none" }; }, inputContainerStyle = function(theme) { return { display: "flex", flexDirection: "row", alignItems: "center", padding: "0.125rem", flex: "0 0 1.25rem", backgroundColor: theme.base00, color: theme.base05, border: "1px solid " + theme.base03, borderRadius: "0.25rem" }; }, styles = { input: { width: "5rem", flex: "1 0 auto", textTransform: "lowercase", boxSizing: "border-box", background: "transparent", border: "none", marginLeft: "0.25rem", outline: "none", color: "inherit", fontFamily: monospace.family, fontSize: monospace.sizes.large }, label: { marginBottom: "0.25rem", display: "inline-block" }, small: { fontWeight: "normal" } }; module.exports = ColorInput; }, function(module, exports, __webpack_require__) { "use strict"; 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 || "object" != typeof call && "function" != typeof call ? self : call; } function _inherits(subClass, superClass) { if ("function" != typeof superClass && null !== superClass) 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: !1, writable: !0, configurable: !0 } }), superClass && (Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass); } Object.defineProperty(exports, "__esModule", { value: !0 }); var _createClass = function() { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0, "value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor); } } return function(Constructor, protoProps, staticProps) { return protoProps && defineProperties(Constructor.prototype, protoProps), staticProps && defineProperties(Constructor, staticProps), Constructor; }; }(), _react = __webpack_require__(12), _react2 = _interopRequireDefault(_react), _reactDom = __webpack_require__(26), _reactDom2 = _interopRequireDefault(_reactDom), _propTypes = __webpack_require__(75), _propTypes2 = _interopRequireDefault(_propTypes), KEYCODES = { ESCAPE: 27 }, Portal = function(_React$Component) { function Portal() { _classCallCheck(this, Portal); var _this = _possibleConstructorReturn(this, (Portal.__proto__ || Object.getPrototypeOf(Portal)).call(this)); return _this.state = { active: !1 }, _this.handleWrapperClick = _this.handleWrapperClick.bind(_this), _this.closePortal = _this.closePortal.bind(_this), _this.handleOutsideMouseClick = _this.handleOutsideMouseClick.bind(_this), _this.handleKeydown = _this.handleKeydown.bind(_this), _this.portal = null, _this.node = null, _this; } return _inherits(Portal, _React$Component), _createClass(Portal, [ { key: "componentDidMount", value: function() { this.props.closeOnEsc && document.addEventListener("keydown", this.handleKeydown), this.props.closeOnOutsideClick && (document.addEventListener("mouseup", this.handleOutsideMouseClick), document.addEventListener("touchstart", this.handleOutsideMouseClick)), this.props.isOpened && this.openPortal(); } }, { key: "componentWillReceiveProps", value: function(newProps) { "undefined" != typeof newProps.isOpened && (newProps.isOpened && (this.state.active ? this.renderPortal(newProps) : this.openPortal(newProps)), !newProps.isOpened && this.state.active && this.closePortal()), "undefined" == typeof newProps.isOpened && this.state.active && this.renderPortal(newProps); } }, { key: "componentWillUnmount", value: function() { this.props.closeOnEsc && document.removeEventListener("keydown", this.handleKeydown), this.props.closeOnOutsideClick && (document.removeEventListener("mouseup", this.handleOutsideMouseClick), document.removeEventListener("touchstart", this.handleOutsideMouseClick)), this.closePortal(!0); } }, { key: "handleWrapperClick", value: function(e) { e.preventDefault(), e.stopPropagation(), this.state.active || this.openPortal(); } }, { key: "openPortal", value: function() { var props = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : this.props; this.setState({ active: !0 }), this.renderPortal(props), this.props.onOpen(this.node); } }, { key: "closePortal", value: function() { var _this2 = this, isUnmounted = arguments.length > 0 && void 0 !== arguments[0] && arguments[0], resetPortalState = function() { _this2.node && (_reactDom2["default"].unmountComponentAtNode(_this2.node), document.body.removeChild(_this2.node)), _this2.portal = null, _this2.node = null, isUnmounted !== !0 && _this2.setState({ active: !1 }); }; this.state.active && (this.props.beforeClose ? this.props.beforeClose(this.node, resetPortalState) : resetPortalState(), this.props.onClose()); } }, { key: "handleOutsideMouseClick", value: function(e) { if (this.state.active) { var root = (0, _reactDom.findDOMNode)(this.portal); root.contains(e.target) || e.button && 0 !== e.button || (e.stopPropagation(), this.closePortal()); } } }, { key: "handleKeydown", value: function(e) { e.keyCode === KEYCODES.ESCAPE && this.state.active && this.closePortal(); } }, { key: "renderPortal", value: function(props) { this.node || (this.node = document.createElement("div"), document.body.appendChild(this.node)); var children = props.children; "function" == typeof props.children.type && (children = _react2["default"].cloneElement(props.children, { closePortal: this.closePortal })), this.portal = _reactDom2["default"].unstable_renderSubtreeIntoContainer(this, children, this.node, this.props.onUpdate); } }, { key: "render", value: function() { return this.props.openByClickOn ? _react2["default"].cloneElement(this.props.openByClickOn, { onClick: this.handleWrapperClick }) : null; } } ]), Portal; }(_react2["default"].Component); exports["default"] = Portal, Portal.propTypes = { children: _propTypes2["default"].element.isRequired, openByClickOn: _propTypes2["default"].element, closeOnEsc: _propTypes2["default"].bool, closeOnOutsideClick: _propTypes2["default"].bool, isOpened: _propTypes2["default"].bool, onOpen: _propTypes2["default"].func, onClose: _propTypes2["default"].func, beforeClose: _propTypes2["default"].func, onUpdate: _propTypes2["default"].func }, Portal.defaultProps = { onOpen: function() {}, onClose: function() {}, onUpdate: function() {} }, module.exports = exports["default"]; }, function(module, exports, __webpack_require__) { module.exports = __webpack_require__(76)(); }, function(module, exports, __webpack_require__) { "use strict"; var emptyFunction = __webpack_require__(77), invariant = __webpack_require__(78), ReactPropTypesSecret = __webpack_require__(79); module.exports = function() { function shim(props, propName, componentName, location, propFullName, secret) { secret !== ReactPropTypesSecret && invariant(!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 getShim() { return shim; } shim.isRequired = shim; 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 }; return ReactPropTypes.checkPropTypes = emptyFunction, ReactPropTypes.PropTypes = ReactPropTypes, ReactPropTypes; }; }, function(module, exports) { "use strict"; function makeEmptyFunction(arg) { return function() { return arg; }; } var emptyFunction = function() {}; emptyFunction.thatReturns = makeEmptyFunction, emptyFunction.thatReturnsFalse = makeEmptyFunction(!1), emptyFunction.thatReturnsTrue = makeEmptyFunction(!0), emptyFunction.thatReturnsNull = makeEmptyFunction(null), emptyFunction.thatReturnsThis = function() { return this; }, emptyFunction.thatReturnsArgument = function(arg) { return arg; }, module.exports = emptyFunction; }, function(module, exports, __webpack_require__) { "use strict"; function invariant(condition, format, a, b, c, d, e, f) { if (validateFormat(format), !condition) { var error; if (void 0 === format) 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 ], argIndex = 0; error = new Error(format.replace(/%s/g, function() { return args[argIndex++]; })), error.name = "Invariant Violation"; } throw error.framesToPop = 1, error; } } var validateFormat = function(format) {}; module.exports = invariant; }, function(module, exports) { "use strict"; var ReactPropTypesSecret = "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"; module.exports = ReactPropTypesSecret; }, function(module, exports, __webpack_require__) { "use strict"; 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 || "object" != typeof call && "function" != typeof call ? self : call; } function _inherits(subClass, superClass) { if ("function" != typeof superClass && null !== superClass) 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: !1, writable: !0, configurable: !0 } }), superClass && (Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass); } var _extends = Object.assign || function(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) Object.prototype.hasOwnProperty.call(source, key) && (target[key] = source[key]); } return target; }, _createClass = function() { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0, "value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor); } } return function(Constructor, protoProps, staticProps) { return protoProps && defineProperties(Constructor.prototype, protoProps), staticProps && defineProperties(Constructor, staticProps), Constructor; }; }(), React = __webpack_require__(12), _require = __webpack_require__(81), CustomPicker = _require.CustomPicker, _require2 = __webpack_require__(249), Hue = _require2.Hue, Saturation = _require2.Saturation, ColorPicker = function(_React$Component) { function ColorPicker() { var _ref, _temp, _this, _ret; _classCallCheck(this, ColorPicker); for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) args[_key] = arguments[_key]; return _temp = _this = _possibleConstructorReturn(this, (_ref = ColorPicker.__proto__ || Object.getPrototypeOf(ColorPicker)).call.apply(_ref, [ this ].concat(args))), _this._onChangeComplete = function(color) { _this.props.updateColor(color.hex); }, _this._setRef = function(ref) { _this._ref = ref; }, _ret = _temp, _possibleConstructorReturn(_this, _ret); } return _inherits(ColorPicker, _React$Component), _createClass(ColorPicker, [ { key: "render", value: function() { var _props = this.props, color = _props.color, theme = _props.theme; return React.createElement(DecoratedCustomColorPicker, { color: color, disableAlpha: !0, onChangeComplete: this._onChangeComplete, ref: this._setRef, theme: theme }); } } ]), ColorPicker; }(React.Component), CustomColorPicker = function(_React$Component2) { function CustomColorPicker() { return _classCallCheck(this, CustomColorPicker), _possibleConstructorReturn(this, (CustomColorPicker.__proto__ || Object.getPrototypeOf(CustomColorPicker)).apply(this, arguments)); } return _inherits(CustomColorPicker, _React$Component2), _createClass(CustomColorPicker, [ { key: "render", value: function() { return React.createElement("div", { style: customColorPicker(this.props.theme) }, React.createElement("div", { style: styles.saturation }, React.createElement(Saturation, _extends({}, this.props, { onChange: this.props.onChange, pointer: CustomPointer }))), React.createElement("div", { style: styles.hue }, React.createElement(Hue, _extends({}, this.props, { direction: "vertical", onChange: this.props.onChange, pointer: CustomPointer })))); } } ]), CustomColorPicker; }(React.Component), CustomPointer = function() { return React.createElement("div", { style: styles.pointer }); }, DecoratedCustomColorPicker = CustomPicker(CustomColorPicker), customColorPicker = function(theme) { return { display: "flex", flexDirection: "row", padding: "0.125rem", borderRadius: "0.25rem", position: "relative", zIndex: 1, background: theme.base00, border: "1px solid " + theme.base03 }; }, styles = { saturation: { flex: "0 0 auto", position: "relative", width: "6rem", height: "6rem" }, hue: { flex: "1 0 auto", position: "relative", width: "0.75rem", height: "6rem", marginLeft: "0.125rem" }, pointer: { width: "0.25rem", height: "0.25rem", borderRadius: "50%", transform: "translate(-0.125rem, -0.125rem)", boxShadow: "rgb(255, 255, 255) 0px 0px 0px 1.5px, rgba(0, 0, 0, 0.3) 0px 0px 1px 1px inset, rgba(0, 0, 0, 0.4) 0px 0px 1px 2px" } }; module.exports = ColorPicker; }, function(module, exports, __webpack_require__) { "use strict"; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } Object.defineProperty(exports, "__esModule", { value: !0 }), exports.CustomPicker = exports.TwitterPicker = exports.SwatchesPicker = exports.SliderPicker = exports.SketchPicker = exports.PhotoshopPicker = exports.MaterialPicker = exports.HuePicker = exports.GithubPicker = exports.CompactPicker = exports.ChromePicker = exports["default"] = exports.CirclePicker = exports.BlockPicker = exports.AlphaPicker = void 0; var _Alpha = __webpack_require__(82); Object.defineProperty(exports, "AlphaPicker", { enumerable: !0, get: function() { return _interopRequireDefault(_Alpha)["default"]; } }); var _Block = __webpack_require__(270); Object.defineProperty(exports, "BlockPicker", { enumerable: !0, get: function() { return _interopRequireDefault(_Block)["default"]; } }); var _Circle = __webpack_require__(272); Object.defineProperty(exports, "CirclePicker", { enumerable: !0, get: function() { return _interopRequireDefault(_Circle)["default"]; } }); var _Chrome = __webpack_require__(275); Object.defineProperty(exports, "ChromePicker", { enumerable: !0, get: function() { return _interopRequireDefault(_Chrome)["default"]; } }); var _Compact = __webpack_require__(279); Object.defineProperty(exports, "CompactPicker", { enumerable: !0, get: function() { return _interopRequireDefault(_Compact)["default"]; } }); var _Github = __webpack_require__(293); Object.defineProperty(exports, "GithubPicker", { enumerable: !0, get: function() { return _interopRequireDefault(_Github)["default"]; } }); var _Hue = __webpack_require__(295); Object.defineProperty(exports, "HuePicker", { enumerable: !0, get: function() { return _interopRequireDefault(_Hue)["default"]; } }); var _Material = __webpack_require__(297); Object.defineProperty(exports, "MaterialPicker", { enumerable: !0, get: function() { return _interopRequireDefault(_Material)["default"]; } }); var _Photoshop = __webpack_require__(298); Object.defineProperty(exports, "PhotoshopPicker", { enumerable: !0, get: function() { return _interopRequireDefault(_Photoshop)["default"]; } }); var _Sketch = __webpack_require__(304); Object.defineProperty(exports, "SketchPicker", { enumerable: !0, get: function() { return _interopRequireDefault(_Sketch)["default"]; } }); var _Slider = __webpack_require__(307); Object.defineProperty(exports, "SliderPicker", { enumerable: !0, get: function() { return _interopRequireDefault(_Slider)["default"]; } }); var _Swatches = __webpack_require__(311); Object.defineProperty(exports, "SwatchesPicker", { enumerable: !0, get: function() { return _interopRequireDefault(_Swatches)["default"]; } }); var _Twitter = __webpack_require__(314); Object.defineProperty(exports, "TwitterPicker", { enumerable: !0, get: function() { return _interopRequireDefault(_Twitter)["default"]; } }); var _ColorWrap = __webpack_require__(263); Object.defineProperty(exports, "CustomPicker", { enumerable: !0, get: function() { return _interopRequireDefault(_ColorWrap)["default"]; } }); var _Chrome2 = _interopRequireDefault(_Chrome); exports["default"] = _Chrome2["default"]; }, function(module, exports, __webpack_require__) { "use strict"; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } Object.defineProperty(exports, "__esModule", { value: !0 }), exports.AlphaPicker = void 0; var _extends = Object.assign || function(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) Object.prototype.hasOwnProperty.call(source, key) && (target[key] = source[key]); } return target; }, _react = __webpack_require__(12), _react2 = _interopRequireDefault(_react), _reactcss = __webpack_require__(83), _reactcss2 = _interopRequireDefault(_reactcss), _common = __webpack_require__(249), _AlphaPointer = __webpack_require__(269), _AlphaPointer2 = _interopRequireDefault(_AlphaPointer), AlphaPicker = exports.AlphaPicker = function(_ref) { var rgb = _ref.rgb, hsl = _ref.hsl, width = _ref.width, height = _ref.height, onChange = _ref.onChange, direction = _ref.direction, style = _ref.style, renderers = _ref.renderers, pointer = _ref.pointer, styles = (0, _reactcss2["default"])({ "default": { picker: { position: "relative", width: width, height: height }, alpha: { radius: "2px", style: style } } }); return _react2["default"].createElement("div", { style: styles.picker, className: "alpha-picker" }, _react2["default"].createElement(_common.Alpha, _extends({}, styles.alpha, { rgb: rgb, hsl: hsl, pointer: pointer, renderers: renderers, onChange: onChange, direction: direction }))); }; AlphaPicker.defaultProps = { width: "316px", height: "16px", direction: "horizontal", pointer: _AlphaPointer2["default"] }, exports["default"] = (0, _common.ColorWrap)(AlphaPicker); }, function(module, exports, __webpack_require__) { "use strict"; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } Object.defineProperty(exports, "__esModule", { value: !0 }), exports.ReactCSS = exports.loop = exports.handleActive = exports.handleHover = exports.hover = void 0; var _flattenNames = __webpack_require__(84), _flattenNames2 = _interopRequireDefault(_flattenNames), _mergeClasses = __webpack_require__(212), _mergeClasses2 = _interopRequireDefault(_mergeClasses), _autoprefix = __webpack_require__(245), _autoprefix2 = _interopRequireDefault(_autoprefix), _hover2 = __webpack_require__(246), _hover3 = _interopRequireDefault(_hover2), _active = __webpack_require__(247), _active2 = _interopRequireDefault(_active), _loop2 = __webpack_require__(248), _loop3 = _interopRequireDefault(_loop2); exports.hover = _hover3["default"], exports.handleHover = _hover3["default"], exports.handleActive = _active2["default"], exports.loop = _loop3["default"]; var ReactCSS = exports.ReactCSS = function(classes) { for (var _len = arguments.length, activations = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) activations[_key - 1] = arguments[_key]; var activeNames = (0, _flattenNames2["default"])(activations), merged = (0, _mergeClasses2["default"])(classes, activeNames); return (0, _autoprefix2["default"])(merged); }; exports["default"] = ReactCSS; }, function(module, exports, __webpack_require__) { "use strict"; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } Object.defineProperty(exports, "__esModule", { value: !0 }), exports.flattenNames = void 0; var _isString2 = __webpack_require__(85), _isString3 = _interopRequireDefault(_isString2), _forOwn2 = __webpack_require__(94), _forOwn3 = _interopRequireDefault(_forOwn2), _isPlainObject2 = __webpack_require__(121), _isPlainObject3 = _interopRequireDefault(_isPlainObject2), _map2 = __webpack_require__(123), _map3 = _interopRequireDefault(_map2), flattenNames = exports.flattenNames = function flattenNames() { var things = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : [], names = []; return (0, _map3["default"])(things, function(thing) { Array.isArray(thing) ? flattenNames(thing).map(function(name) { return names.push(name); }) : (0, _isPlainObject3["default"])(thing) ? (0, _forOwn3["default"])(thing, function(value, key) { value === !0 && names.push(key), names.push(key + "-" + value); }) : (0, _isString3["default"])(thing) && names.push(thing); }), names; }; exports["default"] = flattenNames; }, function(module, exports, __webpack_require__) { function isString(value) { return "string" == typeof value || !isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag; } var baseGetTag = __webpack_require__(86), isArray = __webpack_require__(92), isObjectLike = __webpack_require__(93), stringTag = "[object String]"; module.exports = isString; }, function(module, exports, __webpack_require__) { function baseGetTag(value) { return null == value ? void 0 === value ? undefinedTag : nullTag : symToStringTag && symToStringTag in Object(value) ? getRawTag(value) : objectToString(value); } var Symbol = __webpack_require__(87), getRawTag = __webpack_require__(90), objectToString = __webpack_require__(91), nullTag = "[object Null]", undefinedTag = "[object Undefined]", symToStringTag = Symbol ? Symbol.toStringTag : void 0; module.exports = baseGetTag; }, function(module, exports, __webpack_require__) { var root = __webpack_require__(88), Symbol = root.Symbol; module.exports = Symbol; }, function(module, exports, __webpack_require__) { var freeGlobal = __webpack_require__(89), freeSelf = "object" == typeof self && self && self.Object === Object && self, root = freeGlobal || freeSelf || Function("return this")(); module.exports = root; }, function(module, exports) { (function(global) { var freeGlobal = "object" == typeof global && global && global.Object === Object && global; module.exports = freeGlobal; }).call(exports, function() { return this; }()); }, function(module, exports, __webpack_require__) { function getRawTag(value) { var isOwn = hasOwnProperty.call(value, symToStringTag), tag = value[symToStringTag]; try { value[symToStringTag] = void 0; var unmasked = !0; } catch (e) {} var result = nativeObjectToString.call(value); return unmasked && (isOwn ? value[symToStringTag] = tag : delete value[symToStringTag]), result; } var Symbol = __webpack_require__(87), objectProto = Object.prototype, hasOwnProperty = objectProto.hasOwnProperty, nativeObjectToString = objectProto.toString, symToStringTag = Symbol ? Symbol.toStringTag : void 0; module.exports = getRawTag; }, function(module, exports) { function objectToString(value) { return nativeObjectToString.call(value); } var objectProto = Object.prototype, nativeObjectToString = objectProto.toString; module.exports = objectToString; }, function(module, exports) { var isArray = Array.isArray; module.exports = isArray; }, function(module, exports) { function isObjectLike(value) { return null != value && "object" == typeof value; } module.exports = isObjectLike; }, function(module, exports, __webpack_require__) { function forOwn(object, iteratee) { return object && baseForOwn(object, castFunction(iteratee)); } var baseForOwn = __webpack_require__(95), castFunction = __webpack_require__(119); module.exports = forOwn; }, function(module, exports, __webpack_require__) { function baseForOwn(object, iteratee) { return object && baseFor(object, iteratee, keys); } var baseFor = __webpack_require__(96), keys = __webpack_require__(98); module.exports = baseForOwn; }, function(module, exports, __webpack_require__) { var createBaseFor = __webpack_require__(97), baseFor = createBaseFor(); module.exports = baseFor; }, function(module, exports) { function createBaseFor(fromRight) { return function(object, iteratee, keysFunc) { for (var index = -1, iterable = Object(object), props = keysFunc(object), length = props.length; length--; ) { var key = props[fromRight ? length : ++index]; if (iteratee(iterable[key], key, iterable) === !1) break; } return object; }; } module.exports = createBaseFor; }, function(module, exports, __webpack_require__) { function keys(object) { return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object); } var arrayLikeKeys = __webpack_require__(99), baseKeys = __webpack_require__(112), isArrayLike = __webpack_require__(116); module.exports = keys; }, function(module, exports, __webpack_require__) { function arrayLikeKeys(value, inherited) { var isArr = isArray(value), isArg = !isArr && isArguments(value), isBuff = !isArr && !isArg && isBuffer(value), isType = !isArr && !isArg && !isBuff && isTypedArray(value), skipIndexes = isArr || isArg || isBuff || isType, result = skipIndexes ? baseTimes(value.length, String) : [], length = result.length; for (var key in value) !inherited && !hasOwnProperty.call(value, key) || skipIndexes && ("length" == key || isBuff && ("offset" == key || "parent" == key) || isType && ("buffer" == key || "byteLength" == key || "byteOffset" == key) || isIndex(key, length)) || result.push(key); return result; } var baseTimes = __webpack_require__(100), isArguments = __webpack_require__(101), isArray = __webpack_require__(92), isBuffer = __webpack_require__(103), isIndex = __webpack_require__(106), isTypedArray = __webpack_require__(107), objectProto = Object.prototype, hasOwnProperty = objectProto.hasOwnProperty; module.exports = arrayLikeKeys; }, function(module, exports) { function baseTimes(n, iteratee) { for (var index = -1, result = Array(n); ++index < n; ) result[index] = iteratee(index); return result; } module.exports = baseTimes; }, function(module, exports, __webpack_require__) { var baseIsArguments = __webpack_require__(102), isObjectLike = __webpack_require__(93), objectProto = Object.prototype, hasOwnProperty = objectProto.hasOwnProperty, propertyIsEnumerable = objectProto.propertyIsEnumerable, isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) { return isObjectLike(value) && hasOwnProperty.call(value, "callee") && !propertyIsEnumerable.call(value, "callee"); }; module.exports = isArguments; }, function(module, exports, __webpack_require__) { function baseIsArguments(value) { return isObjectLike(value) && baseGetTag(value) == argsTag; } var baseGetTag = __webpack_require__(86), isObjectLike = __webpack_require__(93), argsTag = "[object Arguments]"; module.exports = baseIsArguments; }, function(module, exports, __webpack_require__) { (function(module) { var root = __webpack_require__(88), stubFalse = __webpack_require__(105), freeExports = "object" == typeof exports && exports && !exports.nodeType && exports, freeModule = freeExports && "object" == typeof module && module && !module.nodeType && module, moduleExports = freeModule && freeModule.exports === freeExports, Buffer = moduleExports ? root.Buffer : void 0, nativeIsBuffer = Buffer ? Buffer.isBuffer : void 0, isBuffer = nativeIsBuffer || stubFalse; module.exports = isBuffer; }).call(exports, __webpack_require__(104)(module)); }, function(module, exports) { module.exports = function(module) { return module.webpackPolyfill || (module.deprecate = function() {}, module.paths = [], module.children = [], module.webpackPolyfill = 1), module; }; }, function(module, exports) { function stubFalse() { return !1; } module.exports = stubFalse; }, function(module, exports) { function isIndex(value, length) { return length = null == length ? MAX_SAFE_INTEGER : length, !!length && ("number" == typeof value || reIsUint.test(value)) && value > -1 && value % 1 == 0 && value < length; } var MAX_SAFE_INTEGER = 9007199254740991, reIsUint = /^(?:0|[1-9]\d*)$/; module.exports = isIndex; }, function(module, exports, __webpack_require__) { var baseIsTypedArray = __webpack_require__(108), baseUnary = __webpack_require__(110), nodeUtil = __webpack_require__(111), nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray, isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray; module.exports = isTypedArray; }, function(module, exports, __webpack_require__) { function baseIsTypedArray(value) { return isObjectLike(value) && isLength(value.length) && !!typedArrayTags[baseGetTag(value)]; } var baseGetTag = __webpack_require__(86), isLength = __webpack_require__(109), isObjectLike = __webpack_require__(93), argsTag = "[object Arguments]", arrayTag = "[object Array]", boolTag = "[object Boolean]", dateTag = "[object Date]", errorTag = "[object Error]", funcTag = "[object Function]", mapTag = "[object Map]", numberTag = "[object Number]", objectTag = "[object Object]", regexpTag = "[object RegExp]", setTag = "[object Set]", stringTag = "[object String]", weakMapTag = "[object WeakMap]", arrayBufferTag = "[object ArrayBuffer]", dataViewTag = "[object DataView]", float32Tag = "[object Float32Array]", float64Tag = "[object Float64Array]", int8Tag = "[object Int8Array]", int16Tag = "[object Int16Array]", int32Tag = "[object Int32Array]", uint8Tag = "[object Uint8Array]", uint8ClampedTag = "[object Uint8ClampedArray]", uint16Tag = "[object Uint16Array]", uint32Tag = "[object Uint32Array]", typedArrayTags = {}; typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = typedArrayTags[uint32Tag] = !0, typedArrayTags[argsTag] = typedArrayTags[arrayTag] = typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = typedArrayTags[errorTag] = typedArrayTags[funcTag] = typedArrayTags[mapTag] = typedArrayTags[numberTag] = typedArrayTags[objectTag] = typedArrayTags[regexpTag] = typedArrayTags[setTag] = typedArrayTags[stringTag] = typedArrayTags[weakMapTag] = !1, module.exports = baseIsTypedArray; }, function(module, exports) { function isLength(value) { return "number" == typeof value && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; } var MAX_SAFE_INTEGER = 9007199254740991; module.exports = isLength; }, function(module, exports) { function baseUnary(func) { return function(value) { return func(value); }; } module.exports = baseUnary; }, function(module, exports, __webpack_require__) { (function(module) { var freeGlobal = __webpack_require__(89), freeExports = "object" == typeof exports && exports && !exports.nodeType && exports, freeModule = freeExports && "object" == typeof module && module && !module.nodeType && module, moduleExports = freeModule && freeModule.exports === freeExports, freeProcess = moduleExports && freeGlobal.process, nodeUtil = function() { try { return freeProcess && freeProcess.binding && freeProcess.binding("util"); } catch (e) {} }(); module.exports = nodeUtil; }).call(exports, __webpack_require__(104)(module)); }, function(module, exports, __webpack_require__) { function baseKeys(object) { if (!isPrototype(object)) return nativeKeys(object); var result = []; for (var key in Object(object)) hasOwnProperty.call(object, key) && "constructor" != key && result.push(key); return result; } var isPrototype = __webpack_require__(113), nativeKeys = __webpack_require__(114), objectProto = Object.prototype, hasOwnProperty = objectProto.hasOwnProperty; module.exports = baseKeys; }, function(module, exports) { function isPrototype(value) { var Ctor = value && value.constructor, proto = "function" == typeof Ctor && Ctor.prototype || objectProto; return value === proto; } var objectProto = Object.prototype; module.exports = isPrototype; }, function(module, exports, __webpack_require__) { var overArg = __webpack_require__(115), nativeKeys = overArg(Object.keys, Object); module.exports = nativeKeys; }, function(module, exports) { function overArg(func, transform) { return function(arg) { return func(transform(arg)); }; } module.exports = overArg; }, function(module, exports, __webpack_require__) { function isArrayLike(value) { return null != value && isLength(value.length) && !isFunction(value); } var isFunction = __webpack_require__(117), isLength = __webpack_require__(109); module.exports = isArrayLike; }, function(module, exports, __webpack_require__) { function isFunction(value) { if (!isObject(value)) return !1; var tag = baseGetTag(value); return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag; } var baseGetTag = __webpack_require__(86), isObject = __webpack_require__(118), asyncTag = "[object AsyncFunction]", funcTag = "[object Function]", genTag = "[object GeneratorFunction]", proxyTag = "[object Proxy]"; module.exports = isFunction; }, function(module, exports) { function isObject(value) { var type = typeof value; return null != value && ("object" == type || "function" == type); } module.exports = isObject; }, function(module, exports, __webpack_require__) { function castFunction(value) { return "function" == typeof value ? value : identity; } var identity = __webpack_require__(120); module.exports = castFunction; }, function(module, exports) { function identity(value) { return value; } module.exports = identity; }, function(module, exports, __webpack_require__) { function isPlainObject(value) { if (!isObjectLike(value) || baseGetTag(value) != objectTag) return !1; var proto = getPrototype(value); if (null === proto) return !0; var Ctor = hasOwnProperty.call(proto, "constructor") && proto.constructor; return "function" == typeof Ctor && Ctor instanceof Ctor && funcToString.call(Ctor) == objectCtorString; } var baseGetTag = __webpack_require__(86), getPrototype = __webpack_require__(122), isObjectLike = __webpack_require__(93), objectTag = "[object Object]", funcProto = Function.prototype, objectProto = Object.prototype, funcToString = funcProto.toString, hasOwnProperty = objectProto.hasOwnProperty, objectCtorString = funcToString.call(Object); module.exports = isPlainObject; }, function(module, exports, __webpack_require__) { var overArg = __webpack_require__(115), getPrototype = overArg(Object.getPrototypeOf, Object); module.exports = getPrototype; }, function(module, exports, __webpack_require__) { function map(collection, iteratee) { var func = isArray(collection) ? arrayMap : baseMap; return func(collection, baseIteratee(iteratee, 3)); } var arrayMap = __webpack_require__(124), baseIteratee = __webpack_require__(125), baseMap = __webpack_require__(209), isArray = __webpack_require__(92); module.exports = map; }, function(module, exports) { function arrayMap(array, iteratee) { for (var index = -1, length = null == array ? 0 : array.length, result = Array(length); ++index < length; ) result[index] = iteratee(array[index], index, array); return result; } module.exports = arrayMap; }, function(module, exports, __webpack_require__) { function baseIteratee(value) { return "function" == typeof value ? value : null == value ? identity : "object" == typeof value ? isArray(value) ? baseMatchesProperty(value[0], value[1]) : baseMatches(value) : property(value); } var baseMatches = __webpack_require__(126), baseMatchesProperty = __webpack_require__(191), identity = __webpack_require__(120), isArray = __webpack_require__(92), property = __webpack_require__(206); module.exports = baseIteratee; }, function(module, exports, __webpack_require__) { function baseMatches(source) { var matchData = getMatchData(source); return 1 == matchData.length && matchData[0][2] ? matchesStrictComparable(matchData[0][0], matchData[0][1]) : function(object) { return object === source || baseIsMatch(object, source, matchData); }; } var baseIsMatch = __webpack_require__(127), getMatchData = __webpack_require__(188), matchesStrictComparable = __webpack_require__(190); module.exports = baseMatches; }, function(module, exports, __webpack_require__) { function baseIsMatch(object, source, matchData, customizer) { var index = matchData.length, length = index, noCustomizer = !customizer; if (null == object) return !length; for (object = Object(object); index--; ) { var data = matchData[index]; if (noCustomizer && data[2] ? data[1] !== object[data[0]] : !(data[0] in object)) return !1; } for (;++index < length; ) { data = matchData[index]; var key = data[0], objValue = object[key], srcValue = data[1]; if (noCustomizer && data[2]) { if (void 0 === objValue && !(key in object)) return !1; } else { var stack = new Stack(); if (customizer) var result = customizer(objValue, srcValue, key, object, source, stack); if (!(void 0 === result ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack) : result)) return !1; } } return !0; } var Stack = __webpack_require__(128), baseIsEqual = __webpack_require__(164), COMPARE_PARTIAL_FLAG = 1, COMPARE_UNORDERED_FLAG = 2; module.exports = baseIsMatch; }, function(module, exports, __webpack_require__) { function Stack(entries) { var data = this.__data__ = new ListCache(entries); this.size = data.size; } var ListCache = __webpack_require__(129), stackClear = __webpack_require__(137), stackDelete = __webpack_require__(138), stackGet = __webpack_require__(139), stackHas = __webpack_require__(140), stackSet = __webpack_require__(141); Stack.prototype.clear = stackClear, Stack.prototype["delete"] = stackDelete, Stack.prototype.get = stackGet, Stack.prototype.has = stackHas, Stack.prototype.set = stackSet, module.exports = Stack; }, function(module, exports, __webpack_require__) { function ListCache(entries) { var index = -1, length = null == entries ? 0 : entries.length; for (this.clear(); ++index < length; ) { var entry = entries[index]; this.set(entry[0], entry[1]); } } var listCacheClear = __webpack_require__(130), listCacheDelete = __webpack_require__(131), listCacheGet = __webpack_require__(134), listCacheHas = __webpack_require__(135), listCacheSet = __webpack_require__(136); ListCache.prototype.clear = listCacheClear, ListCache.prototype["delete"] = listCacheDelete, ListCache.prototype.get = listCacheGet, ListCache.prototype.has = listCacheHas, ListCache.prototype.set = listCacheSet, module.exports = ListCache; }, function(module, exports) { function listCacheClear() { this.__data__ = [], this.size = 0; } module.exports = listCacheClear; }, function(module, exports, __webpack_require__) { function listCacheDelete(key) { var data = this.__data__, index = assocIndexOf(data, key); if (index < 0) return !1; var lastIndex = data.length - 1; return index == lastIndex ? data.pop() : splice.call(data, index, 1), --this.size, !0; } var assocIndexOf = __webpack_require__(132), arrayProto = Array.prototype, splice = arrayProto.splice; module.exports = listCacheDelete; }, function(module, exports, __webpack_require__) { function assocIndexOf(array, key) { for (var length = array.length; length--; ) if (eq(array[length][0], key)) return length; return -1; } var eq = __webpack_require__(133); module.exports = assocIndexOf; }, function(module, exports) { function eq(value, other) { return value === other || value !== value && other !== other; } module.exports = eq; }, function(module, exports, __webpack_require__) { function listCacheGet(key) { var data = this.__data__, index = assocIndexOf(data, key); return index < 0 ? void 0 : data[index][1]; } var assocIndexOf = __webpack_require__(132); module.exports = listCacheGet; }, function(module, exports, __webpack_require__) { function listCacheHas(key) { return assocIndexOf(this.__data__, key) > -1; } var assocIndexOf = __webpack_require__(132); module.exports = listCacheHas; }, function(module, exports, __webpack_require__) { function listCacheSet(key, value) { var data = this.__data__, index = assocIndexOf(data, key); return index < 0 ? (++this.size, data.push([ key, value ])) : data[index][1] = value, this; } var assocIndexOf = __webpack_require__(132); module.exports = listCacheSet; }, function(module, exports, __webpack_require__) { function stackClear() { this.__data__ = new ListCache(), this.size = 0; } var ListCache = __webpack_require__(129); module.exports = stackClear; }, function(module, exports) { function stackDelete(key) { var data = this.__data__, result = data["delete"](key); return this.size = data.size, result; } module.exports = stackDelete; }, function(module, exports) { function stackGet(key) { return this.__data__.get(key); } module.exports = stackGet; }, function(module, exports) { function stackHas(key) { return this.__data__.has(key); } module.exports = stackHas; }, function(module, exports, __webpack_require__) { function stackSet(key, value) { var data = this.__data__; if (data instanceof ListCache) { var pairs = data.__data__; if (!Map || pairs.length < LARGE_ARRAY_SIZE - 1) return pairs.push([ key, value ]), this.size = ++data.size, this; data = this.__data__ = new MapCache(pairs); } return data.set(key, value), this.size = data.size, this; } var ListCache = __webpack_require__(129), Map = __webpack_require__(142), MapCache = __webpack_require__(149), LARGE_ARRAY_SIZE = 200; module.exports = stackSet; }, function(module, exports, __webpack_require__) { var getNative = __webpack_require__(143), root = __webpack_require__(88), Map = getNative(root, "Map"); module.exports = Map; }, function(module, exports, __webpack_require__) { function getNative(object, key) { var value = getValue(object, key); return baseIsNative(value) ? value : void 0; } var baseIsNative = __webpack_require__(144), getValue = __webpack_require__(148); module.exports = getNative; }, function(module, exports, __webpack_require__) { function baseIsNative(value) { if (!isObject(value) || isMasked(value)) return !1; var pattern = isFunction(value) ? reIsNative : reIsHostCtor; return pattern.test(toSource(value)); } var isFunction = __webpack_require__(117), isMasked = __webpack_require__(145), isObject = __webpack_require__(118), toSource = __webpack_require__(147), reRegExpChar = /[\\^$.*+?()[\]{}|]/g, reIsHostCtor = /^\[object .+?Constructor\]$/, funcProto = Function.prototype, objectProto = Object.prototype, funcToString = funcProto.toString, hasOwnProperty = objectProto.hasOwnProperty, reIsNative = RegExp("^" + funcToString.call(hasOwnProperty).replace(reRegExpChar, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"); module.exports = baseIsNative; }, function(module, exports, __webpack_require__) { function isMasked(func) { return !!maskSrcKey && maskSrcKey in func; } var coreJsData = __webpack_require__(146), maskSrcKey = function() { var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || ""); return uid ? "Symbol(src)_1." + uid : ""; }(); module.exports = isMasked; }, function(module, exports, __webpack_require__) { var root = __webpack_require__(88), coreJsData = root["__core-js_shared__"]; module.exports = coreJsData; }, function(module, exports) { function toSource(func) { if (null != func) { try { return funcToString.call(func); } catch (e) {} try { return func + ""; } catch (e) {} } return ""; } var funcProto = Function.prototype, funcToString = funcProto.toString; module.exports = toSource; }, function(module, exports) { function getValue(object, key) { return null == object ? void 0 : object[key]; } module.exports = getValue; }, function(module, exports, __webpack_require__) { function MapCache(entries) { var index = -1, length = null == entries ? 0 : entries.length; for (this.clear(); ++index < length; ) { var entry = entries[index]; this.set(entry[0], entry[1]); } } var mapCacheClear = __webpack_require__(150), mapCacheDelete = __webpack_require__(158), mapCacheGet = __webpack_require__(161), mapCacheHas = __webpack_require__(162), mapCacheSet = __webpack_require__(163); MapCache.prototype.clear = mapCacheClear, MapCache.prototype["delete"] = mapCacheDelete, MapCache.prototype.get = mapCacheGet, MapCache.prototype.has = mapCacheHas, MapCache.prototype.set = mapCacheSet, module.exports = MapCache; }, function(module, exports, __webpack_require__) { function mapCacheClear() { this.size = 0, this.__data__ = { hash: new Hash(), map: new (Map || ListCache)(), string: new Hash() }; } var Hash = __webpack_require__(151), ListCache = __webpack_require__(129), Map = __webpack_require__(142); module.exports = mapCacheClear; }, function(module, exports, __webpack_require__) { function Hash(entries) { var index = -1, length = null == entries ? 0 : entries.length; for (this.clear(); ++index < length; ) { var entry = entries[index]; this.set(entry[0], entry[1]); } } var hashClear = __webpack_require__(152), hashDelete = __webpack_require__(154), hashGet = __webpack_require__(155), hashHas = __webpack_require__(156), hashSet = __webpack_require__(157); Hash.prototype.clear = hashClear, Hash.prototype["delete"] = hashDelete, Hash.prototype.get = hashGet, Hash.prototype.has = hashHas, Hash.prototype.set = hashSet, module.exports = Hash; }, function(module, exports, __webpack_require__) { function hashClear() { this.__data__ = nativeCreate ? nativeCreate(null) : {}, this.size = 0; } var nativeCreate = __webpack_require__(153); module.exports = hashClear; }, function(module, exports, __webpack_require__) { var getNative = __webpack_require__(143), nativeCreate = getNative(Object, "create"); module.exports = nativeCreate; }, function(module, exports) { function hashDelete(key) { var result = this.has(key) && delete this.__data__[key]; return this.size -= result ? 1 : 0, result; } module.exports = hashDelete; }, function(module, exports, __webpack_require__) { function hashGet(key) { var data = this.__data__; if (nativeCreate) { var result = data[key]; return result === HASH_UNDEFINED ? void 0 : result; } return hasOwnProperty.call(data, key) ? data[key] : void 0; } var nativeCreate = __webpack_require__(153), HASH_UNDEFINED = "__lodash_hash_undefined__", objectProto = Object.prototype, hasOwnProperty = objectProto.hasOwnProperty; module.exports = hashGet; }, function(module, exports, __webpack_require__) { function hashHas(key) { var data = this.__data__; return nativeCreate ? void 0 !== data[key] : hasOwnProperty.call(data, key); } var nativeCreate = __webpack_require__(153), objectProto = Object.prototype, hasOwnProperty = objectProto.hasOwnProperty; module.exports = hashHas; }, function(module, exports, __webpack_require__) { function hashSet(key, value) { var data = this.__data__; return this.size += this.has(key) ? 0 : 1, data[key] = nativeCreate && void 0 === value ? HASH_UNDEFINED : value, this; } var nativeCreate = __webpack_require__(153), HASH_UNDEFINED = "__lodash_hash_undefined__"; module.exports = hashSet; }, function(module, exports, __webpack_require__) { function mapCacheDelete(key) { var result = getMapData(this, key)["delete"](key); return this.size -= result ? 1 : 0, result; } var getMapData = __webpack_require__(159); module.exports = mapCacheDelete; }, function(module, exports, __webpack_require__) { function getMapData(map, key) { var data = map.__data__; return isKeyable(key) ? data["string" == typeof key ? "string" : "hash"] : data.map; } var isKeyable = __webpack_require__(160); module.exports = getMapData; }, function(module, exports) { function isKeyable(value) { var type = typeof value; return "string" == type || "number" == type || "symbol" == type || "boolean" == type ? "__proto__" !== value : null === value; } module.exports = isKeyable; }, function(module, exports, __webpack_require__) { function mapCacheGet(key) { return getMapData(this, key).get(key); } var getMapData = __webpack_require__(159); module.exports = mapCacheGet; }, function(module, exports, __webpack_require__) { function mapCacheHas(key) { return getMapData(this, key).has(key); } var getMapData = __webpack_require__(159); module.exports = mapCacheHas; }, function(module, exports, __webpack_require__) { function mapCacheSet(key, value) { var data = getMapData(this, key), size = data.size; return data.set(key, value), this.size += data.size == size ? 0 : 1, this; } var getMapData = __webpack_require__(159); module.exports = mapCacheSet; }, function(module, exports, __webpack_require__) { function baseIsEqual(value, other, bitmask, customizer, stack) { return value === other || (null == value || null == other || !isObjectLike(value) && !isObjectLike(other) ? value !== value && other !== other : baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack)); } var baseIsEqualDeep = __webpack_require__(165), isObjectLike = __webpack_require__(93); module.exports = baseIsEqual; }, function(module, exports, __webpack_require__) { function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) { var objIsArr = isArray(object), othIsArr = isArray(other), objTag = objIsArr ? arrayTag : getTag(object), othTag = othIsArr ? arrayTag : getTag(other); objTag = objTag == argsTag ? objectTag : objTag, othTag = othTag == argsTag ? objectTag : othTag; var objIsObj = objTag == objectTag, othIsObj = othTag == objectTag, isSameTag = objTag == othTag; if (isSameTag && isBuffer(object)) { if (!isBuffer(other)) return !1; objIsArr = !0, objIsObj = !1; } if (isSameTag && !objIsObj) return stack || (stack = new Stack()), objIsArr || isTypedArray(object) ? equalArrays(object, other, bitmask, customizer, equalFunc, stack) : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack); if (!(bitmask & COMPARE_PARTIAL_FLAG)) { var objIsWrapped = objIsObj && hasOwnProperty.call(object, "__wrapped__"), othIsWrapped = othIsObj && hasOwnProperty.call(other, "__wrapped__"); if (objIsWrapped || othIsWrapped) { var objUnwrapped = objIsWrapped ? object.value() : object, othUnwrapped = othIsWrapped ? other.value() : other; return stack || (stack = new Stack()), equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack); } } return !!isSameTag && (stack || (stack = new Stack()), equalObjects(object, other, bitmask, customizer, equalFunc, stack)); } var Stack = __webpack_require__(128), equalArrays = __webpack_require__(166), equalByTag = __webpack_require__(172), equalObjects = __webpack_require__(176), getTag = __webpack_require__(183), isArray = __webpack_require__(92), isBuffer = __webpack_require__(103), isTypedArray = __webpack_require__(107), COMPARE_PARTIAL_FLAG = 1, argsTag = "[object Arguments]", arrayTag = "[object Array]", objectTag = "[object Object]", objectProto = Object.prototype, hasOwnProperty = objectProto.hasOwnProperty; module.exports = baseIsEqualDeep; }, function(module, exports, __webpack_require__) { function equalArrays(array, other, bitmask, customizer, equalFunc, stack) { var isPartial = bitmask & COMPARE_PARTIAL_FLAG, arrLength = array.length, othLength = other.length; if (arrLength != othLength && !(isPartial && othLength > arrLength)) return !1; var stacked = stack.get(array); if (stacked && stack.get(other)) return stacked == other; var index = -1, result = !0, seen = bitmask & COMPARE_UNORDERED_FLAG ? new SetCache() : void 0; for (stack.set(array, other), stack.set(other, array); ++index < arrLength; ) { var arrValue = array[index], othValue = other[index]; if (customizer) var compared = isPartial ? customizer(othValue, arrValue, index, other, array, stack) : customizer(arrValue, othValue, index, array, other, stack); if (void 0 !== compared) { if (compared) continue; result = !1; break; } if (seen) { if (!arraySome(other, function(othValue, othIndex) { if (!cacheHas(seen, othIndex) && (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) return seen.push(othIndex); })) { result = !1; break; } } else if (arrValue !== othValue && !equalFunc(arrValue, othValue, bitmask, customizer, stack)) { result = !1; break; } } return stack["delete"](array), stack["delete"](other), result; } var SetCache = __webpack_require__(167), arraySome = __webpack_require__(170), cacheHas = __webpack_require__(171), COMPARE_PARTIAL_FLAG = 1, COMPARE_UNORDERED_FLAG = 2; module.exports = equalArrays; }, function(module, exports, __webpack_require__) { function SetCache(values) { var index = -1, length = null == values ? 0 : values.length; for (this.__data__ = new MapCache(); ++index < length; ) this.add(values[index]); } var MapCache = __webpack_require__(149), setCacheAdd = __webpack_require__(168), setCacheHas = __webpack_require__(169); SetCache.prototype.add = SetCache.prototype.push = setCacheAdd, SetCache.prototype.has = setCacheHas, module.exports = SetCache; }, function(module, exports) { function setCacheAdd(value) { return this.__data__.set(value, HASH_UNDEFINED), this; } var HASH_UNDEFINED = "__lodash_hash_undefined__"; module.exports = setCacheAdd; }, function(module, exports) { function setCacheHas(value) { return this.__data__.has(value); } module.exports = setCacheHas; }, function(module, exports) { function arraySome(array, predicate) { for (var index = -1, length = null == array ? 0 : array.length; ++index < length; ) if (predicate(array[index], index, array)) return !0; return !1; } module.exports = arraySome; }, function(module, exports) { function cacheHas(cache, key) { return cache.has(key); } module.exports = cacheHas; }, function(module, exports, __webpack_require__) { function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) { switch (tag) { case dataViewTag: if (object.byteLength != other.byteLength || object.byteOffset != other.byteOffset) return !1; object = object.buffer, other = other.buffer; case arrayBufferTag: return !(object.byteLength != other.byteLength || !equalFunc(new Uint8Array(object), new Uint8Array(other))); case boolTag: case dateTag: case numberTag: return eq(+object, +other); case errorTag: return object.name == other.name && object.message == other.message; case regexpTag: case stringTag: return object == other + ""; case mapTag: var convert = mapToArray; case setTag: var isPartial = bitmask & COMPARE_PARTIAL_FLAG; if (convert || (convert = setToArray), object.size != other.size && !isPartial) return !1; var stacked = stack.get(object); if (stacked) return stacked == other; bitmask |= COMPARE_UNORDERED_FLAG, stack.set(object, other); var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack); return stack["delete"](object), result; case symbolTag: if (symbolValueOf) return symbolValueOf.call(object) == symbolValueOf.call(other); } return !1; } var Symbol = __webpack_require__(87), Uint8Array = __webpack_require__(173), eq = __webpack_require__(133), equalArrays = __webpack_require__(166), mapToArray = __webpack_require__(174), setToArray = __webpack_require__(175), COMPARE_PARTIAL_FLAG = 1, COMPARE_UNORDERED_FLAG = 2, boolTag = "[object Boolean]", dateTag = "[object Date]", errorTag = "[object Error]", mapTag = "[object Map]", numberTag = "[object Number]", regexpTag = "[object RegExp]", setTag = "[object Set]", stringTag = "[object String]", symbolTag = "[object Symbol]", arrayBufferTag = "[object ArrayBuffer]", dataViewTag = "[object DataView]", symbolProto = Symbol ? Symbol.prototype : void 0, symbolValueOf = symbolProto ? symbolProto.valueOf : void 0; module.exports = equalByTag; }, function(module, exports, __webpack_require__) { var root = __webpack_require__(88), Uint8Array = root.Uint8Array; module.exports = Uint8Array; }, function(module, exports) { function mapToArray(map) { var index = -1, result = Array(map.size); return map.forEach(function(value, key) { result[++index] = [ key, value ]; }), result; } module.exports = mapToArray; }, function(module, exports) { function setToArray(set) { var index = -1, result = Array(set.size); return set.forEach(function(value) { result[++index] = value; }), result; } module.exports = setToArray; }, function(module, exports, __webpack_require__) { function equalObjects(object, other, bitmask, customizer, equalFunc, stack) { var isPartial = bitmask & COMPARE_PARTIAL_FLAG, objProps = getAllKeys(object), objLength = objProps.length, othProps = getAllKeys(other), othLength = othProps.length; if (objLength != othLength && !isPartial) return !1; for (var index = objLength; index--; ) { var key = objProps[index]; if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) return !1; } var stacked = stack.get(object); if (stacked && stack.get(other)) return stacked == other; var result = !0; stack.set(object, other), stack.set(other, object); for (var skipCtor = isPartial; ++index < objLength; ) { key = objProps[index]; var objValue = object[key], othValue = other[key]; if (customizer) var compared = isPartial ? customizer(othValue, objValue, key, other, object, stack) : customizer(objValue, othValue, key, object, other, stack); if (!(void 0 === compared ? objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack) : compared)) { result = !1; break; } skipCtor || (skipCtor = "constructor" == key); } if (result && !skipCtor) { var objCtor = object.constructor, othCtor = other.constructor; objCtor != othCtor && "constructor" in object && "constructor" in other && !("function" == typeof objCtor && objCtor instanceof objCtor && "function" == typeof othCtor && othCtor instanceof othCtor) && (result = !1); } return stack["delete"](object), stack["delete"](other), result; } var getAllKeys = __webpack_require__(177), COMPARE_PARTIAL_FLAG = 1, objectProto = Object.prototype, hasOwnProperty = objectProto.hasOwnProperty; module.exports = equalObjects; }, function(module, exports, __webpack_require__) { function getAllKeys(object) { return baseGetAllKeys(object, keys, getSymbols); } var baseGetAllKeys = __webpack_require__(178), getSymbols = __webpack_require__(180), keys = __webpack_require__(98); module.exports = getAllKeys; }, function(module, exports, __webpack_require__) { function baseGetAllKeys(object, keysFunc, symbolsFunc) { var result = keysFunc(object); return isArray(object) ? result : arrayPush(result, symbolsFunc(object)); } var arrayPush = __webpack_require__(179), isArray = __webpack_require__(92); module.exports = baseGetAllKeys; }, function(module, exports) { function arrayPush(array, values) { for (var index = -1, length = values.length, offset = array.length; ++index < length; ) array[offset + index] = values[index]; return array; } module.exports = arrayPush; }, function(module, exports, __webpack_require__) { var arrayFilter = __webpack_require__(181), stubArray = __webpack_require__(182), objectProto = Object.prototype, propertyIsEnumerable = objectProto.propertyIsEnumerable, nativeGetSymbols = Object.getOwnPropertySymbols, getSymbols = nativeGetSymbols ? function(object) { return null == object ? [] : (object = Object(object), arrayFilter(nativeGetSymbols(object), function(symbol) { return propertyIsEnumerable.call(object, symbol); })); } : stubArray; module.exports = getSymbols; }, function(module, exports) { function arrayFilter(array, predicate) { for (var index = -1, length = null == array ? 0 : array.length, resIndex = 0, result = []; ++index < length; ) { var value = array[index]; predicate(value, index, array) && (result[resIndex++] = value); } return result; } module.exports = arrayFilter; }, function(module, exports) { function stubArray() { return []; } module.exports = stubArray; }, function(module, exports, __webpack_require__) { var DataView = __webpack_require__(184), Map = __webpack_require__(142), Promise = __webpack_require__(185), Set = __webpack_require__(186), WeakMap = __webpack_require__(187), baseGetTag = __webpack_require__(86), toSource = __webpack_require__(147), mapTag = "[object Map]", objectTag = "[object Object]", promiseTag = "[object Promise]", setTag = "[object Set]", weakMapTag = "[object WeakMap]", dataViewTag = "[object DataView]", dataViewCtorString = toSource(DataView), mapCtorString = toSource(Map), promiseCtorString = toSource(Promise), setCtorString = toSource(Set), weakMapCtorString = toSource(WeakMap), getTag = baseGetTag; (DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag || Map && getTag(new Map()) != mapTag || Promise && getTag(Promise.resolve()) != promiseTag || Set && getTag(new Set()) != setTag || WeakMap && getTag(new WeakMap()) != weakMapTag) && (getTag = function(value) { var result = baseGetTag(value), Ctor = result == objectTag ? value.constructor : void 0, ctorString = Ctor ? toSource(Ctor) : ""; if (ctorString) switch (ctorString) { case dataViewCtorString: return dataViewTag; case mapCtorString: return mapTag; case promiseCtorString: return promiseTag; case setCtorString: return setTag; case weakMapCtorString: return weakMapTag; } return result; }), module.exports = getTag; }, function(module, exports, __webpack_require__) { var getNative = __webpack_require__(143), root = __webpack_require__(88), DataView = getNative(root, "DataView"); module.exports = DataView; }, function(module, exports, __webpack_require__) { var getNative = __webpack_require__(143), root = __webpack_require__(88), Promise = getNative(root, "Promise"); module.exports = Promise; }, function(module, exports, __webpack_require__) { var getNative = __webpack_require__(143), root = __webpack_require__(88), Set = getNative(root, "Set"); module.exports = Set; }, function(module, exports, __webpack_require__) { var getNative = __webpack_require__(143), root = __webpack_require__(88), WeakMap = getNative(root, "WeakMap"); module.exports = WeakMap; }, function(module, exports, __webpack_require__) { function getMatchData(object) { for (var result = keys(object), length = result.length; length--; ) { var key = result[length], value = object[key]; result[length] = [ key, value, isStrictComparable(value) ]; } return result; } var isStrictComparable = __webpack_require__(189), keys = __webpack_require__(98); module.exports = getMatchData; }, function(module, exports, __webpack_require__) { function isStrictComparable(value) { return value === value && !isObject(value); } var isObject = __webpack_require__(118); module.exports = isStrictComparable; }, function(module, exports) { function matchesStrictComparable(key, srcValue) { return function(object) { return null != object && (object[key] === srcValue && (void 0 !== srcValue || key in Object(object))); }; } module.exports = matchesStrictComparable; }, function(module, exports, __webpack_require__) { function baseMatchesProperty(path, srcValue) { return isKey(path) && isStrictComparable(srcValue) ? matchesStrictComparable(toKey(path), srcValue) : function(object) { var objValue = get(object, path); return void 0 === objValue && objValue === srcValue ? hasIn(object, path) : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG); }; } var baseIsEqual = __webpack_require__(164), get = __webpack_require__(192), hasIn = __webpack_require__(203), isKey = __webpack_require__(195), isStrictComparable = __webpack_require__(189), matchesStrictComparable = __webpack_require__(190), toKey = __webpack_require__(202), COMPARE_PARTIAL_FLAG = 1, COMPARE_UNORDERED_FLAG = 2; module.exports = baseMatchesProperty; }, function(module, exports, __webpack_require__) { function get(object, path, defaultValue) { var result = null == object ? void 0 : baseGet(object, path); return void 0 === result ? defaultValue : result; } var baseGet = __webpack_require__(193); module.exports = get; }, function(module, exports, __webpack_require__) { function baseGet(object, path) { path = castPath(path, object); for (var index = 0, length = path.length; null != object && index < length; ) object = object[toKey(path[index++])]; return index && index == length ? object : void 0; } var castPath = __webpack_require__(194), toKey = __webpack_require__(202); module.exports = baseGet; }, function(module, exports, __webpack_require__) { function castPath(value, object) { return isArray(value) ? value : isKey(value, object) ? [ value ] : stringToPath(toString(value)); } var isArray = __webpack_require__(92), isKey = __webpack_require__(195), stringToPath = __webpack_require__(197), toString = __webpack_require__(200); module.exports = castPath; }, function(module, exports, __webpack_require__) { function isKey(value, object) { if (isArray(value)) return !1; var type = typeof value; return !("number" != type && "symbol" != type && "boolean" != type && null != value && !isSymbol(value)) || (reIsPlainProp.test(value) || !reIsDeepProp.test(value) || null != object && value in Object(object)); } var isArray = __webpack_require__(92), isSymbol = __webpack_require__(196), reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, reIsPlainProp = /^\w*$/; module.exports = isKey; }, function(module, exports, __webpack_require__) { function isSymbol(value) { return "symbol" == typeof value || isObjectLike(value) && baseGetTag(value) == symbolTag; } var baseGetTag = __webpack_require__(86), isObjectLike = __webpack_require__(93), symbolTag = "[object Symbol]"; module.exports = isSymbol; }, function(module, exports, __webpack_require__) { var memoizeCapped = __webpack_require__(198), reLeadingDot = /^\./, rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g, reEscapeChar = /\\(\\)?/g, stringToPath = memoizeCapped(function(string) { var result = []; return reLeadingDot.test(string) && result.push(""), string.replace(rePropName, function(match, number, quote, string) { result.push(quote ? string.replace(reEscapeChar, "$1") : number || match); }), result; }); module.exports = stringToPath; }, function(module, exports, __webpack_require__) { function memoizeCapped(func) { var result = memoize(func, function(key) { return cache.size === MAX_MEMOIZE_SIZE && cache.clear(), key; }), cache = result.cache; return result; } var memoize = __webpack_require__(199), MAX_MEMOIZE_SIZE = 500; module.exports = memoizeCapped; }, function(module, exports, __webpack_require__) { function memoize(func, resolver) { if ("function" != typeof func || null != resolver && "function" != typeof resolver) throw new TypeError(FUNC_ERROR_TEXT); var memoized = function() { var args = arguments, key = resolver ? resolver.apply(this, args) : args[0], cache = memoized.cache; if (cache.has(key)) return cache.get(key); var result = func.apply(this, args); return memoized.cache = cache.set(key, result) || cache, result; }; return memoized.cache = new (memoize.Cache || MapCache)(), memoized; } var MapCache = __webpack_require__(149), FUNC_ERROR_TEXT = "Expected a function"; memoize.Cache = MapCache, module.exports = memoize; }, function(module, exports, __webpack_require__) { function toString(value) { return null == value ? "" : baseToString(value); } var baseToString = __webpack_require__(201); module.exports = toString; }, function(module, exports, __webpack_require__) { function baseToString(value) { if ("string" == typeof value) return value; if (isArray(value)) return arrayMap(value, baseToString) + ""; if (isSymbol(value)) return symbolToString ? symbolToString.call(value) : ""; var result = value + ""; return "0" == result && 1 / value == -INFINITY ? "-0" : result; } var Symbol = __webpack_require__(87), arrayMap = __webpack_require__(124), isArray = __webpack_require__(92), isSymbol = __webpack_require__(196), INFINITY = 1 / 0, symbolProto = Symbol ? Symbol.prototype : void 0, symbolToString = symbolProto ? symbolProto.toString : void 0; module.exports = baseToString; }, function(module, exports, __webpack_require__) { function toKey(value) { if ("string" == typeof value || isSymbol(value)) return value; var result = value + ""; return "0" == result && 1 / value == -INFINITY ? "-0" : result; } var isSymbol = __webpack_require__(196), INFINITY = 1 / 0; module.exports = toKey; }, function(module, exports, __webpack_require__) { function hasIn(object, path) { return null != object && hasPath(object, path, baseHasIn); } var baseHasIn = __webpack_require__(204), hasPath = __webpack_require__(205); module.exports = hasIn; }, function(module, exports) { function baseHasIn(object, key) { return null != object && key in Object(object); } module.exports = baseHasIn; }, function(module, exports, __webpack_require__) { function hasPath(object, path, hasFunc) { path = castPath(path, object); for (var index = -1, length = path.length, result = !1; ++index < length; ) { var key = toKey(path[index]); if (!(result = null != object && hasFunc(object, key))) break; object = object[key]; } return result || ++index != length ? result : (length = null == object ? 0 : object.length, !!length && isLength(length) && isIndex(key, length) && (isArray(object) || isArguments(object))); } var castPath = __webpack_require__(194), isArguments = __webpack_require__(101), isArray = __webpack_require__(92), isIndex = __webpack_require__(106), isLength = __webpack_require__(109), toKey = __webpack_require__(202); module.exports = hasPath; }, function(module, exports, __webpack_require__) { function property(path) { return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path); } var baseProperty = __webpack_require__(207), basePropertyDeep = __webpack_require__(208), isKey = __webpack_require__(195), toKey = __webpack_require__(202); module.exports = property; }, function(module, exports) { function baseProperty(key) { return function(object) { return null == object ? void 0 : object[key]; }; } module.exports = baseProperty; }, function(module, exports, __webpack_require__) { function basePropertyDeep(path) { return function(object) { return baseGet(object, path); }; } var baseGet = __webpack_require__(193); module.exports = basePropertyDeep; }, function(module, exports, __webpack_require__) { function baseMap(collection, iteratee) { var index = -1, result = isArrayLike(collection) ? Array(collection.length) : []; return baseEach(collection, function(value, key, collection) { result[++index] = iteratee(value, key, collection); }), result; } var baseEach = __webpack_require__(210), isArrayLike = __webpack_require__(116); module.exports = baseMap; }, function(module, exports, __webpack_require__) { var baseForOwn = __webpack_require__(95), createBaseEach = __webpack_require__(211), baseEach = createBaseEach(baseForOwn); module.exports = baseEach; }, function(module, exports, __webpack_require__) { function createBaseEach(eachFunc, fromRight) { return function(collection, iteratee) { if (null == collection) return collection; if (!isArrayLike(collection)) return eachFunc(collection, iteratee); for (var length = collection.length, index = fromRight ? length : -1, iterable = Object(collection); (fromRight ? index-- : ++index < length) && iteratee(iterable[index], index, iterable) !== !1; ) ; return collection; }; } var isArrayLike = __webpack_require__(116); module.exports = createBaseEach; }, function(module, exports, __webpack_require__) { "use strict"; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } Object.defineProperty(exports, "__esModule", { value: !0 }), exports.mergeClasses = void 0; var _forOwn2 = __webpack_require__(94), _forOwn3 = _interopRequireDefault(_forOwn2), _cloneDeep2 = __webpack_require__(213), _cloneDeep3 = _interopRequireDefault(_cloneDeep2), _extends = Object.assign || function(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) Object.prototype.hasOwnProperty.call(source, key) && (target[key] = source[key]); } return target; }, mergeClasses = exports.mergeClasses = function(classes) { var activeNames = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : [], styles = classes["default"] && (0, _cloneDeep3["default"])(classes["default"]) || {}; return activeNames.map(function(name) { var toMerge = classes[name]; return toMerge && (0, _forOwn3["default"])(toMerge, function(value, key) { styles[key] || (styles[key] = {}), styles[key] = _extends({}, styles[key], toMerge[key]); }), name; }), styles; }; exports["default"] = mergeClasses; }, function(module, exports, __webpack_require__) { function cloneDeep(value) { return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG); } var baseClone = __webpack_require__(214), CLONE_DEEP_FLAG = 1, CLONE_SYMBOLS_FLAG = 4; module.exports = cloneDeep; }, function(module, exports, __webpack_require__) { function baseClone(value, bitmask, customizer, key, object, stack) { var result, isDeep = bitmask & CLONE_DEEP_FLAG, isFlat = bitmask & CLONE_FLAT_FLAG, isFull = bitmask & CLONE_SYMBOLS_FLAG; if (customizer && (result = object ? customizer(value, key, object, stack) : customizer(value)), void 0 !== result) return result; if (!isObject(value)) return value; var isArr = isArray(value); if (isArr) { if (result = initCloneArray(value), !isDeep) return copyArray(value, result); } else { var tag = getTag(value), isFunc = tag == funcTag || tag == genTag; if (isBuffer(value)) return cloneBuffer(value, isDeep); if (tag == objectTag || tag == argsTag || isFunc && !object) { if (result = isFlat || isFunc ? {} : initCloneObject(value), !isDeep) return isFlat ? copySymbolsIn(value, baseAssignIn(result, value)) : copySymbols(value, baseAssign(result, value)); } else { if (!cloneableTags[tag]) return object ? value : {}; result = initCloneByTag(value, tag, baseClone, isDeep); } } stack || (stack = new Stack()); var stacked = stack.get(value); if (stacked) return stacked; stack.set(value, result); var keysFunc = isFull ? isFlat ? getAllKeysIn : getAllKeys : isFlat ? keysIn : keys, props = isArr ? void 0 : keysFunc(value); return arrayEach(props || value, function(subValue, key) { props && (key = subValue, subValue = value[key]), assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack)); }), result; } var Stack = __webpack_require__(128), arrayEach = __webpack_require__(215), assignValue = __webpack_require__(216), baseAssign = __webpack_require__(219), baseAssignIn = __webpack_require__(221), cloneBuffer = __webpack_require__(225), copyArray = __webpack_require__(226), copySymbols = __webpack_require__(227), copySymbolsIn = __webpack_require__(228), getAllKeys = __webpack_require__(177), getAllKeysIn = __webpack_require__(230), getTag = __webpack_require__(183), initCloneArray = __webpack_require__(231), initCloneByTag = __webpack_require__(232), initCloneObject = __webpack_require__(243), isArray = __webpack_require__(92), isBuffer = __webpack_require__(103), isObject = __webpack_require__(118), keys = __webpack_require__(98), CLONE_DEEP_FLAG = 1, CLONE_FLAT_FLAG = 2, CLONE_SYMBOLS_FLAG = 4, argsTag = "[object Arguments]", arrayTag = "[object Array]", boolTag = "[object Boolean]", dateTag = "[object Date]", errorTag = "[object Error]", funcTag = "[object Function]", genTag = "[object GeneratorFunction]", mapTag = "[object Map]", numberTag = "[object Number]", objectTag = "[object Object]", regexpTag = "[object RegExp]", setTag = "[object Set]", stringTag = "[object String]", symbolTag = "[object Symbol]", weakMapTag = "[object WeakMap]", arrayBufferTag = "[object ArrayBuffer]", dataViewTag = "[object DataView]", float32Tag = "[object Float32Array]", float64Tag = "[object Float64Array]", int8Tag = "[object Int8Array]", int16Tag = "[object Int16Array]", int32Tag = "[object Int32Array]", uint8Tag = "[object Uint8Array]", uint8ClampedTag = "[object Uint8ClampedArray]", uint16Tag = "[object Uint16Array]", uint32Tag = "[object Uint32Array]", cloneableTags = {}; cloneableTags[argsTag] = cloneableTags[arrayTag] = cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] = cloneableTags[boolTag] = cloneableTags[dateTag] = cloneableTags[float32Tag] = cloneableTags[float64Tag] = cloneableTags[int8Tag] = cloneableTags[int16Tag] = cloneableTags[int32Tag] = cloneableTags[mapTag] = cloneableTags[numberTag] = cloneableTags[objectTag] = cloneableTags[regexpTag] = cloneableTags[setTag] = cloneableTags[stringTag] = cloneableTags[symbolTag] = cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] = cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = !0, cloneableTags[errorTag] = cloneableTags[funcTag] = cloneableTags[weakMapTag] = !1, module.exports = baseClone; }, function(module, exports) { function arrayEach(array, iteratee) { for (var index = -1, length = null == array ? 0 : array.length; ++index < length && iteratee(array[index], index, array) !== !1; ) ; return array; } module.exports = arrayEach; }, function(module, exports, __webpack_require__) { function assignValue(object, key, value) { var objValue = object[key]; hasOwnProperty.call(object, key) && eq(objValue, value) && (void 0 !== value || key in object) || baseAssignValue(object, key, value); } var baseAssignValue = __webpack_require__(217), eq = __webpack_require__(133), objectProto = Object.prototype, hasOwnProperty = objectProto.hasOwnProperty; module.exports = assignValue; }, function(module, exports, __webpack_require__) { function baseAssignValue(object, key, value) { "__proto__" == key && defineProperty ? defineProperty(object, key, { configurable: !0, enumerable: !0, value: value, writable: !0 }) : object[key] = value; } var defineProperty = __webpack_require__(218); module.exports = baseAssignValue; }, function(module, exports, __webpack_require__) { var getNative = __webpack_require__(143), defineProperty = function() { try { var func = getNative(Object, "defineProperty"); return func({}, "", {}), func; } catch (e) {} }(); module.exports = defineProperty; }, function(module, exports, __webpack_require__) { function baseAssign(object, source) { return object && copyObject(source, keys(source), object); } var copyObject = __webpack_require__(220), keys = __webpack_require__(98); module.exports = baseAssign; }, function(module, exports, __webpack_require__) { function copyObject(source, props, object, customizer) { var isNew = !object; object || (object = {}); for (var index = -1, length = props.length; ++index < length; ) { var key = props[index], newValue = customizer ? customizer(object[key], source[key], key, object, source) : void 0; void 0 === newValue && (newValue = source[key]), isNew ? baseAssignValue(object, key, newValue) : assignValue(object, key, newValue); } return object; } var assignValue = __webpack_require__(216), baseAssignValue = __webpack_require__(217); module.exports = copyObject; }, function(module, exports, __webpack_require__) { function baseAssignIn(object, source) { return object && copyObject(source, keysIn(source), object); } var copyObject = __webpack_require__(220), keysIn = __webpack_require__(222); module.exports = baseAssignIn; }, function(module, exports, __webpack_require__) { function keysIn(object) { return isArrayLike(object) ? arrayLikeKeys(object, !0) : baseKeysIn(object); } var arrayLikeKeys = __webpack_require__(99), baseKeysIn = __webpack_require__(223), isArrayLike = __webpack_require__(116); module.exports = keysIn; }, function(module, exports, __webpack_require__) { function baseKeysIn(object) { if (!isObject(object)) return nativeKeysIn(object); var isProto = isPrototype(object), result = []; for (var key in object) ("constructor" != key || !isProto && hasOwnProperty.call(object, key)) && result.push(key); return result; } var isObject = __webpack_require__(118), isPrototype = __webpack_require__(113), nativeKeysIn = __webpack_require__(224), objectProto = Object.prototype, hasOwnProperty = objectProto.hasOwnProperty; module.exports = baseKeysIn; }, function(module, exports) { function nativeKeysIn(object) { var result = []; if (null != object) for (var key in Object(object)) result.push(key); return result; } module.exports = nativeKeysIn; }, function(module, exports, __webpack_require__) { (function(module) { function cloneBuffer(buffer, isDeep) { if (isDeep) return buffer.slice(); var length = buffer.length, result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length); return buffer.copy(result), result; } var root = __webpack_require__(88), freeExports = "object" == typeof exports && exports && !exports.nodeType && exports, freeModule = freeExports && "object" == typeof module && module && !module.nodeType && module, moduleExports = freeModule && freeModule.exports === freeExports, Buffer = moduleExports ? root.Buffer : void 0, allocUnsafe = Buffer ? Buffer.allocUnsafe : void 0; module.exports = cloneBuffer; }).call(exports, __webpack_require__(104)(module)); }, function(module, exports) { function copyArray(source, array) { var index = -1, length = source.length; for (array || (array = Array(length)); ++index < length; ) array[index] = source[index]; return array; } module.exports = copyArray; }, function(module, exports, __webpack_require__) { function copySymbols(source, object) { return copyObject(source, getSymbols(source), object); } var copyObject = __webpack_require__(220), getSymbols = __webpack_require__(180); module.exports = copySymbols; }, function(module, exports, __webpack_require__) { function copySymbolsIn(source, object) { return copyObject(source, getSymbolsIn(source), object); } var copyObject = __webpack_require__(220), getSymbolsIn = __webpack_require__(229); module.exports = copySymbolsIn; }, function(module, exports, __webpack_require__) { var arrayPush = __webpack_require__(179), getPrototype = __webpack_require__(122), getSymbols = __webpack_require__(180), stubArray = __webpack_require__(182), nativeGetSymbols = Object.getOwnPropertySymbols, getSymbolsIn = nativeGetSymbols ? function(object) { for (var result = []; object; ) arrayPush(result, getSymbols(object)), object = getPrototype(object); return result; } : stubArray; module.exports = getSymbolsIn; }, function(module, exports, __webpack_require__) { function getAllKeysIn(object) { return baseGetAllKeys(object, keysIn, getSymbolsIn); } var baseGetAllKeys = __webpack_require__(178), getSymbolsIn = __webpack_require__(229), keysIn = __webpack_require__(222); module.exports = getAllKeysIn; }, function(module, exports) { function initCloneArray(array) { var length = array.length, result = array.constructor(length); return length && "string" == typeof array[0] && hasOwnProperty.call(array, "index") && (result.index = array.index, result.input = array.input), result; } var objectProto = Object.prototype, hasOwnProperty = objectProto.hasOwnProperty; module.exports = initCloneArray; }, function(module, exports, __webpack_require__) { function initCloneByTag(object, tag, cloneFunc, isDeep) { var Ctor = object.constructor; switch (tag) { case arrayBufferTag: return cloneArrayBuffer(object); case boolTag: case dateTag: return new Ctor((+object)); case dataViewTag: return cloneDataView(object, isDeep); case float32Tag: case float64Tag: case int8Tag: case int16Tag: case int32Tag: case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag: return cloneTypedArray(object, isDeep); case mapTag: return cloneMap(object, isDeep, cloneFunc); case numberTag: case stringTag: return new Ctor(object); case regexpTag: return cloneRegExp(object); case setTag: return cloneSet(object, isDeep, cloneFunc); case symbolTag: return cloneSymbol(object); } } var cloneArrayBuffer = __webpack_require__(233), cloneDataView = __webpack_require__(234), cloneMap = __webpack_require__(235), cloneRegExp = __webpack_require__(238), cloneSet = __webpack_require__(239), cloneSymbol = __webpack_require__(241), cloneTypedArray = __webpack_require__(242), boolTag = "[object Boolean]", dateTag = "[object Date]", mapTag = "[object Map]", numberTag = "[object Number]", regexpTag = "[object RegExp]", setTag = "[object Set]", stringTag = "[object String]", symbolTag = "[object Symbol]", arrayBufferTag = "[object ArrayBuffer]", dataViewTag = "[object DataView]", float32Tag = "[object Float32Array]", float64Tag = "[object Float64Array]", int8Tag = "[object Int8Array]", int16Tag = "[object Int16Array]", int32Tag = "[object Int32Array]", uint8Tag = "[object Uint8Array]", uint8ClampedTag = "[object Uint8ClampedArray]", uint16Tag = "[object Uint16Array]", uint32Tag = "[object Uint32Array]"; module.exports = initCloneByTag; }, function(module, exports, __webpack_require__) { function cloneArrayBuffer(arrayBuffer) { var result = new arrayBuffer.constructor(arrayBuffer.byteLength); return new Uint8Array(result).set(new Uint8Array(arrayBuffer)), result; } var Uint8Array = __webpack_require__(173); module.exports = cloneArrayBuffer; }, function(module, exports, __webpack_require__) { function cloneDataView(dataView, isDeep) { var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer; return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength); } var cloneArrayBuffer = __webpack_require__(233); module.exports = cloneDataView; }, function(module, exports, __webpack_require__) { function cloneMap(map, isDeep, cloneFunc) { var array = isDeep ? cloneFunc(mapToArray(map), CLONE_DEEP_FLAG) : mapToArray(map); return arrayReduce(array, addMapEntry, new map.constructor()); } var addMapEntry = __webpack_require__(236), arrayReduce = __webpack_require__(237), mapToArray = __webpack_require__(174), CLONE_DEEP_FLAG = 1; module.exports = cloneMap; }, function(module, exports) { function addMapEntry(map, pair) { return map.set(pair[0], pair[1]), map; } module.exports = addMapEntry; }, function(module, exports) { function arrayReduce(array, iteratee, accumulator, initAccum) { var index = -1, length = null == array ? 0 : array.length; for (initAccum && length && (accumulator = array[++index]); ++index < length; ) accumulator = iteratee(accumulator, array[index], index, array); return accumulator; } module.exports = arrayReduce; }, function(module, exports) { function cloneRegExp(regexp) { var result = new regexp.constructor(regexp.source, reFlags.exec(regexp)); return result.lastIndex = regexp.lastIndex, result; } var reFlags = /\w*$/; module.exports = cloneRegExp; }, function(module, exports, __webpack_require__) { function cloneSet(set, isDeep, cloneFunc) { var array = isDeep ? cloneFunc(setToArray(set), CLONE_DEEP_FLAG) : setToArray(set); return arrayReduce(array, addSetEntry, new set.constructor()); } var addSetEntry = __webpack_require__(240), arrayReduce = __webpack_require__(237), setToArray = __webpack_require__(175), CLONE_DEEP_FLAG = 1; module.exports = cloneSet; }, function(module, exports) { function addSetEntry(set, value) { return set.add(value), set; } module.exports = addSetEntry; }, function(module, exports, __webpack_require__) { function cloneSymbol(symbol) { return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {}; } var Symbol = __webpack_require__(87), symbolProto = Symbol ? Symbol.prototype : void 0, symbolValueOf = symbolProto ? symbolProto.valueOf : void 0; module.exports = cloneSymbol; }, function(module, exports, __webpack_require__) { function cloneTypedArray(typedArray, isDeep) { var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer; return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length); } var cloneArrayBuffer = __webpack_require__(233); module.exports = cloneTypedArray; }, function(module, exports, __webpack_require__) { function initCloneObject(object) { return "function" != typeof object.constructor || isPrototype(object) ? {} : baseCreate(getPrototype(object)); } var baseCreate = __webpack_require__(244), getPrototype = __webpack_require__(122), isPrototype = __webpack_require__(113); module.exports = initCloneObject; }, function(module, exports, __webpack_require__) { var isObject = __webpack_require__(118), objectCreate = Object.create, baseCreate = function() { function object() {} return function(proto) { if (!isObject(proto)) return {}; if (objectCreate) return objectCreate(proto); object.prototype = proto; var result = new object(); return object.prototype = void 0, result; }; }(); module.exports = baseCreate; }, function(module, exports, __webpack_require__) { "use strict"; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } Object.defineProperty(exports, "__esModule", { value: !0 }), exports.autoprefix = void 0; var _forOwn2 = __webpack_require__(94), _forOwn3 = _interopRequireDefault(_forOwn2), _extends = Object.assign || function(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) Object.prototype.hasOwnProperty.call(source, key) && (target[key] = source[key]); } return target; }, transforms = { borderRadius: function(value) { return { msBorderRadius: value, MozBorderRadius: value, OBorderRadius: value, WebkitBorderRadius: value, borderRadius: value }; }, boxShadow: function(value) { return { msBoxShadow: value, MozBoxShadow: value, OBoxShadow: value, WebkitBoxShadow: value, boxShadow: value }; }, userSelect: function(value) { return { WebkitTouchCallout: value, KhtmlUserSelect: value, MozUserSelect: value, msUserSelect: value, WebkitUserSelect: value, userSelect: value }; }, flex: function(value) { return { WebkitBoxFlex: value, MozBoxFlex: value, WebkitFlex: value, msFlex: value, flex: value }; }, flexBasis: function(value) { return { WebkitFlexBasis: value, flexBasis: value }; }, justifyContent: function(value) { return { WebkitJustifyContent: value, justifyContent: value }; }, transition: function(value) { return { msTransition: value, MozTransition: value, OTransition: value, WebkitTransition: value, transition: value }; }, transform: function(value) { return { msTransform: value, MozTransform: value, OTransform: value, WebkitTransform: value, transform: value }; }, absolute: function(value) { var direction = value && value.split(" "); return { position: "absolute", top: direction && direction[0], right: direction && direction[1], bottom: direction && direction[2], left: direction && direction[3] }; }, extend: function(name, otherElementStyles) { var otherStyle = otherElementStyles[name]; return otherStyle ? otherStyle : { extend: name }; } }, autoprefix = exports.autoprefix = function(elements) { var prefixed = {}; return (0, _forOwn3["default"])(elements, function(styles, element) { var expanded = {}; (0, _forOwn3["default"])(styles, function(value, key) { var transform = transforms[key]; transform ? expanded = _extends({}, expanded, transform(value)) : expanded[key] = value; }), prefixed[element] = expanded; }), prefixed; }; exports["default"] = autoprefix; }, function(module, exports, __webpack_require__) { "use strict"; 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 || "object" != typeof call && "function" != typeof call ? self : call; } function _inherits(subClass, superClass) { if ("function" != typeof superClass && null !== superClass) 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: !1, writable: !0, configurable: !0 } }), superClass && (Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass); } Object.defineProperty(exports, "__esModule", { value: !0 }), exports.hover = void 0; var _extends = Object.assign || function(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) Object.prototype.hasOwnProperty.call(source, key) && (target[key] = source[key]); } return target; }, _react = __webpack_require__(12), _react2 = _interopRequireDefault(_react), hover = exports.hover = function(Component) { var Span = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : "span"; return function(_React$Component) { function Hover() { var _ref, _temp, _this, _ret; _classCallCheck(this, Hover); for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) args[_key] = arguments[_key]; return _temp = _this = _possibleConstructorReturn(this, (_ref = Hover.__proto__ || Object.getPrototypeOf(Hover)).call.apply(_ref, [ this ].concat(args))), _this.state = { hover: !1 }, _this.handleMouseOver = function() { return _this.setState({ hover: !0 }); }, _this.handleMouseOut = function() { return _this.setState({ hover: !1 }); }, _this.render = function() { return _react2["default"].createElement(Span, { onMouseOver: _this.handleMouseOver, onMouseOut: _this.handleMouseOut }, _react2["default"].createElement(Component, _extends({}, _this.props, _this.state))); }, _ret = _temp, _possibleConstructorReturn(_this, _ret); } return _inherits(Hover, _React$Component), Hover; }(_react2["default"].Component); }; exports["default"] = hover; }, function(module, exports, __webpack_require__) { "use strict"; 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 || "object" != typeof call && "function" != typeof call ? self : call; } function _inherits(subClass, superClass) { if ("function" != typeof superClass && null !== superClass) 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: !1, writable: !0, configurable: !0 } }), superClass && (Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass); } Object.defineProperty(exports, "__esModule", { value: !0 }), exports.active = void 0; var _extends = Object.assign || function(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) Object.prototype.hasOwnProperty.call(source, key) && (target[key] = source[key]); } return target; }, _react = __webpack_require__(12), _react2 = _interopRequireDefault(_react), active = exports.active = function(Component) { var Span = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : "span"; return function(_React$Component) { function Active() { var _ref, _temp, _this, _ret; _classCallCheck(this, Active); for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) args[_key] = arguments[_key]; return _temp = _this = _possibleConstructorReturn(this, (_ref = Active.__proto__ || Object.getPrototypeOf(Active)).call.apply(_ref, [ this ].concat(args))), _this.state = { active: !1 }, _this.handleMouseDown = function() { return _this.setState({ active: !0 }); }, _this.handleMouseUp = function() { return _this.setState({ active: !1 }); }, _this.render = function() { return _react2["default"].createElement(Span, { onMouseDown: _this.handleMouseDown, onMouseUp: _this.handleMouseUp }, _react2["default"].createElement(Component, _extends({}, _this.props, _this.state))); }, _ret = _temp, _possibleConstructorReturn(_this, _ret); } return _inherits(Active, _React$Component), Active; }(_react2["default"].Component); }; exports["default"] = active; }, function(module, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: !0 }); var loopable = function(i, length) { var props = {}, setProp = function(name) { var value = !(arguments.length > 1 && void 0 !== arguments[1]) || arguments[1]; props[name] = value; }; return 0 === i && setProp("first-child"), i === length - 1 && setProp("last-child"), (0 === i || i % 2 === 0) && setProp("even"), 1 === Math.abs(i % 2) && setProp("odd"), setProp("nth-child", i), props; }; exports["default"] = loopable; }, function(module, exports, __webpack_require__) { "use strict"; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } Object.defineProperty(exports, "__esModule", { value: !0 }); var _Alpha = __webpack_require__(250); Object.defineProperty(exports, "Alpha", { enumerable: !0, get: function() { return _interopRequireDefault(_Alpha)["default"]; } }); var _Checkboard = __webpack_require__(252); Object.defineProperty(exports, "Checkboard", { enumerable: !0, get: function() { return _interopRequireDefault(_Checkboard)["default"]; } }); var _EditableInput = __webpack_require__(254); Object.defineProperty(exports, "EditableInput", { enumerable: !0, get: function() { return _interopRequireDefault(_EditableInput)["default"]; } }); var _Hue = __webpack_require__(255); Object.defineProperty(exports, "Hue", { enumerable: !0, get: function() { return _interopRequireDefault(_Hue)["default"]; } }); var _Saturation = __webpack_require__(257); Object.defineProperty(exports, "Saturation", { enumerable: !0, get: function() { return _interopRequireDefault(_Saturation)["default"]; } }); var _ColorWrap = __webpack_require__(263); Object.defineProperty(exports, "ColorWrap", { enumerable: !0, get: function() { return _interopRequireDefault(_ColorWrap)["default"]; } }); var _Swatch = __webpack_require__(268); Object.defineProperty(exports, "Swatch", { enumerable: !0, get: function() { return _interopRequireDefault(_Swatch)["default"]; } }); }, function(module, exports, __webpack_require__) { "use strict"; function _interopRequireWildcard(obj) { if (obj && obj.__esModule) return obj; var newObj = {}; if (null != obj) for (var key in obj) Object.prototype.hasOwnProperty.call(obj, key) && (newObj[key] = obj[key]); return newObj["default"] = obj, 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 || "object" != typeof call && "function" != typeof call ? self : call; } function _inherits(subClass, superClass) { if ("function" != typeof superClass && null !== superClass) 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: !1, writable: !0, configurable: !0 } }), superClass && (Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass); } Object.defineProperty(exports, "__esModule", { value: !0 }), exports.Alpha = void 0; var _extends = Object.assign || function(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) Object.prototype.hasOwnProperty.call(source, key) && (target[key] = source[key]); } return target; }, _createClass = function() { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0, "value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor); } } return function(Constructor, protoProps, staticProps) { return protoProps && defineProperties(Constructor.prototype, protoProps), staticProps && defineProperties(Constructor, staticProps), Constructor; }; }(), _react = __webpack_require__(12), _react2 = _interopRequireDefault(_react), _reactcss = __webpack_require__(83), _reactcss2 = _interopRequireDefault(_reactcss), _alpha = __webpack_require__(251), alpha = _interopRequireWildcard(_alpha), _Checkboard = __webpack_require__(252), _Checkboard2 = _interopRequireDefault(_Checkboard), Alpha = exports.Alpha = function(_ref) { function Alpha() { var _ref2, _temp, _this, _ret; _classCallCheck(this, Alpha); for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) args[_key] = arguments[_key]; return _temp = _this = _possibleConstructorReturn(this, (_ref2 = Alpha.__proto__ || Object.getPrototypeOf(Alpha)).call.apply(_ref2, [ this ].concat(args))), _this.handleChange = function(e, skip) { var change = alpha.calculateChange(e, skip, _this.props, _this.refs.container); change && _this.props.onChange(change, e); }, _this.handleMouseDown = function(e) { _this.handleChange(e, !0), window.addEventListener("mousemove", _this.handleChange), window.addEventListener("mouseup", _this.handleMouseUp); }, _this.handleMouseUp = function() { _this.unbindEventListeners(); }, _this.unbindEventListeners = function() { window.removeEventListener("mousemove", _this.handleChange), window.removeEventListener("mouseup", _this.handleMouseUp); }, _ret = _temp, _possibleConstructorReturn(_this, _ret); } return _inherits(Alpha, _ref), _createClass(Alpha, [ { key: "componentWillUnmount", value: function() { this.unbindEventListeners(); } }, { key: "render", value: function() { var rgb = this.props.rgb, styles = (0, _reactcss2["default"])({ "default": { alpha: { absolute: "0px 0px 0px 0px", borderRadius: this.props.radius }, checkboard: { absolute: "0px 0px 0px 0px", overflow: "hidden" }, gradient: { absolute: "0px 0px 0px 0px", background: "linear-gradient(to right, rgba(" + rgb.r + "," + rgb.g + "," + rgb.b + ", 0) 0%,\n rgba(" + rgb.r + "," + rgb.g + "," + rgb.b + ", 1) 100%)", boxShadow: this.props.shadow, borderRadius: this.props.radius }, container: { position: "relative", height: "100%", margin: "0 3px" }, pointer: { position: "absolute", left: 100 * rgb.a + "%" }, slider: { width: "4px", borderRadius: "1px", height: "8px", boxShadow: "0 0 2px rgba(0, 0, 0, .6)", background: "#fff", marginTop: "1px", transform: "translateX(-2px)" } }, vertical: { gradient: { background: "linear-gradient(to bottom, rgba(" + rgb.r + "," + rgb.g + "," + rgb.b + ", 0) 0%,\n rgba(" + rgb.r + "," + rgb.g + "," + rgb.b + ", 1) 100%)" }, pointer: { left: 0, top: 100 * rgb.a + "%" } }, overwrite: _extends({}, this.props.style) }, { vertical: "vertical" === this.props.direction, overwrite: !0 }); return _react2["default"].createElement("div", { style: styles.alpha }, _react2["default"].createElement("div", { style: styles.checkboard }, _react2["default"].createElement(_Checkboard2["default"], { renderers: this.props.renderers })), _react2["default"].createElement("div", { style: styles.gradient }), _react2["default"].createElement("div", { style: styles.container, ref: "container", onMouseDown: this.handleMouseDown, onTouchMove: this.handleChange, onTouchStart: this.handleChange }, _react2["default"].createElement("div", { style: styles.pointer }, this.props.pointer ? _react2["default"].createElement(this.props.pointer, this.props) : _react2["default"].createElement("div", { style: styles.slider })))); } } ]), Alpha; }(_react.PureComponent || _react.Component); exports["default"] = Alpha; }, function(module, exports) { "use strict"; function calculateChange(e, skip, props, container) { !skip && e.preventDefault(); var containerWidth = container.clientWidth, containerHeight = container.clientHeight, x = "number" == typeof e.pageX ? e.pageX : e.touches[0].pageX, y = "number" == typeof e.pageY ? e.pageY : e.touches[0].pageY, left = x - (container.getBoundingClientRect().left + window.pageXOffset), top = y - (container.getBoundingClientRect().top + window.pageYOffset); if ("vertical" === props.direction) { var a = void 0; if (a = top < 0 ? 0 : top > containerHeight ? 1 : Math.round(100 * top / containerHeight) / 100, props.hsl.a !== a) return { h: props.hsl.h, s: props.hsl.s, l: props.hsl.l, a: a, source: "rgb" }; } else { var _a = void 0; if (_a = left < 0 ? 0 : left > containerWidth ? 1 : Math.round(100 * left / containerWidth) / 100, props.a !== _a) return { h: props.hsl.h, s: props.hsl.s, l: props.hsl.l, a: _a, source: "rgb" }; } return null; } Object.defineProperty(exports, "__esModule", { value: !0 }), exports.calculateChange = calculateChange; }, function(module, exports, __webpack_require__) { "use strict"; function _interopRequireWildcard(obj) { if (obj && obj.__esModule) return obj; var newObj = {}; if (null != obj) for (var key in obj) Object.prototype.hasOwnProperty.call(obj, key) && (newObj[key] = obj[key]); return newObj["default"] = obj, newObj; } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } Object.defineProperty(exports, "__esModule", { value: !0 }), exports.Checkboard = void 0; var _react = __webpack_require__(12), _react2 = _interopRequireDefault(_react), _reactcss = __webpack_require__(83), _reactcss2 = _interopRequireDefault(_reactcss), _checkboard = __webpack_require__(253), checkboard = _interopRequireWildcard(_checkboard), Checkboard = exports.Checkboard = function(_ref) { var white = _ref.white, grey = _ref.grey, size = _ref.size, renderers = _ref.renderers, styles = (0, _reactcss2["default"])({ "default": { grid: { absolute: "0px 0px 0px 0px", background: "url(" + checkboard.get(white, grey, size, renderers.canvas) + ") center left" } } }); return _react2["default"].createElement("div", { style: styles.grid }); }; Checkboard.defaultProps = { size: 8, white: "transparent", grey: "rgba(0,0,0,.08)", renderers: {} }, exports["default"] = Checkboard; }, function(module, exports) { "use strict"; function render(c1, c2, size, serverCanvas) { if ("undefined" == typeof document && !serverCanvas) return null; var canvas = serverCanvas ? new serverCanvas() : document.createElement("canvas"); canvas.width = 2 * size, canvas.height = 2 * size; var ctx = canvas.getContext("2d"); return ctx ? (ctx.fillStyle = c1, ctx.fillRect(0, 0, canvas.width, canvas.height), ctx.fillStyle = c2, ctx.fillRect(0, 0, size, size), ctx.translate(size, size), ctx.fillRect(0, 0, size, size), canvas.toDataURL()) : null; } function get(c1, c2, size, serverCanvas) { var key = c1 + "-" + c2 + "-" + size + (serverCanvas ? "-server" : ""), checkboard = render(c1, c2, size, serverCanvas); return checkboardCache[key] ? checkboardCache[key] : (checkboardCache[key] = checkboard, checkboard); } Object.defineProperty(exports, "__esModule", { value: !0 }), exports.render = render, exports.get = get; var checkboardCache = {}; }, function(module, exports, __webpack_require__) { "use strict"; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } function _defineProperty(obj, key, value) { return key in obj ? Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }) : obj[key] = value, 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 || "object" != typeof call && "function" != typeof call ? self : call; } function _inherits(subClass, superClass) { if ("function" != typeof superClass && null !== superClass) 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: !1, writable: !0, configurable: !0 } }), superClass && (Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass); } Object.defineProperty(exports, "__esModule", { value: !0 }), exports.EditableInput = void 0; var _createClass = function() { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0, "value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor); } } return function(Constructor, protoProps, staticProps) { return protoProps && defineProperties(Constructor.prototype, protoProps), staticProps && defineProperties(Constructor, staticProps), Constructor; }; }(), _react = __webpack_require__(12), _react2 = _interopRequireDefault(_react), _reactcss = __webpack_require__(83), _reactcss2 = _interopRequireDefault(_reactcss), EditableInput = exports.EditableInput = function(_ref) { function EditableInput(props) { _classCallCheck(this, EditableInput); var _this = _possibleConstructorReturn(this, (EditableInput.__proto__ || Object.getPrototypeOf(EditableInput)).call(this)); return _this.handleBlur = function() { _this.state.blurValue && _this.setState({ value: _this.state.blurValue, blurValue: null }); }, _this.handleChange = function(e) { _this.props.label ? _this.props.onChange(_defineProperty({}, _this.props.label, e.target.value), e) : _this.props.onChange(e.target.value, e), _this.setState({ value: e.target.value }); }, _this.handleKeyDown = function(e) { var number = Number(e.target.value); if (!isNaN(number)) { var amount = _this.props.arrowOffset || 1; 38 === e.keyCode && (null !== _this.props.label ? _this.props.onChange(_defineProperty({}, _this.props.label, number + amount), e) : _this.props.onChange(number + amount, e), _this.setState({ value: number + amount })), 40 === e.keyCode && (null !== _this.props.label ? _this.props.onChange(_defineProperty({}, _this.props.label, number - amount), e) : _this.props.onChange(number - amount, e), _this.setState({ value: number - amount })); } }, _this.handleDrag = function(e) { if (_this.props.dragLabel) { var newValue = Math.round(_this.props.value + e.movementX); newValue >= 0 && newValue <= _this.props.dragMax && _this.props.onChange(_defineProperty({}, _this.props.label, newValue), e); } }, _this.handleMouseDown = function(e) { _this.props.dragLabel && (e.preventDefault(), _this.handleDrag(e), window.addEventListener("mousemove", _this.handleDrag), window.addEventListener("mouseup", _this.handleMouseUp)); }, _this.handleMouseUp = function() { _this.unbindEventListeners(); }, _this.unbindEventListeners = function() { window.removeEventListener("mousemove", _this.handleDrag), window.removeEventListener("mouseup", _this.handleMouseUp); }, _this.state = { value: String(props.value).toUpperCase(), blurValue: String(props.value).toUpperCase() }, _this; } return _inherits(EditableInput, _ref), _createClass(EditableInput, [ { key: "componentWillReceiveProps", value: function(nextProps) { var input = this.refs.input; nextProps.value !== this.state.value && (input === document.activeElement ? this.setState({ blurValue: String(nextProps.value).toUpperCase() }) : this.setState({ value: String(nextProps.value).toUpperCase() })); } }, { key: "componentWillUnmount", value: function() { this.unbindEventListeners(); } }, { key: "render", value: function() { var styles = (0, _reactcss2["default"])({ "default": { wrap: { position: "relative" } }, "user-override": { wrap: this.props.style && this.props.style.wrap ? this.props.style.wrap : {}, input: this.props.style && this.props.style.input ? this.props.style.input : {}, label: this.props.style && this.props.style.label ? this.props.style.label : {} }, "dragLabel-true": { label: { cursor: "ew-resize" } } }, { "user-override": !0 }, this.props); return _react2["default"].createElement("div", { style: styles.wrap }, _react2["default"].createElement("input", { style: styles.input, ref: "input", value: this.state.value, onKeyDown: this.handleKeyDown, onChange: this.handleChange, onBlur: this.handleBlur, placeholder: this.props.placeholder }), this.props.label ? _react2["default"].createElement("span", { style: styles.label, onMouseDown: this.handleMouseDown }, this.props.label) : null); } } ]), EditableInput; }(_react.PureComponent || _react.Component); exports["default"] = EditableInput; }, function(module, exports, __webpack_require__) { "use strict"; function _interopRequireWildcard(obj) { if (obj && obj.__esModule) return obj; var newObj = {}; if (null != obj) for (var key in obj) Object.prototype.hasOwnProperty.call(obj, key) && (newObj[key] = obj[key]); return newObj["default"] = obj, 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 || "object" != typeof call && "function" != typeof call ? self : call; } function _inherits(subClass, superClass) { if ("function" != typeof superClass && null !== superClass) 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: !1, writable: !0, configurable: !0 } }), superClass && (Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass); } Object.defineProperty(exports, "__esModule", { value: !0 }), exports.Hue = void 0; var _createClass = function() { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0, "value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor); } } return function(Constructor, protoProps, staticProps) { return protoProps && defineProperties(Constructor.prototype, protoProps), staticProps && defineProperties(Constructor, staticProps), Constructor; }; }(), _react = __webpack_require__(12), _react2 = _interopRequireDefault(_react), _reactcss = __webpack_require__(83), _reactcss2 = _interopRequireDefault(_reactcss), _hue = __webpack_require__(256), hue = _interopRequireWildcard(_hue), Hue = exports.Hue = function(_ref) { function Hue() { var _ref2, _temp, _this, _ret; _classCallCheck(this, Hue); for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) args[_key] = arguments[_key]; return _temp = _this = _possibleConstructorReturn(this, (_ref2 = Hue.__proto__ || Object.getPrototypeOf(Hue)).call.apply(_ref2, [ this ].concat(args))), _this.handleChange = function(e, skip) { var change = hue.calculateChange(e, skip, _this.props, _this.refs.container); change && _this.props.onChange(change, e); }, _this.handleMouseDown = function(e) { _this.handleChange(e, !0), window.addEventListener("mousemove", _this.handleChange), window.addEventListener("mouseup", _this.handleMouseUp); }, _this.handleMouseUp = function() { _this.unbindEventListeners(); }, _ret = _temp, _possibleConstructorReturn(_this, _ret); } return _inherits(Hue, _ref), _createClass(Hue, [ { key: "componentWillUnmount", value: function() { this.unbindEventListeners(); } }, { key: "unbindEventListeners", value: function() { window.removeEventListener("mousemove", this.handleChange), window.removeEventListener("mouseup", this.handleMouseUp); } }, { key: "render", value: function() { var styles = (0, _reactcss2["default"])({ "default": { hue: { absolute: "0px 0px 0px 0px", background: "linear-gradient(to right, #f00 0%, #ff0 17%, #0f0 33%,\n #0ff 50%, #00f 67%, #f0f 83%, #f00 100%)", borderRadius: this.props.radius, boxShadow: this.props.shadow }, container: { margin: "0 2px", position: "relative", height: "100%" }, pointer: { position: "absolute", left: 100 * this.props.hsl.h / 360 + "%" }, slider: { marginTop: "1px", width: "4px", borderRadius: "1px", height: "8px", boxShadow: "0 0 2px rgba(0, 0, 0, .6)", background: "#fff", transform: "translateX(-2px)" } }, vertical: { hue: { background: "linear-gradient(to top, #f00 0%, #ff0 17%, #0f0 33%,\n #0ff 50%, #00f 67%, #f0f 83%, #f00 100%)" }, pointer: { left: "0px", top: -(100 * this.props.hsl.h / 360) + 100 + "%" } } }, { vertical: "vertical" === this.props.direction }); return _react2["default"].createElement("div", { style: styles.hue }, _react2["default"].createElement("div", { style: styles.container, ref: "container", onMouseDown: this.handleMouseDown, onTouchMove: this.handleChange, onTouchStart: this.handleChange }, _react2["default"].createElement("div", { style: styles.pointer }, this.props.pointer ? _react2["default"].createElement(this.props.pointer, this.props) : _react2["default"].createElement("div", { style: styles.slider })))); } } ]), Hue; }(_react.PureComponent || _react.Component); exports["default"] = Hue; }, function(module, exports) { "use strict"; function calculateChange(e, skip, props, container) { !skip && e.preventDefault(); var containerWidth = container.clientWidth, containerHeight = container.clientHeight, x = "number" == typeof e.pageX ? e.pageX : e.touches[0].pageX, y = "number" == typeof e.pageY ? e.pageY : e.touches[0].pageY, left = x - (container.getBoundingClientRect().left + window.pageXOffset), top = y - (container.getBoundingClientRect().top + window.pageYOffset); if ("vertical" === props.direction) { var h = void 0; if (top < 0) h = 359; else if (top > containerHeight) h = 0; else { var percent = -(100 * top / containerHeight) + 100; h = 360 * percent / 100; } if (props.hsl.h !== h) return { h: h, s: props.hsl.s, l: props.hsl.l, a: props.hsl.a, source: "rgb" }; } else { var _h = void 0; if (left < 0) _h = 0; else if (left > containerWidth) _h = 359; else { var _percent = 100 * left / containerWidth; _h = 360 * _percent / 100; } if (props.hsl.h !== _h) return { h: _h, s: props.hsl.s, l: props.hsl.l, a: props.hsl.a, source: "rgb" }; } return null; } Object.defineProperty(exports, "__esModule", { value: !0 }), exports.calculateChange = calculateChange; }, function(module, exports, __webpack_require__) { "use strict"; function _interopRequireWildcard(obj) { if (obj && obj.__esModule) return obj; var newObj = {}; if (null != obj) for (var key in obj) Object.prototype.hasOwnProperty.call(obj, key) && (newObj[key] = obj[key]); return newObj["default"] = obj, 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 || "object" != typeof call && "function" != typeof call ? self : call; } function _inherits(subClass, superClass) { if ("function" != typeof superClass && null !== superClass) 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: !1, writable: !0, configurable: !0 } }), superClass && (Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass); } Object.defineProperty(exports, "__esModule", { value: !0 }), exports.Saturation = void 0; var _createClass = function() { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0, "value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor); } } return function(Constructor, protoProps, staticProps) { return protoProps && defineProperties(Constructor.prototype, protoProps), staticProps && defineProperties(Constructor, staticProps), Constructor; }; }(), _react = __webpack_require__(12), _react2 = _interopRequireDefault(_react), _reactcss = __webpack_require__(83), _reactcss2 = _interopRequireDefault(_reactcss), _throttle = __webpack_require__(258), _throttle2 = _interopRequireDefault(_throttle), _saturation = __webpack_require__(262), saturation = _interopRequireWildcard(_saturation), Saturation = exports.Saturation = function(_ref) { function Saturation(props) { _classCallCheck(this, Saturation); var _this = _possibleConstructorReturn(this, (Saturation.__proto__ || Object.getPrototypeOf(Saturation)).call(this, props)); return _this.handleChange = function(e, skip) { _this.throttle(_this.props.onChange, saturation.calculateChange(e, skip, _this.props, _this.refs.container), e); }, _this.handleMouseDown = function(e) { _this.handleChange(e, !0), window.addEventListener("mousemove", _this.handleChange), window.addEventListener("mouseup", _this.handleMouseUp); }, _this.handleMouseUp = function() { _this.unbindEventListeners(); }, _this.throttle = (0, _throttle2["default"])(function(fn, data, e) { fn(data, e); }, 50), _this; } return _inherits(Saturation, _ref), _createClass(Saturation, [ { key: "componentWillUnmount", value: function() { this.unbindEventListeners(); } }, { key: "unbindEventListeners", value: function() { window.removeEventListener("mousemove", this.handleChange), window.removeEventListener("mouseup", this.handleMouseUp); } }, { key: "render", value: function() { var _ref2 = this.props.style || {}, color = _ref2.color, white = _ref2.white, black = _ref2.black, pointer = _ref2.pointer, circle = _ref2.circle, styles = (0, _reactcss2["default"])({ "default": { color: { absolute: "0px 0px 0px 0px", background: "hsl(" + this.props.hsl.h + ",100%, 50%)", borderRadius: this.props.radius }, white: { absolute: "0px 0px 0px 0px", background: "linear-gradient(to right, #fff, rgba(255,255,255,0))" }, black: { absolute: "0px 0px 0px 0px", background: "linear-gradient(to top, #000, rgba(0,0,0,0))", boxShadow: this.props.shadow }, pointer: { position: "absolute", top: -(100 * this.props.hsv.v) + 100 + "%", left: 100 * this.props.hsv.s + "%", cursor: "default" }, circle: { width: "4px", height: "4px", boxShadow: "0 0 0 1.5px #fff, inset 0 0 1px 1px rgba(0,0,0,.3),\n 0 0 1px 2px rgba(0,0,0,.4)", borderRadius: "50%", cursor: "hand", transform: "translate(-2px, -2px)" } }, custom: { color: color, white: white, black: black, pointer: pointer, circle: circle } }, { custom: !!this.props.style }); return _react2["default"].createElement("div", { style: styles.color, ref: "container", onMouseDown: this.handleMouseDown, onTouchMove: this.handleChange, onTouchStart: this.handleChange }, _react2["default"].createElement("div", { style: styles.white }, _react2["default"].createElement("div", { style: styles.black }), _react2["default"].createElement("div", { style: styles.pointer }, this.props.pointer ? _react2["default"].createElement(this.props.pointer, this.props) : _react2["default"].createElement("div", { style: styles.circle })))); } } ]), Saturation; }(_react.PureComponent || _react.Component); exports["default"] = Saturation; }, function(module, exports, __webpack_require__) { function throttle(func, wait, options) { var leading = !0, trailing = !0; if ("function" != typeof func) throw new TypeError(FUNC_ERROR_TEXT); return isObject(options) && (leading = "leading" in options ? !!options.leading : leading, trailing = "trailing" in options ? !!options.trailing : trailing), debounce(func, wait, { leading: leading, maxWait: wait, trailing: trailing }); } var debounce = __webpack_require__(259), isObject = __webpack_require__(118), FUNC_ERROR_TEXT = "Expected a function"; module.exports = throttle; }, function(module, exports, __webpack_require__) { function debounce(func, wait, options) { function invokeFunc(time) { var args = lastArgs, thisArg = lastThis; return lastArgs = lastThis = void 0, lastInvokeTime = time, result = func.apply(thisArg, args); } function leadingEdge(time) { return lastInvokeTime = time, timerId = setTimeout(timerExpired, wait), leading ? invokeFunc(time) : result; } function remainingWait(time) { var timeSinceLastCall = time - lastCallTime, timeSinceLastInvoke = time - lastInvokeTime, result = wait - timeSinceLastCall; return maxing ? nativeMin(result, maxWait - timeSinceLastInvoke) : result; } function shouldInvoke(time) { var timeSinceLastCall = time - lastCallTime, timeSinceLastInvoke = time - lastInvokeTime; return void 0 === lastCallTime || timeSinceLastCall >= wait || timeSinceLastCall < 0 || maxing && timeSinceLastInvoke >= maxWait; } function timerExpired() { var time = now(); return shouldInvoke(time) ? trailingEdge(time) : void (timerId = setTimeout(timerExpired, remainingWait(time))); } function trailingEdge(time) { return timerId = void 0, trailing && lastArgs ? invokeFunc(time) : (lastArgs = lastThis = void 0, result); } function cancel() { void 0 !== timerId && clearTimeout(timerId), lastInvokeTime = 0, lastArgs = lastCallTime = lastThis = timerId = void 0; } function flush() { return void 0 === timerId ? result : trailingEdge(now()); } function debounced() { var time = now(), isInvoking = shouldInvoke(time); if (lastArgs = arguments, lastThis = this, lastCallTime = time, isInvoking) { if (void 0 === timerId) return leadingEdge(lastCallTime); if (maxing) return timerId = setTimeout(timerExpired, wait), invokeFunc(lastCallTime); } return void 0 === timerId && (timerId = setTimeout(timerExpired, wait)), result; } var lastArgs, lastThis, maxWait, result, timerId, lastCallTime, lastInvokeTime = 0, leading = !1, maxing = !1, trailing = !0; if ("function" != typeof func) throw new TypeError(FUNC_ERROR_TEXT); return wait = toNumber(wait) || 0, isObject(options) && (leading = !!options.leading, maxing = "maxWait" in options, maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait, trailing = "trailing" in options ? !!options.trailing : trailing), debounced.cancel = cancel, debounced.flush = flush, debounced; } var isObject = __webpack_require__(118), now = __webpack_require__(260), toNumber = __webpack_require__(261), FUNC_ERROR_TEXT = "Expected a function", nativeMax = Math.max, nativeMin = Math.min; module.exports = debounce; }, function(module, exports, __webpack_require__) { var root = __webpack_require__(88), now = function() { return root.Date.now(); }; module.exports = now; }, function(module, exports, __webpack_require__) { function toNumber(value) { if ("number" == typeof value) return value; if (isSymbol(value)) return NAN; if (isObject(value)) { var other = "function" == typeof value.valueOf ? value.valueOf() : value; value = isObject(other) ? other + "" : other; } if ("string" != typeof value) return 0 === value ? value : +value; value = value.replace(reTrim, ""); var isBinary = reIsBinary.test(value); return isBinary || reIsOctal.test(value) ? freeParseInt(value.slice(2), isBinary ? 2 : 8) : reIsBadHex.test(value) ? NAN : +value; } var isObject = __webpack_require__(118), isSymbol = __webpack_require__(196), NAN = NaN, reTrim = /^\s+|\s+$/g, reIsBadHex = /^[-+]0x[0-9a-f]+$/i, reIsBinary = /^0b[01]+$/i, reIsOctal = /^0o[0-7]+$/i, freeParseInt = parseInt; module.exports = toNumber; }, function(module, exports) { "use strict"; function calculateChange(e, skip, props, container) { !skip && e.preventDefault(); var containerWidth = container.clientWidth, containerHeight = container.clientHeight, x = "number" == typeof e.pageX ? e.pageX : e.touches[0].pageX, y = "number" == typeof e.pageY ? e.pageY : e.touches[0].pageY, left = x - (container.getBoundingClientRect().left + window.pageXOffset), top = y - (container.getBoundingClientRect().top + window.pageYOffset); left < 0 ? left = 0 : left > containerWidth ? left = containerWidth : top < 0 ? top = 0 : top > containerHeight && (top = containerHeight); var saturation = 100 * left / containerWidth, bright = -(100 * top / containerHeight) + 100; return { h: props.hsl.h, s: saturation, v: bright, a: props.hsl.a, source: "rgb" }; } Object.defineProperty(exports, "__esModule", { value: !0 }), exports.calculateChange = calculateChange; }, function(module, exports, __webpack_require__) { "use strict"; 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 || "object" != typeof call && "function" != typeof call ? self : call; } function _inherits(subClass, superClass) { if ("function" != typeof superClass && null !== superClass) 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: !1, writable: !0, configurable: !0 } }), superClass && (Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass); } Object.defineProperty(exports, "__esModule", { value: !0 }), exports.ColorWrap = void 0; var _extends = Object.assign || function(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) Object.prototype.hasOwnProperty.call(source, key) && (target[key] = source[key]); } return target; }, _createClass = function() { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0, "value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor); } } return function(Constructor, protoProps, staticProps) { return protoProps && defineProperties(Constructor.prototype, protoProps), staticProps && defineProperties(Constructor, staticProps), Constructor; }; }(), _react = __webpack_require__(12), _react2 = _interopRequireDefault(_react), _debounce = __webpack_require__(259), _debounce2 = _interopRequireDefault(_debounce), _color = __webpack_require__(264), _color2 = _interopRequireDefault(_color), ColorWrap = exports.ColorWrap = function(Picker) { var ColorPicker = function(_ref) { function ColorPicker(props) { _classCallCheck(this, ColorPicker); var _this = _possibleConstructorReturn(this, (ColorPicker.__proto__ || Object.getPrototypeOf(ColorPicker)).call(this)); return _this.handleChange = function(data, event) { var isValidColor = _color2["default"].simpleCheckForValidColor(data); if (isValidColor) { var colors = _color2["default"].toState(data, data.h || _this.state.oldHue); _this.setState(colors), _this.props.onChangeComplete && _this.debounce(_this.props.onChangeComplete, colors, event), _this.props.onChange && _this.props.onChange(colors, event); } }, _this.state = _extends({}, _color2["default"].toState(props.color, 0), { visible: props.display }), _this.debounce = (0, _debounce2["default"])(function(fn, data, event) { fn(data, event); }, 100), _this; } return _inherits(ColorPicker, _ref), _createClass(ColorPicker, [ { key: "componentWillReceiveProps", value: function(nextProps) { this.setState(_extends({}, _color2["default"].toState(nextProps.color, this.state.oldHue), { visible: nextProps.display })); } }, { key: "render", value: function() { return _react2["default"].createElement(Picker, _extends({}, this.props, this.state, { onChange: this.handleChange })); } } ]), ColorPicker; }(_react.PureComponent || _react.Component); return ColorPicker.defaultProps = { color: { h: 250, s: .5, l: .2, a: 1 } }, ColorPicker; }; exports["default"] = ColorWrap; }, function(module, exports, __webpack_require__) { "use strict"; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } Object.defineProperty(exports, "__esModule", { value: !0 }), exports.red = void 0; var _each = __webpack_require__(265), _each2 = _interopRequireDefault(_each), _tinycolor = __webpack_require__(267), _tinycolor2 = _interopRequireDefault(_tinycolor); exports["default"] = { simpleCheckForValidColor: function(data) { var keysToCheck = [ "r", "g", "b", "a", "h", "s", "a", "v" ], checked = 0, passed = 0; return (0, _each2["default"])(keysToCheck, function(letter) { data[letter] && (checked += 1, isNaN(data[letter]) || (passed += 1)); }), checked === passed && data; }, toState: function(data, oldHue) { var color = data.hex ? (0, _tinycolor2["default"])(data.hex) : (0, _tinycolor2["default"])(data), hsl = color.toHsl(), hsv = color.toHsv(); return 0 === hsl.s && (hsl.h = oldHue || 0, hsv.h = oldHue || 0), { hsl: hsl, hex: "#" + color.toHex(), rgb: color.toRgb(), hsv: hsv, oldHue: data.h || oldHue || hsl.h, source: data.source }; }, isValidHex: function(hex) { return (0, _tinycolor2["default"])(hex).isValid(); } }; exports.red = { hsl: { a: 1, h: 0, l: .5, s: 1 }, hex: "#ff0000", rgb: { r: 255, g: 0, b: 0, a: 1 }, hsv: { h: 0, s: 1, v: 1, a: 1 } }; }, function(module, exports, __webpack_require__) { module.exports = __webpack_require__(266); }, function(module, exports, __webpack_require__) { function forEach(collection, iteratee) { var func = isArray(collection) ? arrayEach : baseEach; return func(collection, castFunction(iteratee)); } var arrayEach = __webpack_require__(215), baseEach = __webpack_require__(210), castFunction = __webpack_require__(119), isArray = __webpack_require__(92); module.exports = forEach; }, function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_RESULT__; !function() { function tinycolor(color, opts) { if (color = color ? color : "", opts = opts || {}, color instanceof tinycolor) return color; if (!(this instanceof tinycolor)) return new tinycolor(color, opts); var rgb = inputToRGB(color); this._originalInput = color, this._r = rgb.r, this._g = rgb.g, this._b = rgb.b, this._a = rgb.a, this._roundA = mathRound(100 * this._a) / 100, this._format = opts.format || rgb.format, this._gradientType = opts.gradientType, this._r < 1 && (this._r = mathRound(this._r)), this._g < 1 && (this._g = mathRound(this._g)), this._b < 1 && (this._b = mathRound(this._b)), this._ok = rgb.ok, this._tc_id = tinyCounter++; } function inputToRGB(color) { var rgb = { r: 0, g: 0, b: 0 }, a = 1, ok = !1, format = !1; return "string" == typeof color && (color = stringInputToObject(color)), "object" == typeof color && (color.hasOwnProperty("r") && color.hasOwnProperty("g") && color.hasOwnProperty("b") ? (rgb = rgbToRgb(color.r, color.g, color.b), ok = !0, format = "%" === String(color.r).substr(-1) ? "prgb" : "rgb") : color.hasOwnProperty("h") && color.hasOwnProperty("s") && color.hasOwnProperty("v") ? (color.s = convertToPercentage(color.s, 1), color.v = convertToPercentage(color.v, 1), rgb = hsvToRgb(color.h, color.s, color.v), ok = !0, format = "hsv") : color.hasOwnProperty("h") && color.hasOwnProperty("s") && color.hasOwnProperty("l") && (color.s = convertToPercentage(color.s), color.l = convertToPercentage(color.l), rgb = hslToRgb(color.h, color.s, color.l), ok = !0, format = "hsl"), color.hasOwnProperty("a") && (a = color.a)), a = boundAlpha(a), { ok: ok, format: color.format || format, r: mathMin(255, mathMax(rgb.r, 0)), g: mathMin(255, mathMax(rgb.g, 0)), b: mathMin(255, mathMax(rgb.b, 0)), a: a }; } function rgbToRgb(r, g, b) { return { r: 255 * bound01(r, 255), g: 255 * bound01(g, 255), b: 255 * bound01(b, 255) }; } function rgbToHsl(r, g, b) { r = bound01(r, 255), g = bound01(g, 255), b = bound01(b, 255); var h, s, max = mathMax(r, g, b), min = mathMin(r, g, b), l = (max + min) / 2; if (max == min) h = s = 0; else { var d = max - min; switch (s = l > .5 ? d / (2 - max - min) : d / (max + min), max) { case r: h = (g - b) / d + (g < b ? 6 : 0); break; case g: h = (b - r) / d + 2; break; case b: h = (r - g) / d + 4; } h /= 6; } return { h: h, s: s, l: l }; } function hslToRgb(h, s, l) { function hue2rgb(p, q, t) { return t < 0 && (t += 1), t > 1 && (t -= 1), t < 1 / 6 ? p + 6 * (q - p) * t : t < .5 ? q : t < 2 / 3 ? p + (q - p) * (2 / 3 - t) * 6 : p; } var r, g, b; if (h = bound01(h, 360), s = bound01(s, 100), l = bound01(l, 100), 0 === s) r = g = b = l; else { var q = l < .5 ? l * (1 + s) : l + s - l * s, p = 2 * l - q; r = hue2rgb(p, q, h + 1 / 3), g = hue2rgb(p, q, h), b = hue2rgb(p, q, h - 1 / 3); } return { r: 255 * r, g: 255 * g, b: 255 * b }; } function rgbToHsv(r, g, b) { r = bound01(r, 255), g = bound01(g, 255), b = bound01(b, 255); var h, s, max = mathMax(r, g, b), min = mathMin(r, g, b), v = max, d = max - min; if (s = 0 === max ? 0 : d / max, max == min) h = 0; else { switch (max) { case r: h = (g - b) / d + (g < b ? 6 : 0); break; case g: h = (b - r) / d + 2; break; case b: h = (r - g) / d + 4; } h /= 6; } return { h: h, s: s, v: v }; } function hsvToRgb(h, s, v) { h = 6 * bound01(h, 360), s = bound01(s, 100), v = bound01(v, 100); var i = math.floor(h), f = h - i, p = v * (1 - s), q = v * (1 - f * s), t = v * (1 - (1 - f) * s), mod = i % 6, r = [ v, q, p, p, t, v ][mod], g = [ t, v, v, q, p, p ][mod], b = [ p, p, t, v, v, q ][mod]; return { r: 255 * r, g: 255 * g, b: 255 * b }; } function rgbToHex(r, g, b, allow3Char) { var hex = [ pad2(mathRound(r).toString(16)), pad2(mathRound(g).toString(16)), pad2(mathRound(b).toString(16)) ]; return allow3Char && hex[0].charAt(0) == hex[0].charAt(1) && hex[1].charAt(0) == hex[1].charAt(1) && hex[2].charAt(0) == hex[2].charAt(1) ? hex[0].charAt(0) + hex[1].charAt(0) + hex[2].charAt(0) : hex.join(""); } function rgbaToHex(r, g, b, a) { var hex = [ pad2(convertDecimalToHex(a)), pad2(mathRound(r).toString(16)), pad2(mathRound(g).toString(16)), pad2(mathRound(b).toString(16)) ]; return hex.join(""); } function desaturate(color, amount) { amount = 0 === amount ? 0 : amount || 10; var hsl = tinycolor(color).toHsl(); return hsl.s -= amount / 100, hsl.s = clamp01(hsl.s), tinycolor(hsl); } function saturate(color, amount) { amount = 0 === amount ? 0 : amount || 10; var hsl = tinycolor(color).toHsl(); return hsl.s += amount / 100, hsl.s = clamp01(hsl.s), tinycolor(hsl); } function greyscale(color) { return tinycolor(color).desaturate(100); } function lighten(color, amount) { amount = 0 === amount ? 0 : amount || 10; var hsl = tinycolor(color).toHsl(); return hsl.l += amount / 100, hsl.l = clamp01(hsl.l), tinycolor(hsl); } function brighten(color, amount) { amount = 0 === amount ? 0 : amount || 10; var rgb = tinycolor(color).toRgb(); return rgb.r = mathMax(0, mathMin(255, rgb.r - mathRound(255 * -(amount / 100)))), rgb.g = mathMax(0, mathMin(255, rgb.g - mathRound(255 * -(amount / 100)))), rgb.b = mathMax(0, mathMin(255, rgb.b - mathRound(255 * -(amount / 100)))), tinycolor(rgb); } function darken(color, amount) { amount = 0 === amount ? 0 : amount || 10; var hsl = tinycolor(color).toHsl(); return hsl.l -= amount / 100, hsl.l = clamp01(hsl.l), tinycolor(hsl); } function spin(color, amount) { var hsl = tinycolor(color).toHsl(), hue = (mathRound(hsl.h) + amount) % 360; return hsl.h = hue < 0 ? 360 + hue : hue, tinycolor(hsl); } function complement(color) { var hsl = tinycolor(color).toHsl(); return hsl.h = (hsl.h + 180) % 360, tinycolor(hsl); } function triad(color) { var hsl = tinycolor(color).toHsl(), h = hsl.h; return [ tinycolor(color), tinycolor({ h: (h + 120) % 360, s: hsl.s, l: hsl.l }), tinycolor({ h: (h + 240) % 360, s: hsl.s, l: hsl.l }) ]; } function tetrad(color) { var hsl = tinycolor(color).toHsl(), h = hsl.h; return [ tinycolor(color), tinycolor({ h: (h + 90) % 360, s: hsl.s, l: hsl.l }), tinycolor({ h: (h + 180) % 360, s: hsl.s, l: hsl.l }), tinycolor({ h: (h + 270) % 360, s: hsl.s, l: hsl.l }) ]; } function splitcomplement(color) { var hsl = tinycolor(color).toHsl(), h = hsl.h; return [ tinycolor(color), tinycolor({ h: (h + 72) % 360, s: hsl.s, l: hsl.l }), tinycolor({ h: (h + 216) % 360, s: hsl.s, l: hsl.l }) ]; } function analogous(color, results, slices) { results = results || 6, slices = slices || 30; var hsl = tinycolor(color).toHsl(), part = 360 / slices, ret = [ tinycolor(color) ]; for (hsl.h = (hsl.h - (part * results >> 1) + 720) % 360; --results; ) hsl.h = (hsl.h + part) % 360, ret.push(tinycolor(hsl)); return ret; } function monochromatic(color, results) { results = results || 6; for (var hsv = tinycolor(color).toHsv(), h = hsv.h, s = hsv.s, v = hsv.v, ret = [], modification = 1 / results; results--; ) ret.push(tinycolor({ h: h, s: s, v: v })), v = (v + modification) % 1; return ret; } function flip(o) { var flipped = {}; for (var i in o) o.hasOwnProperty(i) && (flipped[o[i]] = i); return flipped; } function boundAlpha(a) { return a = parseFloat(a), (isNaN(a) || a < 0 || a > 1) && (a = 1), a; } function bound01(n, max) { isOnePointZero(n) && (n = "100%"); var processPercent = isPercentage(n); return n = mathMin(max, mathMax(0, parseFloat(n))), processPercent && (n = parseInt(n * max, 10) / 100), math.abs(n - max) < 1e-6 ? 1 : n % max / parseFloat(max); } function clamp01(val) { return mathMin(1, mathMax(0, val)); } function parseIntFromHex(val) { return parseInt(val, 16); } function isOnePointZero(n) { return "string" == typeof n && n.indexOf(".") != -1 && 1 === parseFloat(n); } function isPercentage(n) { return "string" == typeof n && n.indexOf("%") != -1; } function pad2(c) { return 1 == c.length ? "0" + c : "" + c; } function convertToPercentage(n, multiplier) { return multiplier = multiplier || 100, n <= 1 && (n = n * multiplier + "%"), n; } function convertDecimalToHex(d) { return Math.round(255 * parseFloat(d)).toString(16); } function convertHexToDecimal(h) { return parseIntFromHex(h) / 255; } function stringInputToObject(color) { color = color.replace(trimLeft, "").replace(trimRight, "").toLowerCase(); var named = !1; if (names[color]) color = names[color], named = !0; else if ("transparent" == color) return { r: 0, g: 0, b: 0, a: 0, format: "name" }; var match; return (match = matchers.rgb.exec(color)) ? { r: match[1], g: match[2], b: match[3] } : (match = matchers.rgba.exec(color)) ? { r: match[1], g: match[2], b: match[3], a: match[4] } : (match = matchers.hsl.exec(color)) ? { h: match[1], s: match[2], l: match[3] } : (match = matchers.hsla.exec(color)) ? { h: match[1], s: match[2], l: match[3], a: match[4] } : (match = matchers.hsv.exec(color)) ? { h: match[1], s: match[2], v: match[3] } : (match = matchers.hsva.exec(color)) ? { h: match[1], s: match[2], v: match[3], a: match[4] } : (match = matchers.hex8.exec(color)) ? { a: convertHexToDecimal(match[1]), r: parseIntFromHex(match[2]), g: parseIntFromHex(match[3]), b: parseIntFromHex(match[4]), format: named ? "name" : "hex8" } : (match = matchers.hex6.exec(color)) ? { r: parseIntFromHex(match[1]), g: parseIntFromHex(match[2]), b: parseIntFromHex(match[3]), format: named ? "name" : "hex" } : !!(match = matchers.hex3.exec(color)) && { r: parseIntFromHex(match[1] + "" + match[1]), g: parseIntFromHex(match[2] + "" + match[2]), b: parseIntFromHex(match[3] + "" + match[3]), format: named ? "name" : "hex" }; } function validateWCAG2Parms(parms) { var level, size; return parms = parms || { level: "AA", size: "small" }, level = (parms.level || "AA").toUpperCase(), size = (parms.size || "small").toLowerCase(), "AA" !== level && "AAA" !== level && (level = "AA"), "small" !== size && "large" !== size && (size = "small"), { level: level, size: size }; } var trimLeft = /^[\s,#]+/, trimRight = /\s+$/, tinyCounter = 0, math = Math, mathRound = math.round, mathMin = math.min, mathMax = math.max, mathRandom = math.random; tinycolor.prototype = { isDark: function() { return this.getBrightness() < 128; }, isLight: function() { return !this.isDark(); }, isValid: function() { return this._ok; }, getOriginalInput: function() { return this._originalInput; }, getFormat: function() { return this._format; }, getAlpha: function() { return this._a; }, getBrightness: function() { var rgb = this.toRgb(); return (299 * rgb.r + 587 * rgb.g + 114 * rgb.b) / 1e3; }, getLuminance: function() { var RsRGB, GsRGB, BsRGB, R, G, B, rgb = this.toRgb(); return RsRGB = rgb.r / 255, GsRGB = rgb.g / 255, BsRGB = rgb.b / 255, R = RsRGB <= .03928 ? RsRGB / 12.92 : Math.pow((RsRGB + .055) / 1.055, 2.4), G = GsRGB <= .03928 ? GsRGB / 12.92 : Math.pow((GsRGB + .055) / 1.055, 2.4), B = BsRGB <= .03928 ? BsRGB / 12.92 : Math.pow((BsRGB + .055) / 1.055, 2.4), .2126 * R + .7152 * G + .0722 * B; }, setAlpha: function(value) { return this._a = boundAlpha(value), this._roundA = mathRound(100 * this._a) / 100, this; }, toHsv: function() { var hsv = rgbToHsv(this._r, this._g, this._b); return { h: 360 * hsv.h, s: hsv.s, v: hsv.v, a: this._a }; }, toHsvString: function() { var hsv = rgbToHsv(this._r, this._g, this._b), h = mathRound(360 * hsv.h), s = mathRound(100 * hsv.s), v = mathRound(100 * hsv.v); return 1 == this._a ? "hsv(" + h + ", " + s + "%, " + v + "%)" : "hsva(" + h + ", " + s + "%, " + v + "%, " + this._roundA + ")"; }, toHsl: function() { var hsl = rgbToHsl(this._r, this._g, this._b); return { h: 360 * hsl.h, s: hsl.s, l: hsl.l, a: this._a }; }, toHslString: function() { var hsl = rgbToHsl(this._r, this._g, this._b), h = mathRound(360 * hsl.h), s = mathRound(100 * hsl.s), l = mathRound(100 * hsl.l); return 1 == this._a ? "hsl(" + h + ", " + s + "%, " + l + "%)" : "hsla(" + h + ", " + s + "%, " + l + "%, " + this._roundA + ")"; }, toHex: function(allow3Char) { return rgbToHex(this._r, this._g, this._b, allow3Char); }, toHexString: function(allow3Char) { return "#" + this.toHex(allow3Char); }, toHex8: function() { return rgbaToHex(this._r, this._g, this._b, this._a); }, toHex8String: function() { return "#" + this.toHex8(); }, toRgb: function() { return { r: mathRound(this._r), g: mathRound(this._g), b: mathRound(this._b), a: this._a }; }, toRgbString: function() { return 1 == this._a ? "rgb(" + mathRound(this._r) + ", " + mathRound(this._g) + ", " + mathRound(this._b) + ")" : "rgba(" + mathRound(this._r) + ", " + mathRound(this._g) + ", " + mathRound(this._b) + ", " + this._roundA + ")"; }, toPercentageRgb: function() { return { r: mathRound(100 * bound01(this._r, 255)) + "%", g: mathRound(100 * bound01(this._g, 255)) + "%", b: mathRound(100 * bound01(this._b, 255)) + "%", a: this._a }; }, toPercentageRgbString: function() { return 1 == this._a ? "rgb(" + mathRound(100 * bound01(this._r, 255)) + "%, " + mathRound(100 * bound01(this._g, 255)) + "%, " + mathRound(100 * bound01(this._b, 255)) + "%)" : "rgba(" + mathRound(100 * bound01(this._r, 255)) + "%, " + mathRound(100 * bound01(this._g, 255)) + "%, " + mathRound(100 * bound01(this._b, 255)) + "%, " + this._roundA + ")"; }, toName: function() { return 0 === this._a ? "transparent" : !(this._a < 1) && (hexNames[rgbToHex(this._r, this._g, this._b, !0)] || !1); }, toFilter: function(secondColor) { var hex8String = "#" + rgbaToHex(this._r, this._g, this._b, this._a), secondHex8String = hex8String, gradientType = this._gradientType ? "GradientType = 1, " : ""; if (secondColor) { var s = tinycolor(secondColor); secondHex8String = s.toHex8String(); } return "progid:DXImageTransform.Microsoft.gradient(" + gradientType + "startColorstr=" + hex8String + ",endColorstr=" + secondHex8String + ")"; }, toString: function(format) { var formatSet = !!format; format = format || this._format; var formattedString = !1, hasAlpha = this._a < 1 && this._a >= 0, needsAlphaFormat = !formatSet && hasAlpha && ("hex" === format || "hex6" === format || "hex3" === format || "name" === format); return needsAlphaFormat ? "name" === format && 0 === this._a ? this.toName() : this.toRgbString() : ("rgb" === format && (formattedString = this.toRgbString()), "prgb" === format && (formattedString = this.toPercentageRgbString()), "hex" !== format && "hex6" !== format || (formattedString = this.toHexString()), "hex3" === format && (formattedString = this.toHexString(!0)), "hex8" === format && (formattedString = this.toHex8String()), "name" === format && (formattedString = this.toName()), "hsl" === format && (formattedString = this.toHslString()), "hsv" === format && (formattedString = this.toHsvString()), formattedString || this.toHexString()); }, _applyModification: function(fn, args) { var color = fn.apply(null, [ this ].concat([].slice.call(args))); return this._r = color._r, this._g = color._g, this._b = color._b, this.setAlpha(color._a), this; }, lighten: function() { return this._applyModification(lighten, arguments); }, brighten: function() { return this._applyModification(brighten, arguments); }, darken: function() { return this._applyModification(darken, arguments); }, desaturate: function() { return this._applyModification(desaturate, arguments); }, saturate: function() { return this._applyModification(saturate, arguments); }, greyscale: function() { return this._applyModification(greyscale, arguments); }, spin: function() { return this._applyModification(spin, arguments); }, _applyCombination: function(fn, args) { return fn.apply(null, [ this ].concat([].slice.call(args))); }, analogous: function() { return this._applyCombination(analogous, arguments); }, complement: function() { return this._applyCombination(complement, arguments); }, monochromatic: function() { return this._applyCombination(monochromatic, arguments); }, splitcomplement: function() { return this._applyCombination(splitcomplement, arguments); }, triad: function() { return this._applyCombination(triad, arguments); }, tetrad: function() { return this._applyCombination(tetrad, arguments); } }, tinycolor.fromRatio = function(color, opts) { if ("object" == typeof color) { var newColor = {}; for (var i in color) color.hasOwnProperty(i) && ("a" === i ? newColor[i] = color[i] : newColor[i] = convertToPercentage(color[i])); color = newColor; } return tinycolor(color, opts); }, tinycolor.equals = function(color1, color2) { return !(!color1 || !color2) && tinycolor(color1).toRgbString() == tinycolor(color2).toRgbString(); }, tinycolor.random = function() { return tinycolor.fromRatio({ r: mathRandom(), g: mathRandom(), b: mathRandom() }); }, tinycolor.mix = function(color1, color2, amount) { amount = 0 === amount ? 0 : amount || 50; var w1, rgb1 = tinycolor(color1).toRgb(), rgb2 = tinycolor(color2).toRgb(), p = amount / 100, w = 2 * p - 1, a = rgb2.a - rgb1.a; w1 = w * a == -1 ? w : (w + a) / (1 + w * a), w1 = (w1 + 1) / 2; var w2 = 1 - w1, rgba = { r: rgb2.r * w1 + rgb1.r * w2, g: rgb2.g * w1 + rgb1.g * w2, b: rgb2.b * w1 + rgb1.b * w2, a: rgb2.a * p + rgb1.a * (1 - p) }; return tinycolor(rgba); }, tinycolor.readability = function(color1, color2) { var c1 = tinycolor(color1), c2 = tinycolor(color2); return (Math.max(c1.getLuminance(), c2.getLuminance()) + .05) / (Math.min(c1.getLuminance(), c2.getLuminance()) + .05); }, tinycolor.isReadable = function(color1, color2, wcag2) { var wcag2Parms, out, readability = tinycolor.readability(color1, color2); switch (out = !1, wcag2Parms = validateWCAG2Parms(wcag2), wcag2Parms.level + wcag2Parms.size) { case "AAsmall": case "AAAlarge": out = readability >= 4.5; break; case "AAlarge": out = readability >= 3; break; case "AAAsmall": out = readability >= 7; } return out; }, tinycolor.mostReadable = function(baseColor, colorList, args) { var readability, includeFallbackColors, level, size, bestColor = null, bestScore = 0; args = args || {}, includeFallbackColors = args.includeFallbackColors, level = args.level, size = args.size; for (var i = 0; i < colorList.length; i++) readability = tinycolor.readability(baseColor, colorList[i]), readability > bestScore && (bestScore = readability, bestColor = tinycolor(colorList[i])); return tinycolor.isReadable(baseColor, bestColor, { level: level, size: size }) || !includeFallbackColors ? bestColor : (args.includeFallbackColors = !1, tinycolor.mostReadable(baseColor, [ "#fff", "#000" ], args)); }; var names = tinycolor.names = { aliceblue: "f0f8ff", antiquewhite: "faebd7", aqua: "0ff", aquamarine: "7fffd4", azure: "f0ffff", beige: "f5f5dc", bisque: "ffe4c4", black: "000", blanchedalmond: "ffebcd", blue: "00f", blueviolet: "8a2be2", brown: "a52a2a", burlywood: "deb887", burntsienna: "ea7e5d", cadetblue: "5f9ea0", chartreuse: "7fff00", chocolate: "d2691e", coral: "ff7f50", cornflowerblue: "6495ed", cornsilk: "fff8dc", crimson: "dc143c", cyan: "0ff", darkblue: "00008b", darkcyan: "008b8b", darkgoldenrod: "b8860b", darkgray: "a9a9a9", darkgreen: "006400", darkgrey: "a9a9a9", darkkhaki: "bdb76b", darkmagenta: "8b008b", darkolivegreen: "556b2f", darkorange: "ff8c00", darkorchid: "9932cc", darkred: "8b0000", darksalmon: "e9967a", darkseagreen: "8fbc8f", darkslateblue: "483d8b", darkslategray: "2f4f4f", darkslategrey: "2f4f4f", darkturquoise: "00ced1", darkviolet: "9400d3", deeppink: "ff1493", deepskyblue: "00bfff", dimgray: "696969", dimgrey: "696969", dodgerblue: "1e90ff", firebrick: "b22222", floralwhite: "fffaf0", forestgreen: "228b22", fuchsia: "f0f", gainsboro: "dcdcdc", ghostwhite: "f8f8ff", gold: "ffd700", goldenrod: "daa520", gray: "808080", green: "008000", greenyellow: "adff2f", grey: "808080", honeydew: "f0fff0", hotpink: "ff69b4", indianred: "cd5c5c", indigo: "4b0082", ivory: "fffff0", khaki: "f0e68c", lavender: "e6e6fa", lavenderblush: "fff0f5", lawngreen: "7cfc00", lemonchiffon: "fffacd", lightblue: "add8e6", lightcoral: "f08080", lightcyan: "e0ffff", lightgoldenrodyellow: "fafad2", lightgray: "d3d3d3", lightgreen: "90ee90", lightgrey: "d3d3d3", lightpink: "ffb6c1", lightsalmon: "ffa07a", lightseagreen: "20b2aa", lightskyblue: "87cefa", lightslategray: "789", lightslategrey: "789", lightsteelblue: "b0c4de", lightyellow: "ffffe0", lime: "0f0", limegreen: "32cd32", linen: "faf0e6", magenta: "f0f", maroon: "800000", mediumaquamarine: "66cdaa", mediumblue: "0000cd", mediumorchid: "ba55d3", mediumpurple: "9370db", mediumseagreen: "3cb371", mediumslateblue: "7b68ee", mediumspringgreen: "00fa9a", mediumturquoise: "48d1cc", mediumvioletred: "c71585", midnightblue: "191970", mintcream: "f5fffa", mistyrose: "ffe4e1", moccasin: "ffe4b5", navajowhite: "ffdead", navy: "000080", oldlace: "fdf5e6", olive: "808000", olivedrab: "6b8e23", orange: "ffa500", orangered: "ff4500", orchid: "da70d6", palegoldenrod: "eee8aa", palegreen: "98fb98", paleturquoise: "afeeee", palevioletred: "db7093", papayawhip: "ffefd5", peachpuff: "ffdab9", peru: "cd853f", pink: "ffc0cb", plum: "dda0dd", powderblue: "b0e0e6", purple: "800080", rebeccapurple: "663399", red: "f00", rosybrown: "bc8f8f", royalblue: "4169e1", saddlebrown: "8b4513", salmon: "fa8072", sandybrown: "f4a460", seagreen: "2e8b57", seashell: "fff5ee", sienna: "a0522d", silver: "c0c0c0", skyblue: "87ceeb", slateblue: "6a5acd", slategray: "708090", slategrey: "708090", snow: "fffafa", springgreen: "00ff7f", steelblue: "4682b4", tan: "d2b48c", teal: "008080", thistle: "d8bfd8", tomato: "ff6347", turquoise: "40e0d0", violet: "ee82ee", wheat: "f5deb3", white: "fff", whitesmoke: "f5f5f5", yellow: "ff0", yellowgreen: "9acd32" }, hexNames = tinycolor.hexNames = flip(names), matchers = function() { var CSS_INTEGER = "[-\\+]?\\d+%?", CSS_NUMBER = "[-\\+]?\\d*\\.\\d+%?", CSS_UNIT = "(?:" + CSS_NUMBER + ")|(?:" + CSS_INTEGER + ")", PERMISSIVE_MATCH3 = "[\\s|\\(]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")\\s*\\)?", PERMISSIVE_MATCH4 = "[\\s|\\(]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")\\s*\\)?"; return { rgb: new RegExp("rgb" + PERMISSIVE_MATCH3), rgba: new RegExp("rgba" + PERMISSIVE_MATCH4), hsl: new RegExp("hsl" + PERMISSIVE_MATCH3), hsla: new RegExp("hsla" + PERMISSIVE_MATCH4), hsv: new RegExp("hsv" + PERMISSIVE_MATCH3), hsva: new RegExp("hsva" + PERMISSIVE_MATCH4), hex3: /^([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/, hex6: /^([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/, hex8: /^([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/ }; }(); "undefined" != typeof module && module.exports ? module.exports = tinycolor : (__WEBPACK_AMD_DEFINE_RESULT__ = function() { return tinycolor; }.call(exports, __webpack_require__, exports, module), !(void 0 !== __WEBPACK_AMD_DEFINE_RESULT__ && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__))); }(); }, function(module, exports, __webpack_require__) { "use strict"; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } Object.defineProperty(exports, "__esModule", { value: !0 }), exports.Swatch = void 0; var _react = __webpack_require__(12), _react2 = _interopRequireDefault(_react), _reactcss = __webpack_require__(83), _reactcss2 = _interopRequireDefault(_reactcss), Swatch = exports.Swatch = function(_ref) { var color = _ref.color, style = _ref.style, onClick = _ref.onClick, _ref$title = _ref.title, title = void 0 === _ref$title ? color : _ref$title, styles = (0, _reactcss2["default"])({ "default": { swatch: { background: color, height: "100%", width: "100%", cursor: "pointer" } }, custom: { swatch: style } }, "custom"), handleClick = function(e) { return onClick(color, e); }; return _react2["default"].createElement("div", { style: styles.swatch, onClick: handleClick, title: title }); }; exports["default"] = Swatch; }, function(module, exports, __webpack_require__) { "use strict"; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } Object.defineProperty(exports, "__esModule", { value: !0 }), exports.AlphaPointer = void 0; var _react = __webpack_require__(12), _react2 = _interopRequireDefault(_react), _reactcss = __webpack_require__(83), _reactcss2 = _interopRequireDefault(_reactcss), AlphaPointer = exports.AlphaPointer = function(_ref) { var direction = _ref.direction, styles = (0, _reactcss2["default"])({ "default": { picker: { width: "18px", height: "18px", borderRadius: "50%", transform: "translate(-9px, -1px)", backgroundColor: "rgb(248, 248, 248)", boxShadow: "0 1px 4px 0 rgba(0, 0, 0, 0.37)" } }, vertical: { picker: { transform: "translate(-3px, -9px)" } } }, { vertical: "vertical" === direction }); return _react2["default"].createElement("div", { style: styles.picker }); }; exports["default"] = AlphaPointer; }, function(module, exports, __webpack_require__) { "use strict"; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } Object.defineProperty(exports, "__esModule", { value: !0 }), exports.Block = void 0; var _react = __webpack_require__(12), _react2 = _interopRequireDefault(_react), _reactcss = __webpack_require__(83), _reactcss2 = _interopRequireDefault(_reactcss), _color = __webpack_require__(264), _color2 = _interopRequireDefault(_color), _common = __webpack_require__(249), _BlockSwatches = __webpack_require__(271), _BlockSwatches2 = _interopRequireDefault(_BlockSwatches), Block = exports.Block = function(_ref) { var onChange = _ref.onChange, hex = _ref.hex, colors = _ref.colors, width = _ref.width, triangle = _ref.triangle, handleChange = function(hexCode, e) { _color2["default"].isValidHex(hexCode) && onChange({ hex: hexCode, source: "hex" }, e); }, styles = (0, _reactcss2["default"])({ "default": { card: { width: width, background: "#fff", boxShadow: "0 1px rgba(0,0,0,.1)", borderRadius: "6px", position: "relative" }, head: { height: "110px", background: hex, borderRadius: "6px 6px 0 0", display: "flex", alignItems: "center", justifyContent: "center" }, body: { padding: "10px" }, label: { fontSize: "18px", color: "#fff" }, triangle: { width: "0px", height: "0px", borderStyle: "solid", borderWidth: "0 10px 10px 10px", borderColor: "transparent transparent " + hex + " transparent", position: "absolute", top: "-10px", left: "50%", marginLeft: "-10px" }, input: { width: "100%", fontSize: "12px", color: "#666", border: "0px", outline: "none", height: "22px", boxShadow: "inset 0 0 0 1px #ddd", borderRadius: "4px", padding: "0 7px", boxSizing: "border-box" } }, "hide-triangle": { triangle: { display: "none" } } }, { "hide-triangle": "hide" === triangle }); return _react2["default"].createElement("div", { style: styles.card, className: "block-picker" }, _react2["default"].createElement("div", { style: styles.triangle }), _react2["default"].createElement("div", { style: styles.head }, _react2["default"].createElement("div", { style: styles.label }, hex)), _react2["default"].createElement("div", { style: styles.body }, _react2["default"].createElement(_BlockSwatches2["default"], { colors: colors, onClick: handleChange }), _react2["default"].createElement(_common.EditableInput, { placeholder: "Hex Code", style: { input: styles.input }, value: "", onChange: handleChange }))); }; Block.defaultProps = { width: "170px", colors: [ "#D9E3F0", "#F47373", "#697689", "#37D67A", "#2CCCE4", "#555555", "#dce775", "#ff8a65", "#ba68c8" ], triangle: "top" }, exports["default"] = (0, _common.ColorWrap)(Block); }, function(module, exports, __webpack_require__) { "use strict"; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } Object.defineProperty(exports, "__esModule", { value: !0 }), exports.BlockSwatches = void 0; var _react = __webpack_require__(12), _react2 = _interopRequireDefault(_react), _reactcss = __webpack_require__(83), _reactcss2 = _interopRequireDefault(_reactcss), _map = __webpack_require__(123), _map2 = _interopRequireDefault(_map), _common = __webpack_require__(249), BlockSwatches = exports.BlockSwatches = function(_ref) { var colors = _ref.colors, onClick = _ref.onClick, styles = (0, _reactcss2["default"])({ "default": { swatches: { marginRight: "-10px" }, swatch: { width: "22px", height: "22px", "float": "left", marginRight: "10px", marginBottom: "10px", borderRadius: "4px" }, clear: { clear: "both" } } }); return _react2["default"].createElement("div", { style: styles.swatches }, (0, _map2["default"])(colors, function(c) { return _react2["default"].createElement(_common.Swatch, { key: c, color: c, style: styles.swatch, onClick: onClick }); }), _react2["default"].createElement("div", { style: styles.clear })); }; exports["default"] = BlockSwatches; }, function(module, exports, __webpack_require__) { "use strict"; function _interopRequireWildcard(obj) { if (obj && obj.__esModule) return obj; var newObj = {}; if (null != obj) for (var key in obj) Object.prototype.hasOwnProperty.call(obj, key) && (newObj[key] = obj[key]); return newObj["default"] = obj, newObj; } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } Object.defineProperty(exports, "__esModule", { value: !0 }), exports.Circle = void 0; var _react = __webpack_require__(12), _react2 = _interopRequireDefault(_react), _reactcss = __webpack_require__(83), _reactcss2 = _interopRequireDefault(_reactcss), _map = __webpack_require__(123), _map2 = _interopRequireDefault(_map), _materialColors = __webpack_require__(273), material = _interopRequireWildcard(_materialColors), _common = __webpack_require__(249), _CircleSwatch = __webpack_require__(274), _CircleSwatch2 = _interopRequireDefault(_CircleSwatch), Circle = exports.Circle = function(_ref) { var width = _ref.width, onChange = _ref.onChange, colors = _ref.colors, hex = _ref.hex, circleSize = _ref.circleSize, circleSpacing = _ref.circleSpacing, styles = (0, _reactcss2["default"])({ "default": { card: { width: width, display: "flex", flexWrap: "wrap", marginRight: -circleSpacing, marginBottom: -circleSpacing } } }), handleChange = function(hexCode, e) { return onChange({ hex: hexCode, source: "hex" }, e); }; return _react2["default"].createElement("div", { style: styles.card, className: "circle-picker" }, (0, _map2["default"])(colors, function(c) { return _react2["default"].createElement(_CircleSwatch2["default"], { key: c, color: c, onClick: handleChange, active: hex === c.toLowerCase(), circleSize: circleSize, circleSpacing: circleSpacing }); })); }; Circle.defaultProps = { width: "252px", circleSize: 28, circleSpacing: 14, colors: [ material.red[500], material.pink[500], material.purple[500], material.deepPurple[500], material.indigo[500], material.blue[500], material.lightBlue[500], material.cyan[500], material.teal[500], material.green[500], material.lightGreen[500], material.lime[500], material.yellow[500], material.amber[500], material.orange[500], material.deepOrange[500], material.brown[500], material.blueGrey[500] ] }, exports["default"] = (0, _common.ColorWrap)(Circle); }, function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__; !function(root, factory) { __WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_FACTORY__ = factory, __WEBPACK_AMD_DEFINE_RESULT__ = "function" == typeof __WEBPACK_AMD_DEFINE_FACTORY__ ? __WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__) : __WEBPACK_AMD_DEFINE_FACTORY__, !(void 0 !== __WEBPACK_AMD_DEFINE_RESULT__ && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); }(this, function() { return { red: { "50": "#ffebee", "100": "#ffcdd2", "200": "#ef9a9a", "300": "#e57373", "400": "#ef5350", "500": "#f44336", "600": "#e53935", "700": "#d32f2f", "800": "#c62828", "900": "#b71c1c", a100: "#ff8a80", a200: "#ff5252", a400: "#ff1744", a700: "#d50000" }, pink: { "50": "#fce4ec", "100": "#f8bbd0", "200": "#f48fb1", "300": "#f06292", "400": "#ec407a", "500": "#e91e63", "600": "#d81b60", "700": "#c2185b", "800": "#ad1457", "900": "#880e4f", a100: "#ff80ab", a200: "#ff4081", a400: "#f50057", a700: "#c51162" }, purple: { "50": "#f3e5f5", "100": "#e1bee7", "200": "#ce93d8", "300": "#ba68c8", "400": "#ab47bc", "500": "#9c27b0", "600": "#8e24aa", "700": "#7b1fa2", "800": "#6a1b9a", "900": "#4a148c", a100: "#ea80fc", a200: "#e040fb", a400: "#d500f9", a700: "#aa00ff" }, deepPurple: { "50": "#ede7f6", "100": "#d1c4e9", "200": "#b39ddb", "300": "#9575cd", "400": "#7e57c2", "500": "#673ab7", "600": "#5e35b1", "700": "#512da8", "800": "#4527a0", "900": "#311b92", a100: "#b388ff", a200: "#7c4dff", a400: "#651fff", a700: "#6200ea" }, indigo: { "50": "#e8eaf6", "100": "#c5cae9", "200": "#9fa8da", "300": "#7986cb", "400": "#5c6bc0", "500": "#3f51b5", "600": "#3949ab", "700": "#303f9f", "800": "#283593", "900": "#1a237e", a100: "#8c9eff", a200: "#536dfe", a400: "#3d5afe", a700: "#304ffe" }, blue: { "50": "#e3f2fd", "100": "#bbdefb", "200": "#90caf9", "300": "#64b5f6", "400": "#42a5f5", "500": "#2196f3", "600": "#1e88e5", "700": "#1976d2", "800": "#1565c0", "900": "#0d47a1", a100: "#82b1ff", a200: "#448aff", a400: "#2979ff", a700: "#2962ff" }, lightBlue: { "50": "#e1f5fe", "100": "#b3e5fc", "200": "#81d4fa", "300": "#4fc3f7", "400": "#29b6f6", "500": "#03a9f4", "600": "#039be5", "700": "#0288d1", "800": "#0277bd", "900": "#01579b", a100: "#80d8ff", a200: "#40c4ff", a400: "#00b0ff", a700: "#0091ea" }, cyan: { "50": "#e0f7fa", "100": "#b2ebf2", "200": "#80deea", "300": "#4dd0e1", "400": "#26c6da", "500": "#00bcd4", "600": "#00acc1", "700": "#0097a7", "800": "#00838f", "900": "#006064", a100: "#84ffff", a200: "#18ffff", a400: "#00e5ff", a700: "#00b8d4" }, teal: { "50": "#e0f2f1", "100": "#b2dfdb", "200": "#80cbc4", "300": "#4db6ac", "400": "#26a69a", "500": "#009688", "600": "#00897b", "700": "#00796b", "800": "#00695c", "900": "#004d40", a100: "#a7ffeb", a200: "#64ffda", a400: "#1de9b6", a700: "#00bfa5" }, green: { "50": "#e8f5e9", "100": "#c8e6c9", "200": "#a5d6a7", "300": "#81c784", "400": "#66bb6a", "500": "#4caf50", "600": "#43a047", "700": "#388e3c", "800": "#2e7d32", "900": "#1b5e20", a100: "#b9f6ca", a200: "#69f0ae", a400: "#00e676", a700: "#00c853" }, lightGreen: { "50": "#f1f8e9", "100": "#dcedc8", "200": "#c5e1a5", "300": "#aed581", "400": "#9ccc65", "500": "#8bc34a", "600": "#7cb342", "700": "#689f38", "800": "#558b2f", "900": "#33691e", a100: "#ccff90", a200: "#b2ff59", a400: "#76ff03", a700: "#64dd17" }, lime: { "50": "#f9fbe7", "100": "#f0f4c3", "200": "#e6ee9c", "300": "#dce775", "400": "#d4e157", "500": "#cddc39", "600": "#c0ca33", "700": "#afb42b", "800": "#9e9d24", "900": "#827717", a100: "#f4ff81", a200: "#eeff41", a400: "#c6ff00", a700: "#aeea00" }, yellow: { "50": "#fffde7", "100": "#fff9c4", "200": "#fff59d", "300": "#fff176", "400": "#ffee58", "500": "#ffeb3b", "600": "#fdd835", "700": "#fbc02d", "800": "#f9a825", "900": "#f57f17", a100: "#ffff8d", a200: "#ffff00", a400: "#ffea00", a700: "#ffd600" }, amber: { "50": "#fff8e1", "100": "#ffecb3", "200": "#ffe082", "300": "#ffd54f", "400": "#ffca28", "500": "#ffc107", "600": "#ffb300", "700": "#ffa000", "800": "#ff8f00", "900": "#ff6f00", a100: "#ffe57f", a200: "#ffd740", a400: "#ffc400", a700: "#ffab00" }, orange: { "50": "#fff3e0", "100": "#ffe0b2", "200": "#ffcc80", "300": "#ffb74d", "400": "#ffa726", "500": "#ff9800", "600": "#fb8c00", "700": "#f57c00", "800": "#ef6c00", "900": "#e65100", a100: "#ffd180", a200: "#ffab40", a400: "#ff9100", a700: "#ff6d00" }, deepOrange: { "50": "#fbe9e7", "100": "#ffccbc", "200": "#ffab91", "300": "#ff8a65", "400": "#ff7043", "500": "#ff5722", "600": "#f4511e", "700": "#e64a19", "800": "#d84315", "900": "#bf360c", a100: "#ff9e80", a200: "#ff6e40", a400: "#ff3d00", a700: "#dd2c00" }, brown: { "50": "#efebe9", "100": "#d7ccc8", "200": "#bcaaa4", "300": "#a1887f", "400": "#8d6e63", "500": "#795548", "600": "#6d4c41", "700": "#5d4037", "800": "#4e342e", "900": "#3e2723" }, grey: { "50": "#fafafa", "100": "#f5f5f5", "200": "#eeeeee", "300": "#e0e0e0", "400": "#bdbdbd", "500": "#9e9e9e", "600": "#757575", "700": "#616161", "800": "#424242", "900": "#212121" }, blueGrey: { "50": "#eceff1", "100": "#cfd8dc", "200": "#b0bec5", "300": "#90a4ae", "400": "#78909c", "500": "#607d8b", "600": "#546e7a", "700": "#455a64", "800": "#37474f", "900": "#263238" }, darkText: { primary: "rgba(0, 0, 0, 0.87)", secondary: "rgba(0, 0, 0, 0.54)", disabled: "rgba(0, 0, 0, 0.38)", dividers: "rgba(0, 0, 0, 0.12)" }, lightText: { primary: "rgba(255, 255, 255, 1)", secondary: "rgba(255, 255, 255, 0.7)", disabled: "rgba(255, 255, 255, 0.5)", dividers: "rgba(255, 255, 255, 0.12)" }, darkIcons: { active: "rgba(0, 0, 0, 0.54)", inactive: "rgba(0, 0, 0, 0.38)" }, lightIcons: { active: "rgba(255, 255, 255, 1)", inactive: "rgba(255, 255, 255, 0.5)" }, white: "#ffffff", black: "#000000" }; }); }, function(module, exports, __webpack_require__) { "use strict"; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } Object.defineProperty(exports, "__esModule", { value: !0 }), exports.CircleSwatch = void 0; var _react = __webpack_require__(12), _react2 = _interopRequireDefault(_react), _reactcss = __webpack_require__(83), _reactcss2 = _interopRequireDefault(_reactcss), _common = __webpack_require__(249), CircleSwatch = exports.CircleSwatch = function(_ref) { var color = _ref.color, onClick = _ref.onClick, hover = _ref.hover, active = _ref.active, circleSize = _ref.circleSize, circleSpacing = _ref.circleSpacing, styles = (0, _reactcss2["default"])({ "default": { swatch: { width: circleSize, height: circleSize, marginRight: circleSpacing, marginBottom: circleSpacing, transform: "scale(1)", transition: "100ms transform ease" }, Swatch: { borderRadius: "50%", background: "transparent", boxShadow: "inset 0 0 0 " + circleSize / 2 + "px " + color, transition: "100ms box-shadow ease" } }, hover: { swatch: { transform: "scale(1.2)" } }, active: { Swatch: { boxShadow: "inset 0 0 0 3px " + color } } }, { hover: hover, active: active }); return _react2["default"].createElement("div", { style: styles.swatch }, _react2["default"].createElement(_common.Swatch, { style: styles.Swatch, color: color, onClick: onClick })); }; CircleSwatch.defaultProps = { circleSize: 28, circleSpacing: 14 }, exports["default"] = (0, _reactcss.handleHover)(CircleSwatch); }, function(module, exports, __webpack_require__) { "use strict"; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } Object.defineProperty(exports, "__esModule", { value: !0 }), exports.Chrome = void 0; var _react = __webpack_require__(12), _react2 = _interopRequireDefault(_react), _reactcss = __webpack_require__(83), _reactcss2 = _interopRequireDefault(_reactcss), _common = __webpack_require__(249), _ChromeFields = __webpack_require__(276), _ChromeFields2 = _interopRequireDefault(_ChromeFields), _ChromePointer = __webpack_require__(277), _ChromePointer2 = _interopRequireDefault(_ChromePointer), _ChromePointerCircle = __webpack_require__(278), _ChromePointerCircle2 = _interopRequireDefault(_ChromePointerCircle), Chrome = exports.Chrome = function(_ref) { var onChange = _ref.onChange, disableAlpha = _ref.disableAlpha, rgb = _ref.rgb, hsl = _ref.hsl, hsv = _ref.hsv, hex = _ref.hex, renderers = _ref.renderers, styles = (0, _reactcss2["default"])({ "default": { picker: { background: "#fff", borderRadius: "2px", boxShadow: "0 0 2px rgba(0,0,0,.3), 0 4px 8px rgba(0,0,0,.3)", boxSizing: "initial", width: "225px", fontFamily: "Menlo" }, saturation: { width: "100%", paddingBottom: "55%", position: "relative", borderRadius: "2px 2px 0 0", overflow: "hidden" }, Saturation: { radius: "2px 2px 0 0" }, body: { padding: "16px 16px 12px" }, controls: { display: "flex" }, color: { width: "32px" }, swatch: { marginTop: "6px", width: "16px", height: "16px", borderRadius: "8px", position: "relative", overflow: "hidden" }, active: { absolute: "0px 0px 0px 0px", borderRadius: "8px", boxShadow: "inset 0 0 0 1px rgba(0,0,0,.1)", background: "rgba(" + rgb.r + ", " + rgb.g + ", " + rgb.b + ", " + rgb.a + ")", zIndex: "2" }, toggles: { flex: "1" }, hue: { height: "10px", position: "relative", marginBottom: "8px" }, Hue: { radius: "2px" }, alpha: { height: "10px", position: "relative" }, Alpha: { radius: "2px" } }, disableAlpha: { color: { width: "22px" }, alpha: { display: "none" }, hue: { marginBottom: "0px" }, swatch: { width: "10px", height: "10px", marginTop: "0px" } } }, { disableAlpha: disableAlpha }); return _react2["default"].createElement("div", { style: styles.picker, className: "chrome-picker" }, _react2["default"].createElement("div", { style: styles.saturation }, _react2["default"].createElement(_common.Saturation, { style: styles.Saturation, hsl: hsl, hsv: hsv, pointer: _ChromePointerCircle2["default"], onChange: onChange })), _react2["default"].createElement("div", { style: styles.body }, _react2["default"].createElement("div", { style: styles.controls, className: "flexbox-fix" }, _react2["default"].createElement("div", { style: styles.color }, _react2["default"].createElement("div", { style: styles.swatch }, _react2["default"].createElement("div", { style: styles.active }), _react2["default"].createElement(_common.Checkboard, { renderers: renderers }))), _react2["default"].createElement("div", { style: styles.toggles }, _react2["default"].createElement("div", { style: styles.hue }, _react2["default"].createElement(_common.Hue, { style: styles.Hue, hsl: hsl, pointer: _ChromePointer2["default"], onChange: onChange })), _react2["default"].createElement("div", { style: styles.alpha }, _react2["default"].createElement(_common.Alpha, { style: styles.Alpha, rgb: rgb, hsl: hsl, pointer: _ChromePointer2["default"], renderers: renderers, onChange: onChange })))), _react2["default"].createElement(_ChromeFields2["default"], { rgb: rgb, hsl: hsl, hex: hex, onChange: onChange, disableAlpha: disableAlpha }))); }; exports["default"] = (0, _common.ColorWrap)(Chrome); }, function(module, exports, __webpack_require__) { "use strict"; 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 || "object" != typeof call && "function" != typeof call ? self : call; } function _inherits(subClass, superClass) { if ("function" != typeof superClass && null !== superClass) 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: !1, writable: !0, configurable: !0 } }), superClass && (Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass); } Object.defineProperty(exports, "__esModule", { value: !0 }), exports.ChromeFields = void 0; var _createClass = function() { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0, "value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor); } } return function(Constructor, protoProps, staticProps) { return protoProps && defineProperties(Constructor.prototype, protoProps), staticProps && defineProperties(Constructor, staticProps), Constructor; }; }(), _react = __webpack_require__(12), _react2 = _interopRequireDefault(_react), _reactcss = __webpack_require__(83), _reactcss2 = _interopRequireDefault(_reactcss), _color = __webpack_require__(264), _color2 = _interopRequireDefault(_color), _common = __webpack_require__(249), ChromeFields = exports.ChromeFields = function(_React$Component) { function ChromeFields() { var _ref, _temp, _this, _ret; _classCallCheck(this, ChromeFields); for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) args[_key] = arguments[_key]; return _temp = _this = _possibleConstructorReturn(this, (_ref = ChromeFields.__proto__ || Object.getPrototypeOf(ChromeFields)).call.apply(_ref, [ this ].concat(args))), _this.state = { view: "" }, _this.toggleViews = function() { "hex" === _this.state.view ? _this.setState({ view: "rgb" }) : "rgb" === _this.state.view ? _this.setState({ view: "hsl" }) : "hsl" === _this.state.view && (1 === _this.props.hsl.a ? _this.setState({ view: "hex" }) : _this.setState({ view: "rgb" })); }, _this.handleChange = function(data, e) { data.hex ? _color2["default"].isValidHex(data.hex) && _this.props.onChange({ hex: data.hex, source: "hex" }, e) : data.r || data.g || data.b ? _this.props.onChange({ r: data.r || _this.props.rgb.r, g: data.g || _this.props.rgb.g, b: data.b || _this.props.rgb.b, source: "rgb" }, e) : data.a ? (data.a < 0 ? data.a = 0 : data.a > 1 && (data.a = 1), _this.props.onChange({ h: _this.props.hsl.h, s: _this.props.hsl.s, l: _this.props.hsl.l, a: Math.round(100 * data.a) / 100, source: "rgb" }, e)) : (data.h || data.s || data.l) && _this.props.onChange({ h: data.h || _this.props.hsl.h, s: data.s && data.s.replace("%", "") || _this.props.hsl.s, l: data.l && data.l.replace("%", "") || _this.props.hsl.l, source: "hsl" }, e); }, _this.showHighlight = function(e) { e.target.style.background = "#eee"; }, _this.hideHighlight = function(e) { e.target.style.background = "transparent"; }, _ret = _temp, _possibleConstructorReturn(_this, _ret); } return _inherits(ChromeFields, _React$Component), _createClass(ChromeFields, [ { key: "componentDidMount", value: function() { 1 === this.props.hsl.a && "hex" !== this.state.view ? this.setState({ view: "hex" }) : "rgb" !== this.state.view && "hsl" !== this.state.view && this.setState({ view: "rgb" }); } }, { key: "componentWillReceiveProps", value: function(nextProps) { 1 !== nextProps.hsl.a && "hex" === this.state.view && this.setState({ view: "rgb" }); } }, { key: "render", value: function() { var styles = (0, _reactcss2["default"])({ "default": { wrap: { paddingTop: "16px", display: "flex" }, fields: { flex: "1", display: "flex", marginLeft: "-6px" }, field: { paddingLeft: "6px", width: "100%" }, alpha: { paddingLeft: "6px", width: "100%" }, toggle: { width: "32px", textAlign: "right", position: "relative" }, icon: { marginRight: "-4px", marginTop: "12px", cursor: "pointer", position: "relative" }, iconHighlight: { position: "absolute", width: "24px", height: "28px", background: "#eee", borderRadius: "4px", top: "10px", left: "12px", display: "none" }, input: { fontSize: "11px", color: "#333", width: "100%", borderRadius: "2px", border: "none", boxShadow: "inset 0 0 0 1px #dadada", height: "21px", textAlign: "center" }, label: { textTransform: "uppercase", fontSize: "11px", lineHeight: "11px", color: "#969696", textAlign: "center", display: "block", marginTop: "12px" }, svg: { width: "24px", height: "24px", border: "1px transparent solid", borderRadius: "5px" } }, disableAlpha: { alpha: { display: "none" } } }, this.props, this.state), fields = void 0; return "hex" === this.state.view ? fields = _react2["default"].createElement("div", { style: styles.fields, className: "flexbox-fix" }, _react2["default"].createElement("div", { style: styles.field }, _react2["default"].createElement(_common.EditableInput, { style: { input: styles.input, label: styles.label }, label: "hex", value: this.props.hex, onChange: this.handleChange }))) : "rgb" === this.state.view ? fields = _react2["default"].createElement("div", { style: styles.fields, className: "flexbox-fix" }, _react2["default"].createElement("div", { style: styles.field }, _react2["default"].createElement(_common.EditableInput, { style: { input: styles.input, label: styles.label }, label: "r", value: this.props.rgb.r, onChange: this.handleChange })), _react2["default"].createElement("div", { style: styles.field }, _react2["default"].createElement(_common.EditableInput, { style: { input: styles.input, label: styles.label }, label: "g", value: this.props.rgb.g, onChange: this.handleChange })), _react2["default"].createElement("div", { style: styles.field }, _react2["default"].createElement(_common.EditableInput, { style: { input: styles.input, label: styles.label }, label: "b", value: this.props.rgb.b, onChange: this.handleChange })), _react2["default"].createElement("div", { style: styles.alpha }, _react2["default"].createElement(_common.EditableInput, { style: { input: styles.input, label: styles.label }, label: "a", value: this.props.rgb.a, arrowOffset: .01, onChange: this.handleChange }))) : "hsl" === this.state.view && (fields = _react2["default"].createElement("div", { style: styles.fields, className: "flexbox-fix" }, _react2["default"].createElement("div", { style: styles.field }, _react2["default"].createElement(_common.EditableInput, { style: { input: styles.input, label: styles.label }, label: "h", value: Math.round(this.props.hsl.h), onChange: this.handleChange })), _react2["default"].createElement("div", { style: styles.field }, _react2["default"].createElement(_common.EditableInput, { style: { input: styles.input, label: styles.label }, label: "s", value: Math.round(100 * this.props.hsl.s) + "%", onChange: this.handleChange })), _react2["default"].createElement("div", { style: styles.field }, _react2["default"].createElement(_common.EditableInput, { style: { input: styles.input, label: styles.label }, label: "l", value: Math.round(100 * this.props.hsl.l) + "%", onChange: this.handleChange })), _react2["default"].createElement("div", { style: styles.alpha }, _react2["default"].createElement(_common.EditableInput, { style: { input: styles.input, label: styles.label }, label: "a", value: this.props.hsl.a, arrowOffset: .01, onChange: this.handleChange })))), _react2["default"].createElement("div", { style: styles.wrap, className: "flexbox-fix" }, fields, _react2["default"].createElement("div", { style: styles.toggle }, _react2["default"].createElement("div", { style: styles.icon, onClick: this.toggleViews, ref: "icon" }, _react2["default"].createElement("svg", { style: styles.svg, viewBox: "0 0 24 24", onMouseOver: this.showHighlight, onMouseEnter: this.showHighlight, onMouseOut: this.hideHighlight }, _react2["default"].createElement("path", { ref: "iconUp", fill: "#333", d: "M12,5.83L15.17,9L16.58,7.59L12,3L7.41,7.59L8.83,9L12,5.83Z" }), _react2["default"].createElement("path", { ref: "iconDown", fill: "#333", d: "M12,18.17L8.83,15L7.42,16.41L12,21L16.59,16.41L15.17,15Z" }))))); } } ]), ChromeFields; }(_react2["default"].Component); exports["default"] = ChromeFields; }, function(module, exports, __webpack_require__) { "use strict"; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } Object.defineProperty(exports, "__esModule", { value: !0 }), exports.ChromePointer = void 0; var _react = __webpack_require__(12), _react2 = _interopRequireDefault(_react), _reactcss = __webpack_require__(83), _reactcss2 = _interopRequireDefault(_reactcss), ChromePointer = exports.ChromePointer = function() { var styles = (0, _reactcss2["default"])({ "default": { picker: { width: "12px", height: "12px", borderRadius: "6px", transform: "translate(-6px, -1px)", backgroundColor: "rgb(248, 248, 248)", boxShadow: "0 1px 4px 0 rgba(0, 0, 0, 0.37)" } } }); return _react2["default"].createElement("div", { style: styles.picker }); }; exports["default"] = ChromePointer; }, function(module, exports, __webpack_require__) { "use strict"; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } Object.defineProperty(exports, "__esModule", { value: !0 }), exports.ChromePointerCircle = void 0; var _react = __webpack_require__(12), _react2 = _interopRequireDefault(_react), _reactcss = __webpack_require__(83), _reactcss2 = _interopRequireDefault(_reactcss), ChromePointerCircle = exports.ChromePointerCircle = function() { var styles = (0, _reactcss2["default"])({ "default": { picker: { width: "12px", height: "12px", borderRadius: "6px", boxShadow: "inset 0 0 0 1px #fff", transform: "translate(-6px, -6px)" } } }); return _react2["default"].createElement("div", { style: styles.picker }); }; exports["default"] = ChromePointerCircle; }, function(module, exports, __webpack_require__) { "use strict"; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } Object.defineProperty(exports, "__esModule", { value: !0 }), exports.Compact = void 0; var _react = __webpack_require__(12), _react2 = _interopRequireDefault(_react), _reactcss = __webpack_require__(83), _reactcss2 = _interopRequireDefault(_reactcss), _map = __webpack_require__(123), _map2 = _interopRequireDefault(_map), _color = __webpack_require__(264), _color2 = _interopRequireDefault(_color), _reactMaterialDesign = __webpack_require__(280), _common = __webpack_require__(249), _CompactColor = __webpack_require__(291), _CompactColor2 = _interopRequireDefault(_CompactColor), _CompactFields = __webpack_require__(292), _CompactFields2 = _interopRequireDefault(_CompactFields), Compact = exports.Compact = function(_ref) { var onChange = _ref.onChange, colors = _ref.colors, hex = _ref.hex, rgb = _ref.rgb, styles = (0, _reactcss2["default"])({ "default": { Compact: { background: "#f6f6f6", radius: "4px" }, compact: { paddingTop: "5px", paddingLeft: "5px", boxSizing: "initial", width: "240px" }, clear: { clear: "both" } } }), handleChange = function(data, e) { data.hex ? _color2["default"].isValidHex(data.hex) && onChange({ hex: data.hex, source: "hex" }, e) : onChange(data, e); }; return _react2["default"].createElement(_reactMaterialDesign.Raised, { style: styles.Compact }, _react2["default"].createElement("div", { style: styles.compact, className: "compact-picker" }, _react2["default"].createElement("div", null, (0, _map2["default"])(colors, function(c) { return _react2["default"].createElement(_CompactColor2["default"], { key: c, color: c, active: c.toLowerCase() === hex, onClick: handleChange }); }), _react2["default"].createElement("div", { style: styles.clear })), _react2["default"].createElement(_CompactFields2["default"], { hex: hex, rgb: rgb, onChange: handleChange }))); }; Compact.defaultProps = { colors: [ "#4D4D4D", "#999999", "#FFFFFF", "#F44E3B", "#FE9200", "#FCDC00", "#DBDF00", "#A4DD00", "#68CCCA", "#73D8FF", "#AEA1FF", "#FDA1FF", "#333333", "#808080", "#cccccc", "#D33115", "#E27300", "#FCC400", "#B0BC00", "#68BC00", "#16A5A5", "#009CE0", "#7B64FF", "#FA28FF", "#000000", "#666666", "#B3B3B3", "#9F0500", "#C45100", "#FB9E00", "#808900", "#194D33", "#0C797D", "#0062B1", "#653294", "#AB149E" ] }, exports["default"] = (0, _common.ColorWrap)(Compact); }, function(module, exports, __webpack_require__) { "use strict"; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } Object.defineProperty(exports, "__esModule", { value: !0 }); var _libComponentsRaised = __webpack_require__(281), _libComponentsRaised2 = _interopRequireDefault(_libComponentsRaised), _libComponentsTile = __webpack_require__(287), _libComponentsTile2 = _interopRequireDefault(_libComponentsTile), _libComponentsTabs = __webpack_require__(288), _libComponentsTabs2 = _interopRequireDefault(_libComponentsTabs); exports.Raised = _libComponentsRaised2["default"], exports.Tile = _libComponentsTile2["default"], exports.Tabs = _libComponentsTabs2["default"]; }, function(module, exports, __webpack_require__) { "use strict"; 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 || "object" != typeof call && "function" != typeof call ? self : call; } function _inherits(subClass, superClass) { if ("function" != typeof superClass && null !== superClass) 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: !1, writable: !0, configurable: !0 } }), superClass && (Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass); } Object.defineProperty(exports, "__esModule", { value: !0 }); var _createClass = function() { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0, "value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor); } } return function(Constructor, protoProps, staticProps) { return protoProps && defineProperties(Constructor.prototype, protoProps), staticProps && defineProperties(Constructor, staticProps), Constructor; }; }(), _react = __webpack_require__(12), _react2 = _interopRequireDefault(_react), _propTypes = __webpack_require__(282), _propTypes2 = _interopRequireDefault(_propTypes), _reactcss = __webpack_require__(83), _reactcss2 = _interopRequireDefault(_reactcss), Raised = function(_React$Component) { function Raised() { return _classCallCheck(this, Raised), _possibleConstructorReturn(this, (Raised.__proto__ || Object.getPrototypeOf(Raised)).apply(this, arguments)); } return _inherits(Raised, _React$Component), _createClass(Raised, [ { key: "render", value: function() { var styles = (0, _reactcss2["default"])({ "default": { wrap: { position: "relative" }, content: { position: "relative" }, bg: { absolute: "0px 0px 0px 0px", boxShadow: "0 ${ this.props.zDepth }px ${ this.props.zDepth * 4 }px rgba(0,0,0,.24)", borderRadius: this.props.radius, background: this.props.background } }, "zDepth-0": { bg: { boxShadow: "none" } }, "zDepth-1": { bg: { boxShadow: "0 2px 10px rgba(0,0,0,.12), 0 2px 5px rgba(0,0,0,.16)" } }, "zDepth-2": { bg: { boxShadow: "0 6px 20px rgba(0,0,0,.19), 0 8px 17px rgba(0,0,0,.2)" } }, "zDepth-3": { bg: { boxShadow: "0 17px 50px rgba(0,0,0,.19), 0 12px 15px rgba(0,0,0,.24)" } }, "zDepth-4": { bg: { boxShadow: "0 25px 55px rgba(0,0,0,.21), 0 16px 28px rgba(0,0,0,.22)" } }, "zDepth-5": { bg: { boxShadow: "0 40px 77px rgba(0,0,0,.22), 0 27px 24px rgba(0,0,0,.2)" } }, square: { bg: { borderRadius: "0" } }, circle: { bg: { borderRadius: "50%" } } }, this.props); return _react2["default"].createElement("div", { style: styles.wrap }, _react2["default"].createElement("div", { style: styles.bg }), _react2["default"].createElement("div", { style: styles.content }, this.props.children)); } } ]), Raised; }(_react2["default"].Component); Raised.propTypes = { background: _propTypes2["default"].string, zDepth: _propTypes2["default"].oneOf([ "0", "1", "2", "3", "4", "5", 0, 1, 2, 3, 4, 5 ]), radius: _propTypes2["default"].oneOfType([ _propTypes2["default"].string, _propTypes2["default"].number ]) }, Raised.defaultProps = { background: "#fff", zDepth: "1", radius: "2px" }, exports["default"] = Raised; }, function(module, exports, __webpack_require__) { module.exports = __webpack_require__(283)(); }, function(module, exports, __webpack_require__) { "use strict"; var emptyFunction = __webpack_require__(284), invariant = __webpack_require__(285), ReactPropTypesSecret = __webpack_require__(286); module.exports = function() { function shim(props, propName, componentName, location, propFullName, secret) { secret !== ReactPropTypesSecret && invariant(!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 getShim() { return shim; } shim.isRequired = shim; 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 }; return ReactPropTypes.checkPropTypes = emptyFunction, ReactPropTypes.PropTypes = ReactPropTypes, ReactPropTypes; }; }, function(module, exports) { "use strict"; function makeEmptyFunction(arg) { return function() { return arg; }; } var emptyFunction = function() {}; emptyFunction.thatReturns = makeEmptyFunction, emptyFunction.thatReturnsFalse = makeEmptyFunction(!1), emptyFunction.thatReturnsTrue = makeEmptyFunction(!0), emptyFunction.thatReturnsNull = makeEmptyFunction(null), emptyFunction.thatReturnsThis = function() { return this; }, emptyFunction.thatReturnsArgument = function(arg) { return arg; }, module.exports = emptyFunction; }, function(module, exports, __webpack_require__) { "use strict"; function invariant(condition, format, a, b, c, d, e, f) { if (validateFormat(format), !condition) { var error; if (void 0 === format) 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 ], argIndex = 0; error = new Error(format.replace(/%s/g, function() { return args[argIndex++]; })), error.name = "Invariant Violation"; } throw error.framesToPop = 1, error; } } var validateFormat = function(format) {}; module.exports = invariant; }, function(module, exports) { "use strict"; var ReactPropTypesSecret = "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"; module.exports = ReactPropTypesSecret; }, function(module, exports, __webpack_require__) { "use strict"; 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 || "object" != typeof call && "function" != typeof call ? self : call; } function _inherits(subClass, superClass) { if ("function" != typeof superClass && null !== superClass) 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: !1, writable: !0, configurable: !0 } }), superClass && (Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass); } Object.defineProperty(exports, "__esModule", { value: !0 }); var _slicedToArray = function() { function sliceIterator(arr, i) { var _arr = [], _n = !0, _d = !1, _e = void 0; try { for (var _s, _i = arr[Symbol.iterator](); !(_n = (_s = _i.next()).done) && (_arr.push(_s.value), !i || _arr.length !== i); _n = !0) ; } catch (err) { _d = !0, _e = err; } finally { try { !_n && _i["return"] && _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function(arr, i) { if (Array.isArray(arr)) return arr; if (Symbol.iterator in Object(arr)) return sliceIterator(arr, i); throw new TypeError("Invalid attempt to destructure non-iterable instance"); }; }(), _createClass = function() { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0, "value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor); } } return function(Constructor, protoProps, staticProps) { return protoProps && defineProperties(Constructor.prototype, protoProps), staticProps && defineProperties(Constructor, staticProps), Constructor; }; }(), _react = __webpack_require__(12), _react2 = _interopRequireDefault(_react), _reactcss = __webpack_require__(83), _reactcss2 = _interopRequireDefault(_reactcss), Tile = function(_React$Component) { function Tile() { return _classCallCheck(this, Tile), _possibleConstructorReturn(this, (Tile.__proto__ || Object.getPrototypeOf(Tile)).apply(this, arguments)); } return _inherits(Tile, _React$Component), _createClass(Tile, [ { key: "render", value: function() { var styles = (0, _reactcss2["default"])({ "default": { tile: { fontSize: "16px", padding: "16px", display: "flex", justifyContent: "space-between", color: this.props.color }, primary: { display: "flex", width: "100%" }, sidebar: { minWidth: "56px", maxWidth: "56px", flexBasis: "56px" }, content: { background: "none", flex: "1", overflow: "auto" }, secondary: { flexBasis: "42", textAlign: "center" }, sidebarIcon: { marginTop: "-12px", marginLeft: "-12px", marginBottom: "-12px" } }, divider: { tile: { boxShadow: "inset 0 -1px 0 rgba(0,0,0,.12)" } }, condensed: { tile: { paddingBottom: "0px", paddingTop: "0px", paddingRight: "0px" }, sidebar: { minWidth: "28px", maxWidth: "28px", flexBasis: "28px" } } }, { clickable: this.props.onClick }, this.props), _props$children = _slicedToArray(this.props.children, 2), sidebar = _props$children[0], content = _props$children[1]; return _react2["default"].createElement("div", { style: styles.tile, className: "flexbox-fix" }, _react2["default"].createElement("div", { style: styles.primary, className: "flexbox-fix" }, _react2["default"].createElement("div", { style: styles.sidebar, key: "sidebar-#{ sidebar }" }, sidebar), _react2["default"].createElement("div", { style: styles.content, key: "content-#{ content }" }, content))); } } ]), Tile; }(_react2["default"].Component); exports["default"] = Tile; }, function(module, exports, __webpack_require__) { "use strict"; 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 || "object" != typeof call && "function" != typeof call ? self : call; } function _inherits(subClass, superClass) { if ("function" != typeof superClass && null !== superClass) 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: !1, writable: !0, configurable: !0 } }), superClass && (Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass); } Object.defineProperty(exports, "__esModule", { value: !0 }); var _createClass = function() { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0, "value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor); } } return function(Constructor, protoProps, staticProps) { return protoProps && defineProperties(Constructor.prototype, protoProps), staticProps && defineProperties(Constructor, staticProps), Constructor; }; }(), _react = __webpack_require__(12), _react2 = _interopRequireDefault(_react), _reactcss = __webpack_require__(83), _reactcss2 = _interopRequireDefault(_reactcss), _isString = __webpack_require__(85), _isString2 = _interopRequireDefault(_isString), _Tab = __webpack_require__(289), _Tab2 = _interopRequireDefault(_Tab), _Link = __webpack_require__(290), _Link2 = _interopRequireDefault(_Link), Tabs = function(_React$Component) { function Tabs(props) { _classCallCheck(this, Tabs); var selectedTab, _this = _possibleConstructorReturn(this, (Tabs.__proto__ || Object.getPrototypeOf(Tabs)).call(this)); return selectedTab = props.selectedTab < (props.tabs && props.tabs.length) ? props.selectedTab : 0, _this.state = { selectedTab: selectedTab }, _this.handleClick = _this.handleClick.bind(_this), _this.slide = _this.slide.bind(_this), _this; } return _inherits(Tabs, _React$Component), _createClass(Tabs, [ { key: "handleClick", value: function(tab) { this.props.onChange && this.props.onChange(tab), this.setState({ selectedTab: tab }); } }, { key: "slide", value: function() { if (this.props.tabs.length) { var containerNode = this.refs.tabs.getDOMNode(), containerLeft = containerNode.scrollLeft, containerRight = containerNode.offsetWidth + containerNode.scrollLeft, selectedNode = this.refs["tab-" + this.state.selectedTab] && this.refs["tab-" + this.state.selectedTab].getDOMNode(), selectedLeft = selectedNode && selectedNode.getBoundingClientRect().left - containerNode.getBoundingClientRect().left + containerNode.scrollLeft, selectedRight = selectedNode && selectedLeft + selectedNode.offsetWidth; selectedRight > containerRight && (containerNode.scrollLeft += selectedRight - containerRight), selectedLeft < containerLeft && (containerNode.scrollLeft -= containerLeft - selectedLeft); var indicator = this.refs.indicator; indicator.style.left = selectedLeft + "px", indicator.style.width = selectedNode.offsetWidth + "px", indicator.style.height = "2px"; } } }, { key: "componentDidMount", value: function() { this.slide(); } }, { key: "componentWillReceiveProps", value: function(nextProps) { nextProps.selectedTab !== this.state.selectedTab && this.setState({ selectedTab: nextProps.selectedTab }); } }, { key: "componentWillUpdate", value: function(nextProps, nextState) { nextState.selectedTab >= (nextProps.tabs && nextProps.tabs.length) && (nextState.selectedTab = nextProps.tabs.length - 1); } }, { key: "componentDidUpdate", value: function() { this.slide(); } }, { key: "render", value: function() { for (var styles = (0, _reactcss2["default"])({ "default": { tabs: { position: "relative", background: this.props.background }, tabWrap: { display: "flex" }, tab: { justifyContent: "flex-start", minWidth: "68px", maxWidth: "240px" }, Tab: { color: this.props.color, inactive: this.props.inactive, capitalize: this.props.capitalize }, indicator: { height: "0", position: "absolute", bottom: "0", left: "0", background: this.props.color, transition: "all 200ms linear" } }, scrollable: { tabs: { overflowX: "scroll" }, tabWrap: { paddingLeft: "60px", justifyContent: "flex-start", width: "400%" }, tab: { width: "auto" } }, "align-justify": { tabWrap: { justifyContent: "space-between" }, tab: { width: 100 / this.props.tabs.length + "%" } }, "align-left": { tabWrap: { paddingLeft: "60px", justifyContent: "flex-start" }, tab: { width: "auto" } }, "align-center": { tabWrap: { justifyContent: "center" }, tab: { width: "auto" } } }, { scrollable: this.props.width / this.props.tabs.length < 72 }, this.props, this.state), tabs = [], i = 0; i < this.props.tabs.length; i++) { var label, callback, callbackValue, newTab, tab = this.props.tabs[i]; (0, _isString2["default"])(tab) ? (label = tab, callback = null) : (label = tab.label, callback = tab.onClick, callbackValue = tab.callbackValue, newTab = tab.newTab), tabs.push(_react2["default"].createElement("div", { style: styles.tab, ref: "tab-" + i, key: i }, _react2["default"].createElement(_Link2["default"], { onClick: callback, callbackValue: callbackValue, newTab: newTab }, _react2["default"].createElement(_Tab2["default"], { style: styles.Tab, tab: i, selected: this.state.selectedTab === i, selectable: tab.selectable, onClick: this.handleClick }, label)))); } return _react2["default"].createElement("div", { style: styles.tabs, ref: "tabs" }, _react2["default"].createElement("div", { style: styles.tabWrap, className: "flexbox-fix" }, tabs), _react2["default"].createElement("div", { style: styles.indicator, ref: "indicator" })); } } ]), Tabs; }(_react2["default"].Component); Tabs.defaultProps = { selectedTab: 0, background: "transparent", color: "#fff" }, exports["default"] = Tabs; }, function(module, exports, __webpack_require__) { "use strict"; 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 || "object" != typeof call && "function" != typeof call ? self : call; } function _inherits(subClass, superClass) { if ("function" != typeof superClass && null !== superClass) 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: !1, writable: !0, configurable: !0 } }), superClass && (Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass); } Object.defineProperty(exports, "__esModule", { value: !0 }); var _createClass = function() { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0, "value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor); } } return function(Constructor, protoProps, staticProps) { return protoProps && defineProperties(Constructor.prototype, protoProps), staticProps && defineProperties(Constructor, staticProps), Constructor; }; }(), _react = __webpack_require__(12), _react2 = _interopRequireDefault(_react), _propTypes = __webpack_require__(282), _propTypes2 = _interopRequireDefault(_propTypes), _reactcss = __webpack_require__(83), _reactcss2 = _interopRequireDefault(_reactcss), Tab = function(_React$Component) { function Tab() { _classCallCheck(this, Tab); var _this = _possibleConstructorReturn(this, (Tab.__proto__ || Object.getPrototypeOf(Tab)).call(this)); return _this.handleClick = _this.handleClick.bind(_this), _this; } return _inherits(Tab, _React$Component), _createClass(Tab, [ { key: "handleClick", value: function() { this.props.selectable !== !1 && this.props.onClick(this.props.tab); } }, { key: "render", value: function() { var styles = (0, _reactcss2["default"])({ "default": { tab: { color: this.props.inactive || this.props.color, cursor: "pointer", paddingLeft: "12px", paddingRight: "12px", height: "48px", lineHeight: "48px", textAlign: "center", fontSize: "14px", textTransform: this.props.capitalize === !1 ? "" : "uppercase", fontWeight: "500", whiteSpace: "nowrap", opacity: ".47", transition: "opacity 100ms linear" } }, selected: { tab: { color: this.props.color, opacity: ".87" } } }, this.props); return _react2["default"].createElement("div", { style: styles.tab, onClick: this.handleClick }, this.props.children); } } ]), Tab; }(_react2["default"].Component); Tab.propTypes = { selected: _propTypes2["default"].bool }, Tab.defaultProps = { selected: !1, color: "#fff" }, exports["default"] = Tab; }, function(module, exports, __webpack_require__) { "use strict"; 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 || "object" != typeof call && "function" != typeof call ? self : call; } function _inherits(subClass, superClass) { if ("function" != typeof superClass && null !== superClass) 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: !1, writable: !0, configurable: !0 } }), superClass && (Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass); } Object.defineProperty(exports, "__esModule", { value: !0 }); var _createClass = function() { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0, "value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor); } } return function(Constructor, protoProps, staticProps) { return protoProps && defineProperties(Constructor.prototype, protoProps), staticProps && defineProperties(Constructor, staticProps), Constructor; }; }(), _react = __webpack_require__(12), _react2 = _interopRequireDefault(_react), _isString = __webpack_require__(85), _isString2 = _interopRequireDefault(_isString), Link = function(_React$Component) { function Link() { _classCallCheck(this, Link); var _this = _possibleConstructorReturn(this, (Link.__proto__ || Object.getPrototypeOf(Link)).call(this)); return _this.handleClick = _this.handleClick.bind(_this), _this; } return _inherits(Link, _React$Component), _createClass(Link, [ { key: "handleClick", value: function(e) { this.props.onClick && this.props.onClick(e, this.props.callbackValue); } }, { key: "render", value: function() { var a; return a = (0, _isString2["default"])(this.props.onClick) ? _react2["default"].createElement("a", { style: { textDecoration: "none" }, href: this.props.onClick, target: this.props.newTab && "_blank" }, this.props.children) : _react2["default"].createElement("a", { style: { textDecoration: "none" }, onClick: this.handleClick }, this.props.children); } } ]), Link; }(_react2["default"].Component); Link.defaultProps = { newTab: !1 }, exports["default"] = Link; }, function(module, exports, __webpack_require__) { "use strict"; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } Object.defineProperty(exports, "__esModule", { value: !0 }), exports.CompactColor = void 0; var _react = __webpack_require__(12), _react2 = _interopRequireDefault(_react), _reactcss = __webpack_require__(83), _reactcss2 = _interopRequireDefault(_reactcss), CompactColor = exports.CompactColor = function(_ref) { var color = _ref.color, onClick = _ref.onClick, active = _ref.active, styles = (0, _reactcss2["default"])({ "default": { color: { background: color, width: "15px", height: "15px", "float": "left", marginRight: "5px", marginBottom: "5px", position: "relative", cursor: "pointer" }, dot: { absolute: "5px 5px 5px 5px", background: "#fff", borderRadius: "50%", opacity: "0" } }, active: { dot: { opacity: "1" } }, "color-#FFFFFF": { color: { boxShadow: "inset 0 0 0 1px #ddd" }, dot: { background: "#000" } } }, { active: active, "color-#FFFFFF": "#FFFFFF" === color }), handleClick = function(e) { return onClick({ hex: color }, e); }; return _react2["default"].createElement("div", { style: styles.color, onClick: handleClick }, _react2["default"].createElement("div", { style: styles.dot })); }; exports["default"] = CompactColor; }, function(module, exports, __webpack_require__) { "use strict"; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } Object.defineProperty(exports, "__esModule", { value: !0 }), exports.CompactFields = void 0; var _react = __webpack_require__(12), _react2 = _interopRequireDefault(_react), _reactcss = __webpack_require__(83), _reactcss2 = _interopRequireDefault(_reactcss), _common = __webpack_require__(249), CompactFields = exports.CompactFields = function(_ref) { var hex = _ref.hex, rgb = _ref.rgb, onChange = _ref.onChange, styles = (0, _reactcss2["default"])({ "default": { fields: { display: "flex", paddingBottom: "6px", paddingRight: "5px", position: "relative" }, active: { position: "absolute", top: "6px", left: "5px", height: "9px", width: "9px", background: hex }, HEXwrap: { flex: "6", position: "relative" }, HEXinput: { width: "80%", padding: "0px", paddingLeft: "20%", border: "none", outline: "none", background: "none", fontSize: "12px", color: "#333", height: "16px" }, HEXlabel: { display: "none" }, RGBwrap: { flex: "3", position: "relative" }, RGBinput: { width: "70%", padding: "0px", paddingLeft: "30%", border: "none", outline: "none", background: "none", fontSize: "12px", color: "#333", height: "16px" }, RGBlabel: { position: "absolute", top: "3px", left: "0px", lineHeight: "16px", textTransform: "uppercase", fontSize: "12px", color: "#999" } } }), handleChange = function(data, e) { data.r || data.g || data.b ? onChange({ r: data.r || rgb.r, g: data.g || rgb.g, b: data.b || rgb.b, source: "rgb" }, e) : onChange({ hex: data.hex, source: "hex" }, e); }; return _react2["default"].createElement("div", { style: styles.fields, className: "flexbox-fix" }, _react2["default"].createElement("div", { style: styles.active }), _react2["default"].createElement(_common.EditableInput, { style: { wrap: styles.HEXwrap, input: styles.HEXinput, label: styles.HEXlabel }, label: "hex", value: hex, onChange: handleChange }), _react2["default"].createElement(_common.EditableInput, { style: { wrap: styles.RGBwrap, input: styles.RGBinput, label: styles.RGBlabel }, label: "r", value: rgb.r, onChange: handleChange }), _react2["default"].createElement(_common.EditableInput, { style: { wrap: styles.RGBwrap, input: styles.RGBinput, label: styles.RGBlabel }, label: "g", value: rgb.g, onChange: handleChange }), _react2["default"].createElement(_common.EditableInput, { style: { wrap: styles.RGBwrap, input: styles.RGBinput, label: styles.RGBlabel }, label: "b", value: rgb.b, onChange: handleChange })); }; exports["default"] = CompactFields; }, function(module, exports, __webpack_require__) { "use strict"; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } Object.defineProperty(exports, "__esModule", { value: !0 }), exports.Github = void 0; var _react = __webpack_require__(12), _react2 = _interopRequireDefault(_react), _reactcss = __webpack_require__(83), _reactcss2 = _interopRequireDefault(_reactcss), _map = __webpack_require__(123), _map2 = _interopRequireDefault(_map), _common = __webpack_require__(249), _GithubSwatch = __webpack_require__(294), _GithubSwatch2 = _interopRequireDefault(_GithubSwatch), Github = exports.Github = function(_ref) { var width = _ref.width, colors = _ref.colors, onChange = _ref.onChange, triangle = _ref.triangle, styles = (0, _reactcss2["default"])({ "default": { card: { width: width, background: "#fff", border: "1px solid rgba(0,0,0,0.2)", boxShadow: "0 3px 12px rgba(0,0,0,0.15)", borderRadius: "4px", position: "relative", padding: "5px", display: "flex", flexWrap: "wrap" }, triangle: { position: "absolute", border: "7px solid transparent", borderBottomColor: "#fff" }, triangleShadow: { position: "absolute", border: "8px solid transparent", borderBottomColor: "rgba(0,0,0,0.15)" } }, "hide-triangle": { triangle: { display: "none" }, triangleShadow: { display: "none" } }, "top-left-triangle": { triangle: { top: "-14px", left: "10px" }, triangleShadow: { top: "-16px", left: "9px" } }, "top-right-triangle": { triangle: { top: "-14px", right: "10px" }, triangleShadow: { top: "-16px", right: "9px" } }, "bottom-right-triangle": { triangle: { top: "35px", right: "10px", transform: "rotate(180deg)" }, triangleShadow: { top: "37px", right: "9px", transform: "rotate(180deg)" } } }, { "hide-triangle": "hide" === triangle, "top-left-triangle": "top-left" === triangle, "top-right-triangle": "top-right" === triangle, "bottom-right-triangle": "bottom-right" === triangle }), handleChange = function(hex, e) { return onChange({ hex: hex, source: "hex" }, e); }; return _react2["default"].createElement("div", { style: styles.card, className: "github-picker" }, _react2["default"].createElement("div", { style: styles.triangleShadow }), _react2["default"].createElement("div", { style: styles.triangle }), (0, _map2["default"])(colors, function(c) { return _react2["default"].createElement(_GithubSwatch2["default"], { color: c, key: c, onClick: handleChange }); })); }; Github.defaultProps = { width: "200px", colors: [ "#B80000", "#DB3E00", "#FCCB00", "#008B02", "#006B76", "#1273DE", "#004DCF", "#5300EB", "#EB9694", "#FAD0C3", "#FEF3BD", "#C1E1C5", "#BEDADC", "#C4DEF6", "#BED3F3", "#D4C4FB" ], triangle: "top-left" }, exports["default"] = (0, _common.ColorWrap)(Github); }, function(module, exports, __webpack_require__) { "use strict"; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } Object.defineProperty(exports, "__esModule", { value: !0 }), exports.GithubSwatch = void 0; var _react = __webpack_require__(12), _react2 = _interopRequireDefault(_react), _reactcss = __webpack_require__(83), _reactcss2 = _interopRequireDefault(_reactcss), _common = __webpack_require__(249), GithubSwatch = exports.GithubSwatch = function(_ref) { var hover = _ref.hover, color = _ref.color, onClick = _ref.onClick, styles = (0, _reactcss2["default"])({ "default": { swatch: { width: "25px", height: "25px" } }, hover: { swatch: { position: "relative", zIndex: "2", outline: "2px solid #fff", boxShadow: "0 0 5px 2px rgba(0,0,0,0.25)" } } }, { hover: hover }); return _react2["default"].createElement("div", { style: styles.swatch }, _react2["default"].createElement(_common.Swatch, { color: color, onClick: onClick })); }; exports["default"] = (0, _reactcss.handleHover)(GithubSwatch); }, function(module, exports, __webpack_require__) { "use strict"; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } Object.defineProperty(exports, "__esModule", { value: !0 }), exports.HuePicker = void 0; var _extends = Object.assign || function(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) Object.prototype.hasOwnProperty.call(source, key) && (target[key] = source[key]); } return target; }, _react = __webpack_require__(12), _react2 = _interopRequireDefault(_react), _reactcss = __webpack_require__(83), _reactcss2 = _interopRequireDefault(_reactcss), _common = __webpack_require__(249), _HuePointer = __webpack_require__(296), _HuePointer2 = _interopRequireDefault(_HuePointer), HuePicker = exports.HuePicker = function(_ref) { var width = _ref.width, height = _ref.height, onChange = _ref.onChange, hsl = _ref.hsl, direction = _ref.direction, pointer = _ref.pointer, styles = (0, _reactcss2["default"])({ "default": { picker: { position: "relative", width: width, height: height }, hue: { radius: "2px" } } }), handleChange = function(data) { return onChange({ a: 1, h: data.h, l: .5, s: 1 }); }; return _react2["default"].createElement("div", { style: styles.picker, className: "hue-picker" }, _react2["default"].createElement(_common.Hue, _extends({}, styles.hue, { hsl: hsl, pointer: pointer, onChange: handleChange, direction: direction }))); }; HuePicker.defaultProps = { width: "316px", height: "16px", direction: "horizontal", pointer: _HuePointer2["default"] }, exports["default"] = (0, _common.ColorWrap)(HuePicker); }, function(module, exports, __webpack_require__) { "use strict"; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } Object.defineProperty(exports, "__esModule", { value: !0 }), exports.SliderPointer = void 0; var _react = __webpack_require__(12), _react2 = _interopRequireDefault(_react), _reactcss = __webpack_require__(83), _reactcss2 = _interopRequireDefault(_reactcss), SliderPointer = exports.SliderPointer = function(_ref) { var direction = _ref.direction, styles = (0, _reactcss2["default"])({ "default": { picker: { width: "18px", height: "18px", borderRadius: "50%", transform: "translate(-9px, -1px)", backgroundColor: "rgb(248, 248, 248)", boxShadow: "0 1px 4px 0 rgba(0, 0, 0, 0.37)" } }, vertical: { picker: { transform: "translate(-3px, -9px)" } } }, { vertical: "vertical" === direction }); return _react2["default"].createElement("div", { style: styles.picker }); }; exports["default"] = SliderPointer; }, function(module, exports, __webpack_require__) { "use strict"; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } Object.defineProperty(exports, "__esModule", { value: !0 }), exports.Material = void 0; var _react = __webpack_require__(12), _react2 = _interopRequireDefault(_react), _reactcss = __webpack_require__(83), _reactcss2 = _interopRequireDefault(_reactcss), _color = __webpack_require__(264), _color2 = _interopRequireDefault(_color), _reactMaterialDesign = __webpack_require__(280), _common = __webpack_require__(249), Material = exports.Material = function(_ref) { var onChange = _ref.onChange, hex = _ref.hex, rgb = _ref.rgb, styles = (0, _reactcss2["default"])({ "default": { material: { width: "98px", height: "98px", padding: "16px", fontFamily: "Roboto" }, HEXwrap: { position: "relative" }, HEXinput: { width: "100%", marginTop: "12px", fontSize: "15px", color: "#333", padding: "0px", border: "0px", borderBottom: "2px solid " + hex, outline: "none", height: "30px" }, HEXlabel: { position: "absolute", top: "0px", left: "0px", fontSize: "11px", color: "#999999", textTransform: "capitalize" }, Hex: { style: {} }, RGBwrap: { position: "relative" }, RGBinput: { width: "100%", marginTop: "12px", fontSize: "15px", color: "#333", padding: "0px", border: "0px", borderBottom: "1px solid #eee", outline: "none", height: "30px" }, RGBlabel: { position: "absolute", top: "0px", left: "0px", fontSize: "11px", color: "#999999", textTransform: "capitalize" }, split: { display: "flex", marginRight: "-10px", paddingTop: "11px" }, third: { flex: "1", paddingRight: "10px" } } }), handleChange = function(data, e) { data.hex ? _color2["default"].isValidHex(data.hex) && onChange({ hex: data.hex, source: "hex" }, e) : (data.r || data.g || data.b) && onChange({ r: data.r || rgb.r, g: data.g || rgb.g, b: data.b || rgb.b, source: "rgb" }, e); }; return _react2["default"].createElement(_reactMaterialDesign.Raised, null, _react2["default"].createElement("div", { style: styles.material, className: "material-picker" }, _react2["default"].createElement(_common.EditableInput, { style: { wrap: styles.HEXwrap, input: styles.HEXinput, label: styles.HEXlabel }, label: "hex", value: hex, onChange: handleChange }), _react2["default"].createElement("div", { style: styles.split, className: "flexbox-fix" }, _react2["default"].createElement("div", { style: styles.third }, _react2["default"].createElement(_common.EditableInput, { style: { wrap: styles.RGBwrap, input: styles.RGBinput, label: styles.RGBlabel }, label: "r", value: rgb.r, onChange: handleChange })), _react2["default"].createElement("div", { style: styles.third }, _react2["default"].createElement(_common.EditableInput, { style: { wrap: styles.RGBwrap, input: styles.RGBinput, label: styles.RGBlabel }, label: "g", value: rgb.g, onChange: handleChange })), _react2["default"].createElement("div", { style: styles.third }, _react2["default"].createElement(_common.EditableInput, { style: { wrap: styles.RGBwrap, input: styles.RGBinput, label: styles.RGBlabel }, label: "b", value: rgb.b, onChange: handleChange }))))); }; exports["default"] = (0, _common.ColorWrap)(Material); }, function(module, exports, __webpack_require__) { "use strict"; 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 || "object" != typeof call && "function" != typeof call ? self : call; } function _inherits(subClass, superClass) { if ("function" != typeof superClass && null !== superClass) 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: !1, writable: !0, configurable: !0 } }), superClass && (Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass); } Object.defineProperty(exports, "__esModule", { value: !0 }), exports.Photoshop = void 0; var _createClass = function() { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0, "value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor); } } return function(Constructor, protoProps, staticProps) { return protoProps && defineProperties(Constructor.prototype, protoProps), staticProps && defineProperties(Constructor, staticProps), Constructor; }; }(), _react = __webpack_require__(12), _react2 = _interopRequireDefault(_react), _reactcss = __webpack_require__(83), _reactcss2 = _interopRequireDefault(_reactcss), _common = __webpack_require__(249), _PhotoshopFields = __webpack_require__(299), _PhotoshopFields2 = _interopRequireDefault(_PhotoshopFields), _PhotoshopPointerCircle = __webpack_require__(300), _PhotoshopPointerCircle2 = _interopRequireDefault(_PhotoshopPointerCircle), _PhotoshopPointer = __webpack_require__(301), _PhotoshopPointer2 = _interopRequireDefault(_PhotoshopPointer), _PhotoshopButton = __webpack_require__(302), _PhotoshopButton2 = _interopRequireDefault(_PhotoshopButton), _PhotoshopPreviews = __webpack_require__(303), _PhotoshopPreviews2 = _interopRequireDefault(_PhotoshopPreviews), Photoshop = exports.Photoshop = function(_React$Component) { function Photoshop(props) { _classCallCheck(this, Photoshop); var _this = _possibleConstructorReturn(this, (Photoshop.__proto__ || Object.getPrototypeOf(Photoshop)).call(this)); return _this.state = { currentColor: props.hex }, _this; } return _inherits(Photoshop, _React$Component), _createClass(Photoshop, [ { key: "render", value: function() { var styles = (0, _reactcss2["default"])({ "default": { picker: { background: "#DCDCDC", borderRadius: "4px", boxShadow: "0 0 0 1px rgba(0,0,0,.25), 0 8px 16px rgba(0,0,0,.15)", boxSizing: "initial", width: "513px" }, head: { backgroundImage: "linear-gradient(-180deg, #F0F0F0 0%, #D4D4D4 100%)", borderBottom: "1px solid #B1B1B1", boxShadow: "inset 0 1px 0 0 rgba(255,255,255,.2), inset 0 -1px 0 0 rgba(0,0,0,.02)", height: "23px", lineHeight: "24px", borderRadius: "4px 4px 0 0", fontSize: "13px", color: "#4D4D4D", textAlign: "center" }, body: { padding: "15px 15px 0", display: "flex" }, saturation: { width: "256px", height: "256px", position: "relative", border: "2px solid #B3B3B3", borderBottom: "2px solid #F0F0F0", overflow: "hidden" }, hue: { position: "relative", height: "256px", width: "19px", marginLeft: "10px", border: "2px solid #B3B3B3", borderBottom: "2px solid #F0F0F0" }, controls: { width: "180px", marginLeft: "10px" }, top: { display: "flex" }, previews: { width: "60px" }, actions: { flex: "1", marginLeft: "20px" } } }); return _react2["default"].createElement("div", { style: styles.picker, className: "photoshop-picker" }, _react2["default"].createElement("div", { style: styles.head }, this.props.header), _react2["default"].createElement("div", { style: styles.body, className: "flexbox-fix" }, _react2["default"].createElement("div", { style: styles.saturation }, _react2["default"].createElement(_common.Saturation, { hsl: this.props.hsl, hsv: this.props.hsv, pointer: _PhotoshopPointerCircle2["default"], onChange: this.props.onChange })), _react2["default"].createElement("div", { style: styles.hue }, _react2["default"].createElement(_common.Hue, { direction: "vertical", hsl: this.props.hsl, pointer: _PhotoshopPointer2["default"], onChange: this.props.onChange })), _react2["default"].createElement("div", { style: styles.controls }, _react2["default"].createElement("div", { style: styles.top, className: "flexbox-fix" }, _react2["default"].createElement("div", { style: styles.previews }, _react2["default"].createElement(_PhotoshopPreviews2["default"], { rgb: this.props.rgb, currentColor: this.state.currentColor })), _react2["default"].createElement("div", { style: styles.actions }, _react2["default"].createElement(_PhotoshopButton2["default"], { label: "OK", onClick: this.props.onAccept, active: !0 }), _react2["default"].createElement(_PhotoshopButton2["default"], { label: "Cancel", onClick: this.props.onCancel }), _react2["default"].createElement(_PhotoshopFields2["default"], { onChange: this.props.onChange, rgb: this.props.rgb, hsv: this.props.hsv, hex: this.props.hex })))))); } } ]), Photoshop; }(_react2["default"].Component); Photoshop.defaultProps = { header: "Color Picker" }, exports["default"] = (0, _common.ColorWrap)(Photoshop); }, function(module, exports, __webpack_require__) { "use strict"; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } Object.defineProperty(exports, "__esModule", { value: !0 }), exports.PhotoshopPicker = void 0; var _react = __webpack_require__(12), _react2 = _interopRequireDefault(_react), _reactcss = __webpack_require__(83), _reactcss2 = _interopRequireDefault(_reactcss), _color = __webpack_require__(264), _color2 = _interopRequireDefault(_color), _common = __webpack_require__(249), PhotoshopPicker = exports.PhotoshopPicker = function(_ref) { var onChange = _ref.onChange, rgb = _ref.rgb, hsv = _ref.hsv, hex = _ref.hex, styles = (0, _reactcss2["default"])({ "default": { fields: { paddingTop: "5px", paddingBottom: "9px", width: "80px", position: "relative" }, divider: { height: "5px" }, RGBwrap: { position: "relative" }, RGBinput: { marginLeft: "40%", width: "40%", height: "18px", border: "1px solid #888888", boxShadow: "inset 0 1px 1px rgba(0,0,0,.1), 0 1px 0 0 #ECECEC", marginBottom: "5px", fontSize: "13px", paddingLeft: "3px", marginRight: "10px" }, RGBlabel: { left: "0px", width: "34px", textTransform: "uppercase", fontSize: "13px", height: "18px", lineHeight: "22px", position: "absolute" }, HEXwrap: { position: "relative" }, HEXinput: { marginLeft: "20%", width: "80%", height: "18px", border: "1px solid #888888", boxShadow: "inset 0 1px 1px rgba(0,0,0,.1), 0 1px 0 0 #ECECEC", marginBottom: "6px", fontSize: "13px", paddingLeft: "3px" }, HEXlabel: { position: "absolute", top: "0px", left: "0px", width: "14px", textTransform: "uppercase", fontSize: "13px", height: "18px", lineHeight: "22px" }, fieldSymbols: { position: "absolute", top: "5px", right: "-7px", fontSize: "13px" }, symbol: { height: "20px", lineHeight: "22px", paddingBottom: "7px" } } }), handleChange = function(data, e) { data["#"] ? _color2["default"].isValidHex(data["#"]) && onChange({ hex: data["#"], source: "hex" }, e) : data.r || data.g || data.b ? onChange({ r: data.r || rgb.r, g: data.g || rgb.g, b: data.b || rgb.b, source: "rgb" }, e) : (data.h || data.s || data.v) && onChange({ h: data.h || hsv.h, s: data.s || hsv.s, v: data.v || hsv.v, source: "hsv" }, e); }; return _react2["default"].createElement("div", { style: styles.fields }, _react2["default"].createElement(_common.EditableInput, { style: { wrap: styles.RGBwrap, input: styles.RGBinput, label: styles.RGBlabel }, label: "h", value: Math.round(hsv.h), onChange: handleChange }), _react2["default"].createElement(_common.EditableInput, { style: { wrap: styles.RGBwrap, input: styles.RGBinput, label: styles.RGBlabel }, label: "s", value: Math.round(100 * hsv.s), onChange: handleChange }), _react2["default"].createElement(_common.EditableInput, { style: { wrap: styles.RGBwrap, input: styles.RGBinput, label: styles.RGBlabel }, label: "v", value: Math.round(100 * hsv.v), onChange: handleChange }), _react2["default"].createElement("div", { style: styles.divider }), _react2["default"].createElement(_common.EditableInput, { style: { wrap: styles.RGBwrap, input: styles.RGBinput, label: styles.RGBlabel }, label: "r", value: rgb.r, onChange: handleChange }), _react2["default"].createElement(_common.EditableInput, { style: { wrap: styles.RGBwrap, input: styles.RGBinput, label: styles.RGBlabel }, label: "g", value: rgb.g, onChange: handleChange }), _react2["default"].createElement(_common.EditableInput, { style: { wrap: styles.RGBwrap, input: styles.RGBinput, label: styles.RGBlabel }, label: "b", value: rgb.b, onChange: handleChange }), _react2["default"].createElement("div", { style: styles.divider }), _react2["default"].createElement(_common.EditableInput, { style: { wrap: styles.HEXwrap, input: styles.HEXinput, label: styles.HEXlabel }, label: "#", value: hex.replace("#", ""), onChange: handleChange }), _react2["default"].createElement("div", { style: styles.fieldSymbols }, _react2["default"].createElement("div", { style: styles.symbol }, "°"), _react2["default"].createElement("div", { style: styles.symbol }, "%"), _react2["default"].createElement("div", { style: styles.symbol }, "%"))); }; exports["default"] = PhotoshopPicker; }, function(module, exports, __webpack_require__) { "use strict"; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } Object.defineProperty(exports, "__esModule", { value: !0 }), exports.PhotoshopPointerCircle = void 0; var _react = __webpack_require__(12), _react2 = _interopRequireDefault(_react), _reactcss = __webpack_require__(83), _reactcss2 = _interopRequireDefault(_reactcss), PhotoshopPointerCircle = exports.PhotoshopPointerCircle = function(_ref) { var hsl = _ref.hsl, styles = (0, _reactcss2["default"])({ "default": { picker: { width: "12px", height: "12px", borderRadius: "6px", boxShadow: "inset 0 0 0 1px #fff", transform: "translate(-6px, -6px)" } }, "black-outline": { picker: { boxShadow: "inset 0 0 0 1px #000" } } }, { "black-outline": hsl.l > .5 }); return _react2["default"].createElement("div", { style: styles.picker }); }; exports["default"] = PhotoshopPointerCircle; }, function(module, exports, __webpack_require__) { "use strict"; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } Object.defineProperty(exports, "__esModule", { value: !0 }), exports.PhotoshopPointerCircle = void 0; var _react = __webpack_require__(12), _react2 = _interopRequireDefault(_react), _reactcss = __webpack_require__(83), _reactcss2 = _interopRequireDefault(_reactcss), PhotoshopPointerCircle = exports.PhotoshopPointerCircle = function() { var styles = (0, _reactcss2["default"])({ "default": { triangle: { width: 0, height: 0, borderStyle: "solid", borderWidth: "4px 0 4px 6px", borderColor: "transparent transparent transparent #fff", position: "absolute", top: "1px", left: "1px" }, triangleBorder: { width: 0, height: 0, borderStyle: "solid", borderWidth: "5px 0 5px 8px", borderColor: "transparent transparent transparent #555" }, left: { Extend: "triangleBorder", transform: "translate(-13px, -4px)" }, leftInside: { Extend: "triangle", transform: "translate(-8px, -5px)" }, right: { Extend: "triangleBorder", transform: "translate(20px, -14px) rotate(180deg)" }, rightInside: { Extend: "triangle", transform: "translate(-8px, -5px)" } } }); return _react2["default"].createElement("div", { style: styles.pointer }, _react2["default"].createElement("div", { style: styles.left }, _react2["default"].createElement("div", { style: styles.leftInside })), _react2["default"].createElement("div", { style: styles.right }, _react2["default"].createElement("div", { style: styles.rightInside }))); }; exports["default"] = PhotoshopPointerCircle; }, function(module, exports, __webpack_require__) { "use strict"; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } Object.defineProperty(exports, "__esModule", { value: !0 }), exports.PhotoshopBotton = void 0; var _react = __webpack_require__(12), _react2 = _interopRequireDefault(_react), _reactcss = __webpack_require__(83), _reactcss2 = _interopRequireDefault(_reactcss), PhotoshopBotton = exports.PhotoshopBotton = function(_ref) { var onClick = _ref.onClick, label = _ref.label, children = _ref.children, active = _ref.active, styles = (0, _reactcss2["default"])({ "default": { button: { backgroundImage: "linear-gradient(-180deg, #FFFFFF 0%, #E6E6E6 100%)", border: "1px solid #878787", borderRadius: "2px", height: "20px", boxShadow: "0 1px 0 0 #EAEAEA", fontSize: "14px", color: "#000", lineHeight: "20px", textAlign: "center", marginBottom: "10px", cursor: "pointer" } }, active: { button: { boxShadow: "0 0 0 1px #878787" } } }, { active: active }); return _react2["default"].createElement("div", { style: styles.button, onClick: onClick }, label || children); }; exports["default"] = PhotoshopBotton; }, function(module, exports, __webpack_require__) { "use strict"; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } Object.defineProperty(exports, "__esModule", { value: !0 }), exports.PhotoshopPreviews = void 0; var _react = __webpack_require__(12), _react2 = _interopRequireDefault(_react), _reactcss = __webpack_require__(83), _reactcss2 = _interopRequireDefault(_reactcss), PhotoshopPreviews = exports.PhotoshopPreviews = function(_ref) { var rgb = _ref.rgb, currentColor = _ref.currentColor, styles = (0, _reactcss2["default"])({ "default": { swatches: { border: "1px solid #B3B3B3", borderBottom: "1px solid #F0F0F0", marginBottom: "2px", marginTop: "1px" }, "new": { height: "34px", background: "rgb(" + rgb.r + "," + rgb.g + ", " + rgb.b + ")", boxShadow: "inset 1px 0 0 #000, inset -1px 0 0 #000, inset 0 1px 0 #000" }, current: { height: "34px", background: currentColor, boxShadow: "inset 1px 0 0 #000, inset -1px 0 0 #000, inset 0 -1px 0 #000" }, label: { fontSize: "14px", color: "#000", textAlign: "center" } } }); return _react2["default"].createElement("div", null, _react2["default"].createElement("div", { style: styles.label }, "new"), _react2["default"].createElement("div", { style: styles.swatches }, _react2["default"].createElement("div", { style: styles["new"] }), _react2["default"].createElement("div", { style: styles.current })), _react2["default"].createElement("div", { style: styles.label }, "current")); }; exports["default"] = PhotoshopPreviews; }, function(module, exports, __webpack_require__) { "use strict"; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } Object.defineProperty(exports, "__esModule", { value: !0 }), exports.Sketch = void 0; var _react = __webpack_require__(12), _react2 = _interopRequireDefault(_react), _reactcss = __webpack_require__(83), _reactcss2 = _interopRequireDefault(_reactcss), _common = __webpack_require__(249), _SketchFields = __webpack_require__(305), _SketchFields2 = _interopRequireDefault(_SketchFields), _SketchPresetColors = __webpack_require__(306), _SketchPresetColors2 = _interopRequireDefault(_SketchPresetColors), Sketch = exports.Sketch = function(_ref) { var width = _ref.width, rgb = _ref.rgb, hex = _ref.hex, hsv = _ref.hsv, hsl = _ref.hsl, onChange = _ref.onChange, disableAlpha = _ref.disableAlpha, presetColors = _ref.presetColors, renderers = _ref.renderers, styles = (0, _reactcss2["default"])({ "default": { picker: { width: width, padding: "10px 10px 0", boxSizing: "initial", background: "#fff", borderRadius: "4px", boxShadow: "0 0 0 1px rgba(0,0,0,.15), 0 8px 16px rgba(0,0,0,.15)" }, saturation: { width: "100%", paddingBottom: "75%", position: "relative", overflow: "hidden" }, Saturation: { radius: "3px", shadow: "inset 0 0 0 1px rgba(0,0,0,.15), inset 0 0 4px rgba(0,0,0,.25)" }, controls: { display: "flex" }, sliders: { padding: "4px 0", flex: "1" }, color: { width: "24px", height: "24px", position: "relative", marginTop: "4px", marginLeft: "4px", borderRadius: "3px" }, activeColor: { absolute: "0px 0px 0px 0px", borderRadius: "2px", background: "rgba(" + rgb.r + "," + rgb.g + "," + rgb.b + "," + rgb.a + ")", boxShadow: "inset 0 0 0 1px rgba(0,0,0,.15), inset 0 0 4px rgba(0,0,0,.25)" }, hue: { position: "relative", height: "10px", overflow: "hidden" }, Hue: { radius: "2px", shadow: "inset 0 0 0 1px rgba(0,0,0,.15), inset 0 0 4px rgba(0,0,0,.25)" }, alpha: { position: "relative", height: "10px", marginTop: "4px", overflow: "hidden" }, Alpha: { radius: "2px", shadow: "inset 0 0 0 1px rgba(0,0,0,.15), inset 0 0 4px rgba(0,0,0,.25)" } }, disableAlpha: { color: { height: "10px" }, hue: { height: "10px" }, alpha: { display: "none" } } }, { disableAlpha: disableAlpha }); return _react2["default"].createElement("div", { style: styles.picker, className: "sketch-picker" }, _react2["default"].createElement("div", { style: styles.saturation }, _react2["default"].createElement(_common.Saturation, { style: styles.Saturation, hsl: hsl, hsv: hsv, onChange: onChange })), _react2["default"].createElement("div", { style: styles.controls, className: "flexbox-fix" }, _react2["default"].createElement("div", { style: styles.sliders }, _react2["default"].createElement("div", { style: styles.hue }, _react2["default"].createElement(_common.Hue, { style: styles.Hue, hsl: hsl, onChange: onChange })), _react2["default"].createElement("div", { style: styles.alpha }, _react2["default"].createElement(_common.Alpha, { style: styles.Alpha, rgb: rgb, hsl: hsl, renderers: renderers, onChange: onChange }))), _react2["default"].createElement("div", { style: styles.color }, _react2["default"].createElement(_common.Checkboard, null), _react2["default"].createElement("div", { style: styles.activeColor }))), _react2["default"].createElement(_SketchFields2["default"], { rgb: rgb, hsl: hsl, hex: hex, onChange: onChange, disableAlpha: disableAlpha }), _react2["default"].createElement(_SketchPresetColors2["default"], { colors: presetColors, onClick: onChange })); }; Sketch.defaultProps = { presetColors: [ "#D0021B", "#F5A623", "#F8E71C", "#8B572A", "#7ED321", "#417505", "#BD10E0", "#9013FE", "#4A90E2", "#50E3C2", "#B8E986", "#000000", "#4A4A4A", "#9B9B9B", "#FFFFFF" ], width: 200 }, exports["default"] = (0, _common.ColorWrap)(Sketch); }, function(module, exports, __webpack_require__) { "use strict"; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } Object.defineProperty(exports, "__esModule", { value: !0 }), exports.ShetchFields = void 0; var _react = __webpack_require__(12), _react2 = _interopRequireDefault(_react), _reactcss = __webpack_require__(83), _reactcss2 = _interopRequireDefault(_reactcss), _color = __webpack_require__(264), _color2 = _interopRequireDefault(_color), _common = __webpack_require__(249), ShetchFields = exports.ShetchFields = function(_ref) { var onChange = _ref.onChange, rgb = _ref.rgb, hsl = _ref.hsl, hex = _ref.hex, disableAlpha = _ref.disableAlpha, styles = (0, _reactcss2["default"])({ "default": { fields: { display: "flex", paddingTop: "4px" }, single: { flex: "1", paddingLeft: "6px" }, alpha: { flex: "1", paddingLeft: "6px" }, "double": { flex: "2" }, input: { width: "80%", padding: "4px 10% 3px", border: "none", boxShadow: "inset 0 0 0 1px #ccc", fontSize: "11px" }, label: { display: "block", textAlign: "center", fontSize: "11px", color: "#222", paddingTop: "3px", paddingBottom: "4px", textTransform: "capitalize" } }, disableAlpha: { alpha: { display: "none" } } }, { disableAlpha: disableAlpha }), handleChange = function(data, e) { data.hex ? _color2["default"].isValidHex(data.hex) && onChange({ hex: data.hex, source: "hex" }, e) : data.r || data.g || data.b ? onChange({ r: data.r || rgb.r, g: data.g || rgb.g, b: data.b || rgb.b, a: rgb.a, source: "rgb" }, e) : data.a && (data.a < 0 ? data.a = 0 : data.a > 100 && (data.a = 100), data.a = data.a / 100, onChange({ h: hsl.h, s: hsl.s, l: hsl.l, a: data.a, source: "rgb" }, e)); }; return _react2["default"].createElement("div", { style: styles.fields, className: "flexbox-fix" }, _react2["default"].createElement("div", { style: styles["double"] }, _react2["default"].createElement(_common.EditableInput, { style: { input: styles.input, label: styles.label }, label: "hex", value: hex.replace("#", ""), onChange: handleChange })), _react2["default"].createElement("div", { style: styles.single }, _react2["default"].createElement(_common.EditableInput, { style: { input: styles.input, label: styles.label }, label: "r", value: rgb.r, onChange: handleChange, dragLabel: "true", dragMax: "255" })), _react2["default"].createElement("div", { style: styles.single }, _react2["default"].createElement(_common.EditableInput, { style: { input: styles.input, label: styles.label }, label: "g", value: rgb.g, onChange: handleChange, dragLabel: "true", dragMax: "255" })), _react2["default"].createElement("div", { style: styles.single }, _react2["default"].createElement(_common.EditableInput, { style: { input: styles.input, label: styles.label }, label: "b", value: rgb.b, onChange: handleChange, dragLabel: "true", dragMax: "255" })), _react2["default"].createElement("div", { style: styles.alpha }, _react2["default"].createElement(_common.EditableInput, { style: { input: styles.input, label: styles.label }, label: "a", value: Math.round(100 * rgb.a), onChange: handleChange, dragLabel: "true", dragMax: "100" }))); }; exports["default"] = ShetchFields; }, function(module, exports, __webpack_require__) { "use strict"; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } Object.defineProperty(exports, "__esModule", { value: !0 }), exports.SketchPresetColors = void 0; var _extends = Object.assign || function(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) Object.prototype.hasOwnProperty.call(source, key) && (target[key] = source[key]); } return target; }, _react = __webpack_require__(12), _react2 = _interopRequireDefault(_react), _propTypes = __webpack_require__(282), _propTypes2 = _interopRequireDefault(_propTypes), _reactcss = __webpack_require__(83), _reactcss2 = _interopRequireDefault(_reactcss), _common = __webpack_require__(249), SketchPresetColors = exports.SketchPresetColors = function(_ref) { var colors = _ref.colors, onClick = _ref.onClick, styles = (0, _reactcss2["default"])({ "default": { colors: { margin: "0 -10px", padding: "10px 0 0 10px", borderTop: "1px solid #eee", display: "flex", flexWrap: "wrap", position: "relative" }, swatchWrap: { width: "16px", height: "16px", margin: "0 10px 10px 0" }, swatch: { borderRadius: "3px", boxShadow: "inset 0 0 0 1px rgba(0,0,0,.15)" } }, "no-presets": { colors: { display: "none" } } }, { "no-presets": !colors || !colors.length }), handleClick = function(hex, e) { onClick({ hex: hex, source: "hex" }, e); }; return _react2["default"].createElement("div", { style: styles.colors, className: "flexbox-fix" }, colors.map(function(colorObjOrString) { var c = "string" == typeof colorObjOrString ? { color: colorObjOrString } : colorObjOrString; return _react2["default"].createElement("div", { key: c.color, style: styles.swatchWrap }, _react2["default"].createElement(_common.Swatch, _extends({}, c, { style: styles.swatch, onClick: handleClick }))); })); }; SketchPresetColors.propTypes = { colors: _propTypes2["default"].arrayOf(_propTypes2["default"].oneOfType([ _propTypes2["default"].string, _propTypes2["default"].shape({ color: _propTypes2["default"].string, title: _propTypes2["default"].string }) ])) }, exports["default"] = SketchPresetColors; }, function(module, exports, __webpack_require__) { "use strict"; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } Object.defineProperty(exports, "__esModule", { value: !0 }), exports.Slider = void 0; var _react = __webpack_require__(12), _react2 = _interopRequireDefault(_react), _reactcss = __webpack_require__(83), _reactcss2 = _interopRequireDefault(_reactcss), _common = __webpack_require__(249), _SliderSwatches = __webpack_require__(308), _SliderSwatches2 = _interopRequireDefault(_SliderSwatches), _SliderPointer = __webpack_require__(310), _SliderPointer2 = _interopRequireDefault(_SliderPointer), Slider = exports.Slider = function(_ref) { var hsl = _ref.hsl, onChange = _ref.onChange, pointer = _ref.pointer, styles = (0, _reactcss2["default"])({ "default": { hue: { height: "12px", position: "relative" }, Hue: { radius: "2px" } } }); return _react2["default"].createElement("div", { className: "slider-picker" }, _react2["default"].createElement("div", { style: styles.hue }, _react2["default"].createElement(_common.Hue, { style: styles.Hue, hsl: hsl, pointer: pointer, onChange: onChange })), _react2["default"].createElement("div", { style: styles.swatches }, _react2["default"].createElement(_SliderSwatches2["default"], { hsl: hsl, onClick: onChange }))); }; Slider.defaultProps = { pointer: _SliderPointer2["default"] }, exports["default"] = (0, _common.ColorWrap)(Slider); }, function(module, exports, __webpack_require__) { "use strict"; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } Object.defineProperty(exports, "__esModule", { value: !0 }), exports.SliderSwatches = void 0; var _react = __webpack_require__(12), _react2 = _interopRequireDefault(_react), _reactcss = __webpack_require__(83), _reactcss2 = _interopRequireDefault(_reactcss), _SliderSwatch = __webpack_require__(309), _SliderSwatch2 = _interopRequireDefault(_SliderSwatch), SliderSwatches = exports.SliderSwatches = function(_ref) { var onClick = _ref.onClick, hsl = _ref.hsl, styles = (0, _reactcss2["default"])({ "default": { swatches: { marginTop: "20px" }, swatch: { boxSizing: "border-box", width: "20%", paddingRight: "1px", "float": "left" }, clear: { clear: "both" } } }); return _react2["default"].createElement("div", { style: styles.swatches }, _react2["default"].createElement("div", { style: styles.swatch }, _react2["default"].createElement(_SliderSwatch2["default"], { hsl: hsl, offset: ".80", active: Math.round(100 * hsl.l) / 100 === .8 && Math.round(100 * hsl.s) / 100 === .5, onClick: onClick, first: !0 })), _react2["default"].createElement("div", { style: styles.swatch }, _react2["default"].createElement(_SliderSwatch2["default"], { hsl: hsl, offset: ".65", active: Math.round(100 * hsl.l) / 100 === .65 && Math.round(100 * hsl.s) / 100 === .5, onClick: onClick })), _react2["default"].createElement("div", { style: styles.swatch }, _react2["default"].createElement(_SliderSwatch2["default"], { hsl: hsl, offset: ".50", active: Math.round(100 * hsl.l) / 100 === .5 && Math.round(100 * hsl.s) / 100 === .5, onClick: onClick })), _react2["default"].createElement("div", { style: styles.swatch }, _react2["default"].createElement(_SliderSwatch2["default"], { hsl: hsl, offset: ".35", active: Math.round(100 * hsl.l) / 100 === .35 && Math.round(100 * hsl.s) / 100 === .5, onClick: onClick })), _react2["default"].createElement("div", { style: styles.swatch }, _react2["default"].createElement(_SliderSwatch2["default"], { hsl: hsl, offset: ".20", active: Math.round(100 * hsl.l) / 100 === .2 && Math.round(100 * hsl.s) / 100 === .5, onClick: onClick, last: !0 })), _react2["default"].createElement("div", { style: styles.clear })); }; exports["default"] = SliderSwatches; }, function(module, exports, __webpack_require__) { "use strict"; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } Object.defineProperty(exports, "__esModule", { value: !0 }), exports.SliderSwatch = void 0; var _react = __webpack_require__(12), _react2 = _interopRequireDefault(_react), _reactcss = __webpack_require__(83), _reactcss2 = _interopRequireDefault(_reactcss), SliderSwatch = exports.SliderSwatch = function(_ref) { var hsl = _ref.hsl, offset = _ref.offset, onClick = _ref.onClick, active = _ref.active, first = _ref.first, last = _ref.last, styles = (0, _reactcss2["default"])({ "default": { swatch: { height: "12px", background: "hsl(" + hsl.h + ", 50%, " + 100 * offset + "%)", cursor: "pointer" } }, first: { swatch: { borderRadius: "2px 0 0 2px" } }, last: { swatch: { borderRadius: "0 2px 2px 0" } }, active: { swatch: { transform: "scaleY(1.8)", borderRadius: "3.6px/2px" } } }, { active: active, first: first, last: last }), handleClick = function(e) { return onClick({ h: hsl.h, s: .5, l: offset, source: "hsl" }, e); }; return _react2["default"].createElement("div", { style: styles.swatch, onClick: handleClick }); }; exports["default"] = SliderSwatch; }, function(module, exports, __webpack_require__) { "use strict"; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } Object.defineProperty(exports, "__esModule", { value: !0 }), exports.SliderPointer = void 0; var _react = __webpack_require__(12), _react2 = _interopRequireDefault(_react), _reactcss = __webpack_require__(83), _reactcss2 = _interopRequireDefault(_reactcss), SliderPointer = exports.SliderPointer = function() { var styles = (0, _reactcss2["default"])({ "default": { picker: { width: "14px", height: "14px", borderRadius: "6px", transform: "translate(-7px, -1px)", backgroundColor: "rgb(248, 248, 248)", boxShadow: "0 1px 4px 0 rgba(0, 0, 0, 0.37)" } } }); return _react2["default"].createElement("div", { style: styles.picker }); }; exports["default"] = SliderPointer; }, function(module, exports, __webpack_require__) { "use strict"; function _interopRequireWildcard(obj) { if (obj && obj.__esModule) return obj; var newObj = {}; if (null != obj) for (var key in obj) Object.prototype.hasOwnProperty.call(obj, key) && (newObj[key] = obj[key]); return newObj["default"] = obj, newObj; } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } Object.defineProperty(exports, "__esModule", { value: !0 }), exports.Swatches = void 0; var _react = __webpack_require__(12), _react2 = _interopRequireDefault(_react), _reactcss = __webpack_require__(83), _reactcss2 = _interopRequireDefault(_reactcss), _map = __webpack_require__(123), _map2 = _interopRequireDefault(_map), _color = __webpack_require__(264), _color2 = _interopRequireDefault(_color), _materialColors = __webpack_require__(273), material = _interopRequireWildcard(_materialColors), _common = __webpack_require__(249), _reactMaterialDesign = __webpack_require__(280), _SwatchesGroup = __webpack_require__(312), _SwatchesGroup2 = _interopRequireDefault(_SwatchesGroup), Swatches = exports.Swatches = function(_ref) { var width = _ref.width, height = _ref.height, onChange = _ref.onChange, colors = _ref.colors, hex = _ref.hex, styles = (0, _reactcss2["default"])({ "default": { picker: { width: width, height: height }, overflow: { height: height, overflowY: "scroll" }, body: { padding: "16px 0 6px 16px" }, clear: { clear: "both" } } }), handleChange = function(data, e) { _color2["default"].isValidHex(data) && onChange({ hex: data, source: "hex" }, e); }; return _react2["default"].createElement("div", { style: styles.picker, className: "swatches-picker" }, _react2["default"].createElement(_reactMaterialDesign.Raised, null, _react2["default"].createElement("div", { style: styles.overflow }, _react2["default"].createElement("div", { style: styles.body }, (0, _map2["default"])(colors, function(group) { return _react2["default"].createElement(_SwatchesGroup2["default"], { key: group.toString(), group: group, active: hex, onClick: handleChange }); }), _react2["default"].createElement("div", { style: styles.clear }))))); }; Swatches.defaultProps = { width: 320, height: 240, colors: [ [ material.red[900], material.red[700], material.red[500], material.red[300], material.red[100] ], [ material.pink[900], material.pink[700], material.pink[500], material.pink[300], material.pink[100] ], [ material.purple[900], material.purple[700], material.purple[500], material.purple[300], material.purple[100] ], [ material.deepPurple[900], material.deepPurple[700], material.deepPurple[500], material.deepPurple[300], material.deepPurple[100] ], [ material.indigo[900], material.indigo[700], material.indigo[500], material.indigo[300], material.indigo[100] ], [ material.blue[900], material.blue[700], material.blue[500], material.blue[300], material.blue[100] ], [ material.lightBlue[900], material.lightBlue[700], material.lightBlue[500], material.lightBlue[300], material.lightBlue[100] ], [ material.cyan[900], material.cyan[700], material.cyan[500], material.cyan[300], material.cyan[100] ], [ material.teal[900], material.teal[700], material.teal[500], material.teal[300], material.teal[100] ], [ "#194D33", material.green[700], material.green[500], material.green[300], material.green[100] ], [ material.lightGreen[900], material.lightGreen[700], material.lightGreen[500], material.lightGreen[300], material.lightGreen[100] ], [ material.lime[900], material.lime[700], material.lime[500], material.lime[300], material.lime[100] ], [ material.yellow[900], material.yellow[700], material.yellow[500], material.yellow[300], material.yellow[100] ], [ material.amber[900], material.amber[700], material.amber[500], material.amber[300], material.amber[100] ], [ material.orange[900], material.orange[700], material.orange[500], material.orange[300], material.orange[100] ], [ material.deepOrange[900], material.deepOrange[700], material.deepOrange[500], material.deepOrange[300], material.deepOrange[100] ], [ material.brown[900], material.brown[700], material.brown[500], material.brown[300], material.brown[100] ], [ material.blueGrey[900], material.blueGrey[700], material.blueGrey[500], material.blueGrey[300], material.blueGrey[100] ], [ "#000000", "#525252", "#969696", "#D9D9D9", "#FFFFFF" ] ] }, exports["default"] = (0, _common.ColorWrap)(Swatches); }, function(module, exports, __webpack_require__) { "use strict"; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } Object.defineProperty(exports, "__esModule", { value: !0 }), exports.SwatchesGroup = void 0; var _react = __webpack_require__(12), _react2 = _interopRequireDefault(_react), _reactcss = __webpack_require__(83), _reactcss2 = _interopRequireDefault(_reactcss), _map = __webpack_require__(123), _map2 = _interopRequireDefault(_map), _SwatchesColor = __webpack_require__(313), _SwatchesColor2 = _interopRequireDefault(_SwatchesColor), SwatchesGroup = exports.SwatchesGroup = function(_ref) { var onClick = _ref.onClick, group = _ref.group, active = _ref.active, styles = (0, _reactcss2["default"])({ "default": { group: { paddingBottom: "10px", width: "40px", "float": "left", marginRight: "10px" } } }); return _react2["default"].createElement("div", { style: styles.group }, (0, _map2["default"])(group, function(color, i) { return _react2["default"].createElement(_SwatchesColor2["default"], { key: color, color: color, active: color.toLowerCase() === active, first: 0 === i, last: i === group.length - 1, onClick: onClick }); })); }; exports["default"] = SwatchesGroup; }, function(module, exports, __webpack_require__) { "use strict"; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } Object.defineProperty(exports, "__esModule", { value: !0 }), exports.SwatchesColor = void 0; var _react = __webpack_require__(12), _react2 = _interopRequireDefault(_react), _reactcss = __webpack_require__(83), _reactcss2 = _interopRequireDefault(_reactcss), SwatchesColor = exports.SwatchesColor = function(_ref) { var color = _ref.color, onClick = _ref.onClick, first = _ref.first, last = _ref.last, active = _ref.active, styles = (0, _reactcss2["default"])({ "default": { color: { width: "40px", height: "24px", cursor: "pointer", background: color, marginBottom: "1px" }, check: { fill: "#fff", marginLeft: "8px", display: "none" } }, first: { color: { overflow: "hidden", borderRadius: "2px 2px 0 0" } }, last: { color: { overflow: "hidden", borderRadius: "0 0 2px 2px" } }, active: { check: { display: "block" } }, "color-#FFFFFF": { color: { boxShadow: "inset 0 0 0 1px #ddd" }, check: { fill: "#333" } } }, { first: first, last: last, active: active, "color-#FFFFFF": "#FFFFFF" === color }), handleClick = function(e) { return onClick(color, e); }; return _react2["default"].createElement("div", { style: styles.color, onClick: handleClick }, _react2["default"].createElement("div", { style: styles.check }, _react2["default"].createElement("svg", { style: { width: "24px", height: "24px" }, viewBox: "0 0 24 24" }, _react2["default"].createElement("path", { d: "M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z" })))); }; exports["default"] = SwatchesColor; }, function(module, exports, __webpack_require__) { "use strict"; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } Object.defineProperty(exports, "__esModule", { value: !0 }), exports.Twitter = void 0; var _react = __webpack_require__(12), _react2 = _interopRequireDefault(_react), _reactcss = __webpack_require__(83), _reactcss2 = _interopRequireDefault(_reactcss), _map = __webpack_require__(123), _map2 = _interopRequireDefault(_map), _color = __webpack_require__(264), _color2 = _interopRequireDefault(_color), _common = __webpack_require__(249), Twitter = exports.Twitter = function(_ref) { var onChange = _ref.onChange, colors = _ref.colors, width = _ref.width, triangle = _ref.triangle, styles = (0, _reactcss2["default"])({ "default": { card: { width: width, background: "#fff", border: "0 solid rgba(0,0,0,0.25)", boxShadow: "0 1px 4px rgba(0,0,0,0.25)", borderRadius: "4px", position: "relative" }, body: { padding: "15px 9px 9px 15px" }, label: { fontSize: "18px", color: "#fff" }, triangle: { width: "0px", height: "0px", borderStyle: "solid", borderWidth: "0 9px 10px 9px", borderColor: "transparent transparent #fff transparent", position: "absolute" }, triangleShadow: { width: "0px", height: "0px", borderStyle: "solid", borderWidth: "0 9px 10px 9px", borderColor: "transparent transparent rgba(0,0,0,.1) transparent", position: "absolute" }, hash: { background: "#F0F0F0", height: "30px", width: "30px", borderRadius: "4px 0 0 4px", "float": "left", color: "#98A1A4", display: "flex", alignItems: "center", justifyContent: "center" }, input: { width: "100px", fontSize: "14px", color: "#666", border: "0px", outline: "none", height: "28px", boxShadow: "inset 0 0 0 1px #F0F0F0", borderRadius: "0 4px 4px 0", "float": "left", paddingLeft: "8px" }, swatch: { width: "30px", height: "30px", "float": "left", borderRadius: "4px", margin: "0 6px 6px 0" }, clear: { clear: "both" } }, "hide-triangle": { triangle: { display: "none" }, triangleShadow: { display: "none" } }, "top-left-triangle": { triangle: { top: "-10px", left: "12px" }, triangleShadow: { top: "-11px", left: "12px" } }, "top-right-triangle": { triangle: { top: "-10px", right: "12px" }, triangleShadow: { top: "-11px", right: "12px" } } }, { "hide-triangle": "hide" === triangle, "top-left-triangle": "top-left" === triangle, "top-right-triangle": "top-right" === triangle }), handleChange = function(hex, e) { _color2["default"].isValidHex(hex) && onChange({ hex: hex, source: "hex" }, e); }; return _react2["default"].createElement("div", { style: styles.card, className: "twitter-picker" }, _react2["default"].createElement("div", { style: styles.triangleShadow }), _react2["default"].createElement("div", { style: styles.triangle }), _react2["default"].createElement("div", { style: styles.body }, (0, _map2["default"])(colors, function(c, i) { return _react2["default"].createElement(_common.Swatch, { key: i, color: c, hex: c, style: styles.swatch, onClick: handleChange }); }), _react2["default"].createElement("div", { style: styles.hash }, "#"), _react2["default"].createElement(_common.EditableInput, { placeholder: "ff691f", style: { input: styles.input }, value: "", onChange: handleChange }), _react2["default"].createElement("div", { style: styles.clear }))); }; Twitter.defaultProps = { width: "276px", colors: [ "#FF6900", "#FCB900", "#7BDCB5", "#00D084", "#8ED1FC", "#0693E3", "#ABB8C3", "#EB144C", "#F78DA7", "#9900EF" ], triangle: "top-left" }, exports["default"] = (0, _common.ColorWrap)(Twitter); }, function(module, exports) { "use strict"; var Base = { base00: "Default Background", base01: "Soft Background", base02: "Soft Middle", base03: "Strong Middle", base04: "Soft Foreground", base05: "Default Foreground" }, Syntax = { special00: "Custom Components", special01: "Integers, Booleans", special02: "Strings, Arrays", special03: "Details Pane Text", special04: "Functions, Objects", special05: "Special Text", special06: "XML Attributes", special07: "Host Components" }, Selection = { state00: "Focused Background", state01: "Blurred Background", state03: "Hovered Background", state02: "Focused Foreground", state04: "Search Background", state05: "Search Foreground", state06: "Interactive Hover" }; module.exports = { Base: Base, Selection: Selection, Syntax: Syntax }; }, function(module, exports, __webpack_require__) { "use strict"; function _defineProperty(obj, key, value) { return key in obj ? Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }) : obj[key] = value, 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 || "object" != typeof call && "function" != typeof call ? self : call; } function _inherits(subClass, superClass) { if ("function" != typeof superClass && null !== superClass) 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: !1, writable: !0, configurable: !0 } }), superClass && (Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass); } var _fauxRef, _createClass = function() { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0, "value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor); } } return function(Constructor, protoProps, staticProps) { return protoProps && defineProperties(Constructor.prototype, protoProps), staticProps && defineProperties(Constructor, staticProps), Constructor; }; }(), React = __webpack_require__(12), PropTypes = __webpack_require__(7), _require = __webpack_require__(317), Map = _require.Map, consts = __webpack_require__(32), Node = __webpack_require__(64), _require2 = __webpack_require__(17), monospace = _require2.monospace, Preview = function(_React$Component) { function Preview() { return _classCallCheck(this, Preview), _possibleConstructorReturn(this, (Preview.__proto__ || Object.getPrototypeOf(Preview)).apply(this, arguments)); } return _inherits(Preview, _React$Component), _createClass(Preview, [ { key: "getChildContext", value: function() { return { scrollTo: function() {}, store: fauxStore }; } }, { key: "render", value: function() { var theme = this.props.theme; return React.createElement("div", { style: panelStyle(theme) }, React.createElement(Node, { depth: 0, node: Map({ children: [ "strictMode" ], name: "div" }), searchRegExp: /iv/ })); } } ]), Preview; }(React.Component); Preview.childContextTypes = { scrollTo: PropTypes.func, store: PropTypes.object }; var fauxRef = (_fauxRef = {}, _defineProperty(_fauxRef, consts.type, "function"), _defineProperty(_fauxRef, consts.name, "setRef"), _fauxRef), childNode = Map({ id: "child", children: "text", name: "div", props: { style: { color: "red" } }, ref: fauxRef }), strictModeNode = Map({ id: "strictMode", children: [ "grandparent" ], name: "StrictMode", nodeType: "Special" }), grandparentNode = Map({ id: "grandparent", children: [ "parent" ], name: "Grandparent", nodeType: "Composite", props: { depth: 0 } }), parentNode = Map({ id: "parent", children: [ "child" ], name: "Parent", nodeType: "Composite", props: { "boolean": !0, integer: 123, string: "foobar" } }), nodes = { child: childNode, grandparent: grandparentNode, parent: parentNode, strictMode: strictModeNode }, noop = function() {}, fauxStore = { hovered: "parent", selected: "grandparent", get: function(id) { return nodes[id]; }, off: noop, on: noop, onContextMenu: noop, onHover: noop, onHoverBottom: noop, onSelect: noop, onSelectBottom: noop, onToggleCollapse: noop, setHover: noop, selectBottom: noop, selectTop: noop }, panelStyle = function(theme) { return { maxWidth: "100%", padding: "0.25rem 0", zIndex: 1, fontFamily: monospace.family, fontSize: monospace.sizes.normal, backgroundColor: theme.base00, color: theme.base05 }; }; module.exports = Preview; }, function(module, exports, __webpack_require__) { !function(global, factory) { module.exports = factory(); }(this, function() { "use strict"; function createClass(ctor, superClass) { superClass && (ctor.prototype = Object.create(superClass.prototype)), ctor.prototype.constructor = ctor; } function Iterable(value) { return isIterable(value) ? value : Seq(value); } function KeyedIterable(value) { return isKeyed(value) ? value : KeyedSeq(value); } function IndexedIterable(value) { return isIndexed(value) ? value : IndexedSeq(value); } function SetIterable(value) { return isIterable(value) && !isAssociative(value) ? value : SetSeq(value); } function isIterable(maybeIterable) { return !(!maybeIterable || !maybeIterable[IS_ITERABLE_SENTINEL]); } function isKeyed(maybeKeyed) { return !(!maybeKeyed || !maybeKeyed[IS_KEYED_SENTINEL]); } function isIndexed(maybeIndexed) { return !(!maybeIndexed || !maybeIndexed[IS_INDEXED_SENTINEL]); } function isAssociative(maybeAssociative) { return isKeyed(maybeAssociative) || isIndexed(maybeAssociative); } function isOrdered(maybeOrdered) { return !(!maybeOrdered || !maybeOrdered[IS_ORDERED_SENTINEL]); } function MakeRef(ref) { return ref.value = !1, ref; } function SetRef(ref) { ref && (ref.value = !0); } function OwnerID() {} function arrCopy(arr, offset) { offset = offset || 0; for (var len = Math.max(0, arr.length - offset), newArr = new Array(len), ii = 0; ii < len; ii++) newArr[ii] = arr[ii + offset]; return newArr; } function ensureSize(iter) { return void 0 === iter.size && (iter.size = iter.__iterate(returnTrue)), iter.size; } function wrapIndex(iter, index) { if ("number" != typeof index) { var uint32Index = index >>> 0; if ("" + uint32Index !== index || 4294967295 === uint32Index) return NaN; index = uint32Index; } return index < 0 ? ensureSize(iter) + index : index; } function returnTrue() { return !0; } function wholeSlice(begin, end, size) { return (0 === begin || void 0 !== size && begin <= -size) && (void 0 === end || void 0 !== size && end >= size); } function resolveBegin(begin, size) { return resolveIndex(begin, size, 0); } function resolveEnd(end, size) { return resolveIndex(end, size, size); } function resolveIndex(index, size, defaultIndex) { return void 0 === index ? defaultIndex : index < 0 ? Math.max(0, size + index) : void 0 === size ? index : Math.min(size, index); } function Iterator(next) { this.next = next; } function iteratorValue(type, k, v, iteratorResult) { var value = 0 === type ? k : 1 === type ? v : [ k, v ]; return iteratorResult ? iteratorResult.value = value : iteratorResult = { value: value, done: !1 }, iteratorResult; } function iteratorDone() { return { value: void 0, done: !0 }; } function hasIterator(maybeIterable) { return !!getIteratorFn(maybeIterable); } function isIterator(maybeIterator) { return maybeIterator && "function" == typeof maybeIterator.next; } function getIterator(iterable) { var iteratorFn = getIteratorFn(iterable); return iteratorFn && iteratorFn.call(iterable); } function getIteratorFn(iterable) { var iteratorFn = iterable && (REAL_ITERATOR_SYMBOL && iterable[REAL_ITERATOR_SYMBOL] || iterable[FAUX_ITERATOR_SYMBOL]); if ("function" == typeof iteratorFn) return iteratorFn; } function isArrayLike(value) { return value && "number" == typeof value.length; } function Seq(value) { return null === value || void 0 === value ? emptySequence() : isIterable(value) ? value.toSeq() : seqFromValue(value); } function KeyedSeq(value) { return null === value || void 0 === value ? emptySequence().toKeyedSeq() : isIterable(value) ? isKeyed(value) ? value.toSeq() : value.fromEntrySeq() : keyedSeqFromValue(value); } function IndexedSeq(value) { return null === value || void 0 === value ? emptySequence() : isIterable(value) ? isKeyed(value) ? value.entrySeq() : value.toIndexedSeq() : indexedSeqFromValue(value); } function SetSeq(value) { return (null === value || void 0 === value ? emptySequence() : isIterable(value) ? isKeyed(value) ? value.entrySeq() : value : indexedSeqFromValue(value)).toSetSeq(); } function ArraySeq(array) { this._array = array, this.size = array.length; } function ObjectSeq(object) { var keys = Object.keys(object); this._object = object, this._keys = keys, this.size = keys.length; } function IterableSeq(iterable) { this._iterable = iterable, this.size = iterable.length || iterable.size; } function IteratorSeq(iterator) { this._iterator = iterator, this._iteratorCache = []; } function isSeq(maybeSeq) { return !(!maybeSeq || !maybeSeq[IS_SEQ_SENTINEL]); } function emptySequence() { return EMPTY_SEQ || (EMPTY_SEQ = new ArraySeq([])); } function keyedSeqFromValue(value) { var seq = Array.isArray(value) ? new ArraySeq(value).fromEntrySeq() : isIterator(value) ? new IteratorSeq(value).fromEntrySeq() : hasIterator(value) ? new IterableSeq(value).fromEntrySeq() : "object" == typeof value ? new ObjectSeq(value) : void 0; if (!seq) throw new TypeError("Expected Array or iterable object of [k, v] entries, or keyed object: " + value); return seq; } function indexedSeqFromValue(value) { var seq = maybeIndexedSeqFromValue(value); if (!seq) throw new TypeError("Expected Array or iterable object of values: " + value); return seq; } function seqFromValue(value) { var seq = maybeIndexedSeqFromValue(value) || "object" == typeof value && new ObjectSeq(value); if (!seq) throw new TypeError("Expected Array or iterable object of values, or keyed object: " + value); return seq; } function maybeIndexedSeqFromValue(value) { return isArrayLike(value) ? new ArraySeq(value) : isIterator(value) ? new IteratorSeq(value) : hasIterator(value) ? new IterableSeq(value) : void 0; } function seqIterate(seq, fn, reverse, useKeys) { var cache = seq._cache; if (cache) { for (var maxIndex = cache.length - 1, ii = 0; ii <= maxIndex; ii++) { var entry = cache[reverse ? maxIndex - ii : ii]; if (fn(entry[1], useKeys ? entry[0] : ii, seq) === !1) return ii + 1; } return ii; } return seq.__iterateUncached(fn, reverse); } function seqIterator(seq, type, reverse, useKeys) { var cache = seq._cache; if (cache) { var maxIndex = cache.length - 1, ii = 0; return new Iterator(function() { var entry = cache[reverse ? maxIndex - ii : ii]; return ii++ > maxIndex ? iteratorDone() : iteratorValue(type, useKeys ? entry[0] : ii - 1, entry[1]); }); } return seq.__iteratorUncached(type, reverse); } function fromJS(json, converter) { return converter ? fromJSWith(converter, json, "", { "": json }) : fromJSDefault(json); } function fromJSWith(converter, json, key, parentJSON) { return Array.isArray(json) ? converter.call(parentJSON, key, IndexedSeq(json).map(function(v, k) { return fromJSWith(converter, v, k, json); })) : isPlainObj(json) ? converter.call(parentJSON, key, KeyedSeq(json).map(function(v, k) { return fromJSWith(converter, v, k, json); })) : json; } function fromJSDefault(json) { return Array.isArray(json) ? IndexedSeq(json).map(fromJSDefault).toList() : isPlainObj(json) ? KeyedSeq(json).map(fromJSDefault).toMap() : json; } function isPlainObj(value) { return value && (value.constructor === Object || void 0 === value.constructor); } function is(valueA, valueB) { if (valueA === valueB || valueA !== valueA && valueB !== valueB) return !0; if (!valueA || !valueB) return !1; if ("function" == typeof valueA.valueOf && "function" == typeof valueB.valueOf) { if (valueA = valueA.valueOf(), valueB = valueB.valueOf(), valueA === valueB || valueA !== valueA && valueB !== valueB) return !0; if (!valueA || !valueB) return !1; } return !("function" != typeof valueA.equals || "function" != typeof valueB.equals || !valueA.equals(valueB)); } function deepEqual(a, b) { if (a === b) return !0; if (!isIterable(b) || void 0 !== a.size && void 0 !== b.size && a.size !== b.size || void 0 !== a.__hash && void 0 !== b.__hash && a.__hash !== b.__hash || isKeyed(a) !== isKeyed(b) || isIndexed(a) !== isIndexed(b) || isOrdered(a) !== isOrdered(b)) return !1; if (0 === a.size && 0 === b.size) return !0; var notAssociative = !isAssociative(a); if (isOrdered(a)) { var entries = a.entries(); return b.every(function(v, k) { var entry = entries.next().value; return entry && is(entry[1], v) && (notAssociative || is(entry[0], k)); }) && entries.next().done; } var flipped = !1; if (void 0 === a.size) if (void 0 === b.size) "function" == typeof a.cacheResult && a.cacheResult(); else { flipped = !0; var _ = a; a = b, b = _; } var allEqual = !0, bSize = b.__iterate(function(v, k) { if (notAssociative ? !a.has(v) : flipped ? !is(v, a.get(k, NOT_SET)) : !is(a.get(k, NOT_SET), v)) return allEqual = !1, !1; }); return allEqual && a.size === bSize; } function Repeat(value, times) { if (!(this instanceof Repeat)) return new Repeat(value, times); if (this._value = value, this.size = void 0 === times ? 1 / 0 : Math.max(0, times), 0 === this.size) { if (EMPTY_REPEAT) return EMPTY_REPEAT; EMPTY_REPEAT = this; } } function invariant(condition, error) { if (!condition) throw new Error(error); } function Range(start, end, step) { if (!(this instanceof Range)) return new Range(start, end, step); if (invariant(0 !== step, "Cannot step a Range by 0"), start = start || 0, void 0 === end && (end = 1 / 0), step = void 0 === step ? 1 : Math.abs(step), end < start && (step = -step), this._start = start, this._end = end, this._step = step, this.size = Math.max(0, Math.ceil((end - start) / step - 1) + 1), 0 === this.size) { if (EMPTY_RANGE) return EMPTY_RANGE; EMPTY_RANGE = this; } } function Collection() { throw TypeError("Abstract"); } function KeyedCollection() {} function IndexedCollection() {} function SetCollection() {} function smi(i32) { return i32 >>> 1 & 1073741824 | 3221225471 & i32; } function hash(o) { if (o === !1 || null === o || void 0 === o) return 0; if ("function" == typeof o.valueOf && (o = o.valueOf(), o === !1 || null === o || void 0 === o)) return 0; if (o === !0) return 1; var type = typeof o; if ("number" === type) { var h = 0 | o; for (h !== o && (h ^= 4294967295 * o); o > 4294967295; ) o /= 4294967295, h ^= o; return smi(h); } if ("string" === type) return o.length > STRING_HASH_CACHE_MIN_STRLEN ? cachedHashString(o) : hashString(o); if ("function" == typeof o.hashCode) return o.hashCode(); if ("object" === type) return hashJSObj(o); if ("function" == typeof o.toString) return hashString(o.toString()); throw new Error("Value type " + type + " cannot be hashed."); } function cachedHashString(string) { var hash = stringHashCache[string]; return void 0 === hash && (hash = hashString(string), STRING_HASH_CACHE_SIZE === STRING_HASH_CACHE_MAX_SIZE && (STRING_HASH_CACHE_SIZE = 0, stringHashCache = {}), STRING_HASH_CACHE_SIZE++, stringHashCache[string] = hash), hash; } function hashString(string) { for (var hash = 0, ii = 0; ii < string.length; ii++) hash = 31 * hash + string.charCodeAt(ii) | 0; return smi(hash); } function hashJSObj(obj) { var hash; if (usingWeakMap && (hash = weakMap.get(obj), void 0 !== hash)) return hash; if (hash = obj[UID_HASH_KEY], void 0 !== hash) return hash; if (!canDefineProperty) { if (hash = obj.propertyIsEnumerable && obj.propertyIsEnumerable[UID_HASH_KEY], void 0 !== hash) return hash; if (hash = getIENodeHash(obj), void 0 !== hash) return hash; } if (hash = ++objHashUID, 1073741824 & objHashUID && (objHashUID = 0), usingWeakMap) weakMap.set(obj, hash); else { if (void 0 !== isExtensible && isExtensible(obj) === !1) throw new Error("Non-extensible objects are not allowed as keys."); if (canDefineProperty) Object.defineProperty(obj, UID_HASH_KEY, { enumerable: !1, configurable: !1, writable: !1, value: hash }); else if (void 0 !== obj.propertyIsEnumerable && obj.propertyIsEnumerable === obj.constructor.prototype.propertyIsEnumerable) obj.propertyIsEnumerable = function() { return this.constructor.prototype.propertyIsEnumerable.apply(this, arguments); }, obj.propertyIsEnumerable[UID_HASH_KEY] = hash; else { if (void 0 === obj.nodeType) throw new Error("Unable to set a non-enumerable property on object."); obj[UID_HASH_KEY] = hash; } } return hash; } function getIENodeHash(node) { if (node && node.nodeType > 0) switch (node.nodeType) { case 1: return node.uniqueID; case 9: return node.documentElement && node.documentElement.uniqueID; } } function assertNotInfinite(size) { invariant(size !== 1 / 0, "Cannot perform this action with an infinite size."); } function Map(value) { return null === value || void 0 === value ? emptyMap() : isMap(value) && !isOrdered(value) ? value : emptyMap().withMutations(function(map) { var iter = KeyedIterable(value); assertNotInfinite(iter.size), iter.forEach(function(v, k) { return map.set(k, v); }); }); } function isMap(maybeMap) { return !(!maybeMap || !maybeMap[IS_MAP_SENTINEL]); } function ArrayMapNode(ownerID, entries) { this.ownerID = ownerID, this.entries = entries; } function BitmapIndexedNode(ownerID, bitmap, nodes) { this.ownerID = ownerID, this.bitmap = bitmap, this.nodes = nodes; } function HashArrayMapNode(ownerID, count, nodes) { this.ownerID = ownerID, this.count = count, this.nodes = nodes; } function HashCollisionNode(ownerID, keyHash, entries) { this.ownerID = ownerID, this.keyHash = keyHash, this.entries = entries; } function ValueNode(ownerID, keyHash, entry) { this.ownerID = ownerID, this.keyHash = keyHash, this.entry = entry; } function MapIterator(map, type, reverse) { this._type = type, this._reverse = reverse, this._stack = map._root && mapIteratorFrame(map._root); } function mapIteratorValue(type, entry) { return iteratorValue(type, entry[0], entry[1]); } function mapIteratorFrame(node, prev) { return { node: node, index: 0, __prev: prev }; } function makeMap(size, root, ownerID, hash) { var map = Object.create(MapPrototype); return map.size = size, map._root = root, map.__ownerID = ownerID, map.__hash = hash, map.__altered = !1, map; } function emptyMap() { return EMPTY_MAP || (EMPTY_MAP = makeMap(0)); } function updateMap(map, k, v) { var newRoot, newSize; if (map._root) { var didChangeSize = MakeRef(CHANGE_LENGTH), didAlter = MakeRef(DID_ALTER); if (newRoot = updateNode(map._root, map.__ownerID, 0, void 0, k, v, didChangeSize, didAlter), !didAlter.value) return map; newSize = map.size + (didChangeSize.value ? v === NOT_SET ? -1 : 1 : 0); } else { if (v === NOT_SET) return map; newSize = 1, newRoot = new ArrayMapNode(map.__ownerID, [ [ k, v ] ]); } return map.__ownerID ? (map.size = newSize, map._root = newRoot, map.__hash = void 0, map.__altered = !0, map) : newRoot ? makeMap(newSize, newRoot) : emptyMap(); } function updateNode(node, ownerID, shift, keyHash, key, value, didChangeSize, didAlter) { return node ? node.update(ownerID, shift, keyHash, key, value, didChangeSize, didAlter) : value === NOT_SET ? node : (SetRef(didAlter), SetRef(didChangeSize), new ValueNode(ownerID, keyHash, [ key, value ])); } function isLeafNode(node) { return node.constructor === ValueNode || node.constructor === HashCollisionNode; } function mergeIntoNode(node, ownerID, shift, keyHash, entry) { if (node.keyHash === keyHash) return new HashCollisionNode(ownerID, keyHash, [ node.entry, entry ]); var newNode, idx1 = (0 === shift ? node.keyHash : node.keyHash >>> shift) & MASK, idx2 = (0 === shift ? keyHash : keyHash >>> shift) & MASK, nodes = idx1 === idx2 ? [ mergeIntoNode(node, ownerID, shift + SHIFT, keyHash, entry) ] : (newNode = new ValueNode(ownerID, keyHash, entry), idx1 < idx2 ? [ node, newNode ] : [ newNode, node ]); return new BitmapIndexedNode(ownerID, 1 << idx1 | 1 << idx2, nodes); } function createNodes(ownerID, entries, key, value) { ownerID || (ownerID = new OwnerID()); for (var node = new ValueNode(ownerID, hash(key), [ key, value ]), ii = 0; ii < entries.length; ii++) { var entry = entries[ii]; node = node.update(ownerID, 0, void 0, entry[0], entry[1]); } return node; } function packNodes(ownerID, nodes, count, excluding) { for (var bitmap = 0, packedII = 0, packedNodes = new Array(count), ii = 0, bit = 1, len = nodes.length; ii < len; ii++, bit <<= 1) { var node = nodes[ii]; void 0 !== node && ii !== excluding && (bitmap |= bit, packedNodes[packedII++] = node); } return new BitmapIndexedNode(ownerID, bitmap, packedNodes); } function expandNodes(ownerID, nodes, bitmap, including, node) { for (var count = 0, expandedNodes = new Array(SIZE), ii = 0; 0 !== bitmap; ii++, bitmap >>>= 1) expandedNodes[ii] = 1 & bitmap ? nodes[count++] : void 0; return expandedNodes[including] = node, new HashArrayMapNode(ownerID, count + 1, expandedNodes); } function mergeIntoMapWith(map, merger, iterables) { for (var iters = [], ii = 0; ii < iterables.length; ii++) { var value = iterables[ii], iter = KeyedIterable(value); isIterable(value) || (iter = iter.map(function(v) { return fromJS(v); })), iters.push(iter); } return mergeIntoCollectionWith(map, merger, iters); } function deepMerger(existing, value, key) { return existing && existing.mergeDeep && isIterable(value) ? existing.mergeDeep(value) : is(existing, value) ? existing : value; } function deepMergerWith(merger) { return function(existing, value, key) { if (existing && existing.mergeDeepWith && isIterable(value)) return existing.mergeDeepWith(merger, value); var nextValue = merger(existing, value, key); return is(existing, nextValue) ? existing : nextValue; }; } function mergeIntoCollectionWith(collection, merger, iters) { return iters = iters.filter(function(x) { return 0 !== x.size; }), 0 === iters.length ? collection : 0 !== collection.size || collection.__ownerID || 1 !== iters.length ? collection.withMutations(function(collection) { for (var mergeIntoMap = merger ? function(value, key) { collection.update(key, NOT_SET, function(existing) { return existing === NOT_SET ? value : merger(existing, value, key); }); } : function(value, key) { collection.set(key, value); }, ii = 0; ii < iters.length; ii++) iters[ii].forEach(mergeIntoMap); }) : collection.constructor(iters[0]); } function updateInDeepMap(existing, keyPathIter, notSetValue, updater) { var isNotSet = existing === NOT_SET, step = keyPathIter.next(); if (step.done) { var existingValue = isNotSet ? notSetValue : existing, newValue = updater(existingValue); return newValue === existingValue ? existing : newValue; } invariant(isNotSet || existing && existing.set, "invalid keyPath"); var key = step.value, nextExisting = isNotSet ? NOT_SET : existing.get(key, NOT_SET), nextUpdated = updateInDeepMap(nextExisting, keyPathIter, notSetValue, updater); return nextUpdated === nextExisting ? existing : nextUpdated === NOT_SET ? existing.remove(key) : (isNotSet ? emptyMap() : existing).set(key, nextUpdated); } function popCount(x) { return x -= x >> 1 & 1431655765, x = (858993459 & x) + (x >> 2 & 858993459), x = x + (x >> 4) & 252645135, x += x >> 8, x += x >> 16, 127 & x; } function setIn(array, idx, val, canEdit) { var newArray = canEdit ? array : arrCopy(array); return newArray[idx] = val, newArray; } function spliceIn(array, idx, val, canEdit) { var newLen = array.length + 1; if (canEdit && idx + 1 === newLen) return array[idx] = val, array; for (var newArray = new Array(newLen), after = 0, ii = 0; ii < newLen; ii++) ii === idx ? (newArray[ii] = val, after = -1) : newArray[ii] = array[ii + after]; return newArray; } function spliceOut(array, idx, canEdit) { var newLen = array.length - 1; if (canEdit && idx === newLen) return array.pop(), array; for (var newArray = new Array(newLen), after = 0, ii = 0; ii < newLen; ii++) ii === idx && (after = 1), newArray[ii] = array[ii + after]; return newArray; } function List(value) { var empty = emptyList(); if (null === value || void 0 === value) return empty; if (isList(value)) return value; var iter = IndexedIterable(value), size = iter.size; return 0 === size ? empty : (assertNotInfinite(size), size > 0 && size < SIZE ? makeList(0, size, SHIFT, null, new VNode(iter.toArray())) : empty.withMutations(function(list) { list.setSize(size), iter.forEach(function(v, i) { return list.set(i, v); }); })); } function isList(maybeList) { return !(!maybeList || !maybeList[IS_LIST_SENTINEL]); } function VNode(array, ownerID) { this.array = array, this.ownerID = ownerID; } function iterateList(list, reverse) { function iterateNodeOrLeaf(node, level, offset) { return 0 === level ? iterateLeaf(node, offset) : iterateNode(node, level, offset); } function iterateLeaf(node, offset) { var array = offset === tailPos ? tail && tail.array : node && node.array, from = offset > left ? 0 : left - offset, to = right - offset; return to > SIZE && (to = SIZE), function() { if (from === to) return DONE; var idx = reverse ? --to : from++; return array && array[idx]; }; } function iterateNode(node, level, offset) { var values, array = node && node.array, from = offset > left ? 0 : left - offset >> level, to = (right - offset >> level) + 1; return to > SIZE && (to = SIZE), function() { for (;;) { if (values) { var value = values(); if (value !== DONE) return value; values = null; } if (from === to) return DONE; var idx = reverse ? --to : from++; values = iterateNodeOrLeaf(array && array[idx], level - SHIFT, offset + (idx << level)); } }; } var left = list._origin, right = list._capacity, tailPos = getTailOffset(right), tail = list._tail; return iterateNodeOrLeaf(list._root, list._level, 0); } function makeList(origin, capacity, level, root, tail, ownerID, hash) { var list = Object.create(ListPrototype); return list.size = capacity - origin, list._origin = origin, list._capacity = capacity, list._level = level, list._root = root, list._tail = tail, list.__ownerID = ownerID, list.__hash = hash, list.__altered = !1, list; } function emptyList() { return EMPTY_LIST || (EMPTY_LIST = makeList(0, 0, SHIFT)); } function updateList(list, index, value) { if (index = wrapIndex(list, index), index !== index) return list; if (index >= list.size || index < 0) return list.withMutations(function(list) { index < 0 ? setListBounds(list, index).set(0, value) : setListBounds(list, 0, index + 1).set(index, value); }); index += list._origin; var newTail = list._tail, newRoot = list._root, didAlter = MakeRef(DID_ALTER); return index >= getTailOffset(list._capacity) ? newTail = updateVNode(newTail, list.__ownerID, 0, index, value, didAlter) : newRoot = updateVNode(newRoot, list.__ownerID, list._level, index, value, didAlter), didAlter.value ? list.__ownerID ? (list._root = newRoot, list._tail = newTail, list.__hash = void 0, list.__altered = !0, list) : makeList(list._origin, list._capacity, list._level, newRoot, newTail) : list; } function updateVNode(node, ownerID, level, index, value, didAlter) { var idx = index >>> level & MASK, nodeHas = node && idx < node.array.length; if (!nodeHas && void 0 === value) return node; var newNode; if (level > 0) { var lowerNode = node && node.array[idx], newLowerNode = updateVNode(lowerNode, ownerID, level - SHIFT, index, value, didAlter); return newLowerNode === lowerNode ? node : (newNode = editableVNode(node, ownerID), newNode.array[idx] = newLowerNode, newNode); } return nodeHas && node.array[idx] === value ? node : (SetRef(didAlter), newNode = editableVNode(node, ownerID), void 0 === value && idx === newNode.array.length - 1 ? newNode.array.pop() : newNode.array[idx] = value, newNode); } function editableVNode(node, ownerID) { return ownerID && node && ownerID === node.ownerID ? node : new VNode(node ? node.array.slice() : [], ownerID); } function listNodeFor(list, rawIndex) { if (rawIndex >= getTailOffset(list._capacity)) return list._tail; if (rawIndex < 1 << list._level + SHIFT) { for (var node = list._root, level = list._level; node && level > 0; ) node = node.array[rawIndex >>> level & MASK], level -= SHIFT; return node; } } function setListBounds(list, begin, end) { void 0 !== begin && (begin = 0 | begin), void 0 !== end && (end = 0 | end); var owner = list.__ownerID || new OwnerID(), oldOrigin = list._origin, oldCapacity = list._capacity, newOrigin = oldOrigin + begin, newCapacity = void 0 === end ? oldCapacity : end < 0 ? oldCapacity + end : oldOrigin + end; if (newOrigin === oldOrigin && newCapacity === oldCapacity) return list; if (newOrigin >= newCapacity) return list.clear(); for (var newLevel = list._level, newRoot = list._root, offsetShift = 0; newOrigin + offsetShift < 0; ) newRoot = new VNode(newRoot && newRoot.array.length ? [ void 0, newRoot ] : [], owner), newLevel += SHIFT, offsetShift += 1 << newLevel; offsetShift && (newOrigin += offsetShift, oldOrigin += offsetShift, newCapacity += offsetShift, oldCapacity += offsetShift); for (var oldTailOffset = getTailOffset(oldCapacity), newTailOffset = getTailOffset(newCapacity); newTailOffset >= 1 << newLevel + SHIFT; ) newRoot = new VNode(newRoot && newRoot.array.length ? [ newRoot ] : [], owner), newLevel += SHIFT; var oldTail = list._tail, newTail = newTailOffset < oldTailOffset ? listNodeFor(list, newCapacity - 1) : newTailOffset > oldTailOffset ? new VNode([], owner) : oldTail; if (oldTail && newTailOffset > oldTailOffset && newOrigin < oldCapacity && oldTail.array.length) { newRoot = editableVNode(newRoot, owner); for (var node = newRoot, level = newLevel; level > SHIFT; level -= SHIFT) { var idx = oldTailOffset >>> level & MASK; node = node.array[idx] = editableVNode(node.array[idx], owner); } node.array[oldTailOffset >>> SHIFT & MASK] = oldTail; } if (newCapacity < oldCapacity && (newTail = newTail && newTail.removeAfter(owner, 0, newCapacity)), newOrigin >= newTailOffset) newOrigin -= newTailOffset, newCapacity -= newTailOffset, newLevel = SHIFT, newRoot = null, newTail = newTail && newTail.removeBefore(owner, 0, newOrigin); else if (newOrigin > oldOrigin || newTailOffset < oldTailOffset) { for (offsetShift = 0; newRoot; ) { var beginIndex = newOrigin >>> newLevel & MASK; if (beginIndex !== newTailOffset >>> newLevel & MASK) break; beginIndex && (offsetShift += (1 << newLevel) * beginIndex), newLevel -= SHIFT, newRoot = newRoot.array[beginIndex]; } newRoot && newOrigin > oldOrigin && (newRoot = newRoot.removeBefore(owner, newLevel, newOrigin - offsetShift)), newRoot && newTailOffset < oldTailOffset && (newRoot = newRoot.removeAfter(owner, newLevel, newTailOffset - offsetShift)), offsetShift && (newOrigin -= offsetShift, newCapacity -= offsetShift); } return list.__ownerID ? (list.size = newCapacity - newOrigin, list._origin = newOrigin, list._capacity = newCapacity, list._level = newLevel, list._root = newRoot, list._tail = newTail, list.__hash = void 0, list.__altered = !0, list) : makeList(newOrigin, newCapacity, newLevel, newRoot, newTail); } function mergeIntoListWith(list, merger, iterables) { for (var iters = [], maxSize = 0, ii = 0; ii < iterables.length; ii++) { var value = iterables[ii], iter = IndexedIterable(value); iter.size > maxSize && (maxSize = iter.size), isIterable(value) || (iter = iter.map(function(v) { return fromJS(v); })), iters.push(iter); } return maxSize > list.size && (list = list.setSize(maxSize)), mergeIntoCollectionWith(list, merger, iters); } function getTailOffset(size) { return size < SIZE ? 0 : size - 1 >>> SHIFT << SHIFT; } function OrderedMap(value) { return null === value || void 0 === value ? emptyOrderedMap() : isOrderedMap(value) ? value : emptyOrderedMap().withMutations(function(map) { var iter = KeyedIterable(value); assertNotInfinite(iter.size), iter.forEach(function(v, k) { return map.set(k, v); }); }); } function isOrderedMap(maybeOrderedMap) { return isMap(maybeOrderedMap) && isOrdered(maybeOrderedMap); } function makeOrderedMap(map, list, ownerID, hash) { var omap = Object.create(OrderedMap.prototype); return omap.size = map ? map.size : 0, omap._map = map, omap._list = list, omap.__ownerID = ownerID, omap.__hash = hash, omap; } function emptyOrderedMap() { return EMPTY_ORDERED_MAP || (EMPTY_ORDERED_MAP = makeOrderedMap(emptyMap(), emptyList())); } function updateOrderedMap(omap, k, v) { var newMap, newList, map = omap._map, list = omap._list, i = map.get(k), has = void 0 !== i; if (v === NOT_SET) { if (!has) return omap; list.size >= SIZE && list.size >= 2 * map.size ? (newList = list.filter(function(entry, idx) { return void 0 !== entry && i !== idx; }), newMap = newList.toKeyedSeq().map(function(entry) { return entry[0]; }).flip().toMap(), omap.__ownerID && (newMap.__ownerID = newList.__ownerID = omap.__ownerID)) : (newMap = map.remove(k), newList = i === list.size - 1 ? list.pop() : list.set(i, void 0)); } else if (has) { if (v === list.get(i)[1]) return omap; newMap = map, newList = list.set(i, [ k, v ]); } else newMap = map.set(k, list.size), newList = list.set(list.size, [ k, v ]); return omap.__ownerID ? (omap.size = newMap.size, omap._map = newMap, omap._list = newList, omap.__hash = void 0, omap) : makeOrderedMap(newMap, newList); } function ToKeyedSequence(indexed, useKeys) { this._iter = indexed, this._useKeys = useKeys, this.size = indexed.size; } function ToIndexedSequence(iter) { this._iter = iter, this.size = iter.size; } function ToSetSequence(iter) { this._iter = iter, this.size = iter.size; } function FromEntriesSequence(entries) { this._iter = entries, this.size = entries.size; } function flipFactory(iterable) { var flipSequence = makeSequence(iterable); return flipSequence._iter = iterable, flipSequence.size = iterable.size, flipSequence.flip = function() { return iterable; }, flipSequence.reverse = function() { var reversedSequence = iterable.reverse.apply(this); return reversedSequence.flip = function() { return iterable.reverse(); }, reversedSequence; }, flipSequence.has = function(key) { return iterable.includes(key); }, flipSequence.includes = function(key) { return iterable.has(key); }, flipSequence.cacheResult = cacheResultThrough, flipSequence.__iterateUncached = function(fn, reverse) { var this$0 = this; return iterable.__iterate(function(v, k) { return fn(k, v, this$0) !== !1; }, reverse); }, flipSequence.__iteratorUncached = function(type, reverse) { if (type === ITERATE_ENTRIES) { var iterator = iterable.__iterator(type, reverse); return new Iterator(function() { var step = iterator.next(); if (!step.done) { var k = step.value[0]; step.value[0] = step.value[1], step.value[1] = k; } return step; }); } return iterable.__iterator(type === ITERATE_VALUES ? ITERATE_KEYS : ITERATE_VALUES, reverse); }, flipSequence; } function mapFactory(iterable, mapper, context) { var mappedSequence = makeSequence(iterable); return mappedSequence.size = iterable.size, mappedSequence.has = function(key) { return iterable.has(key); }, mappedSequence.get = function(key, notSetValue) { var v = iterable.get(key, NOT_SET); return v === NOT_SET ? notSetValue : mapper.call(context, v, key, iterable); }, mappedSequence.__iterateUncached = function(fn, reverse) { var this$0 = this; return iterable.__iterate(function(v, k, c) { return fn(mapper.call(context, v, k, c), k, this$0) !== !1; }, reverse); }, mappedSequence.__iteratorUncached = function(type, reverse) { var iterator = iterable.__iterator(ITERATE_ENTRIES, reverse); return new Iterator(function() { var step = iterator.next(); if (step.done) return step; var entry = step.value, key = entry[0]; return iteratorValue(type, key, mapper.call(context, entry[1], key, iterable), step); }); }, mappedSequence; } function reverseFactory(iterable, useKeys) { var reversedSequence = makeSequence(iterable); return reversedSequence._iter = iterable, reversedSequence.size = iterable.size, reversedSequence.reverse = function() { return iterable; }, iterable.flip && (reversedSequence.flip = function() { var flipSequence = flipFactory(iterable); return flipSequence.reverse = function() { return iterable.flip(); }, flipSequence; }), reversedSequence.get = function(key, notSetValue) { return iterable.get(useKeys ? key : -1 - key, notSetValue); }, reversedSequence.has = function(key) { return iterable.has(useKeys ? key : -1 - key); }, reversedSequence.includes = function(value) { return iterable.includes(value); }, reversedSequence.cacheResult = cacheResultThrough, reversedSequence.__iterate = function(fn, reverse) { var this$0 = this; return iterable.__iterate(function(v, k) { return fn(v, k, this$0); }, !reverse); }, reversedSequence.__iterator = function(type, reverse) { return iterable.__iterator(type, !reverse); }, reversedSequence; } function filterFactory(iterable, predicate, context, useKeys) { var filterSequence = makeSequence(iterable); return useKeys && (filterSequence.has = function(key) { var v = iterable.get(key, NOT_SET); return v !== NOT_SET && !!predicate.call(context, v, key, iterable); }, filterSequence.get = function(key, notSetValue) { var v = iterable.get(key, NOT_SET); return v !== NOT_SET && predicate.call(context, v, key, iterable) ? v : notSetValue; }), filterSequence.__iterateUncached = function(fn, reverse) { var this$0 = this, iterations = 0; return iterable.__iterate(function(v, k, c) { if (predicate.call(context, v, k, c)) return iterations++, fn(v, useKeys ? k : iterations - 1, this$0); }, reverse), iterations; }, filterSequence.__iteratorUncached = function(type, reverse) { var iterator = iterable.__iterator(ITERATE_ENTRIES, reverse), iterations = 0; return new Iterator(function() { for (;;) { var step = iterator.next(); if (step.done) return step; var entry = step.value, key = entry[0], value = entry[1]; if (predicate.call(context, value, key, iterable)) return iteratorValue(type, useKeys ? key : iterations++, value, step); } }); }, filterSequence; } function countByFactory(iterable, grouper, context) { var groups = Map().asMutable(); return iterable.__iterate(function(v, k) { groups.update(grouper.call(context, v, k, iterable), 0, function(a) { return a + 1; }); }), groups.asImmutable(); } function groupByFactory(iterable, grouper, context) { var isKeyedIter = isKeyed(iterable), groups = (isOrdered(iterable) ? OrderedMap() : Map()).asMutable(); iterable.__iterate(function(v, k) { groups.update(grouper.call(context, v, k, iterable), function(a) { return a = a || [], a.push(isKeyedIter ? [ k, v ] : v), a; }); }); var coerce = iterableClass(iterable); return groups.map(function(arr) { return reify(iterable, coerce(arr)); }); } function sliceFactory(iterable, begin, end, useKeys) { var originalSize = iterable.size; if (void 0 !== begin && (begin = 0 | begin), void 0 !== end && (end = 0 | end), wholeSlice(begin, end, originalSize)) return iterable; var resolvedBegin = resolveBegin(begin, originalSize), resolvedEnd = resolveEnd(end, originalSize); if (resolvedBegin !== resolvedBegin || resolvedEnd !== resolvedEnd) return sliceFactory(iterable.toSeq().cacheResult(), begin, end, useKeys); var sliceSize, resolvedSize = resolvedEnd - resolvedBegin; resolvedSize === resolvedSize && (sliceSize = resolvedSize < 0 ? 0 : resolvedSize); var sliceSeq = makeSequence(iterable); return sliceSeq.size = 0 === sliceSize ? sliceSize : iterable.size && sliceSize || void 0, !useKeys && isSeq(iterable) && sliceSize >= 0 && (sliceSeq.get = function(index, notSetValue) { return index = wrapIndex(this, index), index >= 0 && index < sliceSize ? iterable.get(index + resolvedBegin, notSetValue) : notSetValue; }), sliceSeq.__iterateUncached = function(fn, reverse) { var this$0 = this; if (0 === sliceSize) return 0; if (reverse) return this.cacheResult().__iterate(fn, reverse); var skipped = 0, isSkipping = !0, iterations = 0; return iterable.__iterate(function(v, k) { if (!isSkipping || !(isSkipping = skipped++ < resolvedBegin)) return iterations++, fn(v, useKeys ? k : iterations - 1, this$0) !== !1 && iterations !== sliceSize; }), iterations; }, sliceSeq.__iteratorUncached = function(type, reverse) { if (0 !== sliceSize && reverse) return this.cacheResult().__iterator(type, reverse); var iterator = 0 !== sliceSize && iterable.__iterator(type, reverse), skipped = 0, iterations = 0; return new Iterator(function() { for (;skipped++ < resolvedBegin; ) iterator.next(); if (++iterations > sliceSize) return iteratorDone(); var step = iterator.next(); return useKeys || type === ITERATE_VALUES ? step : type === ITERATE_KEYS ? iteratorValue(type, iterations - 1, void 0, step) : iteratorValue(type, iterations - 1, step.value[1], step); }); }, sliceSeq; } function takeWhileFactory(iterable, predicate, context) { var takeSequence = makeSequence(iterable); return takeSequence.__iterateUncached = function(fn, reverse) { var this$0 = this; if (reverse) return this.cacheResult().__iterate(fn, reverse); var iterations = 0; return iterable.__iterate(function(v, k, c) { return predicate.call(context, v, k, c) && ++iterations && fn(v, k, this$0); }), iterations; }, takeSequence.__iteratorUncached = function(type, reverse) { var this$0 = this; if (reverse) return this.cacheResult().__iterator(type, reverse); var iterator = iterable.__iterator(ITERATE_ENTRIES, reverse), iterating = !0; return new Iterator(function() { if (!iterating) return iteratorDone(); var step = iterator.next(); if (step.done) return step; var entry = step.value, k = entry[0], v = entry[1]; return predicate.call(context, v, k, this$0) ? type === ITERATE_ENTRIES ? step : iteratorValue(type, k, v, step) : (iterating = !1, iteratorDone()); }); }, takeSequence; } function skipWhileFactory(iterable, predicate, context, useKeys) { var skipSequence = makeSequence(iterable); return skipSequence.__iterateUncached = function(fn, reverse) { var this$0 = this; if (reverse) return this.cacheResult().__iterate(fn, reverse); var isSkipping = !0, iterations = 0; return iterable.__iterate(function(v, k, c) { if (!isSkipping || !(isSkipping = predicate.call(context, v, k, c))) return iterations++, fn(v, useKeys ? k : iterations - 1, this$0); }), iterations; }, skipSequence.__iteratorUncached = function(type, reverse) { var this$0 = this; if (reverse) return this.cacheResult().__iterator(type, reverse); var iterator = iterable.__iterator(ITERATE_ENTRIES, reverse), skipping = !0, iterations = 0; return new Iterator(function() { var step, k, v; do { if (step = iterator.next(), step.done) return useKeys || type === ITERATE_VALUES ? step : type === ITERATE_KEYS ? iteratorValue(type, iterations++, void 0, step) : iteratorValue(type, iterations++, step.value[1], step); var entry = step.value; k = entry[0], v = entry[1], skipping && (skipping = predicate.call(context, v, k, this$0)); } while (skipping); return type === ITERATE_ENTRIES ? step : iteratorValue(type, k, v, step); }); }, skipSequence; } function concatFactory(iterable, values) { var isKeyedIterable = isKeyed(iterable), iters = [ iterable ].concat(values).map(function(v) { return isIterable(v) ? isKeyedIterable && (v = KeyedIterable(v)) : v = isKeyedIterable ? keyedSeqFromValue(v) : indexedSeqFromValue(Array.isArray(v) ? v : [ v ]), v; }).filter(function(v) { return 0 !== v.size; }); if (0 === iters.length) return iterable; if (1 === iters.length) { var singleton = iters[0]; if (singleton === iterable || isKeyedIterable && isKeyed(singleton) || isIndexed(iterable) && isIndexed(singleton)) return singleton; } var concatSeq = new ArraySeq(iters); return isKeyedIterable ? concatSeq = concatSeq.toKeyedSeq() : isIndexed(iterable) || (concatSeq = concatSeq.toSetSeq()), concatSeq = concatSeq.flatten(!0), concatSeq.size = iters.reduce(function(sum, seq) { if (void 0 !== sum) { var size = seq.size; if (void 0 !== size) return sum + size; } }, 0), concatSeq; } function flattenFactory(iterable, depth, useKeys) { var flatSequence = makeSequence(iterable); return flatSequence.__iterateUncached = function(fn, reverse) { function flatDeep(iter, currentDepth) { var this$0 = this; iter.__iterate(function(v, k) { return (!depth || currentDepth < depth) && isIterable(v) ? flatDeep(v, currentDepth + 1) : fn(v, useKeys ? k : iterations++, this$0) === !1 && (stopped = !0), !stopped; }, reverse); } var iterations = 0, stopped = !1; return flatDeep(iterable, 0), iterations; }, flatSequence.__iteratorUncached = function(type, reverse) { var iterator = iterable.__iterator(type, reverse), stack = [], iterations = 0; return new Iterator(function() { for (;iterator; ) { var step = iterator.next(); if (step.done === !1) { var v = step.value; if (type === ITERATE_ENTRIES && (v = v[1]), depth && !(stack.length < depth) || !isIterable(v)) return useKeys ? step : iteratorValue(type, iterations++, v, step); stack.push(iterator), iterator = v.__iterator(type, reverse); } else iterator = stack.pop(); } return iteratorDone(); }); }, flatSequence; } function flatMapFactory(iterable, mapper, context) { var coerce = iterableClass(iterable); return iterable.toSeq().map(function(v, k) { return coerce(mapper.call(context, v, k, iterable)); }).flatten(!0); } function interposeFactory(iterable, separator) { var interposedSequence = makeSequence(iterable); return interposedSequence.size = iterable.size && 2 * iterable.size - 1, interposedSequence.__iterateUncached = function(fn, reverse) { var this$0 = this, iterations = 0; return iterable.__iterate(function(v, k) { return (!iterations || fn(separator, iterations++, this$0) !== !1) && fn(v, iterations++, this$0) !== !1; }, reverse), iterations; }, interposedSequence.__iteratorUncached = function(type, reverse) { var step, iterator = iterable.__iterator(ITERATE_VALUES, reverse), iterations = 0; return new Iterator(function() { return (!step || iterations % 2) && (step = iterator.next(), step.done) ? step : iterations % 2 ? iteratorValue(type, iterations++, separator) : iteratorValue(type, iterations++, step.value, step); }); }, interposedSequence; } function sortFactory(iterable, comparator, mapper) { comparator || (comparator = defaultComparator); var isKeyedIterable = isKeyed(iterable), index = 0, entries = iterable.toSeq().map(function(v, k) { return [ k, v, index++, mapper ? mapper(v, k, iterable) : v ]; }).toArray(); return entries.sort(function(a, b) { return comparator(a[3], b[3]) || a[2] - b[2]; }).forEach(isKeyedIterable ? function(v, i) { entries[i].length = 2; } : function(v, i) { entries[i] = v[1]; }), isKeyedIterable ? KeyedSeq(entries) : isIndexed(iterable) ? IndexedSeq(entries) : SetSeq(entries); } function maxFactory(iterable, comparator, mapper) { if (comparator || (comparator = defaultComparator), mapper) { var entry = iterable.toSeq().map(function(v, k) { return [ v, mapper(v, k, iterable) ]; }).reduce(function(a, b) { return maxCompare(comparator, a[1], b[1]) ? b : a; }); return entry && entry[0]; } return iterable.reduce(function(a, b) { return maxCompare(comparator, a, b) ? b : a; }); } function maxCompare(comparator, a, b) { var comp = comparator(b, a); return 0 === comp && b !== a && (void 0 === b || null === b || b !== b) || comp > 0; } function zipWithFactory(keyIter, zipper, iters) { var zipSequence = makeSequence(keyIter); return zipSequence.size = new ArraySeq(iters).map(function(i) { return i.size; }).min(), zipSequence.__iterate = function(fn, reverse) { for (var step, iterator = this.__iterator(ITERATE_VALUES, reverse), iterations = 0; !(step = iterator.next()).done && fn(step.value, iterations++, this) !== !1; ) ; return iterations; }, zipSequence.__iteratorUncached = function(type, reverse) { var iterators = iters.map(function(i) { return i = Iterable(i), getIterator(reverse ? i.reverse() : i); }), iterations = 0, isDone = !1; return new Iterator(function() { var steps; return isDone || (steps = iterators.map(function(i) { return i.next(); }), isDone = steps.some(function(s) { return s.done; })), isDone ? iteratorDone() : iteratorValue(type, iterations++, zipper.apply(null, steps.map(function(s) { return s.value; }))); }); }, zipSequence; } function reify(iter, seq) { return isSeq(iter) ? seq : iter.constructor(seq); } function validateEntry(entry) { if (entry !== Object(entry)) throw new TypeError("Expected [K, V] tuple: " + entry); } function resolveSize(iter) { return assertNotInfinite(iter.size), ensureSize(iter); } function iterableClass(iterable) { return isKeyed(iterable) ? KeyedIterable : isIndexed(iterable) ? IndexedIterable : SetIterable; } function makeSequence(iterable) { return Object.create((isKeyed(iterable) ? KeyedSeq : isIndexed(iterable) ? IndexedSeq : SetSeq).prototype); } function cacheResultThrough() { return this._iter.cacheResult ? (this._iter.cacheResult(), this.size = this._iter.size, this) : Seq.prototype.cacheResult.call(this); } function defaultComparator(a, b) { return a > b ? 1 : a < b ? -1 : 0; } function forceIterator(keyPath) { var iter = getIterator(keyPath); if (!iter) { if (!isArrayLike(keyPath)) throw new TypeError("Expected iterable or array-like: " + keyPath); iter = getIterator(Iterable(keyPath)); } return iter; } function Record(defaultValues, name) { var hasInitialized, RecordType = function(values) { if (values instanceof RecordType) return values; if (!(this instanceof RecordType)) return new RecordType(values); if (!hasInitialized) { hasInitialized = !0; var keys = Object.keys(defaultValues); setProps(RecordTypePrototype, keys), RecordTypePrototype.size = keys.length, RecordTypePrototype._name = name, RecordTypePrototype._keys = keys, RecordTypePrototype._defaultValues = defaultValues; } this._map = Map(values); }, RecordTypePrototype = RecordType.prototype = Object.create(RecordPrototype); return RecordTypePrototype.constructor = RecordType, RecordType; } function makeRecord(likeRecord, map, ownerID) { var record = Object.create(Object.getPrototypeOf(likeRecord)); return record._map = map, record.__ownerID = ownerID, record; } function recordName(record) { return record._name || record.constructor.name || "Record"; } function setProps(prototype, names) { try { names.forEach(setProp.bind(void 0, prototype)); } catch (error) {} } function setProp(prototype, name) { Object.defineProperty(prototype, name, { get: function() { return this.get(name); }, set: function(value) { invariant(this.__ownerID, "Cannot set on an immutable record."), this.set(name, value); } }); } function Set(value) { return null === value || void 0 === value ? emptySet() : isSet(value) && !isOrdered(value) ? value : emptySet().withMutations(function(set) { var iter = SetIterable(value); assertNotInfinite(iter.size), iter.forEach(function(v) { return set.add(v); }); }); } function isSet(maybeSet) { return !(!maybeSet || !maybeSet[IS_SET_SENTINEL]); } function updateSet(set, newMap) { return set.__ownerID ? (set.size = newMap.size, set._map = newMap, set) : newMap === set._map ? set : 0 === newMap.size ? set.__empty() : set.__make(newMap); } function makeSet(map, ownerID) { var set = Object.create(SetPrototype); return set.size = map ? map.size : 0, set._map = map, set.__ownerID = ownerID, set; } function emptySet() { return EMPTY_SET || (EMPTY_SET = makeSet(emptyMap())); } function OrderedSet(value) { return null === value || void 0 === value ? emptyOrderedSet() : isOrderedSet(value) ? value : emptyOrderedSet().withMutations(function(set) { var iter = SetIterable(value); assertNotInfinite(iter.size), iter.forEach(function(v) { return set.add(v); }); }); } function isOrderedSet(maybeOrderedSet) { return isSet(maybeOrderedSet) && isOrdered(maybeOrderedSet); } function makeOrderedSet(map, ownerID) { var set = Object.create(OrderedSetPrototype); return set.size = map ? map.size : 0, set._map = map, set.__ownerID = ownerID, set; } function emptyOrderedSet() { return EMPTY_ORDERED_SET || (EMPTY_ORDERED_SET = makeOrderedSet(emptyOrderedMap())); } function Stack(value) { return null === value || void 0 === value ? emptyStack() : isStack(value) ? value : emptyStack().unshiftAll(value); } function isStack(maybeStack) { return !(!maybeStack || !maybeStack[IS_STACK_SENTINEL]); } function makeStack(size, head, ownerID, hash) { var map = Object.create(StackPrototype); return map.size = size, map._head = head, map.__ownerID = ownerID, map.__hash = hash, map.__altered = !1, map; } function emptyStack() { return EMPTY_STACK || (EMPTY_STACK = makeStack(0)); } function mixin(ctor, methods) { var keyCopier = function(key) { ctor.prototype[key] = methods[key]; }; return Object.keys(methods).forEach(keyCopier), Object.getOwnPropertySymbols && Object.getOwnPropertySymbols(methods).forEach(keyCopier), ctor; } function keyMapper(v, k) { return k; } function entryMapper(v, k) { return [ k, v ]; } function not(predicate) { return function() { return !predicate.apply(this, arguments); }; } function neg(predicate) { return function() { return -predicate.apply(this, arguments); }; } function quoteString(value) { return "string" == typeof value ? JSON.stringify(value) : value; } function defaultZipper() { return arrCopy(arguments); } function defaultNegComparator(a, b) { return a < b ? 1 : a > b ? -1 : 0; } function hashIterable(iterable) { if (iterable.size === 1 / 0) return 0; var ordered = isOrdered(iterable), keyed = isKeyed(iterable), h = ordered ? 1 : 0, size = iterable.__iterate(keyed ? ordered ? function(v, k) { h = 31 * h + hashMerge(hash(v), hash(k)) | 0; } : function(v, k) { h = h + hashMerge(hash(v), hash(k)) | 0; } : ordered ? function(v) { h = 31 * h + hash(v) | 0; } : function(v) { h = h + hash(v) | 0; }); return murmurHashOfSize(size, h); } function murmurHashOfSize(size, h) { return h = imul(h, 3432918353), h = imul(h << 15 | h >>> -15, 461845907), h = imul(h << 13 | h >>> -13, 5), h = (h + 3864292196 | 0) ^ size, h = imul(h ^ h >>> 16, 2246822507), h = imul(h ^ h >>> 13, 3266489909), h = smi(h ^ h >>> 16); } function hashMerge(a, b) { return a ^ b + 2654435769 + (a << 6) + (a >> 2) | 0; } var SLICE$0 = Array.prototype.slice; createClass(KeyedIterable, Iterable), createClass(IndexedIterable, Iterable), createClass(SetIterable, Iterable), Iterable.isIterable = isIterable, Iterable.isKeyed = isKeyed, Iterable.isIndexed = isIndexed, Iterable.isAssociative = isAssociative, Iterable.isOrdered = isOrdered, Iterable.Keyed = KeyedIterable, Iterable.Indexed = IndexedIterable, Iterable.Set = SetIterable; var IS_ITERABLE_SENTINEL = "@@__IMMUTABLE_ITERABLE__@@", IS_KEYED_SENTINEL = "@@__IMMUTABLE_KEYED__@@", IS_INDEXED_SENTINEL = "@@__IMMUTABLE_INDEXED__@@", IS_ORDERED_SENTINEL = "@@__IMMUTABLE_ORDERED__@@", DELETE = "delete", SHIFT = 5, SIZE = 1 << SHIFT, MASK = SIZE - 1, NOT_SET = {}, CHANGE_LENGTH = { value: !1 }, DID_ALTER = { value: !1 }, ITERATE_KEYS = 0, ITERATE_VALUES = 1, ITERATE_ENTRIES = 2, REAL_ITERATOR_SYMBOL = "function" == typeof Symbol && Symbol.iterator, FAUX_ITERATOR_SYMBOL = "@@iterator", ITERATOR_SYMBOL = REAL_ITERATOR_SYMBOL || FAUX_ITERATOR_SYMBOL; Iterator.prototype.toString = function() { return "[Iterator]"; }, Iterator.KEYS = ITERATE_KEYS, Iterator.VALUES = ITERATE_VALUES, Iterator.ENTRIES = ITERATE_ENTRIES, Iterator.prototype.inspect = Iterator.prototype.toSource = function() { return this.toString(); }, Iterator.prototype[ITERATOR_SYMBOL] = function() { return this; }, createClass(Seq, Iterable), Seq.of = function() { return Seq(arguments); }, Seq.prototype.toSeq = function() { return this; }, Seq.prototype.toString = function() { return this.__toString("Seq {", "}"); }, Seq.prototype.cacheResult = function() { return !this._cache && this.__iterateUncached && (this._cache = this.entrySeq().toArray(), this.size = this._cache.length), this; }, Seq.prototype.__iterate = function(fn, reverse) { return seqIterate(this, fn, reverse, !0); }, Seq.prototype.__iterator = function(type, reverse) { return seqIterator(this, type, reverse, !0); }, createClass(KeyedSeq, Seq), KeyedSeq.prototype.toKeyedSeq = function() { return this; }, createClass(IndexedSeq, Seq), IndexedSeq.of = function() { return IndexedSeq(arguments); }, IndexedSeq.prototype.toIndexedSeq = function() { return this; }, IndexedSeq.prototype.toString = function() { return this.__toString("Seq [", "]"); }, IndexedSeq.prototype.__iterate = function(fn, reverse) { return seqIterate(this, fn, reverse, !1); }, IndexedSeq.prototype.__iterator = function(type, reverse) { return seqIterator(this, type, reverse, !1); }, createClass(SetSeq, Seq), SetSeq.of = function() { return SetSeq(arguments); }, SetSeq.prototype.toSetSeq = function() { return this; }, Seq.isSeq = isSeq, Seq.Keyed = KeyedSeq, Seq.Set = SetSeq, Seq.Indexed = IndexedSeq; var IS_SEQ_SENTINEL = "@@__IMMUTABLE_SEQ__@@"; Seq.prototype[IS_SEQ_SENTINEL] = !0, createClass(ArraySeq, IndexedSeq), ArraySeq.prototype.get = function(index, notSetValue) { return this.has(index) ? this._array[wrapIndex(this, index)] : notSetValue; }, ArraySeq.prototype.__iterate = function(fn, reverse) { for (var array = this._array, maxIndex = array.length - 1, ii = 0; ii <= maxIndex; ii++) if (fn(array[reverse ? maxIndex - ii : ii], ii, this) === !1) return ii + 1; return ii; }, ArraySeq.prototype.__iterator = function(type, reverse) { var array = this._array, maxIndex = array.length - 1, ii = 0; return new Iterator(function() { return ii > maxIndex ? iteratorDone() : iteratorValue(type, ii, array[reverse ? maxIndex - ii++ : ii++]); }); }, createClass(ObjectSeq, KeyedSeq), ObjectSeq.prototype.get = function(key, notSetValue) { return void 0 === notSetValue || this.has(key) ? this._object[key] : notSetValue; }, ObjectSeq.prototype.has = function(key) { return this._object.hasOwnProperty(key); }, ObjectSeq.prototype.__iterate = function(fn, reverse) { for (var object = this._object, keys = this._keys, maxIndex = keys.length - 1, ii = 0; ii <= maxIndex; ii++) { var key = keys[reverse ? maxIndex - ii : ii]; if (fn(object[key], key, this) === !1) return ii + 1; } return ii; }, ObjectSeq.prototype.__iterator = function(type, reverse) { var object = this._object, keys = this._keys, maxIndex = keys.length - 1, ii = 0; return new Iterator(function() { var key = keys[reverse ? maxIndex - ii : ii]; return ii++ > maxIndex ? iteratorDone() : iteratorValue(type, key, object[key]); }); }, ObjectSeq.prototype[IS_ORDERED_SENTINEL] = !0, createClass(IterableSeq, IndexedSeq), IterableSeq.prototype.__iterateUncached = function(fn, reverse) { if (reverse) return this.cacheResult().__iterate(fn, reverse); var iterable = this._iterable, iterator = getIterator(iterable), iterations = 0; if (isIterator(iterator)) for (var step; !(step = iterator.next()).done && fn(step.value, iterations++, this) !== !1; ) ; return iterations; }, IterableSeq.prototype.__iteratorUncached = function(type, reverse) { if (reverse) return this.cacheResult().__iterator(type, reverse); var iterable = this._iterable, iterator = getIterator(iterable); if (!isIterator(iterator)) return new Iterator(iteratorDone); var iterations = 0; return new Iterator(function() { var step = iterator.next(); return step.done ? step : iteratorValue(type, iterations++, step.value); }); }, createClass(IteratorSeq, IndexedSeq), IteratorSeq.prototype.__iterateUncached = function(fn, reverse) { if (reverse) return this.cacheResult().__iterate(fn, reverse); for (var iterator = this._iterator, cache = this._iteratorCache, iterations = 0; iterations < cache.length; ) if (fn(cache[iterations], iterations++, this) === !1) return iterations; for (var step; !(step = iterator.next()).done; ) { var val = step.value; if (cache[iterations] = val, fn(val, iterations++, this) === !1) break; } return iterations; }, IteratorSeq.prototype.__iteratorUncached = function(type, reverse) { if (reverse) return this.cacheResult().__iterator(type, reverse); var iterator = this._iterator, cache = this._iteratorCache, iterations = 0; return new Iterator(function() { if (iterations >= cache.length) { var step = iterator.next(); if (step.done) return step; cache[iterations] = step.value; } return iteratorValue(type, iterations, cache[iterations++]); }); }; var EMPTY_SEQ; createClass(Repeat, IndexedSeq), Repeat.prototype.toString = function() { return 0 === this.size ? "Repeat []" : "Repeat [ " + this._value + " " + this.size + " times ]"; }, Repeat.prototype.get = function(index, notSetValue) { return this.has(index) ? this._value : notSetValue; }, Repeat.prototype.includes = function(searchValue) { return is(this._value, searchValue); }, Repeat.prototype.slice = function(begin, end) { var size = this.size; return wholeSlice(begin, end, size) ? this : new Repeat(this._value, resolveEnd(end, size) - resolveBegin(begin, size)); }, Repeat.prototype.reverse = function() { return this; }, Repeat.prototype.indexOf = function(searchValue) { return is(this._value, searchValue) ? 0 : -1; }, Repeat.prototype.lastIndexOf = function(searchValue) { return is(this._value, searchValue) ? this.size : -1; }, Repeat.prototype.__iterate = function(fn, reverse) { for (var ii = 0; ii < this.size; ii++) if (fn(this._value, ii, this) === !1) return ii + 1; return ii; }, Repeat.prototype.__iterator = function(type, reverse) { var this$0 = this, ii = 0; return new Iterator(function() { return ii < this$0.size ? iteratorValue(type, ii++, this$0._value) : iteratorDone(); }); }, Repeat.prototype.equals = function(other) { return other instanceof Repeat ? is(this._value, other._value) : deepEqual(other); }; var EMPTY_REPEAT; createClass(Range, IndexedSeq), Range.prototype.toString = function() { return 0 === this.size ? "Range []" : "Range [ " + this._start + "..." + this._end + (this._step > 1 ? " by " + this._step : "") + " ]"; }, Range.prototype.get = function(index, notSetValue) { return this.has(index) ? this._start + wrapIndex(this, index) * this._step : notSetValue; }, Range.prototype.includes = function(searchValue) { var possibleIndex = (searchValue - this._start) / this._step; return possibleIndex >= 0 && possibleIndex < this.size && possibleIndex === Math.floor(possibleIndex); }, Range.prototype.slice = function(begin, end) { return wholeSlice(begin, end, this.size) ? this : (begin = resolveBegin(begin, this.size), end = resolveEnd(end, this.size), end <= begin ? new Range(0, 0) : new Range(this.get(begin, this._end), this.get(end, this._end), this._step)); }, Range.prototype.indexOf = function(searchValue) { var offsetValue = searchValue - this._start; if (offsetValue % this._step === 0) { var index = offsetValue / this._step; if (index >= 0 && index < this.size) return index; } return -1; }, Range.prototype.lastIndexOf = function(searchValue) { return this.indexOf(searchValue); }, Range.prototype.__iterate = function(fn, reverse) { for (var maxIndex = this.size - 1, step = this._step, value = reverse ? this._start + maxIndex * step : this._start, ii = 0; ii <= maxIndex; ii++) { if (fn(value, ii, this) === !1) return ii + 1; value += reverse ? -step : step; } return ii; }, Range.prototype.__iterator = function(type, reverse) { var maxIndex = this.size - 1, step = this._step, value = reverse ? this._start + maxIndex * step : this._start, ii = 0; return new Iterator(function() { var v = value; return value += reverse ? -step : step, ii > maxIndex ? iteratorDone() : iteratorValue(type, ii++, v); }); }, Range.prototype.equals = function(other) { return other instanceof Range ? this._start === other._start && this._end === other._end && this._step === other._step : deepEqual(this, other); }; var EMPTY_RANGE; createClass(Collection, Iterable), createClass(KeyedCollection, Collection), createClass(IndexedCollection, Collection), createClass(SetCollection, Collection), Collection.Keyed = KeyedCollection, Collection.Indexed = IndexedCollection, Collection.Set = SetCollection; var weakMap, imul = "function" == typeof Math.imul && Math.imul(4294967295, 2) === -2 ? Math.imul : function(a, b) { a = 0 | a, b = 0 | b; var c = 65535 & a, d = 65535 & b; return c * d + ((a >>> 16) * d + c * (b >>> 16) << 16 >>> 0) | 0; }, isExtensible = Object.isExtensible, canDefineProperty = function() { try { return Object.defineProperty({}, "@", {}), !0; } catch (e) { return !1; } }(), usingWeakMap = "function" == typeof WeakMap; usingWeakMap && (weakMap = new WeakMap()); var objHashUID = 0, UID_HASH_KEY = "__immutablehash__"; "function" == typeof Symbol && (UID_HASH_KEY = Symbol(UID_HASH_KEY)); var STRING_HASH_CACHE_MIN_STRLEN = 16, STRING_HASH_CACHE_MAX_SIZE = 255, STRING_HASH_CACHE_SIZE = 0, stringHashCache = {}; createClass(Map, KeyedCollection), Map.prototype.toString = function() { return this.__toString("Map {", "}"); }, Map.prototype.get = function(k, notSetValue) { return this._root ? this._root.get(0, void 0, k, notSetValue) : notSetValue; }, Map.prototype.set = function(k, v) { return updateMap(this, k, v); }, Map.prototype.setIn = function(keyPath, v) { return this.updateIn(keyPath, NOT_SET, function() { return v; }); }, Map.prototype.remove = function(k) { return updateMap(this, k, NOT_SET); }, Map.prototype.deleteIn = function(keyPath) { return this.updateIn(keyPath, function() { return NOT_SET; }); }, Map.prototype.update = function(k, notSetValue, updater) { return 1 === arguments.length ? k(this) : this.updateIn([ k ], notSetValue, updater); }, Map.prototype.updateIn = function(keyPath, notSetValue, updater) { updater || (updater = notSetValue, notSetValue = void 0); var updatedValue = updateInDeepMap(this, forceIterator(keyPath), notSetValue, updater); return updatedValue === NOT_SET ? void 0 : updatedValue; }, Map.prototype.clear = function() { return 0 === this.size ? this : this.__ownerID ? (this.size = 0, this._root = null, this.__hash = void 0, this.__altered = !0, this) : emptyMap(); }, Map.prototype.merge = function() { return mergeIntoMapWith(this, void 0, arguments); }, Map.prototype.mergeWith = function(merger) { var iters = SLICE$0.call(arguments, 1); return mergeIntoMapWith(this, merger, iters); }, Map.prototype.mergeIn = function(keyPath) { var iters = SLICE$0.call(arguments, 1); return this.updateIn(keyPath, emptyMap(), function(m) { return "function" == typeof m.merge ? m.merge.apply(m, iters) : iters[iters.length - 1]; }); }, Map.prototype.mergeDeep = function() { return mergeIntoMapWith(this, deepMerger, arguments); }, Map.prototype.mergeDeepWith = function(merger) { var iters = SLICE$0.call(arguments, 1); return mergeIntoMapWith(this, deepMergerWith(merger), iters); }, Map.prototype.mergeDeepIn = function(keyPath) { var iters = SLICE$0.call(arguments, 1); return this.updateIn(keyPath, emptyMap(), function(m) { return "function" == typeof m.mergeDeep ? m.mergeDeep.apply(m, iters) : iters[iters.length - 1]; }); }, Map.prototype.sort = function(comparator) { return OrderedMap(sortFactory(this, comparator)); }, Map.prototype.sortBy = function(mapper, comparator) { return OrderedMap(sortFactory(this, comparator, mapper)); }, Map.prototype.withMutations = function(fn) { var mutable = this.asMutable(); return fn(mutable), mutable.wasAltered() ? mutable.__ensureOwner(this.__ownerID) : this; }, Map.prototype.asMutable = function() { return this.__ownerID ? this : this.__ensureOwner(new OwnerID()); }, Map.prototype.asImmutable = function() { return this.__ensureOwner(); }, Map.prototype.wasAltered = function() { return this.__altered; }, Map.prototype.__iterator = function(type, reverse) { return new MapIterator(this, type, reverse); }, Map.prototype.__iterate = function(fn, reverse) { var this$0 = this, iterations = 0; return this._root && this._root.iterate(function(entry) { return iterations++, fn(entry[1], entry[0], this$0); }, reverse), iterations; }, Map.prototype.__ensureOwner = function(ownerID) { return ownerID === this.__ownerID ? this : ownerID ? makeMap(this.size, this._root, ownerID, this.__hash) : (this.__ownerID = ownerID, this.__altered = !1, this); }, Map.isMap = isMap; var IS_MAP_SENTINEL = "@@__IMMUTABLE_MAP__@@", MapPrototype = Map.prototype; MapPrototype[IS_MAP_SENTINEL] = !0, MapPrototype[DELETE] = MapPrototype.remove, MapPrototype.removeIn = MapPrototype.deleteIn, ArrayMapNode.prototype.get = function(shift, keyHash, key, notSetValue) { for (var entries = this.entries, ii = 0, len = entries.length; ii < len; ii++) if (is(key, entries[ii][0])) return entries[ii][1]; return notSetValue; }, ArrayMapNode.prototype.update = function(ownerID, shift, keyHash, key, value, didChangeSize, didAlter) { for (var removed = value === NOT_SET, entries = this.entries, idx = 0, len = entries.length; idx < len && !is(key, entries[idx][0]); idx++) ; var exists = idx < len; if (exists ? entries[idx][1] === value : removed) return this; if (SetRef(didAlter), (removed || !exists) && SetRef(didChangeSize), !removed || 1 !== entries.length) { if (!exists && !removed && entries.length >= MAX_ARRAY_MAP_SIZE) return createNodes(ownerID, entries, key, value); var isEditable = ownerID && ownerID === this.ownerID, newEntries = isEditable ? entries : arrCopy(entries); return exists ? removed ? idx === len - 1 ? newEntries.pop() : newEntries[idx] = newEntries.pop() : newEntries[idx] = [ key, value ] : newEntries.push([ key, value ]), isEditable ? (this.entries = newEntries, this) : new ArrayMapNode(ownerID, newEntries); } }, BitmapIndexedNode.prototype.get = function(shift, keyHash, key, notSetValue) { void 0 === keyHash && (keyHash = hash(key)); var bit = 1 << ((0 === shift ? keyHash : keyHash >>> shift) & MASK), bitmap = this.bitmap; return 0 === (bitmap & bit) ? notSetValue : this.nodes[popCount(bitmap & bit - 1)].get(shift + SHIFT, keyHash, key, notSetValue); }, BitmapIndexedNode.prototype.update = function(ownerID, shift, keyHash, key, value, didChangeSize, didAlter) { void 0 === keyHash && (keyHash = hash(key)); var keyHashFrag = (0 === shift ? keyHash : keyHash >>> shift) & MASK, bit = 1 << keyHashFrag, bitmap = this.bitmap, exists = 0 !== (bitmap & bit); if (!exists && value === NOT_SET) return this; var idx = popCount(bitmap & bit - 1), nodes = this.nodes, node = exists ? nodes[idx] : void 0, newNode = updateNode(node, ownerID, shift + SHIFT, keyHash, key, value, didChangeSize, didAlter); if (newNode === node) return this; if (!exists && newNode && nodes.length >= MAX_BITMAP_INDEXED_SIZE) return expandNodes(ownerID, nodes, bitmap, keyHashFrag, newNode); if (exists && !newNode && 2 === nodes.length && isLeafNode(nodes[1 ^ idx])) return nodes[1 ^ idx]; if (exists && newNode && 1 === nodes.length && isLeafNode(newNode)) return newNode; var isEditable = ownerID && ownerID === this.ownerID, newBitmap = exists ? newNode ? bitmap : bitmap ^ bit : bitmap | bit, newNodes = exists ? newNode ? setIn(nodes, idx, newNode, isEditable) : spliceOut(nodes, idx, isEditable) : spliceIn(nodes, idx, newNode, isEditable); return isEditable ? (this.bitmap = newBitmap, this.nodes = newNodes, this) : new BitmapIndexedNode(ownerID, newBitmap, newNodes); }, HashArrayMapNode.prototype.get = function(shift, keyHash, key, notSetValue) { void 0 === keyHash && (keyHash = hash(key)); var idx = (0 === shift ? keyHash : keyHash >>> shift) & MASK, node = this.nodes[idx]; return node ? node.get(shift + SHIFT, keyHash, key, notSetValue) : notSetValue; }, HashArrayMapNode.prototype.update = function(ownerID, shift, keyHash, key, value, didChangeSize, didAlter) { void 0 === keyHash && (keyHash = hash(key)); var idx = (0 === shift ? keyHash : keyHash >>> shift) & MASK, removed = value === NOT_SET, nodes = this.nodes, node = nodes[idx]; if (removed && !node) return this; var newNode = updateNode(node, ownerID, shift + SHIFT, keyHash, key, value, didChangeSize, didAlter); if (newNode === node) return this; var newCount = this.count; if (node) { if (!newNode && (newCount--, newCount < MIN_HASH_ARRAY_MAP_SIZE)) return packNodes(ownerID, nodes, newCount, idx); } else newCount++; var isEditable = ownerID && ownerID === this.ownerID, newNodes = setIn(nodes, idx, newNode, isEditable); return isEditable ? (this.count = newCount, this.nodes = newNodes, this) : new HashArrayMapNode(ownerID, newCount, newNodes); }, HashCollisionNode.prototype.get = function(shift, keyHash, key, notSetValue) { for (var entries = this.entries, ii = 0, len = entries.length; ii < len; ii++) if (is(key, entries[ii][0])) return entries[ii][1]; return notSetValue; }, HashCollisionNode.prototype.update = function(ownerID, shift, keyHash, key, value, didChangeSize, didAlter) { void 0 === keyHash && (keyHash = hash(key)); var removed = value === NOT_SET; if (keyHash !== this.keyHash) return removed ? this : (SetRef(didAlter), SetRef(didChangeSize), mergeIntoNode(this, ownerID, shift, keyHash, [ key, value ])); for (var entries = this.entries, idx = 0, len = entries.length; idx < len && !is(key, entries[idx][0]); idx++) ; var exists = idx < len; if (exists ? entries[idx][1] === value : removed) return this; if (SetRef(didAlter), (removed || !exists) && SetRef(didChangeSize), removed && 2 === len) return new ValueNode(ownerID, this.keyHash, entries[1 ^ idx]); var isEditable = ownerID && ownerID === this.ownerID, newEntries = isEditable ? entries : arrCopy(entries); return exists ? removed ? idx === len - 1 ? newEntries.pop() : newEntries[idx] = newEntries.pop() : newEntries[idx] = [ key, value ] : newEntries.push([ key, value ]), isEditable ? (this.entries = newEntries, this) : new HashCollisionNode(ownerID, this.keyHash, newEntries); }, ValueNode.prototype.get = function(shift, keyHash, key, notSetValue) { return is(key, this.entry[0]) ? this.entry[1] : notSetValue; }, ValueNode.prototype.update = function(ownerID, shift, keyHash, key, value, didChangeSize, didAlter) { var removed = value === NOT_SET, keyMatch = is(key, this.entry[0]); return (keyMatch ? value === this.entry[1] : removed) ? this : (SetRef(didAlter), removed ? void SetRef(didChangeSize) : keyMatch ? ownerID && ownerID === this.ownerID ? (this.entry[1] = value, this) : new ValueNode(ownerID, this.keyHash, [ key, value ]) : (SetRef(didChangeSize), mergeIntoNode(this, ownerID, shift, hash(key), [ key, value ]))); }, ArrayMapNode.prototype.iterate = HashCollisionNode.prototype.iterate = function(fn, reverse) { for (var entries = this.entries, ii = 0, maxIndex = entries.length - 1; ii <= maxIndex; ii++) if (fn(entries[reverse ? maxIndex - ii : ii]) === !1) return !1; }, BitmapIndexedNode.prototype.iterate = HashArrayMapNode.prototype.iterate = function(fn, reverse) { for (var nodes = this.nodes, ii = 0, maxIndex = nodes.length - 1; ii <= maxIndex; ii++) { var node = nodes[reverse ? maxIndex - ii : ii]; if (node && node.iterate(fn, reverse) === !1) return !1; } }, ValueNode.prototype.iterate = function(fn, reverse) { return fn(this.entry); }, createClass(MapIterator, Iterator), MapIterator.prototype.next = function() { for (var type = this._type, stack = this._stack; stack; ) { var maxIndex, node = stack.node, index = stack.index++; if (node.entry) { if (0 === index) return mapIteratorValue(type, node.entry); } else if (node.entries) { if (maxIndex = node.entries.length - 1, index <= maxIndex) return mapIteratorValue(type, node.entries[this._reverse ? maxIndex - index : index]); } else if (maxIndex = node.nodes.length - 1, index <= maxIndex) { var subNode = node.nodes[this._reverse ? maxIndex - index : index]; if (subNode) { if (subNode.entry) return mapIteratorValue(type, subNode.entry); stack = this._stack = mapIteratorFrame(subNode, stack); } continue; } stack = this._stack = this._stack.__prev; } return iteratorDone(); }; var EMPTY_MAP, MAX_ARRAY_MAP_SIZE = SIZE / 4, MAX_BITMAP_INDEXED_SIZE = SIZE / 2, MIN_HASH_ARRAY_MAP_SIZE = SIZE / 4; createClass(List, IndexedCollection), List.of = function() { return this(arguments); }, List.prototype.toString = function() { return this.__toString("List [", "]"); }, List.prototype.get = function(index, notSetValue) { if (index = wrapIndex(this, index), index >= 0 && index < this.size) { index += this._origin; var node = listNodeFor(this, index); return node && node.array[index & MASK]; } return notSetValue; }, List.prototype.set = function(index, value) { return updateList(this, index, value); }, List.prototype.remove = function(index) { return this.has(index) ? 0 === index ? this.shift() : index === this.size - 1 ? this.pop() : this.splice(index, 1) : this; }, List.prototype.insert = function(index, value) { return this.splice(index, 0, value); }, List.prototype.clear = function() { return 0 === this.size ? this : this.__ownerID ? (this.size = this._origin = this._capacity = 0, this._level = SHIFT, this._root = this._tail = null, this.__hash = void 0, this.__altered = !0, this) : emptyList(); }, List.prototype.push = function() { var values = arguments, oldSize = this.size; return this.withMutations(function(list) { setListBounds(list, 0, oldSize + values.length); for (var ii = 0; ii < values.length; ii++) list.set(oldSize + ii, values[ii]); }); }, List.prototype.pop = function() { return setListBounds(this, 0, -1); }, List.prototype.unshift = function() { var values = arguments; return this.withMutations(function(list) { setListBounds(list, -values.length); for (var ii = 0; ii < values.length; ii++) list.set(ii, values[ii]); }); }, List.prototype.shift = function() { return setListBounds(this, 1); }, List.prototype.merge = function() { return mergeIntoListWith(this, void 0, arguments); }, List.prototype.mergeWith = function(merger) { var iters = SLICE$0.call(arguments, 1); return mergeIntoListWith(this, merger, iters); }, List.prototype.mergeDeep = function() { return mergeIntoListWith(this, deepMerger, arguments); }, List.prototype.mergeDeepWith = function(merger) { var iters = SLICE$0.call(arguments, 1); return mergeIntoListWith(this, deepMergerWith(merger), iters); }, List.prototype.setSize = function(size) { return setListBounds(this, 0, size); }, List.prototype.slice = function(begin, end) { var size = this.size; return wholeSlice(begin, end, size) ? this : setListBounds(this, resolveBegin(begin, size), resolveEnd(end, size)); }, List.prototype.__iterator = function(type, reverse) { var index = 0, values = iterateList(this, reverse); return new Iterator(function() { var value = values(); return value === DONE ? iteratorDone() : iteratorValue(type, index++, value); }); }, List.prototype.__iterate = function(fn, reverse) { for (var value, index = 0, values = iterateList(this, reverse); (value = values()) !== DONE && fn(value, index++, this) !== !1; ) ; return index; }, List.prototype.__ensureOwner = function(ownerID) { return ownerID === this.__ownerID ? this : ownerID ? makeList(this._origin, this._capacity, this._level, this._root, this._tail, ownerID, this.__hash) : (this.__ownerID = ownerID, this); }, List.isList = isList; var IS_LIST_SENTINEL = "@@__IMMUTABLE_LIST__@@", ListPrototype = List.prototype; ListPrototype[IS_LIST_SENTINEL] = !0, ListPrototype[DELETE] = ListPrototype.remove, ListPrototype.setIn = MapPrototype.setIn, ListPrototype.deleteIn = ListPrototype.removeIn = MapPrototype.removeIn, ListPrototype.update = MapPrototype.update, ListPrototype.updateIn = MapPrototype.updateIn, ListPrototype.mergeIn = MapPrototype.mergeIn, ListPrototype.mergeDeepIn = MapPrototype.mergeDeepIn, ListPrototype.withMutations = MapPrototype.withMutations, ListPrototype.asMutable = MapPrototype.asMutable, ListPrototype.asImmutable = MapPrototype.asImmutable, ListPrototype.wasAltered = MapPrototype.wasAltered, VNode.prototype.removeBefore = function(ownerID, level, index) { if (index === level ? 1 << level : 0 === this.array.length) return this; var originIndex = index >>> level & MASK; if (originIndex >= this.array.length) return new VNode([], ownerID); var newChild, removingFirst = 0 === originIndex; if (level > 0) { var oldChild = this.array[originIndex]; if (newChild = oldChild && oldChild.removeBefore(ownerID, level - SHIFT, index), newChild === oldChild && removingFirst) return this; } if (removingFirst && !newChild) return this; var editable = editableVNode(this, ownerID); if (!removingFirst) for (var ii = 0; ii < originIndex; ii++) editable.array[ii] = void 0; return newChild && (editable.array[originIndex] = newChild), editable; }, VNode.prototype.removeAfter = function(ownerID, level, index) { if (index === (level ? 1 << level : 0) || 0 === this.array.length) return this; var sizeIndex = index - 1 >>> level & MASK; if (sizeIndex >= this.array.length) return this; var newChild; if (level > 0) { var oldChild = this.array[sizeIndex]; if (newChild = oldChild && oldChild.removeAfter(ownerID, level - SHIFT, index), newChild === oldChild && sizeIndex === this.array.length - 1) return this; } var editable = editableVNode(this, ownerID); return editable.array.splice(sizeIndex + 1), newChild && (editable.array[sizeIndex] = newChild), editable; }; var EMPTY_LIST, DONE = {}; createClass(OrderedMap, Map), OrderedMap.of = function() { return this(arguments); }, OrderedMap.prototype.toString = function() { return this.__toString("OrderedMap {", "}"); }, OrderedMap.prototype.get = function(k, notSetValue) { var index = this._map.get(k); return void 0 !== index ? this._list.get(index)[1] : notSetValue; }, OrderedMap.prototype.clear = function() { return 0 === this.size ? this : this.__ownerID ? (this.size = 0, this._map.clear(), this._list.clear(), this) : emptyOrderedMap(); }, OrderedMap.prototype.set = function(k, v) { return updateOrderedMap(this, k, v); }, OrderedMap.prototype.remove = function(k) { return updateOrderedMap(this, k, NOT_SET); }, OrderedMap.prototype.wasAltered = function() { return this._map.wasAltered() || this._list.wasAltered(); }, OrderedMap.prototype.__iterate = function(fn, reverse) { var this$0 = this; return this._list.__iterate(function(entry) { return entry && fn(entry[1], entry[0], this$0); }, reverse); }, OrderedMap.prototype.__iterator = function(type, reverse) { return this._list.fromEntrySeq().__iterator(type, reverse); }, OrderedMap.prototype.__ensureOwner = function(ownerID) { if (ownerID === this.__ownerID) return this; var newMap = this._map.__ensureOwner(ownerID), newList = this._list.__ensureOwner(ownerID); return ownerID ? makeOrderedMap(newMap, newList, ownerID, this.__hash) : (this.__ownerID = ownerID, this._map = newMap, this._list = newList, this); }, OrderedMap.isOrderedMap = isOrderedMap, OrderedMap.prototype[IS_ORDERED_SENTINEL] = !0, OrderedMap.prototype[DELETE] = OrderedMap.prototype.remove; var EMPTY_ORDERED_MAP; createClass(ToKeyedSequence, KeyedSeq), ToKeyedSequence.prototype.get = function(key, notSetValue) { return this._iter.get(key, notSetValue); }, ToKeyedSequence.prototype.has = function(key) { return this._iter.has(key); }, ToKeyedSequence.prototype.valueSeq = function() { return this._iter.valueSeq(); }, ToKeyedSequence.prototype.reverse = function() { var this$0 = this, reversedSequence = reverseFactory(this, !0); return this._useKeys || (reversedSequence.valueSeq = function() { return this$0._iter.toSeq().reverse(); }), reversedSequence; }, ToKeyedSequence.prototype.map = function(mapper, context) { var this$0 = this, mappedSequence = mapFactory(this, mapper, context); return this._useKeys || (mappedSequence.valueSeq = function() { return this$0._iter.toSeq().map(mapper, context); }), mappedSequence; }, ToKeyedSequence.prototype.__iterate = function(fn, reverse) { var ii, this$0 = this; return this._iter.__iterate(this._useKeys ? function(v, k) { return fn(v, k, this$0); } : (ii = reverse ? resolveSize(this) : 0, function(v) { return fn(v, reverse ? --ii : ii++, this$0); }), reverse); }, ToKeyedSequence.prototype.__iterator = function(type, reverse) { if (this._useKeys) return this._iter.__iterator(type, reverse); var iterator = this._iter.__iterator(ITERATE_VALUES, reverse), ii = reverse ? resolveSize(this) : 0; return new Iterator(function() { var step = iterator.next(); return step.done ? step : iteratorValue(type, reverse ? --ii : ii++, step.value, step); }); }, ToKeyedSequence.prototype[IS_ORDERED_SENTINEL] = !0, createClass(ToIndexedSequence, IndexedSeq), ToIndexedSequence.prototype.includes = function(value) { return this._iter.includes(value); }, ToIndexedSequence.prototype.__iterate = function(fn, reverse) { var this$0 = this, iterations = 0; return this._iter.__iterate(function(v) { return fn(v, iterations++, this$0); }, reverse); }, ToIndexedSequence.prototype.__iterator = function(type, reverse) { var iterator = this._iter.__iterator(ITERATE_VALUES, reverse), iterations = 0; return new Iterator(function() { var step = iterator.next(); return step.done ? step : iteratorValue(type, iterations++, step.value, step); }); }, createClass(ToSetSequence, SetSeq), ToSetSequence.prototype.has = function(key) { return this._iter.includes(key); }, ToSetSequence.prototype.__iterate = function(fn, reverse) { var this$0 = this; return this._iter.__iterate(function(v) { return fn(v, v, this$0); }, reverse); }, ToSetSequence.prototype.__iterator = function(type, reverse) { var iterator = this._iter.__iterator(ITERATE_VALUES, reverse); return new Iterator(function() { var step = iterator.next(); return step.done ? step : iteratorValue(type, step.value, step.value, step); }); }, createClass(FromEntriesSequence, KeyedSeq), FromEntriesSequence.prototype.entrySeq = function() { return this._iter.toSeq(); }, FromEntriesSequence.prototype.__iterate = function(fn, reverse) { var this$0 = this; return this._iter.__iterate(function(entry) { if (entry) { validateEntry(entry); var indexedIterable = isIterable(entry); return fn(indexedIterable ? entry.get(1) : entry[1], indexedIterable ? entry.get(0) : entry[0], this$0); } }, reverse); }, FromEntriesSequence.prototype.__iterator = function(type, reverse) { var iterator = this._iter.__iterator(ITERATE_VALUES, reverse); return new Iterator(function() { for (;;) { var step = iterator.next(); if (step.done) return step; var entry = step.value; if (entry) { validateEntry(entry); var indexedIterable = isIterable(entry); return iteratorValue(type, indexedIterable ? entry.get(0) : entry[0], indexedIterable ? entry.get(1) : entry[1], step); } } }); }, ToIndexedSequence.prototype.cacheResult = ToKeyedSequence.prototype.cacheResult = ToSetSequence.prototype.cacheResult = FromEntriesSequence.prototype.cacheResult = cacheResultThrough, createClass(Record, KeyedCollection), Record.prototype.toString = function() { return this.__toString(recordName(this) + " {", "}"); }, Record.prototype.has = function(k) { return this._defaultValues.hasOwnProperty(k); }, Record.prototype.get = function(k, notSetValue) { if (!this.has(k)) return notSetValue; var defaultVal = this._defaultValues[k]; return this._map ? this._map.get(k, defaultVal) : defaultVal; }, Record.prototype.clear = function() { if (this.__ownerID) return this._map && this._map.clear(), this; var RecordType = this.constructor; return RecordType._empty || (RecordType._empty = makeRecord(this, emptyMap())); }, Record.prototype.set = function(k, v) { if (!this.has(k)) throw new Error('Cannot set unknown key "' + k + '" on ' + recordName(this)); var newMap = this._map && this._map.set(k, v); return this.__ownerID || newMap === this._map ? this : makeRecord(this, newMap); }, Record.prototype.remove = function(k) { if (!this.has(k)) return this; var newMap = this._map && this._map.remove(k); return this.__ownerID || newMap === this._map ? this : makeRecord(this, newMap); }, Record.prototype.wasAltered = function() { return this._map.wasAltered(); }, Record.prototype.__iterator = function(type, reverse) { var this$0 = this; return KeyedIterable(this._defaultValues).map(function(_, k) { return this$0.get(k); }).__iterator(type, reverse); }, Record.prototype.__iterate = function(fn, reverse) { var this$0 = this; return KeyedIterable(this._defaultValues).map(function(_, k) { return this$0.get(k); }).__iterate(fn, reverse); }, Record.prototype.__ensureOwner = function(ownerID) { if (ownerID === this.__ownerID) return this; var newMap = this._map && this._map.__ensureOwner(ownerID); return ownerID ? makeRecord(this, newMap, ownerID) : (this.__ownerID = ownerID, this._map = newMap, this); }; var RecordPrototype = Record.prototype; RecordPrototype[DELETE] = RecordPrototype.remove, RecordPrototype.deleteIn = RecordPrototype.removeIn = MapPrototype.removeIn, RecordPrototype.merge = MapPrototype.merge, RecordPrototype.mergeWith = MapPrototype.mergeWith, RecordPrototype.mergeIn = MapPrototype.mergeIn, RecordPrototype.mergeDeep = MapPrototype.mergeDeep, RecordPrototype.mergeDeepWith = MapPrototype.mergeDeepWith, RecordPrototype.mergeDeepIn = MapPrototype.mergeDeepIn, RecordPrototype.setIn = MapPrototype.setIn, RecordPrototype.update = MapPrototype.update, RecordPrototype.updateIn = MapPrototype.updateIn, RecordPrototype.withMutations = MapPrototype.withMutations, RecordPrototype.asMutable = MapPrototype.asMutable, RecordPrototype.asImmutable = MapPrototype.asImmutable, createClass(Set, SetCollection), Set.of = function() { return this(arguments); }, Set.fromKeys = function(value) { return this(KeyedIterable(value).keySeq()); }, Set.prototype.toString = function() { return this.__toString("Set {", "}"); }, Set.prototype.has = function(value) { return this._map.has(value); }, Set.prototype.add = function(value) { return updateSet(this, this._map.set(value, !0)); }, Set.prototype.remove = function(value) { return updateSet(this, this._map.remove(value)); }, Set.prototype.clear = function() { return updateSet(this, this._map.clear()); }, Set.prototype.union = function() { var iters = SLICE$0.call(arguments, 0); return iters = iters.filter(function(x) { return 0 !== x.size; }), 0 === iters.length ? this : 0 !== this.size || this.__ownerID || 1 !== iters.length ? this.withMutations(function(set) { for (var ii = 0; ii < iters.length; ii++) SetIterable(iters[ii]).forEach(function(value) { return set.add(value); }); }) : this.constructor(iters[0]); }, Set.prototype.intersect = function() { var iters = SLICE$0.call(arguments, 0); if (0 === iters.length) return this; iters = iters.map(function(iter) { return SetIterable(iter); }); var originalSet = this; return this.withMutations(function(set) { originalSet.forEach(function(value) { iters.every(function(iter) { return iter.includes(value); }) || set.remove(value); }); }); }, Set.prototype.subtract = function() { var iters = SLICE$0.call(arguments, 0); if (0 === iters.length) return this; iters = iters.map(function(iter) { return SetIterable(iter); }); var originalSet = this; return this.withMutations(function(set) { originalSet.forEach(function(value) { iters.some(function(iter) { return iter.includes(value); }) && set.remove(value); }); }); }, Set.prototype.merge = function() { return this.union.apply(this, arguments); }, Set.prototype.mergeWith = function(merger) { var iters = SLICE$0.call(arguments, 1); return this.union.apply(this, iters); }, Set.prototype.sort = function(comparator) { return OrderedSet(sortFactory(this, comparator)); }, Set.prototype.sortBy = function(mapper, comparator) { return OrderedSet(sortFactory(this, comparator, mapper)); }, Set.prototype.wasAltered = function() { return this._map.wasAltered(); }, Set.prototype.__iterate = function(fn, reverse) { var this$0 = this; return this._map.__iterate(function(_, k) { return fn(k, k, this$0); }, reverse); }, Set.prototype.__iterator = function(type, reverse) { return this._map.map(function(_, k) { return k; }).__iterator(type, reverse); }, Set.prototype.__ensureOwner = function(ownerID) { if (ownerID === this.__ownerID) return this; var newMap = this._map.__ensureOwner(ownerID); return ownerID ? this.__make(newMap, ownerID) : (this.__ownerID = ownerID, this._map = newMap, this); }, Set.isSet = isSet; var IS_SET_SENTINEL = "@@__IMMUTABLE_SET__@@", SetPrototype = Set.prototype; SetPrototype[IS_SET_SENTINEL] = !0, SetPrototype[DELETE] = SetPrototype.remove, SetPrototype.mergeDeep = SetPrototype.merge, SetPrototype.mergeDeepWith = SetPrototype.mergeWith, SetPrototype.withMutations = MapPrototype.withMutations, SetPrototype.asMutable = MapPrototype.asMutable, SetPrototype.asImmutable = MapPrototype.asImmutable, SetPrototype.__empty = emptySet, SetPrototype.__make = makeSet; var EMPTY_SET; createClass(OrderedSet, Set), OrderedSet.of = function() { return this(arguments); }, OrderedSet.fromKeys = function(value) { return this(KeyedIterable(value).keySeq()); }, OrderedSet.prototype.toString = function() { return this.__toString("OrderedSet {", "}"); }, OrderedSet.isOrderedSet = isOrderedSet; var OrderedSetPrototype = OrderedSet.prototype; OrderedSetPrototype[IS_ORDERED_SENTINEL] = !0, OrderedSetPrototype.__empty = emptyOrderedSet, OrderedSetPrototype.__make = makeOrderedSet; var EMPTY_ORDERED_SET; createClass(Stack, IndexedCollection), Stack.of = function() { return this(arguments); }, Stack.prototype.toString = function() { return this.__toString("Stack [", "]"); }, Stack.prototype.get = function(index, notSetValue) { var head = this._head; for (index = wrapIndex(this, index); head && index--; ) head = head.next; return head ? head.value : notSetValue; }, Stack.prototype.peek = function() { return this._head && this._head.value; }, Stack.prototype.push = function() { if (0 === arguments.length) return this; for (var newSize = this.size + arguments.length, head = this._head, ii = arguments.length - 1; ii >= 0; ii--) head = { value: arguments[ii], next: head }; return this.__ownerID ? (this.size = newSize, this._head = head, this.__hash = void 0, this.__altered = !0, this) : makeStack(newSize, head); }, Stack.prototype.pushAll = function(iter) { if (iter = IndexedIterable(iter), 0 === iter.size) return this; assertNotInfinite(iter.size); var newSize = this.size, head = this._head; return iter.reverse().forEach(function(value) { newSize++, head = { value: value, next: head }; }), this.__ownerID ? (this.size = newSize, this._head = head, this.__hash = void 0, this.__altered = !0, this) : makeStack(newSize, head); }, Stack.prototype.pop = function() { return this.slice(1); }, Stack.prototype.unshift = function() { return this.push.apply(this, arguments); }, Stack.prototype.unshiftAll = function(iter) { return this.pushAll(iter); }, Stack.prototype.shift = function() { return this.pop.apply(this, arguments); }, Stack.prototype.clear = function() { return 0 === this.size ? this : this.__ownerID ? (this.size = 0, this._head = void 0, this.__hash = void 0, this.__altered = !0, this) : emptyStack(); }, Stack.prototype.slice = function(begin, end) { if (wholeSlice(begin, end, this.size)) return this; var resolvedBegin = resolveBegin(begin, this.size), resolvedEnd = resolveEnd(end, this.size); if (resolvedEnd !== this.size) return IndexedCollection.prototype.slice.call(this, begin, end); for (var newSize = this.size - resolvedBegin, head = this._head; resolvedBegin--; ) head = head.next; return this.__ownerID ? (this.size = newSize, this._head = head, this.__hash = void 0, this.__altered = !0, this) : makeStack(newSize, head); }, Stack.prototype.__ensureOwner = function(ownerID) { return ownerID === this.__ownerID ? this : ownerID ? makeStack(this.size, this._head, ownerID, this.__hash) : (this.__ownerID = ownerID, this.__altered = !1, this); }, Stack.prototype.__iterate = function(fn, reverse) { if (reverse) return this.reverse().__iterate(fn); for (var iterations = 0, node = this._head; node && fn(node.value, iterations++, this) !== !1; ) node = node.next; return iterations; }, Stack.prototype.__iterator = function(type, reverse) { if (reverse) return this.reverse().__iterator(type); var iterations = 0, node = this._head; return new Iterator(function() { if (node) { var value = node.value; return node = node.next, iteratorValue(type, iterations++, value); } return iteratorDone(); }); }, Stack.isStack = isStack; var IS_STACK_SENTINEL = "@@__IMMUTABLE_STACK__@@", StackPrototype = Stack.prototype; StackPrototype[IS_STACK_SENTINEL] = !0, StackPrototype.withMutations = MapPrototype.withMutations, StackPrototype.asMutable = MapPrototype.asMutable, StackPrototype.asImmutable = MapPrototype.asImmutable, StackPrototype.wasAltered = MapPrototype.wasAltered; var EMPTY_STACK; Iterable.Iterator = Iterator, mixin(Iterable, { toArray: function() { assertNotInfinite(this.size); var array = new Array(this.size || 0); return this.valueSeq().__iterate(function(v, i) { array[i] = v; }), array; }, toIndexedSeq: function() { return new ToIndexedSequence(this); }, toJS: function() { return this.toSeq().map(function(value) { return value && "function" == typeof value.toJS ? value.toJS() : value; }).__toJS(); }, toJSON: function() { return this.toSeq().map(function(value) { return value && "function" == typeof value.toJSON ? value.toJSON() : value; }).__toJS(); }, toKeyedSeq: function() { return new ToKeyedSequence(this, (!0)); }, toMap: function() { return Map(this.toKeyedSeq()); }, toObject: function() { assertNotInfinite(this.size); var object = {}; return this.__iterate(function(v, k) { object[k] = v; }), object; }, toOrderedMap: function() { return OrderedMap(this.toKeyedSeq()); }, toOrderedSet: function() { return OrderedSet(isKeyed(this) ? this.valueSeq() : this); }, toSet: function() { return Set(isKeyed(this) ? this.valueSeq() : this); }, toSetSeq: function() { return new ToSetSequence(this); }, toSeq: function() { return isIndexed(this) ? this.toIndexedSeq() : isKeyed(this) ? this.toKeyedSeq() : this.toSetSeq(); }, toStack: function() { return Stack(isKeyed(this) ? this.valueSeq() : this); }, toList: function() { return List(isKeyed(this) ? this.valueSeq() : this); }, toString: function() { return "[Iterable]"; }, __toString: function(head, tail) { return 0 === this.size ? head + tail : head + " " + this.toSeq().map(this.__toStringMapper).join(", ") + " " + tail; }, concat: function() { var values = SLICE$0.call(arguments, 0); return reify(this, concatFactory(this, values)); }, includes: function(searchValue) { return this.some(function(value) { return is(value, searchValue); }); }, entries: function() { return this.__iterator(ITERATE_ENTRIES); }, every: function(predicate, context) { assertNotInfinite(this.size); var returnValue = !0; return this.__iterate(function(v, k, c) { if (!predicate.call(context, v, k, c)) return returnValue = !1, !1; }), returnValue; }, filter: function(predicate, context) { return reify(this, filterFactory(this, predicate, context, !0)); }, find: function(predicate, context, notSetValue) { var entry = this.findEntry(predicate, context); return entry ? entry[1] : notSetValue; }, findEntry: function(predicate, context) { var found; return this.__iterate(function(v, k, c) { if (predicate.call(context, v, k, c)) return found = [ k, v ], !1; }), found; }, findLastEntry: function(predicate, context) { return this.toSeq().reverse().findEntry(predicate, context); }, forEach: function(sideEffect, context) { return assertNotInfinite(this.size), this.__iterate(context ? sideEffect.bind(context) : sideEffect); }, join: function(separator) { assertNotInfinite(this.size), separator = void 0 !== separator ? "" + separator : ","; var joined = "", isFirst = !0; return this.__iterate(function(v) { isFirst ? isFirst = !1 : joined += separator, joined += null !== v && void 0 !== v ? v.toString() : ""; }), joined; }, keys: function() { return this.__iterator(ITERATE_KEYS); }, map: function(mapper, context) { return reify(this, mapFactory(this, mapper, context)); }, reduce: function(reducer, initialReduction, context) { assertNotInfinite(this.size); var reduction, useFirst; return arguments.length < 2 ? useFirst = !0 : reduction = initialReduction, this.__iterate(function(v, k, c) { useFirst ? (useFirst = !1, reduction = v) : reduction = reducer.call(context, reduction, v, k, c); }), reduction; }, reduceRight: function(reducer, initialReduction, context) { var reversed = this.toKeyedSeq().reverse(); return reversed.reduce.apply(reversed, arguments); }, reverse: function() { return reify(this, reverseFactory(this, !0)); }, slice: function(begin, end) { return reify(this, sliceFactory(this, begin, end, !0)); }, some: function(predicate, context) { return !this.every(not(predicate), context); }, sort: function(comparator) { return reify(this, sortFactory(this, comparator)); }, values: function() { return this.__iterator(ITERATE_VALUES); }, butLast: function() { return this.slice(0, -1); }, isEmpty: function() { return void 0 !== this.size ? 0 === this.size : !this.some(function() { return !0; }); }, count: function(predicate, context) { return ensureSize(predicate ? this.toSeq().filter(predicate, context) : this); }, countBy: function(grouper, context) { return countByFactory(this, grouper, context); }, equals: function(other) { return deepEqual(this, other); }, entrySeq: function() { var iterable = this; if (iterable._cache) return new ArraySeq(iterable._cache); var entriesSequence = iterable.toSeq().map(entryMapper).toIndexedSeq(); return entriesSequence.fromEntrySeq = function() { return iterable.toSeq(); }, entriesSequence; }, filterNot: function(predicate, context) { return this.filter(not(predicate), context); }, findLast: function(predicate, context, notSetValue) { return this.toKeyedSeq().reverse().find(predicate, context, notSetValue); }, first: function() { return this.find(returnTrue); }, flatMap: function(mapper, context) { return reify(this, flatMapFactory(this, mapper, context)); }, flatten: function(depth) { return reify(this, flattenFactory(this, depth, !0)); }, fromEntrySeq: function() { return new FromEntriesSequence(this); }, get: function(searchKey, notSetValue) { return this.find(function(_, key) { return is(key, searchKey); }, void 0, notSetValue); }, getIn: function(searchKeyPath, notSetValue) { for (var step, nested = this, iter = forceIterator(searchKeyPath); !(step = iter.next()).done; ) { var key = step.value; if (nested = nested && nested.get ? nested.get(key, NOT_SET) : NOT_SET, nested === NOT_SET) return notSetValue; } return nested; }, groupBy: function(grouper, context) { return groupByFactory(this, grouper, context); }, has: function(searchKey) { return this.get(searchKey, NOT_SET) !== NOT_SET; }, hasIn: function(searchKeyPath) { return this.getIn(searchKeyPath, NOT_SET) !== NOT_SET; }, isSubset: function(iter) { return iter = "function" == typeof iter.includes ? iter : Iterable(iter), this.every(function(value) { return iter.includes(value); }); }, isSuperset: function(iter) { return iter = "function" == typeof iter.isSubset ? iter : Iterable(iter), iter.isSubset(this); }, keySeq: function() { return this.toSeq().map(keyMapper).toIndexedSeq(); }, last: function() { return this.toSeq().reverse().first(); }, max: function(comparator) { return maxFactory(this, comparator); }, maxBy: function(mapper, comparator) { return maxFactory(this, comparator, mapper); }, min: function(comparator) { return maxFactory(this, comparator ? neg(comparator) : defaultNegComparator); }, minBy: function(mapper, comparator) { return maxFactory(this, comparator ? neg(comparator) : defaultNegComparator, mapper); }, rest: function() { return this.slice(1); }, skip: function(amount) { return this.slice(Math.max(0, amount)); }, skipLast: function(amount) { return reify(this, this.toSeq().reverse().skip(amount).reverse()); }, skipWhile: function(predicate, context) { return reify(this, skipWhileFactory(this, predicate, context, !0)); }, skipUntil: function(predicate, context) { return this.skipWhile(not(predicate), context); }, sortBy: function(mapper, comparator) { return reify(this, sortFactory(this, comparator, mapper)); }, take: function(amount) { return this.slice(0, Math.max(0, amount)); }, takeLast: function(amount) { return reify(this, this.toSeq().reverse().take(amount).reverse()); }, takeWhile: function(predicate, context) { return reify(this, takeWhileFactory(this, predicate, context)); }, takeUntil: function(predicate, context) { return this.takeWhile(not(predicate), context); }, valueSeq: function() { return this.toIndexedSeq(); }, hashCode: function() { return this.__hash || (this.__hash = hashIterable(this)); } }); var IterablePrototype = Iterable.prototype; IterablePrototype[IS_ITERABLE_SENTINEL] = !0, IterablePrototype[ITERATOR_SYMBOL] = IterablePrototype.values, IterablePrototype.__toJS = IterablePrototype.toArray, IterablePrototype.__toStringMapper = quoteString, IterablePrototype.inspect = IterablePrototype.toSource = function() { return this.toString(); }, IterablePrototype.chain = IterablePrototype.flatMap, IterablePrototype.contains = IterablePrototype.includes, function() { try { Object.defineProperty(IterablePrototype, "length", { get: function() { if (!Iterable.noLengthWarning) { var stack; try { throw new Error(); } catch (error) { stack = error.stack; } if (stack.indexOf("_wrapObject") === -1) return console && console.warn && console.warn("iterable.length has been deprecated, use iterable.size or iterable.count(). This warning will become a silent error in a future version. " + stack), this.size; } } }); } catch (e) {} }(), mixin(KeyedIterable, { flip: function() { return reify(this, flipFactory(this)); }, findKey: function(predicate, context) { var entry = this.findEntry(predicate, context); return entry && entry[0]; }, findLastKey: function(predicate, context) { return this.toSeq().reverse().findKey(predicate, context); }, keyOf: function(searchValue) { return this.findKey(function(value) { return is(value, searchValue); }); }, lastKeyOf: function(searchValue) { return this.findLastKey(function(value) { return is(value, searchValue); }); }, mapEntries: function(mapper, context) { var this$0 = this, iterations = 0; return reify(this, this.toSeq().map(function(v, k) { return mapper.call(context, [ k, v ], iterations++, this$0); }).fromEntrySeq()); }, mapKeys: function(mapper, context) { var this$0 = this; return reify(this, this.toSeq().flip().map(function(k, v) { return mapper.call(context, k, v, this$0); }).flip()); } }); var KeyedIterablePrototype = KeyedIterable.prototype; KeyedIterablePrototype[IS_KEYED_SENTINEL] = !0, KeyedIterablePrototype[ITERATOR_SYMBOL] = IterablePrototype.entries, KeyedIterablePrototype.__toJS = IterablePrototype.toObject, KeyedIterablePrototype.__toStringMapper = function(v, k) { return JSON.stringify(k) + ": " + quoteString(v); }, mixin(IndexedIterable, { toKeyedSeq: function() { return new ToKeyedSequence(this, (!1)); }, filter: function(predicate, context) { return reify(this, filterFactory(this, predicate, context, !1)); }, findIndex: function(predicate, context) { var entry = this.findEntry(predicate, context); return entry ? entry[0] : -1; }, indexOf: function(searchValue) { var key = this.toKeyedSeq().keyOf(searchValue); return void 0 === key ? -1 : key; }, lastIndexOf: function(searchValue) { var key = this.toKeyedSeq().reverse().keyOf(searchValue); return void 0 === key ? -1 : key; }, reverse: function() { return reify(this, reverseFactory(this, !1)); }, slice: function(begin, end) { return reify(this, sliceFactory(this, begin, end, !1)); }, splice: function(index, removeNum) { var numArgs = arguments.length; if (removeNum = Math.max(0 | removeNum, 0), 0 === numArgs || 2 === numArgs && !removeNum) return this; index = resolveBegin(index, index < 0 ? this.count() : this.size); var spliced = this.slice(0, index); return reify(this, 1 === numArgs ? spliced : spliced.concat(arrCopy(arguments, 2), this.slice(index + removeNum))); }, findLastIndex: function(predicate, context) { var key = this.toKeyedSeq().findLastKey(predicate, context); return void 0 === key ? -1 : key; }, first: function() { return this.get(0); }, flatten: function(depth) { return reify(this, flattenFactory(this, depth, !1)); }, get: function(index, notSetValue) { return index = wrapIndex(this, index), index < 0 || this.size === 1 / 0 || void 0 !== this.size && index > this.size ? notSetValue : this.find(function(_, key) { return key === index; }, void 0, notSetValue); }, has: function(index) { return index = wrapIndex(this, index), index >= 0 && (void 0 !== this.size ? this.size === 1 / 0 || index < this.size : this.indexOf(index) !== -1); }, interpose: function(separator) { return reify(this, interposeFactory(this, separator)); }, interleave: function() { var iterables = [ this ].concat(arrCopy(arguments)), zipped = zipWithFactory(this.toSeq(), IndexedSeq.of, iterables), interleaved = zipped.flatten(!0); return zipped.size && (interleaved.size = zipped.size * iterables.length), reify(this, interleaved); }, last: function() { return this.get(-1); }, skipWhile: function(predicate, context) { return reify(this, skipWhileFactory(this, predicate, context, !1)); }, zip: function() { var iterables = [ this ].concat(arrCopy(arguments)); return reify(this, zipWithFactory(this, defaultZipper, iterables)); }, zipWith: function(zipper) { var iterables = arrCopy(arguments); return iterables[0] = this, reify(this, zipWithFactory(this, zipper, iterables)); } }), IndexedIterable.prototype[IS_INDEXED_SENTINEL] = !0, IndexedIterable.prototype[IS_ORDERED_SENTINEL] = !0, mixin(SetIterable, { get: function(value, notSetValue) { return this.has(value) ? value : notSetValue; }, includes: function(value) { return this.has(value); }, keySeq: function() { return this.valueSeq(); } }), SetIterable.prototype.has = IterablePrototype.includes, mixin(KeyedSeq, KeyedIterable.prototype), mixin(IndexedSeq, IndexedIterable.prototype), mixin(SetSeq, SetIterable.prototype), mixin(KeyedCollection, KeyedIterable.prototype), mixin(IndexedCollection, IndexedIterable.prototype), mixin(SetCollection, SetIterable.prototype); var Immutable = { Iterable: Iterable, Seq: Seq, Collection: Collection, Map: Map, OrderedMap: OrderedMap, List: List, Stack: Stack, Set: Set, OrderedSet: OrderedSet, Record: Record, Range: Range, Repeat: Repeat, is: is, fromJS: fromJS }; return Immutable; }); }, function(module, exports) { "use strict"; var ApathyDark = { displayName: "Apathy (dark)", base00: "#1b322e", base01: "#30695f", base02: "#184E45", base03: "#2B685E", base04: "#5F9C92", base05: "#f5fcfb", special00: "#3E9688", special01: "#3E7996", special02: "#883E96", special03: "#963E4C", special04: "#96883E", special05: "#4C963E", special06: "#3E965B", special07: "#5F9C92", state00: "#28423d", state01: "#28423d", state02: "#f5fcfb", state03: "#28423d", state04: "#3E4C96", state05: "#f5fcfb", state06: "#ffffff" }, ApathyLight = { displayName: "Apathy (light)", base00: "#D2E7E4", base01: "#fff", base02: "#184E45", base03: "#2B685E", base04: "#5F9C92", base05: "rgba(0, 0, 0, .7)", special00: "#3E9688", special01: "#3E7996", special02: "#883E96", special03: "#963E4C", special04: "#96883E", special05: "#4C963E", special06: "#3E965B", special07: "#5F9C92", state00: "#f5fcfb", state01: "#f5fcfb", state02: "#2b2d2d", state03: "#f5fcfb", state04: "#3E4C96", state05: "#f5fcfb", state06: "#000000" }, AtomDark = { displayName: "Atom (dark)", hidden: !0, base00: "#1d1f21", base01: "#292c2f", base02: "#2e2e2e", base03: "#303030", base04: "#868989", base05: "#c1c4c2", special00: "#fffeba", special01: "#f574f3", special02: "#aafd6a", special03: "#93c294", special04: "#fed2aa", special05: "#93c294", special06: "#c5c5fb", special07: "#98ccfc", state00: "#4483c2", state01: "#444444", state02: "#ffffff", state03: "#444444", state04: "#4483c2", state05: "#ffffff", state06: "#e3e6e4" }, AtomLight = { displayName: "Atom (light)", hidden: !0, base00: "#ffffff", base01: "#f4f4f4", base02: "#eeeeee", base03: "#555555", base04: "#999989", base05: "#222222", special00: "#11807f", special01: "#db1847", special02: "#db1847", special03: "#11807f", special04: "#97040c", special05: "#616b9f", special06: "#455686", special07: "#11807f", state00: "#b0c4d9", state01: "#fffed8", state02: "#222222", state03: "#fffed8", state04: "#6da6e7", state05: "#ffffff", state06: "#000000" }, ChromeDark = { displayName: "Chrome (dark)", hidden: !0, base00: "#242424", base01: "#2a2a2a", base02: "#363636", base03: "#404040", base04: "#777777", base05: "#a5a5a5", special00: "#5db0d7", special01: "#a1f7b5", special02: "#f29766", special03: "#d2c057", special04: "#34d1c5", special05: "#9a7fd5", special06: "#9bbbdc", special07: "#777777", state00: "#c78626", state01: "#363636", state02: "#242424", state03: "#342e24", state04: "#66ff88", state05: "#242424", state06: "#cccccc" }, ChromeDefault = { displayName: "Chrome (default)", hidden: !0, base00: "#ffffff", base01: "#f3f3f3", base02: "#eeeeee", base03: "#dadada", base04: "#888888", base05: "#5a5a5a", special00: "#881280", special01: "#222222", special02: "#1a1aa6", special03: "#c80000", special04: "#236e25", special05: "#aa0d91", special06: "#994500", special07: "#888888", state00: "#3879d9", state01: "#dadada", state02: "#ffffff", state03: "#ebf1fb", state04: "#FFFF00", state05: "#222222", state06: "#222222" }, Dracula = { displayName: "Dracula", base00: "#282936", base01: "#3a3c4e", base02: "#4d4f68", base03: "#626483", base04: "#6f7191", base05: "#e9e9f4", special00: "#ff79c6", special01: "#bd93f9", special02: "#f1fa8c", special03: "#a1efe4", special04: "#4afa7b", special05: "#ff79c6", special06: "#f8f8f2", special07: "#6f7191", state00: "#181a21", state01: "#323547", state02: "#f7f7fb", state03: "#323547", state04: "#fafa8c", state05: "#000000", state06: "#ffffff" }, Eighties = { displayName: "Eighties", base00: "#2d2d2d", base01: "#393939", base02: "#515151", base03: "#747369", base04: "#a09f93", base05: "#d3d0c8", special00: "#f2777a", special01: "#f99157", special02: "#99cc99", special03: "#66cccc", special04: "#4afa7b", special05: "#cc99cc", special06: "#d27b53", special07: "#a09f93", state00: "#f2f0ec", state01: "#3f3e3e", state02: "#2d2d2d", state03: "#3f3e3e", state04: "#4afa7b", state05: "#121212", state06: "#e3e0d8" }, FirefoxDark = { displayName: "Firefox (dark)", hidden: !0, base00: "#393f4c", base01: "#393f4c", base02: "#454d5d", base03: "#454D5D", base04: "#8fa1b2", base05: "#a9bacb", special00: "#00ff7f", special01: "#eb5368", special02: "#e9f4fe", special03: "#bcb8db", special04: "#e9f4fe", special05: "#e9f4fe", special06: "#e9f4fe", special07: "#8fa1b2", state00: "#5675b9", state01: "#475983", state02: "#ffffff", state03: "#475983", state04: "#00ff7f", state05: "#181d20", state06: "#b9cadb" }, FirefoxFirebug = { displayName: "Firefox (firebug)", hidden: !0, base00: "#ffffff", base01: "#f5f5f5", base02: "#dde1e4", base03: "#c1c1c1", base04: "#888888", base05: "#2a2a2a", special00: "#0000ff", special01: "#ff0000", special02: "#ff0000", special03: "#292e33", special04: "#ff0000", special05: "#0000ff", special06: "#000062", special07: "#0000ff", state00: "#3399ff", state01: "#e4f1fa", state02: "#ffffff", state03: "#e6e6e6", state04: "#ffee99", state05: "#000000", state06: "#000000" }, FirefoxLight = { displayName: "Firefox (light)", hidden: !0, base00: "#ffffff", base01: "#fcfcfc", base02: "#dde1e4", base03: "#c1c1c1", base04: "#888888", base05: "#767676", special00: "#2e9dd5", special01: "#676bff", special02: "#5b5fff", special03: "#393f4c", special04: "#ed2655", special05: "#4f88cc", special06: "#393f4c", special07: "#888888", state00: "#4c9ed9", state01: "#e4f1fa", state02: "#f4f7fa", state03: "#e4f1fa", state04: "#FFFF00", state05: "#585959", state06: "#444444" }, Flat = { displayName: "Flat", base00: "#2C3E50", base01: "#34495E", base02: "#7F8C8D", base03: "#95A5A6", base04: "#BDC3C7", base05: "#e0e0e0", special00: "#E74C3C", special01: "#E67E22", special02: "#2ECC71", special03: "#1ABC9C", special04: "#3498DB", special05: "#b670d2", special06: "#be643c", special07: "#BDC3C7", state00: "#6a8db1", state01: "#364c62", state02: "#2C3E50", state03: "#364c62", state04: "#64fa82", state05: "#2C3E50", state06: "#ffffff" }, GruvboxDark = { displayName: "Gruvbox (dark)", base00: "#282828", base01: "#3c3836", base02: "#504945", base03: "#928374", base04: "#bdae93", base05: "#ebdbb2", special00: "#83a598", special01: "#d3869b", special02: "#b8bb26", special03: "#689d6a", special04: "#fabd2f", special05: "#fe8019", special06: "#fe8019", special07: "#bdae93", state00: "#504945", state01: "#3c3836", state02: "#fbf1c7", state03: "#3c3836", state04: "#7c6f64", state05: "#fbf1c7", state06: "#fbebc2" }, GruvboxLight = { displayName: "Gruvbox (light)", base00: "#fbf1c7", base01: "#ebdbb2", base02: "#d5c4a1", base03: "#928374", base04: "#282828", base05: "#3c3836", special00: "#076678", special01: "#8f3f71", special02: "#98971a", special03: "#af3a03", special04: "#458588", special05: "#fe8019", special06: "#b57614", special07: "#282828", state00: "#bdae93", state01: "#d5c4a1", state02: "#282828", state03: "#d5c4a1", state04: "#d5c4a1", state05: "#282828", state06: "#000000" }, Halflife = { displayName: "Halflife", base00: "#222222", base01: "#f3f3f3", base02: "#888888", base03: "#282828", base04: "#888888", base05: "#aaaaaa", special00: "#fc913a", special01: "#f9d423", special02: "#f9d423", special03: "#cccccc", special04: "#f9d423", special05: "#3b3a32", special06: "#cccccc", special07: "#7d8991", state00: "#f85931", state01: "#dadada", state02: "#ffffff", state03: "#282828", state04: "#ffe792", state05: "#000000", state06: "#222222" }, Materia = { displayName: "Materia", base00: "#263238", base01: "#2C393F", base02: "#37474F", base03: "#707880", base04: "#C9CCD3", base05: "#CDD3DE", special00: "#EC5F67", special01: "#EA9560", special02: "#8BD649", special03: "#80CBC4", special04: "#89DDFF", special05: "#82AAFF", special06: "#EC5F67", special07: "#C9CCD3", state00: "#0084ff", state01: "#314048", state02: "#263238", state03: "#314048", state04: "#00ff84", state05: "#263238", state06: "#DDE3EE" }, MaterialDark = { displayName: "Material Dark", base00: "#263239", base01: "#373b41", base02: "#3e4a51", base03: "#445052", base04: "#718184", base05: "#B2CCD6", special00: "#f95479", special01: "#F78C6A", special02: "#C3E88D", special03: "#89DDF3", special04: "#82AAFF", special05: "#C792EA", special06: "#FFCB6B", special07: "#718184", state00: "#4a55b9", state01: "#3e4a50", state02: "#ffffff", state03: "#212b30", state04: "#4a55b9", state05: "#ffffff", state06: "#D2ECF6" }, OceanDark = { displayName: "Ocean Dark", base00: "#232730", base01: "#2b303c", base02: "#323943", base03: "#414551", base04: "#65727e", base05: "#757984", special00: "#b48bae", special01: "#c0c5ce", special02: "#a3c08a", special03: "#ab7866", special04: "#eccd88", special05: "#d06a77", special06: "#757a85", special07: "#65727e", state00: "#a0a4ae", state01: "#314048", state02: "#263238", state03: "#314048", state04: "#d06a77", state05: "#1c1f27", state06: "#A5A9B4" }, OneDark = { displayName: "One (dark)", base00: "#282c34", base01: "#21252b", base02: "#568af2", base03: "#3b4048", base04: "#3e454f", base05: "#abb2bf", special00: "#e5c07b", special01: "#abb2bf", special02: "#98c379", special03: "#9da5b4", special04: "#e06c75", special05: "#6b717e", special06: "#d19a66", special07: "#abb2bf", state00: "#4d78cc", state01: "#3e4450", state02: "#ffffff", state03: "#2c323c", state04: "#4d78cc", state05: "#ffffff", state06: "#ffffff" }, OneLight = { displayName: "One (light)", base00: "#fafafa", base01: "#eaeaeb", base02: "#eeeeee", base03: "#dbdbdc", base04: "#8e8e90", base05: "#3e4048", special00: "#c0831e", special01: "#a42ea2", special02: "#68ab68", special03: "#447bef", special04: "#e2574e", special05: "#424242", special06: "#976715", special07: "#424242", state00: "#447bef", state01: "#f0f0f1", state02: "#ffffff", state03: "#f0f0f1", state04: "#447bef", state05: "#ffffff", state06: "#1c2026" }, Phd = { displayName: "Phd", base00: "#061229", base01: "#2a3448", base02: "#4d5666", base03: "#717885", base04: "#9a99a3", base05: "#b8bbc2", special00: "#d07346", special01: "#f0a000", special02: "#99bf52", special03: "#72b9bf", special04: "#5299bf", special05: "#9989cc", special06: "#b08060", special07: "#9a99a3", state00: "#4b73bf", state01: "#112243", state02: "#061229", state03: "#112243", state04: "#00c8fa", state05: "#061229", state06: "#d8dbe2" }, SolarizedDark = { displayName: "Solarized Dark", base00: "#002b36", base01: "#073642", base02: "#586e75", base03: "#657b83", base04: "#93a1a1", base05: "#839496", special00: "#268bd2", special01: "#268bd2", special02: "#2aa198", special03: "#839496", special04: "#2aa198", special05: "#b58900", special06: "#859900", special07: "#268bd2", state00: "#073642", state01: "#002b36", state02: "#93a1a1", state03: "#073642", state04: "#859900", state05: "#002b36", state06: "#fdf6e3" }, SolarizedLight = { displayName: "Solarized Light", base00: "#fdf6e3", base01: "#eee8d5", base02: "#586e75", base03: "#657b83", base04: "#93a1a1", base05: "#657b83", special00: "#268bd2", special01: "#268bd2", special02: "#2aa198", special03: "#839496", special04: "#2aa198", special05: "#b58900", special06: "#859900", special07: "#268bd2", state00: "#eee8d5", state01: "#eee8d5", state02: "#586e75", state03: "#eee8d5", state04: "#859900", state05: "#eee8d5", state06: "#073642" }, Tomorrow = { displayName: "Tomorrow", base00: "#ffffff", base01: "#e0e0e0", base02: "#d6d6d6", base03: "#8e908c", base04: "#969896", base05: "#4d4d4c", special00: "#c82829", special01: "#f5871f", special02: "#718c00", special03: "#3e999f", special04: "#4271ae", special05: "#8959a8", special06: "#a3685a", special07: "#969896", state00: "#4271ae", state01: "#e0e0e0", state02: "#ffffff", state03: "#e0e0e0", state04: "#eab700", state05: "#1d1f21", state06: "#222222" }, TomorrowNight = { displayName: "Tomorrow Night", base00: "#1d1f21", base01: "#282a2e", base02: "#373b41", base03: "#969896", base04: "#b4b7b4", base05: "#c5c8c6", special00: "#cc6666", special01: "#de935f", special02: "#b5bd68", special03: "#8abeb7", special04: "#81a2be", special05: "#b294bb", special06: "#a3685a", special07: "#b4b7b4", state00: "#0084ff", state01: "#e0e0e0", state02: "#282a2e", state03: "#373b41", state04: "#f0c674", state05: "#1d1f21", state06: "#e5e8e6" }; module.exports = { ApathyDark: ApathyDark, ApathyLight: ApathyLight, AtomDark: AtomDark, AtomLight: AtomLight, ChromeDark: ChromeDark, ChromeDefault: ChromeDefault, Dracula: Dracula, Eighties: Eighties, FirefoxDark: FirefoxDark, FirefoxFirebug: FirefoxFirebug, FirefoxLight: FirefoxLight, Flat: Flat, GruvboxDark: GruvboxDark, GruvboxLight: GruvboxLight, Halflife: Halflife, Materia: Materia, MaterialDark: MaterialDark, OceanDark: OceanDark, OneDark: OneDark, OneLight: OneLight, Phd: Phd, SolarizedDark: SolarizedDark, SolarizedLight: SolarizedLight, Tomorrow: Tomorrow, TomorrowNight: TomorrowNight }; }, function(module, exports, __webpack_require__) { "use strict"; 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 || "object" != typeof call && "function" != typeof call ? self : call; } function _inherits(subClass, superClass) { if ("function" != typeof superClass && null !== superClass) 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: !1, writable: !0, configurable: !0 } }), superClass && (Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass); } var _extends = Object.assign || function(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) Object.prototype.hasOwnProperty.call(source, key) && (target[key] = source[key]); } return target; }, _createClass = function() { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0, "value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor); } } return function(Constructor, protoProps, staticProps) { return protoProps && defineProperties(Constructor.prototype, protoProps), staticProps && defineProperties(Constructor, staticProps), Constructor; }; }(), React = __webpack_require__(12), TimerSafe = function(Component) { var TimerSafeImplementation = function(_React$Component) { function TimerSafeImplementation() { var _ref, _temp, _this, _ret; _classCallCheck(this, TimerSafeImplementation); for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) args[_key] = arguments[_key]; return _temp = _this = _possibleConstructorReturn(this, (_ref = TimerSafeImplementation.__proto__ || Object.getPrototypeOf(TimerSafeImplementation)).call.apply(_ref, [ this ].concat(args))), _this._timeoutIds = {}, _this._clearTimeout = function(id) { clearTimeout(id), delete _this._timeoutIds[id]; }, _this._setTimeout = function(callback, delay) { var id = setTimeout(function() { delete _this._timeoutIds[id], callback(); }, delay); return _this._timeoutIds[id] = !0, id; }, _ret = _temp, _possibleConstructorReturn(_this, _ret); } return _inherits(TimerSafeImplementation, _React$Component), _createClass(TimerSafeImplementation, [ { key: "componentWillUnmount", value: function() { Object.keys(this._timeoutIds).forEach(this._clearTimeout); } }, { key: "render", value: function() { return React.createElement(Component, _extends({}, this.props, { clearTimeout: this._clearTimeout, setTimeout: this._setTimeout })); } } ]), TimerSafeImplementation; }(React.Component); return TimerSafeImplementation; }; module.exports = TimerSafe; }, function(module, exports, __webpack_require__) { "use strict"; function deserialize(string) { var fallbackTheme = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : ChromeDefault, theme = {}; try { !function() { var maybeTheme = JSON.parse(string); themeKeys.forEach(function(key) { var maybeColor = maybeTheme[key]; isColorSet(maybeColor) && (theme[key] = maybeColor); }); }(); } catch (error) { console.error("Could not deserialize theme", error); } return isColorSet(theme.state06) || (theme.state06 = theme.base05), themeKeys.forEach(function(key) { var maybeColor = theme[key]; isColorSet(maybeColor) || (theme[key] = fallbackTheme[key]); }), theme; } function isColorSet(maybeColor) { return "string" == typeof maybeColor && "" !== maybeColor; } function serialize(theme) { return JSON.stringify(theme, null, 0); } var _require = __webpack_require__(318), ChromeDefault = _require.ChromeDefault, themeKeys = Object.keys(ChromeDefault); module.exports = { deserialize: deserialize, serialize: serialize }; }, function(module, exports, __webpack_require__) { "use strict"; var decorate = __webpack_require__(20), SettingsCheckbox = __webpack_require__(322), Wrapped = decorate({ listeners: function() { return [ "traceupdatesstatechange" ]; }, props: function(store) { return { state: store.traceupdatesState, text: "Highlight Updates", onChange: function(state) { return store.changeTraceUpdates(state); } }; } }, SettingsCheckbox); module.exports = Wrapped; }, function(module, exports, __webpack_require__) { "use strict"; 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 || "object" != typeof call && "function" != typeof call ? self : call; } function _inherits(subClass, superClass) { if ("function" != typeof superClass && null !== superClass) 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: !1, writable: !0, configurable: !0 } }), superClass && (Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass); } var _createClass = function() { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0, "value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor); } } return function(Constructor, protoProps, staticProps) { return protoProps && defineProperties(Constructor.prototype, protoProps), staticProps && defineProperties(Constructor, staticProps), Constructor; }; }(), React = __webpack_require__(12), immutable = __webpack_require__(317), _require = __webpack_require__(17), sansSerif = _require.sansSerif, StateRecord = immutable.Record({ enabled: !1 }), SettingsCheckbox = function(_React$Component) { function SettingsCheckbox(props) { _classCallCheck(this, SettingsCheckbox); var _this = _possibleConstructorReturn(this, (SettingsCheckbox.__proto__ || Object.getPrototypeOf(SettingsCheckbox)).call(this, props)); return _this._toggle = _this._toggle.bind(_this), _this._defaultState = new StateRecord(), _this; } return _inherits(SettingsCheckbox, _React$Component), _createClass(SettingsCheckbox, [ { key: "componentDidMount", value: function() { !this.props.state !== this._defaultState && this.props.onChange(this._defaultState); } }, { key: "render", value: function() { var state = this.props.state || this._defaultState; return React.createElement("div", { style: styles.container, onClick: this._toggle, tabIndex: 0 }, React.createElement("input", { style: styles.checkbox, type: "checkbox", checked: state.enabled, readOnly: !0 }), React.createElement("span", null, this.props.text)); } }, { key: "_toggle", value: function() { var state = this.props.state || this._defaultState, nextState = state.merge({ enabled: !state.enabled }); this.props.onChange(nextState); } } ]), SettingsCheckbox; }(React.Component), styles = { checkbox: { pointerEvents: "none", marginRight: "5px" }, container: { WebkitUserSelect: "none", cursor: "default", display: "inline-block", outline: "none", fontFamily: sansSerif.family, userSelect: "none", marginRight: "10px" } }; module.exports = SettingsCheckbox; }, function(module, exports, __webpack_require__) { "use strict"; var decorate = __webpack_require__(20), SettingsCheckbox = __webpack_require__(322), Wrapped = decorate({ listeners: function() { return [ "colorizerchange" ]; }, props: function(store) { return { state: store.colorizerState, text: "Highlight Search", onChange: function(state) { return store.changeColorizer(state); } }; } }, SettingsCheckbox); module.exports = Wrapped; }, function(module, exports, __webpack_require__) { "use strict"; 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 || "object" != typeof call && "function" != typeof call ? self : call; } function _inherits(subClass, superClass) { if ("function" != typeof superClass && null !== superClass) 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: !1, writable: !0, configurable: !0 } }), superClass && (Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass); } var _extends = Object.assign || function(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) Object.prototype.hasOwnProperty.call(source, key) && (target[key] = source[key]); } return target; }, _createClass = function() { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0, "value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor); } } return function(Constructor, protoProps, staticProps) { return protoProps && defineProperties(Constructor.prototype, protoProps), staticProps && defineProperties(Constructor, staticProps), Constructor; }; }(), PropTypes = __webpack_require__(7), React = __webpack_require__(12), ReactDOM = __webpack_require__(26), Draggable = __webpack_require__(325), nullthrows = __webpack_require__(3)["default"], SplitPane = function(_React$Component) { function SplitPane(props) { _classCallCheck(this, SplitPane); var _this = _possibleConstructorReturn(this, (SplitPane.__proto__ || Object.getPrototypeOf(SplitPane)).call(this, props)); return _this.state = { moving: !1, width: props.initialWidth, height: props.initialHeight }, _this; } return _inherits(SplitPane, _React$Component), _createClass(SplitPane, [ { key: "componentDidMount", value: function() { var node = nullthrows(ReactDOM.findDOMNode(this)), width = Math.floor(node.offsetWidth * (this.props.isVertical ? .6 : .3)); this.setState({ width: Math.min(250, width), height: Math.floor(.3 * node.offsetHeight) }); } }, { key: "onMove", value: function(x, y) { var _this2 = this, rect = ReactDOM.findDOMNode(this).getBoundingClientRect(); this.setState(function(prevState) { return { width: _this2.props.isVertical ? prevState.width : Math.floor(rect.left + rect.width - x), height: _this2.props.isVertical ? Math.floor(rect.top + rect.height - y) : prevState.height }; }); } }, { key: "render", value: function() { var _this3 = this, theme = this.context.theme, isVertical = this.props.isVertical, _state = this.state, height = _state.height, width = _state.width; return React.createElement("div", { style: containerStyle(isVertical) }, React.createElement("div", { style: styles.leftPane }, this.props.left()), React.createElement("div", { style: rightStyle(isVertical, width, height) }, React.createElement(Draggable, { style: draggerStyle(isVertical), onStart: function() { return _this3.setState({ moving: !0 }); }, onMove: function(x, y) { return _this3.onMove(x, y); }, onStop: function() { return _this3.setState({ moving: !1 }); } }, React.createElement("div", { style: draggerInnerStyle(isVertical, theme) })), React.createElement("div", { style: styles.rightPane }, this.props.right()))); } } ]), SplitPane; }(React.Component); SplitPane.contextTypes = { theme: PropTypes.object.isRequired }; var containerStyle = function(isVertical) { return { display: "flex", minWidth: 0, flex: 1, flexDirection: isVertical ? "column" : "row", maxWidth: "100vw" }; }, draggerInnerStyle = function(isVertical, theme) { return { height: isVertical ? "1px" : "100%", width: isVertical ? "100%" : "1px", backgroundColor: theme.base04 }; }, draggerStyle = function(isVertical) { return { position: "relative", zIndex: 1, padding: isVertical ? "0.25rem 0" : "0 0.25rem", margin: isVertical ? "-0.25rem 0" : "0 -0.25rem", cursor: isVertical ? "ns-resize" : "ew-resize" }; }, rightStyle = function(isVertical, width, height) { return _extends({}, containerStyle(isVertical), { width: isVertical ? null : width, height: isVertical ? height : null, flex: "initial", minHeight: 120, minWidth: 150 }); }, styles = { rightPane: { display: "flex", width: "100%", overflow: "auto" }, leftPane: { display: "flex", minWidth: "50%", minHeight: "50%", flex: 1, overflow: "hidden" } }; module.exports = SplitPane; }, function(module, exports, __webpack_require__) { "use strict"; 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 || "object" != typeof call && "function" != typeof call ? self : call; } function _inherits(subClass, superClass) { if ("function" != typeof superClass && null !== superClass) 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: !1, writable: !0, configurable: !0 } }), superClass && (Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass); } var _createClass = function() { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0, "value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor); } } return function(Constructor, protoProps, staticProps) { return protoProps && defineProperties(Constructor.prototype, protoProps), staticProps && defineProperties(Constructor, staticProps), Constructor; }; }(), React = __webpack_require__(12), ReactDOM = __webpack_require__(26), Draggable = function(_React$Component) { function Draggable() { return _classCallCheck(this, Draggable), _possibleConstructorReturn(this, (Draggable.__proto__ || Object.getPrototypeOf(Draggable)).apply(this, arguments)); } return _inherits(Draggable, _React$Component), _createClass(Draggable, [ { key: "componentDidMount", value: function() { this._onMove = this.onMove.bind(this), this._onUp = this.onUp.bind(this); } }, { key: "_startDragging", value: function(evt) { evt.preventDefault(); var doc = ReactDOM.findDOMNode(this).ownerDocument; doc.addEventListener("mousemove", this._onMove), doc.addEventListener("mouseup", this._onUp), this.props.onStart(); } }, { key: "onMove", value: function(evt) { evt.preventDefault(), this.props.onMove(evt.pageX, evt.pageY); } }, { key: "onUp", value: function(evt) { evt.preventDefault(); var doc = ReactDOM.findDOMNode(this).ownerDocument; doc.removeEventListener("mousemove", this._onMove), doc.removeEventListener("mouseup", this._onUp), this.props.onStop(); } }, { key: "render", value: function() { return React.createElement("div", { style: this.props.style, onMouseDown: this._startDragging.bind(this) }, this.props.children); } } ]), Draggable; }(React.Component); module.exports = Draggable; }, function(module, exports, __webpack_require__) { "use strict"; 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 || "object" != typeof call && "function" != typeof call ? self : call; } function _inherits(subClass, superClass) { if ("function" != typeof superClass && null !== superClass) 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: !1, writable: !0, configurable: !0 } }), superClass && (Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass); } var _createClass = function() { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0, "value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor); } } return function(Constructor, protoProps, staticProps) { return protoProps && defineProperties(Constructor.prototype, protoProps), staticProps && defineProperties(Constructor, staticProps), Constructor; }; }(), PropTypes = __webpack_require__(7), React = __webpack_require__(12), decorate = __webpack_require__(20), _require = __webpack_require__(17), sansSerif = _require.sansSerif, TabbedPane = function(_React$Component) { function TabbedPane() { return _classCallCheck(this, TabbedPane), _possibleConstructorReturn(this, (TabbedPane.__proto__ || Object.getPrototypeOf(TabbedPane)).apply(this, arguments)); } return _inherits(TabbedPane, _React$Component), _createClass(TabbedPane, [ { key: "render", value: function() { var _this2 = this, theme = this.context.theme, tabs = Object.keys(this.props.tabs); return 1 === tabs.length ? this.props.tabs[tabs[0]]() : React.createElement("div", { style: styles.container }, React.createElement("ul", { style: tabsStyle(theme) }, tabs.map(function(name, i) { return React.createElement("li", { key: name + i, onClick: function() { return _this2.props.setSelectedTab(name); }, style: tabStyle(name === _this2.props.selected, theme) }, name); })), React.createElement("div", { style: styles.body }, this.props.tabs[this.props.selected]())); } } ]), TabbedPane; }(React.Component); TabbedPane.contextTypes = { theme: PropTypes.object.isRequired }; var tabsStyle = function(theme) { return { display: "flex", flexShrink: 0, listStyle: "none", margin: 0, backgroundColor: theme.base01, borderBottom: "1px solid " + theme.base03, padding: "0 0.25rem" }; }, tabStyle = function(isSelected, theme) { return { padding: "0.25rem 0.75rem", lineHeight: "15px", fontSize: sansSerif.sizes.normal, fontFamily: sansSerif.family, cursor: "pointer", borderTop: "1px solid transparent", borderBottom: isSelected ? "2px solid " + theme.state00 : "none", marginBottom: isSelected ? "-1px" : "1px" }; }, styles = { container: { flex: 1, display: "flex", flexDirection: "column", width: "100%" }, body: { flex: 1, display: "flex", minHeight: 0 } }; module.exports = decorate({ listeners: function() { return [ "selectedTab" ]; }, shouldUpdate: function(props, prevProps) { for (var name in props) if (props[name] !== prevProps[name]) return !0; return !1; }, props: function(store) { return { selected: store.selectedTab, setSelectedTab: function(name) { return store.setSelectedTab(name); } }; } }, TabbedPane); }, function(module, exports, __webpack_require__) { "use strict"; 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 || "object" != typeof call && "function" != typeof call ? self : call; } function _inherits(subClass, superClass) { if ("function" != typeof superClass && null !== superClass) 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: !1, writable: !0, configurable: !0 } }), superClass && (Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass); } var _slicedToArray = function() { function sliceIterator(arr, i) { var _arr = [], _n = !0, _d = !1, _e = void 0; try { for (var _s, _i = arr[Symbol.iterator](); !(_n = (_s = _i.next()).done) && (_arr.push(_s.value), !i || _arr.length !== i); _n = !0) ; } catch (err) { _d = !0, _e = err; } finally { try { !_n && _i["return"] && _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function(arr, i) { if (Array.isArray(arr)) return arr; if (Symbol.iterator in Object(arr)) return sliceIterator(arr, i); throw new TypeError("Invalid attempt to destructure non-iterable instance"); }; }(), _extends = Object.assign || function(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) Object.prototype.hasOwnProperty.call(source, key) && (target[key] = source[key]); } return target; }, _createClass = function() { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0, "value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor); } } return function(Constructor, protoProps, staticProps) { return protoProps && defineProperties(Constructor.prototype, protoProps), staticProps && defineProperties(Constructor, staticProps), Constructor; }; }(), _require = __webpack_require__(328), EventEmitter = _require.EventEmitter, _require2 = __webpack_require__(317), Map = _require2.Map, Set = _require2.Set, List = _require2.List, assign = __webpack_require__(19), _require3 = __webpack_require__(70), copy = _require3.copy, nodeMatchesText = __webpack_require__(329), consts = __webpack_require__(32), serializePropsForCopy = __webpack_require__(330), invariant = __webpack_require__(56), SearchUtils = __webpack_require__(59), Store = (__webpack_require__(331), function(_EventEmitter) { function Store(bridge, themeStore) { _classCallCheck(this, Store); var _this = _possibleConstructorReturn(this, (Store.__proto__ || Object.getPrototypeOf(Store)).call(this)); return _this.snapshotQueue = [], _this._nodes = new Map(), _this._parents = new Map(), _this._nodesByName = new Map(), _this._bridge = bridge, _this.isInspectEnabled = !1, _this.roots = new List(), _this.contextMenu = null, _this.searchRoots = null, _this.hovered = null, _this.selected = null, _this.selectedTab = "Elements", _this.breadcrumbHead = null, _this.isBottomTagHovered = !1, _this.isBottomTagSelected = !1, _this.searchText = "", _this.capabilities = {}, _this.traceupdatesState = null, _this.colorizerState = null, _this.refreshSearch = !1, _this.themeStore = themeStore, window.store = _this, _this._bridge.on("root", function(id) { _this.roots.contains(id) || (_this.roots = _this.roots.push(id), _this.selected || (_this.selected = _this.skipWrapper(id), _this.breadcrumbHead = _this.selected, _this.emit("selected"), _this.emit("breadcrumbHead"), _this._bridge.send("selected", _this.selected)), _this.emit("roots")); }), _this._bridge.on("mount", function(data) { return _this._mountComponent(data); }), _this._bridge.on("update", function(data) { return _this._updateComponent(data); }), _this._bridge.on("updateProfileTimes", function(data) { return _this._updateComponentProfileTimes(data); }), _this._bridge.on("unmount", function(id) { return _this._unmountComponent(id); }), _this._bridge.on("setInspectEnabled", function(data) { return _this.setInspectEnabled(data); }), _this._bridge.on("select", function(_ref) { for (var id = _ref.id, quiet = _ref.quiet, _ref$offsetFromLeaf = _ref.offsetFromLeaf, offsetFromLeaf = void 0 === _ref$offsetFromLeaf ? 0 : _ref$offsetFromLeaf; offsetFromLeaf > 0; ) { offsetFromLeaf--; var pid = _this._parents.get(id); if (!pid) break; id = pid; } _this._revealDeep(id), _this.selectTop(_this.skipWrapper(id), quiet), _this.setSelectedTab("Elements"); }), _this._bridge.on("storeSnapshot", function(storeSnapshot) { _this.snapshotQueue.push(_extends({}, storeSnapshot, { nodes: _this._nodes })), _this.emit("storeSnapshot"); }), _this._bridge.on("clearSnapshots", function() { _this.snapshotQueue.length = 0, _this.emit("clearSnapshots"); }), _this._establishConnection(), _this._eventQueue = [], _this._eventTimer = null, _this; } return _inherits(Store, _EventEmitter), _createClass(Store, [ { key: "emit", value: function(event) { var _this2 = this; return this._eventQueue.indexOf(event) !== -1 || (this._eventQueue.push(event), this._eventTimer || (this._eventTimer = setTimeout(function() { return _this2.flush(); }, 50)), !0); } }, { key: "flush", value: function() { var _this3 = this; this._eventTimer && (clearTimeout(this._eventTimer), this._eventTimer = null), this._eventQueue.forEach(function(evt) { EventEmitter.prototype.emit.call(_this3, evt); }), this._eventQueue = []; } }, { key: "scrollToNode", value: function(id) { this._bridge.send("scrollToNode", id); } }, { key: "copyNodeName", value: function(name) { copy(name); } }, { key: "copyNodeProps", value: function(props) { copy(serializePropsForCopy(props)); } }, { key: "setSelectedTab", value: function(name) { this.selectedTab !== name && (this.selectedTab = name, this.emit("selectedTab")); } }, { key: "changeTextContent", value: function(id, text) { this._bridge.send("changeTextContent", { id: id, text: text }); var node = this._nodes.get(id); if ("Text" === node.get("nodeType")) this._nodes = this._nodes.set(id, node.set("text", text)); else { this._nodes = this._nodes.set(id, node.set("children", text)); var props = node.get("props"); props.children = text; } this.emit(id); } }, { key: "changeSearch", value: function(text) { var _this4 = this, needle = text.toLowerCase(); (needle !== this.searchText.toLowerCase() || this.refreshSearch) && (text && 0 !== SearchUtils.trimSearchText(text).length ? (this.searchRoots && 0 === needle.indexOf(this.searchText.toLowerCase()) && !SearchUtils.shouldSearchUseRegex(text) ? this.searchRoots = this.searchRoots.filter(function(item) { var node = _this4.get(item); return node.get("name") && node.get("name").toLowerCase().indexOf(needle) !== -1 || node.get("text") && node.get("text").toLowerCase().indexOf(needle) !== -1 || "string" == typeof node.get("children") && node.get("children").toLowerCase().indexOf(needle) !== -1; }) : this.searchRoots = this._nodes.entrySeq().filter(function(_ref2) { var _ref3 = _slicedToArray(_ref2, 2), key = _ref3[0], val = _ref3[1]; return nodeMatchesText(val, needle, key, _this4); }).map(function(_ref4) { var _ref5 = _slicedToArray(_ref4, 2), key = _ref5[0]; _ref5[1]; return key; }).toList(), this.searchRoots.forEach(function(id) { _this4.hasBottom(id) && (_this4._nodes = _this4._nodes.setIn([ id, "collapsed" ], !0)); })) : this.searchRoots = null, this.searchText = text, this.emit("searchText"), this.emit("searchRoots"), this.searchRoots && !this.searchRoots.contains(this.selected) ? this.select(null, !0) : this.searchRoots || (this.selected ? this._revealDeep(this.selected) : this.select(this.roots.get(0))), this.highlightSearch(), this.refreshSearch = !1, this.flush()); } }, { key: "highlight", value: function(id) { this.colorizerState && this.colorizerState.enabled || this._bridge.send("highlight", id); } }, { key: "highlightMany", value: function(ids) { this._bridge.send("highlightMany", ids); } }, { key: "highlightSearch", value: function() { this.colorizerState && this.colorizerState.enabled && (this._bridge.send("hideHighlight"), this.searchRoots && this.highlightMany(this.searchRoots.toArray())); } }, { key: "hoverClass", value: function(name) { if (null === name) return void this.hideHighlight(); var ids = this._nodesByName.get(name); ids && this.highlightMany(ids.toArray()); } }, { key: "selectFirstOfClass", value: function(name) { var ids = this._nodesByName.get(name); if (ids && ids.size) { var id = ids.toSeq().first(); this._revealDeep(id), this.selectTop(id); } } }, { key: "showContextMenu", value: function(type, evt) { for (var _len = arguments.length, args = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) args[_key - 2] = arguments[_key]; evt.preventDefault(), this.contextMenu = { type: type, x: evt.pageX, y: evt.pageY, args: args }, this.emit("contextMenu"); } }, { key: "hideContextMenu", value: function() { this.contextMenu = null, this.emit("contextMenu"); } }, { key: "changeTheme", value: function(themeName) { this.themeStore.update(themeName), this.emit("theme"); } }, { key: "changeDefaultTheme", value: function(defaultThemeName) { this.themeStore.setDefaultTheme(defaultThemeName), this.emit("theme"); } }, { key: "saveCustomTheme", value: function(theme) { this.themeStore.saveCustomTheme(theme), this.emit("theme"); } }, { key: "showPreferencesPanel", value: function() { this.preferencesPanelShown = !0, this.emit("preferencesPanelShown"); } }, { key: "hidePreferencesPanel", value: function() { this.preferencesPanelShown = !1, this.emit("preferencesPanelShown"); } }, { key: "selectFirstSearchResult", value: function() { this.searchRoots && this.select(this.searchRoots.get(0), !0); } }, { key: "hasBottom", value: function(id) { var node = this.get(id), children = node.get("children"); return "NativeWrapper" === node.get("nodeType") && (children = this.get(children[0]).get("children")), !("string" == typeof children || !children || !children.length || node.get("collapsed")); } }, { key: "toggleCollapse", value: function(id) { this._nodes = this._nodes.updateIn([ id, "collapsed" ], function(c) { return !c; }), this.emit(id); } }, { key: "toggleAllChildrenNodes", value: function(value) { var id = this.selected; id && this._toggleDeepChildren(id, value); } }, { key: "setProps", value: function(id, path, value) { this._bridge.send("setProps", { id: id, path: path, value: value }); } }, { key: "setState", value: function(id, path, value) { this._bridge.send("setState", { id: id, path: path, value: value }); } }, { key: "setContext", value: function(id, path, value) { this._bridge.send("setContext", { id: id, path: path, value: value }); } }, { key: "makeGlobal", value: function(id, path) { this._bridge.send("makeGlobal", { id: id, path: path }); } }, { key: "setHover", value: function(id, isHovered, isBottomTag) { if (isHovered) { var old = this.hovered; this.hovered = id, this.isBottomTagHovered = isBottomTag, old && this.emit(old), this.emit(id), this.emit("hover"), this.highlight(id); } else this.hovered === id && (this.hideHighlight(), this.isBottomTagHovered = !1); } }, { key: "hideHighlight", value: function() { if ((!this.colorizerState || !this.colorizerState.enabled) && (this._bridge.send("hideHighlight"), this.hovered)) { var id = this.hovered; this.hovered = null, this.emit(id), this.emit("hover"); } } }, { key: "selectBreadcrumb", value: function(id) { this._revealDeep(id), this.changeSearch(""), this.isBottomTagSelected = !1, this.select(id, !1, !0); } }, { key: "selectTop", value: function(id, noHighlight) { this.isBottomTagSelected = !1, this.select(id, noHighlight); } }, { key: "selectBottom", value: function(id) { this.isBottomTagSelected = !0, this.select(id); } }, { key: "select", value: function(id, noHighlight, keepBreadcrumb) { var oldSel = this.selected; this.selected = id, oldSel && this.emit(oldSel), id && this.emit(id), keepBreadcrumb || (this.breadcrumbHead = id, this.emit("breadcrumbHead")), this.emit("selected"), this._bridge.send("selected", id), !noHighlight && id && this.highlight(id); } }, { key: "get", value: function(id) { return this._nodes.get(id); } }, { key: "getParent", value: function(id) { return this._parents.get(id); } }, { key: "skipWrapper", value: function(id, up, end) { if (id) for (;;) { var node = this.get(id), nodeType = node.get("nodeType"); if ("Wrapper" !== nodeType && "Native" !== nodeType) return id; if ("Native" === nodeType && (!up || "NativeWrapper" !== this.get(this._parents.get(id)).get("nodeType"))) return id; if (up) { var parentId = this._parents.get(id); if (!parentId) return; id = parentId; } else { var children = node.get("children"); if (0 === children.length) return; var index = end ? children.length - 1 : 0, childId = children[index]; id = childId; } } } }, { key: "off", value: function(evt, fn) { this.removeListener(evt, fn); } }, { key: "inspect", value: function(id, path, cb) { var _this5 = this; invariant("props" === path[0] || "state" === path[0] || "context" === path[0], "Inspected path must be one of props, state, or context"), this._bridge.inspect(id, path, function(value) { var base = _this5.get(id).get(path[0]), inspected = path.slice(1).reduce(function(obj, attr) { return obj ? obj[attr] : null; }, base); inspected && (assign(inspected, value), inspected[consts.inspected] = !0), cb(); }); } }, { key: "changeTraceUpdates", value: function(state) { this.traceupdatesState = state, this.emit("traceupdatesstatechange"), invariant(state.toJS, "state.toJS should exist"), this._bridge.send("traceupdatesstatechange", state.toJS()); } }, { key: "changeColorizer", value: function(state) { this.colorizerState = state, this.emit("colorizerchange"), this._bridge.send("colorizerchange", state.toJS()), this.colorizerState && this.colorizerState.enabled ? this.highlightSearch() : this.hideHighlight(); } }, { key: "setInspectEnabled", value: function(isInspectEnabled) { this.isInspectEnabled = isInspectEnabled, this.emit("isInspectEnabled"), this._bridge.send("setInspectEnabled", isInspectEnabled); } }, { key: "setIsRecording", value: function(isRecording) { this._bridge.send("isRecording", isRecording); } }, { key: "_establishConnection", value: function() { var requestInt, _this6 = this, tries = 0; this._bridge.once("capabilities", function(capabilities) { clearInterval(requestInt), _this6.capabilities = assign(_this6.capabilities, capabilities), _this6.emit("connected"); }), this._bridge.send("requestCapabilities"), requestInt = setInterval(function() { return tries += 1, tries > 100 ? (console.error("failed to connect"), clearInterval(requestInt), void _this6.emit("connection failed")) : void _this6._bridge.send("requestCapabilities"); }, 500); } }, { key: "_revealDeep", value: function(id) { if (!this.searchRoots || !this.searchRoots.contains(id)) for (var pid = this._parents.get(id); pid; ) { if (this._nodes.getIn([ pid, "collapsed" ]) && (this._nodes = this._nodes.setIn([ pid, "collapsed" ], !1), this.emit(pid)), this.searchRoots && this.searchRoots.contains(pid)) return; pid = this._parents.get(pid); } } }, { key: "_toggleDeepChildren", value: function(id, value) { var _this7 = this, node = this._nodes.get(id); if (node) { node.get("collapsed") !== value && (this._nodes = this._nodes.setIn([ id, "collapsed" ], value), this.emit(id)); var children = node.get("children"); children && children.forEach && children.forEach(function(cid) { return _this7._toggleDeepChildren(cid, value); }); } } }, { key: "_mountComponent", value: function(data) { var _this8 = this, map = Map(data).set("renders", 1); "Composite" === data.nodeType && (map = map.set("collapsed", !0)), this._nodes = this._nodes.set(data.id, map), data.children && data.children.forEach && data.children.forEach(function(cid) { _this8._parents = _this8._parents.set(cid, data.id); }); var curNodes = this._nodesByName.get(data.name) || new Set(); this._nodesByName = this._nodesByName.set(data.name, curNodes.add(data.id)), this.emit(data.id); } }, { key: "_updateComponent", value: function(data) { var _this9 = this, node = this.get(data.id); node && (data.renders = node.get("renders") + 1, this._nodes = this._nodes.mergeIn([ data.id ], Map(data)), data.children && data.children.forEach && data.children.forEach(function(cid) { if (!_this9._parents.get(cid)) { _this9._parents = _this9._parents.set(cid, data.id); var childNode = _this9._nodes.get(cid), childID = childNode.get("id"); _this9.searchRoots && nodeMatchesText(childNode, _this9.searchText.toLowerCase(), childID, _this9) && (_this9.searchRoots = _this9.searchRoots.push(childID), _this9.emit("searchRoots"), _this9.highlightSearch()); } }), this.emit(data.id)); } }, { key: "_updateComponentProfileTimes", value: function(data) { var node = this.get(data.id); node && (this._nodes = this._nodes.mergeIn([ data.id ], Map(data)), this.emit(data.id)); } }, { key: "_unmountComponent", value: function(id) { var pid = this._parents.get(id); if (this._removeFromNodesByName(id), this._parents = this._parents["delete"](id), this._nodes = this._nodes["delete"](id), pid) this.emit(pid); else { var ix = this.roots.indexOf(id); ix !== -1 && (this.roots = this.roots["delete"](ix), this.emit("roots")); } if (id === this.selected) { var newsel = pid ? this.skipWrapper(pid, !0) : this.roots.get(0); this.selectTop(newsel, !0); } this.searchRoots && this.searchRoots.contains(id) && (this.searchRoots = this.searchRoots["delete"](this.searchRoots.indexOf(id)), this.emit("searchRoots"), this.highlightSearch()); } }, { key: "_removeFromNodesByName", value: function(id) { var node = this._nodes.get(id); node && (this._nodesByName = this._nodesByName.set(node.get("name"), this._nodesByName.get(node.get("name"))["delete"](id))); } } ]), Store; }(EventEmitter)); module.exports = Store; }, function(module, exports) { function EventEmitter() { this._events = this._events || {}, this._maxListeners = this._maxListeners || void 0; } function isFunction(arg) { return "function" == typeof arg; } function isNumber(arg) { return "number" == typeof arg; } function isObject(arg) { return "object" == typeof arg && null !== arg; } function isUndefined(arg) { return void 0 === arg; } module.exports = EventEmitter, EventEmitter.EventEmitter = EventEmitter, EventEmitter.prototype._events = void 0, EventEmitter.prototype._maxListeners = void 0, EventEmitter.defaultMaxListeners = 10, EventEmitter.prototype.setMaxListeners = function(n) { if (!isNumber(n) || n < 0 || isNaN(n)) throw TypeError("n must be a positive number"); return this._maxListeners = n, this; }, EventEmitter.prototype.emit = function(type) { var er, handler, len, args, i, listeners; if (this._events || (this._events = {}), "error" === type && (!this._events.error || isObject(this._events.error) && !this._events.error.length)) { if (er = arguments[1], er instanceof Error) throw er; var err = new Error('Uncaught, unspecified "error" event. (' + er + ")"); throw err.context = er, err; } if (handler = this._events[type], isUndefined(handler)) return !1; if (isFunction(handler)) switch (arguments.length) { case 1: handler.call(this); break; case 2: handler.call(this, arguments[1]); break; case 3: handler.call(this, arguments[1], arguments[2]); break; default: args = Array.prototype.slice.call(arguments, 1), handler.apply(this, args); } else if (isObject(handler)) for (args = Array.prototype.slice.call(arguments, 1), listeners = handler.slice(), len = listeners.length, i = 0; i < len; i++) listeners[i].apply(this, args); return !0; }, EventEmitter.prototype.addListener = function(type, listener) { var m; if (!isFunction(listener)) throw TypeError("listener must be a function"); return this._events || (this._events = {}), this._events.newListener && this.emit("newListener", type, isFunction(listener.listener) ? listener.listener : listener), this._events[type] ? isObject(this._events[type]) ? this._events[type].push(listener) : this._events[type] = [ this._events[type], listener ] : this._events[type] = listener, isObject(this._events[type]) && !this._events[type].warned && (m = isUndefined(this._maxListeners) ? EventEmitter.defaultMaxListeners : this._maxListeners, m && m > 0 && this._events[type].length > m && (this._events[type].warned = !0, console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.", this._events[type].length), "function" == typeof console.trace && console.trace())), this; }, EventEmitter.prototype.on = EventEmitter.prototype.addListener, EventEmitter.prototype.once = function(type, listener) { function g() { this.removeListener(type, g), fired || (fired = !0, listener.apply(this, arguments)); } if (!isFunction(listener)) throw TypeError("listener must be a function"); var fired = !1; return g.listener = listener, this.on(type, g), this; }, EventEmitter.prototype.removeListener = function(type, listener) { var list, position, length, i; if (!isFunction(listener)) throw TypeError("listener must be a function"); if (!this._events || !this._events[type]) return this; if (list = this._events[type], length = list.length, position = -1, list === listener || isFunction(list.listener) && list.listener === listener) delete this._events[type], this._events.removeListener && this.emit("removeListener", type, listener); else if (isObject(list)) { for (i = length; i-- > 0; ) if (list[i] === listener || list[i].listener && list[i].listener === listener) { position = i; break; } if (position < 0) return this; 1 === list.length ? (list.length = 0, delete this._events[type]) : list.splice(position, 1), this._events.removeListener && this.emit("removeListener", type, listener); } return this; }, EventEmitter.prototype.removeAllListeners = function(type) { var key, listeners; if (!this._events) return this; if (!this._events.removeListener) return 0 === arguments.length ? this._events = {} : this._events[type] && delete this._events[type], this; if (0 === arguments.length) { for (key in this._events) "removeListener" !== key && this.removeAllListeners(key); return this.removeAllListeners("removeListener"), this._events = {}, this; } if (listeners = this._events[type], isFunction(listeners)) this.removeListener(type, listeners); else if (listeners) for (;listeners.length; ) this.removeListener(type, listeners[listeners.length - 1]); return delete this._events[type], this; }, EventEmitter.prototype.listeners = function(type) { var ret; return ret = this._events && this._events[type] ? isFunction(this._events[type]) ? [ this._events[type] ] : this._events[type].slice() : []; }, EventEmitter.prototype.listenerCount = function(type) { if (this._events) { var evlistener = this._events[type]; if (isFunction(evlistener)) return 1; if (evlistener) return evlistener.length; } return 0; }, EventEmitter.listenerCount = function(emitter, type) { return emitter.listenerCount(type); }; }, function(module, exports, __webpack_require__) { "use strict"; function nodeMatchesText(node, needle, key, store) { var name = node.get("name"), wrapper = store.get(store.getParent(key)); if ("Native" === node.get("nodeType") && wrapper && "NativeWrapper" === wrapper.get("nodeType")) return !1; var useRegex = SearchUtils.shouldSearchUseRegex(needle); if (name && "Wrapper" !== node.get("nodeType")) return validString(name, needle, useRegex); var text = node.get("text"); if (text) return validString(text, needle, useRegex); var children = node.get("children"); return "string" == typeof children && validString(children, needle, useRegex); } function validString(str, needle, regex) { if (regex) try { var regExp = SearchUtils.searchTextToRegExp(needle); return regExp.test(str.toLowerCase()); } catch (error) { return !1; } return str.toLowerCase().indexOf(needle) !== -1; } var SearchUtils = __webpack_require__(59); module.exports = nodeMatchesText; }, function(module, exports, __webpack_require__) { "use strict"; function stripFunctions(props) { for (var key in props) { var value = props[key], type = value && value[consts.type] || ("undefined" == typeof value ? "undefined" : _typeof(value)); if ("function" === type) { var name = value[consts.name]; props[key] = "[function " + name + "]"; } } } function serializePropsForCopy(props) { var cloned = Object.assign({}, props); delete cloned.children, stripFunctions(cloned); try { return JSON.stringify(cloned, null, 2); } catch (error) { return ""; } } var _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj) { return typeof obj; } : function(obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, consts = __webpack_require__(32); module.exports = serializePropsForCopy; }, function(module, exports, __webpack_require__) { "use strict"; function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function"); } function getSafeThemeName(themeName, fallbackThemeName) { return themeName === CUSTOM_THEME_NAME ? CUSTOM_THEME_NAME : themeName && Themes.hasOwnProperty(themeName) ? themeName : fallbackThemeName && Themes.hasOwnProperty(fallbackThemeName) ? fallbackThemeName : "ChromeDefault"; } var _createClass = function() { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0, "value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor); } } return function(Constructor, protoProps, staticProps) { return protoProps && defineProperties(Constructor.prototype, protoProps), staticProps && defineProperties(Constructor, staticProps), Constructor; }; }(), _require = __webpack_require__(320), deserialize = _require.deserialize, serialize = _require.serialize, Themes = __webpack_require__(318), _require2 = __webpack_require__(68), CUSTOM_THEME_NAME = _require2.CUSTOM_THEME_NAME, _require3 = __webpack_require__(332), get = _require3.get, set = _require3.set, LOCAL_STORAGE_CUSTOM_THEME_KEY = "customTheme", LOCAL_STORAGE_THEME_NAME_KEY = "themeName", Store = function() { function Store(defaultThemeName) { _classCallCheck(this, Store), this.themes = Themes; var customTheme = get(LOCAL_STORAGE_CUSTOM_THEME_KEY); customTheme && (this.customTheme = deserialize(customTheme)), this.setDefaultTheme(defaultThemeName); } return _createClass(Store, [ { key: "setDefaultTheme", value: function(defaultThemeName) { this.defaultThemeName = getSafeThemeName(defaultThemeName); var themeName = getSafeThemeName(get(LOCAL_STORAGE_THEME_NAME_KEY), this.defaultThemeName); this.theme = themeName === CUSTOM_THEME_NAME ? this.customTheme : Themes[themeName], this.themeName = themeName; } }, { key: "update", value: function(themeName) { if (themeName === CUSTOM_THEME_NAME) this.theme = this.customTheme, this.themeName = CUSTOM_THEME_NAME; else { var safeThemeKey = getSafeThemeName(themeName, this.defaultThemeName); this.theme = this.themes[safeThemeKey], this.themeName = safeThemeKey; } set(LOCAL_STORAGE_THEME_NAME_KEY, themeName || null); } }, { key: "saveCustomTheme", value: function(theme) { this.customTheme = theme, this.theme = theme, set(LOCAL_STORAGE_CUSTOM_THEME_KEY, serialize(theme)); } } ]), Store; }(); module.exports = Store; }, function(module, exports) { "use strict"; function get(key) { var defaultValue = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : null, value = void 0; try { value = JSON.parse(localStorage.getItem(key)); } catch (error) { console.error("Could not read from localStorage.", error); } return null !== value ? value : defaultValue; } function set(key, value) { try { return localStorage.setItem(key, JSON.stringify(value)), !0; } catch (error) { console.error("Could not write to localStorage.", error); } return !1; } Object.defineProperty(exports, "__esModule", { value: !0 }), exports.get = get, exports.set = set; }, function(module, exports, __webpack_require__) { "use strict"; function getDest(dir, store) { var id = store.selected; if (!id) return null; var bottom = store.isBottomTagSelected, node = store.get(id), collapsed = node.get("collapsed"), children = node.get("children"); "NativeWrapper" === node.get("nodeType") && (children = store.get(children[0]).get("children")); var hasChildren = children && "string" != typeof children && children.length; return dirToDest(dir, bottom, collapsed, hasChildren); } function getRootSelection(dest, store, id) { var roots = store.searchRoots || store.roots, ix = roots.indexOf(id); if (ix === -1 && (ix = roots.indexOf(store._parents.get(id))), "prevSibling" === dest) { if (0 === ix) return null; var prev = store.skipWrapper(roots.get(ix - 1), !1, !0); return store.isBottomTagSelected = !!prev && store.hasBottom(prev), prev; } return "nextSibling" === dest ? ix >= roots.size - 1 ? null : (store.isBottomTagSelected = !1, store.skipWrapper(roots.get(ix + 1))) : null; } function getNewSelection(dest, store) { var id = store.selected; if (id) { var node = store.get(id), pid = store.getParent(id); if (pid) { var lastId = id; if ("parent" === dest) { var parentNode = store.get(pid); if ("Wrapper" !== parentNode.get("nodeType")) return pid; for (;"Wrapper" === parentNode.get("nodeType"); ) { if (lastId = id, id = pid, pid = store.getParent(id), !pid) { pid = id, id = lastId; break; } parentNode = store.get(pid); } dest = "prevSibling"; } else if ("parentBottom" === dest) { var _parentNode = store.get(pid); if ("Wrapper" !== _parentNode.get("nodeType")) return store.isBottomTagSelected = !0, pid; for (;"Wrapper" === _parentNode.get("nodeType"); ) { if (lastId = id, id = pid, pid = store.getParent(id), !pid) { pid = id, id = lastId; break; } _parentNode = store.get(pid); } dest = "nextSibling"; } } if (id) { if (store.searchRoots && store.searchRoots.contains(pid) && (pid = null), "collapse" === dest || "uncollapse" === dest) return "collapse" === dest && (store.isBottomTagSelected = !1), void store.toggleCollapse(id); "selectTop" === dest && store.selectTop(id); var children = node.get("children"); "NativeWrapper" === node.get("nodeType") && (children = store.get(children[0]).get("children")); var cid; if ("firstChild" === dest) { if ("string" == typeof children) return getNewSelection("nextSibling", store); for (var i = 0; i < children.length; i++) if (cid = store.skipWrapper(children[i])) return store.isBottomTagSelected = !1, cid; } if ("lastChild" === dest) return "string" == typeof children ? getNewSelection("prevSibling", store) : (cid = store.skipWrapper(children[children.length - 1], !1, !0), cid && !store.hasBottom(cid) && (store.isBottomTagSelected = !1), cid); if (!pid) return getRootSelection(dest, store, id); var parent = store.get(store.getParent(id)), pchildren = parent.get("children"), pix = pchildren.indexOf(id); if (pix === -1 && (pix = pchildren.indexOf(store._parents.get(id))), "prevSibling" === dest) { for (;pix > 0; ) { var _childId = pchildren[pix - 1], _child = store.get(_childId), prevCid = store.skipWrapper(_childId, !1, "Wrapper" === _child.get("nodeType")); if (prevCid) return store.hasBottom(prevCid) && (store.isBottomTagSelected = !0), prevCid; pix--; } var roots = store.searchRoots || store.roots; if (roots.indexOf(store.getParent(id)) > -1) return getRootSelection(dest, store, id); var childId = pchildren[pix], child = store.get(childId); return "Wrapper" === child.get("nodeType") ? store.getParent(id) : getNewSelection("parent", store); } if ("nextSibling" === dest) { if (pix === pchildren.length - 1) { var _roots = store.searchRoots || store.roots; if (_roots.indexOf(store.getParent(id)) > -1) return getRootSelection(dest, store, id); var _childId2 = pchildren[pix], _child2 = store.get(_childId2); return "Wrapper" === _child2.get("nodeType") ? (store.isBottomTagSelected = !0, store.getParent(id)) : getNewSelection("parentBottom", store); } return store.isBottomTagSelected = !1, store.skipWrapper(pchildren[pix + 1]); } return null; } } } var dirToDest = __webpack_require__(334), keyCodes = { "72": "left", "74": "down", "75": "up", "76": "right", "37": "left", "38": "up", "39": "right", "40": "down" }; module.exports = function(store, win) { return win = win || window, function(e) { if (win.document.activeElement === win.document.body && !e.shiftKey && !e.metaKey) { var direction = keyCodes[e.keyCode]; if (direction) { if (e.preventDefault(), e.altKey && "right" === direction) return void store.toggleAllChildrenNodes(!1); if (e.altKey && "left" === direction) return void store.toggleAllChildrenNodes(!0); if (!e.ctrlKey && !e.altKey) { var dest = getDest(direction, store); if (dest) { var move = getNewSelection(dest, store); move && move !== store.selected && store.select(move); } } } } }; }; }, function(module, exports) { "use strict"; module.exports = function(dir, bottom, collapsed, hasChildren) { if ("down" === dir) return bottom || collapsed || !hasChildren ? "nextSibling" : "firstChild"; if ("up" === dir) return bottom && !collapsed && hasChildren ? "lastChild" : "prevSibling"; if ("left" === dir) return !collapsed && hasChildren ? bottom ? "selectTop" : "collapse" : "parent"; if ("right" === dir) { if (collapsed && hasChildren) return "uncollapse"; if (hasChildren) return bottom ? null : "firstChild"; } return null; }; }, function(module, exports, __webpack_require__) { "use strict"; 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; } return Array.from(arr); } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function"); } function getWindowFunction(name, polyfill) { return String(window[name]).indexOf("[native code]") === -1 ? polyfill : window[name]; } var _extends = Object.assign || function(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) Object.prototype.hasOwnProperty.call(source, key) && (target[key] = source[key]); } return target; }, _createClass = function() { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0, "value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor); } } return function(Constructor, protoProps, staticProps) { return protoProps && defineProperties(Constructor.prototype, protoProps), staticProps && defineProperties(Constructor, staticProps), Constructor; }; }(), consts = __webpack_require__(32), hydrate = __webpack_require__(336), dehydrate = __webpack_require__(337), getIn = __webpack_require__(338), performanceNow = __webpack_require__(339), lastRunTimeMS = 5, cancelIdleCallback = getWindowFunction("cancelIdleCallback", clearTimeout), requestIdleCallback = getWindowFunction("requestIdleCallback", function(cb, options) { var delayMS = 3e3 * lastRunTimeMS; return delayMS > 500 && (delayMS = 500), setTimeout(function() { var startTime = performanceNow(); cb({ didTimeout: !1, timeRemaining: function() { return 1 / 0; } }); var endTime = performanceNow(); lastRunTimeMS = (endTime - startTime) / 1e3; }, delayMS); }), Bridge = function() { function Bridge(wall) { _classCallCheck(this, Bridge), this._cbs = new Map(), this._inspectables = new Map(), this._cid = 0, this._listeners = {}, this._buffer = [], this._flushHandle = null, this._callers = {}, this._paused = !1, this._wall = wall, wall.listen(this._handleMessage.bind(this)); } return _createClass(Bridge, [ { key: "inspect", value: function(id, path, cb) { var _cid = this._cid++; this._cbs.set(_cid, function(data, cleaned, proto, protoclean) { cleaned.length && hydrate(data, cleaned), proto && protoclean.length && hydrate(proto, protoclean), proto && (data[consts.proto] = proto), cb(data); }), this._wall.send({ type: "inspect", callback: _cid, path: path, id: id }); } }, { key: "call", value: function(name, args, cb) { var _cid = this._cid++; this._cbs.set(_cid, cb), this._wall.send({ type: "call", callback: _cid, args: args, name: name }); } }, { key: "onCall", value: function(name, handler) { if (this._callers[name]) throw new Error("only one call handler per call name allowed"); this._callers[name] = handler; } }, { key: "pause", value: function() { this._wall.send({ type: "pause" }); } }, { key: "resume", value: function() { this._wall.send({ type: "resume" }); } }, { key: "setInspectable", value: function(id, data) { var prev = this._inspectables.get(id); return prev ? void this._inspectables.set(id, _extends({}, prev, data)) : void this._inspectables.set(id, data); } }, { key: "send", value: function(evt, data) { this._buffer.push({ evt: evt, data: data }), this.scheduleFlush(); } }, { key: "scheduleFlush", value: function() { if (!this._flushHandle && this._buffer.length) { var timeout = this._paused ? 5e3 : 500; this._flushHandle = requestIdleCallback(this.flushBufferWhileIdle.bind(this), { timeout: timeout }); } } }, { key: "cancelFlush", value: function() { this._flushHandle && (cancelIdleCallback(this._flushHandle), this._flushHandle = null); } }, { key: "flushBufferWhileIdle", value: function(deadline) { this._flushHandle = null; for (var chunkCount = this._paused ? 20 : 10, chunkSize = Math.round(this._buffer.length / chunkCount), minChunkSize = this._paused ? 50 : 100; this._buffer.length && (deadline.timeRemaining() > 0 || deadline.didTimeout); ) { var take = Math.min(this._buffer.length, Math.max(minChunkSize, chunkSize)), currentBuffer = this._buffer.splice(0, take); this.flushBufferSlice(currentBuffer); } this._buffer.length && this.scheduleFlush(); } }, { key: "flushBufferSlice", value: function(bufferSlice) { var _this = this, events = bufferSlice.map(function(_ref) { var evt = _ref.evt, data = _ref.data, cleaned = [], san = dehydrate(data, cleaned); return cleaned.length && _this.setInspectable(data.id, data), { type: "event", evt: evt, data: san, cleaned: cleaned }; }); this._wall.send({ type: "many-events", events: events }); } }, { key: "forget", value: function(id) { this._inspectables["delete"](id); } }, { key: "on", value: function(evt, fn) { this._listeners[evt] ? this._listeners[evt].push(fn) : this._listeners[evt] = [ fn ]; } }, { key: "off", value: function(evt, fn) { if (this._listeners[evt]) { var ix = this._listeners[evt].indexOf(fn); ix !== -1 && this._listeners[evt].splice(ix, 1); } } }, { key: "once", value: function(evt, fn) { var self = this, listener = function listener() { fn.apply(this, arguments), self.off(evt, listener); }; this.on(evt, listener); } }, { key: "_handleMessage", value: function(payload) { var _this2 = this; if ("resume" === payload.type) return this._paused = !1, void this.scheduleFlush(); if ("pause" === payload.type) return this._paused = !0, void this.cancelFlush(); if ("callback" === payload.type) { var callback = this._cbs.get(payload.id); return void (callback && (callback.apply(void 0, _toConsumableArray(payload.args)), this._cbs["delete"](payload.id))); } if ("call" === payload.type) return void this._handleCall(payload.name, payload.args, payload.callback); if ("inspect" === payload.type) return void this._inspectResponse(payload.id, payload.path, payload.callback); if ("event" === payload.type) { payload.cleaned && hydrate(payload.data, payload.cleaned); var fns = this._listeners[payload.evt], data = payload.data; fns && fns.forEach(function(fn) { return fn(data); }); } "many-events" === payload.type && payload.events.forEach(function(event) { event.cleaned && hydrate(event.data, event.cleaned); var handlers = _this2._listeners[event.evt]; handlers && handlers.forEach(function(fn) { return fn(event.data); }); }); } }, { key: "_handleCall", value: function(name, args, callback) { if (!this._callers[name]) return void console.warn('unknown call: "' + name + '"'); args = Array.isArray(args) ? args : [ args ]; var result; try { result = this._callers[name].apply(null, args); } catch (e) { return void console.error("Failed to call", e); } this._wall.send({ type: "callback", id: callback, args: [ result ] }); } }, { key: "_inspectResponse", value: function(id, path, callback) { var inspectable = this._inspectables.get(id), result = {}, cleaned = [], proto = null, protoclean = []; if (inspectable) { var val = getIn(inspectable, path), protod = !1, isFn = "function" == typeof val; if (val && "function" == typeof val[Symbol.iterator]) { var iterVal = Object.create({}), count = 0, _iteratorNormalCompletion = !0, _didIteratorError = !1, _iteratorError = void 0; try { for (var _step, _iterator = val[Symbol.iterator](); !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0) { var entry = _step.value; if (count > 100) break; iterVal[count] = entry, count++; } } catch (err) { _didIteratorError = !0, _iteratorError = err; } finally { try { !_iteratorNormalCompletion && _iterator["return"] && _iterator["return"](); } finally { if (_didIteratorError) throw _iteratorError; } } val = iterVal; } if (Object.getOwnPropertyNames(val).forEach(function(name) { "__proto__" === name && (protod = !0), (!isFn || "arguments" !== name && "callee" !== name && "caller" !== name) && (result[name] = dehydrate(val[name], cleaned, [ name ])); }), !protod && val.__proto__ && "Object" !== val.constructor.name) { var newProto = {}, pIsFn = "function" == typeof val.__proto__; Object.getOwnPropertyNames(val.__proto__).forEach(function(name) { (!pIsFn || "arguments" !== name && "callee" !== name && "caller" !== name) && (newProto[name] = dehydrate(val.__proto__[name], protoclean, [ name ])); }), proto = newProto; } } this._wall.send({ type: "callback", id: callback, args: [ result, cleaned, proto, protoclean ] }); } } ]), Bridge; }(); module.exports = Bridge; }, function(module, exports, __webpack_require__) { "use strict"; function hydrate(data, cleaned) { cleaned.forEach(function(path) { var last = path.pop(), obj = path.reduce(function(obj_, attr) { return obj_ ? obj_[attr] : null; }, data); if (obj && obj[last]) { var replace = {}; replace[consts.name] = obj[last].name, replace[consts.type] = obj[last].type, replace[consts.meta] = obj[last].meta, replace[consts.inspected] = !1, obj[last] = replace; } }); } var consts = __webpack_require__(32); module.exports = hydrate; }, function(module, exports) { "use strict"; function getPropType(data) { if (!data) return null; var type = "undefined" == typeof data ? "undefined" : _typeof(data); if ("object" === type) { if (data._reactFragment) return "react_fragment"; if (Array.isArray(data)) return "array"; if (ArrayBuffer.isView(data)) return data instanceof DataView ? "data_view" : "typed_array"; if (data instanceof ArrayBuffer) return "array_buffer"; if ("function" == typeof data[Symbol.iterator]) return "iterator"; if ("[object Date]" === Object.prototype.toString.call(data)) return "date"; } return type; } function createDehydrated(type, data, cleaned, path) { var meta = {}; return "array" !== type && "typed_array" !== type || (meta.length = data.length), "iterator" !== type && "typed_array" !== type || (meta.readOnly = !0), cleaned.push(path), { type: type, meta: meta, name: data.constructor && "Object" !== data.constructor.name ? data.constructor.name : "" }; } function dehydrate(data, cleaned) { var path = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : [], level = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : 0, type = getPropType(data); switch (type) { case "function": return cleaned.push(path), { name: data.name, type: "function" }; case "string": return data.length <= 500 ? data : data.slice(0, 500) + "..."; case "symbol": return cleaned.push(path), { type: "symbol", name: data.toString() }; case "react_fragment": return "A React Fragment"; case "array_buffer": case "data_view": return cleaned.push(path), { type: type, name: "data_view" === type ? "DataView" : "ArrayBuffer", meta: { length: data.byteLength, uninspectable: !0 } }; case "array": return level > 2 ? createDehydrated(type, data, cleaned, path) : data.map(function(item, i) { return dehydrate(item, cleaned, path.concat([ i ]), level + 1); }); case "typed_array": case "iterator": return createDehydrated(type, data, cleaned, path); case "date": return cleaned.push(path), { name: data.toString(), type: "date", meta: { uninspectable: !0 } }; case "object": if (level > 2 || data.constructor && "function" == typeof data.constructor && "Object" !== data.constructor.name) return createDehydrated(type, data, cleaned, path); var res = {}; for (var name in data) res[name] = dehydrate(data[name], cleaned, path.concat([ name ]), level + 1); return res; default: return data; } } var _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj) { return typeof obj; } : function(obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; module.exports = dehydrate; }, function(module, exports) { "use strict"; 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; } return Array.from(arr); } function getIn(base, path) { return path.reduce(function(obj, attr) { if (obj) { if (hasOwnProperty.call(obj, attr)) return obj[attr]; if ("function" == typeof obj[Symbol.iterator]) return [].concat(_toConsumableArray(obj))[attr]; } return null; }, base); } var hasOwnProperty = Object.prototype.hasOwnProperty; module.exports = getIn; }, function(module, exports, __webpack_require__) { "use strict"; var performanceNow, performance = __webpack_require__(340); performanceNow = performance.now ? function() { return performance.now(); } : function() { return Date.now(); }, module.exports = performanceNow; }, function(module, exports, __webpack_require__) { "use strict"; var performance, ExecutionEnvironment = __webpack_require__(341); ExecutionEnvironment.canUseDOM && (performance = window.performance || window.msPerformance || window.webkitPerformance), module.exports = performance || {}; }, function(module, exports) { "use strict"; var canUseDOM = !("undefined" == typeof window || !window.document || !window.document.createElement), ExecutionEnvironment = { canUseDOM: canUseDOM, canUseWorkers: "undefined" != typeof Worker, canUseEventListeners: canUseDOM && !(!window.addEventListener && !window.attachEvent), canUseViewport: canUseDOM && !!window.screen, isInWorker: !canUseDOM }; module.exports = ExecutionEnvironment; }, function(module, exports, __webpack_require__) { "use strict"; 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 || "object" != typeof call && "function" != typeof call ? self : call; } function _inherits(subClass, superClass) { if ("function" != typeof superClass && null !== superClass) 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: !1, writable: !0, configurable: !0 } }), superClass && (Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass); } function shallowClone(obj) { var nobj = {}; for (var n in obj) nobj[n] = obj[n]; return nobj; } var _createClass = function() { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0, "value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor); } } return function(Constructor, protoProps, staticProps) { return protoProps && defineProperties(Constructor.prototype, protoProps), staticProps && defineProperties(Constructor, staticProps), Constructor; }; }(), React = __webpack_require__(12), StyleEdit = __webpack_require__(343), BoxInspector = __webpack_require__(345), NativeStyler = function(_React$Component) { function NativeStyler(props) { _classCallCheck(this, NativeStyler); var _this = _possibleConstructorReturn(this, (NativeStyler.__proto__ || Object.getPrototypeOf(NativeStyler)).call(this, props)); return _this.state = { style: null, measuredLayout: null }, _this; } return _inherits(NativeStyler, _React$Component), _createClass(NativeStyler, [ { key: "componentWillMount", value: function() { var _this2 = this; this._styleGet = this._styleGet.bind(this), this.props.supportsMeasure ? (this.props.bridge.on("rn-style:measure", this._styleGet), this.props.bridge.send("rn-style:measure", this.props.id)) : this.props.bridge.call("rn-style:get", this.props.id, function(style) { _this2.setState({ style: style }); }); } }, { key: "componentWillUnmount", value: function() { this.props.supportsMeasure && this.props.bridge.off("rn-style:measure", this._styleGet); } }, { key: "componentWillReceiveProps", value: function(nextProps) { var _this3 = this; nextProps.id !== this.props.id && (this.setState({ style: null }), this.props.bridge.send("rn-style:get", nextProps.id), this.props.supportsMeasure ? this.props.bridge.send("rn-style:measure", nextProps.id) : this.props.bridge.call("rn-style:get", nextProps.id, function(style) { _this3.setState({ style: style }); })); } }, { key: "_styleGet", value: function(result) { var style = result.style, measuredLayout = result.measuredLayout; this.setState({ style: style, measuredLayout: measuredLayout }); } }, { key: "_handleStyleChange", value: function(attr, val) { this.state.style && (this.state.style[attr] = val), this.props.bridge.send("rn-style:set", { id: this.props.id, attr: attr, val: val }), this.setState({ style: this.state.style }); } }, { key: "_handleStyleRename", value: function(oldName, newName, val) { var style = shallowClone(this.state.style); delete style[oldName], style[newName] = val, this.props.bridge.send("rn-style:rename", { id: this.props.id, oldName: oldName, newName: newName, val: val }), this.setState({ style: style }); } }, { key: "render", value: function() { return this.state.style ? React.createElement("div", { style: styles.container }, this.state.measuredLayout && React.createElement(BoxInspector, this.state.measuredLayout), React.createElement(StyleEdit, { style: this.state.style, onRename: this._handleStyleRename.bind(this), onChange: this._handleStyleChange.bind(this) })) : React.createElement("em", null, "loading"); } } ]), NativeStyler; }(React.Component), styles = { container: { display: "flex", flexDirection: "column" } }; module.exports = NativeStyler; }, function(module, exports, __webpack_require__) { "use strict"; 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 || "object" != typeof call && "function" != typeof call ? self : call; } function _inherits(subClass, superClass) { if ("function" != typeof superClass && null !== superClass) 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: !1, writable: !0, configurable: !0 } }), superClass && (Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass); } var _createClass = function() { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0, "value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor); } } return function(Constructor, protoProps, staticProps) { return protoProps && defineProperties(Constructor.prototype, protoProps), staticProps && defineProperties(Constructor, staticProps), Constructor; }; }(), PropTypes = __webpack_require__(7), React = __webpack_require__(12), AutoSizeInput = __webpack_require__(344), StyleEdit = function(_React$Component) { function StyleEdit(props) { _classCallCheck(this, StyleEdit); var _this = _possibleConstructorReturn(this, (StyleEdit.__proto__ || Object.getPrototypeOf(StyleEdit)).call(this, props)); return _this.state = { showNew: !1, newAttr: "", newValue: "" }, _this; } return _inherits(StyleEdit, _React$Component), _createClass(StyleEdit, [ { key: "onChange", value: function(name, val) { var num = Number(val); this.props.onChange(name, num === Number(val) ? num : val); } }, { key: "onNewSubmit", value: function(val) { this.onChange(this.state.newAttr, val), this.setState({ showNew: !1, newAttr: "", newValue: "" }); } }, { key: "onNewAttr", value: function(attr) { "" === attr ? this.setState({ showNew: !1 }) : this.setState({ newAttr: "" + attr }); } }, { key: "onListClick", value: function(e) { e.target instanceof Element && "INPUT" === e.target.tagName || this.setState({ showNew: !0 }); } }, { key: "render", value: function() { var _this2 = this, attrs = Object.keys(this.props.style); return React.createElement("ul", { style: styles.list, onClick: function(e) { return _this2.onListClick(e); } }, React.createElement("span", { style: tagStyle(this.context.theme) }, "style"), React.createElement("span", null, " {"), attrs.map(function(name) { return React.createElement("li", { key: "style-" + name, style: styles.listItem, onClick: blockClick }, React.createElement(AutoSizeInput, { type: "attr", value: name, onChange: function(newName) { return _this2.props.onRename(name, "" + newName, _this2.props.style[name]); } }), React.createElement("span", { style: styles.colon }, ":"), React.createElement(AutoSizeInput, { value: _this2.props.style[name], onChange: function(val) { return _this2.onChange(name, val); } }), React.createElement("span", { style: styles.colon }, ";")); }), this.state.showNew && React.createElement("li", { style: styles.listItem }, React.createElement(AutoSizeInput, { isNew: !0, type: "attr", value: this.state.newAttr, onChange: function(newAttr) { return _this2.onNewAttr(newAttr); } }), React.createElement("span", { style: styles.colon }, ":"), React.createElement(AutoSizeInput, { value: "", onChange: function(val) { return _this2.onNewSubmit(val); } }), React.createElement("span", { style: styles.colon }, ";")), React.createElement("span", null, "}")); } } ]), StyleEdit; }(React.Component); StyleEdit.contextTypes = { theme: PropTypes.object.isRequired }; var blockClick = function(event) { return event.stopPropagation(); }, tagStyle = function(theme) { return { color: theme.base04 }; }, styles = { list: { listStyle: "none", padding: 0, margin: "5px 0px", cursor: "text" }, colon: { margin: "-3px" }, listItem: { margin: 0, display: "flex", alignItems: "center", cursor: "default" } }; module.exports = StyleEdit; }, function(module, exports, __webpack_require__) { "use strict"; 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 || "object" != typeof call && "function" != typeof call ? self : call; } function _inherits(subClass, superClass) { if ("function" != typeof superClass && null !== superClass) 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: !1, writable: !0, configurable: !0 } }), superClass && (Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass); } var _createClass = function() { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0, "value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor); } } return function(Constructor, protoProps, staticProps) { return protoProps && defineProperties(Constructor.prototype, protoProps), staticProps && defineProperties(Constructor, staticProps), Constructor; }; }(), PropTypes = __webpack_require__(7), React = __webpack_require__(12), nullthrows = __webpack_require__(3)["default"], _require = __webpack_require__(17), monospace = _require.monospace, Input = __webpack_require__(23), AutoSizeInput = function(_React$Component) { function AutoSizeInput(props, context) { _classCallCheck(this, AutoSizeInput); var _this = _possibleConstructorReturn(this, (AutoSizeInput.__proto__ || Object.getPrototypeOf(AutoSizeInput)).call(this, props, context)); return _this.state = { text: "" + _this.props.value, inputWidth: 1 }, _this; } return _inherits(AutoSizeInput, _React$Component), _createClass(AutoSizeInput, [ { key: "componentDidMount", value: function() { this.copyInputStyles(), this.updateInputWidth(), this.props.isNew && this.input.focus(); } }, { key: "componentDidUpdate", value: function(prevProps, prevState) { this.updateInputWidth(); } }, { key: "componentWillReceiveProps", value: function(nextProps) { this.setState({ text: "" + nextProps.value }); } }, { key: "copyInputStyles", value: function() { if (window.getComputedStyle) { var inputStyle = this.input && window.getComputedStyle(this.input); if (inputStyle) { var sizerNode = nullthrows(this.sizer); sizerNode.style.fontSize = inputStyle.fontSize, sizerNode.style.fontFamily = inputStyle.fontFamily, sizerNode.style.fontWeight = inputStyle.fontWeight, sizerNode.style.fontStyle = inputStyle.fontStyle, sizerNode.style.letterSpacing = inputStyle.letterSpacing; } } } }, { key: "updateInputWidth", value: function() { if (this.sizer && "undefined" != typeof this.sizer.scrollWidth) { var width = this.sizer.scrollWidth + 1; width !== this.state.inputWidth && this.setState({ inputWidth: width }); } } }, { key: "onKeyDown", value: function(e) { return "Enter" === e.key || "Escape" === e.key ? void this.done() : void ("ArrowUp" === e.key ? +this.state.text + "" === this.state.text && this.props.onChange(+this.state.text + 1) : "ArrowDown" === e.key && +this.state.text + "" === this.state.text && this.props.onChange(+this.state.text - 1)); } }, { key: "onFocus", value: function() { var theme = this.context.theme, input = this.input; input.selectionStart = 0, input.selectionEnd = input.value.length, input.style.color = theme.base05, input.style.boxShadow = "0 0 3px " + theme.base03, input.style.border = "1px solid " + theme.base03, input.style.padding = "0px 1px"; } }, { key: "done", value: function() { var input = this.input; input.style.color = this.getColor(), input.style.boxShadow = "none", input.style.border = "none", input.style.padding = "1px 2px", (this.state.text !== "" + this.props.value || this.props.isNew) && this.props.onChange(this.state.text); } }, { key: "getColor", value: function() { var theme = this.context.theme; return "attr" === this.props.type ? theme.special06 : theme.base05; } }, { key: "render", value: function() { var _this2 = this, style = inputStyle(this.state.text); return style.color = this.getColor(), style.width = this.state.inputWidth + "px", React.createElement("div", { style: styles.wrapper }, React.createElement(Input, { innerRef: function(i) { return _this2.input = i; }, value: this.state.text, style: style, onChange: function(e) { return _this2.setState({ text: e.target.value }); }, onFocus: function() { return _this2.onFocus(); }, onBlur: function() { return _this2.done(); }, onKeyDown: function(e) { return _this2.onKeyDown(e); } }), React.createElement("div", { ref: function(el) { return _this2.sizer = el; }, style: styles.sizer }, this.state.text)); } } ]), AutoSizeInput; }(React.Component); AutoSizeInput.contextTypes = { theme: PropTypes.object.isRequired }; var inputStyle = function(text) { return { fontFamily: monospace.family, fontSize: monospace.sizes.normal, boxSizing: "content-box", border: "none", padding: "1px 2px", marginLeft: "0.75rem", outline: "none", width: "0px", minWidth: text ? "0" : "1rem" }; }, styles = { wrapper: { display: "inline-block" }, sizer: { position: "absolute", top: 0, left: 0, visibility: "hidden", height: 0, overflow: "scroll", whiteSpace: "pre" } }; module.exports = AutoSizeInput; }, function(module, exports, __webpack_require__) { "use strict"; 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 || "object" != typeof call && "function" != typeof call ? self : call; } function _inherits(subClass, superClass) { if ("function" != typeof superClass && null !== superClass) 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: !1, writable: !0, configurable: !0 } }), superClass && (Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass); } var _extends = Object.assign || function(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) Object.prototype.hasOwnProperty.call(source, key) && (target[key] = source[key]); } return target; }, _createClass = function() { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0, "value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor); } } return function(Constructor, protoProps, staticProps) { return protoProps && defineProperties(Constructor.prototype, protoProps), staticProps && defineProperties(Constructor, staticProps), Constructor; }; }(), PropTypes = __webpack_require__(7), React = __webpack_require__(12), _require = __webpack_require__(17), sansSerif = _require.sansSerif, Box = function(props) { var title = props.title, children = props.children, top = props.top, left = props.left, right = props.right, bottom = props.bottom, theme = props.theme; return React.createElement("div", { style: boxStyle(theme) }, React.createElement("span", { style: labelStyle(theme) }, title), React.createElement("div", { style: styles.boxText }, +top.toFixed(3)), React.createElement("div", { style: styles.row }, React.createElement("span", { style: styles.boxText }, +left.toFixed(3)), children, React.createElement("span", { style: styles.boxText }, +right.toFixed(3))), React.createElement("div", { style: styles.boxText }, +bottom.toFixed(3))); }, BoxInspector = function(_React$Component) { function BoxInspector() { return _classCallCheck(this, BoxInspector), _possibleConstructorReturn(this, (BoxInspector.__proto__ || Object.getPrototypeOf(BoxInspector)).apply(this, arguments)); } return _inherits(BoxInspector, _React$Component), _createClass(BoxInspector, [ { key: "render", value: function() { var theme = this.context.theme, _props = this.props, left = _props.left, top = _props.top, width = _props.width, height = _props.height, margin = _props.margin, padding = _props.padding; return React.createElement(Box, _extends({ theme: theme, title: "margin" }, margin), React.createElement(Box, _extends({ theme: theme, title: "padding" }, padding), React.createElement("div", { style: styles.measureLayout }, React.createElement("span", { style: positionTextStyle(theme) }, "(", +left.toFixed(3), ", ", +top.toFixed(3), ")"), React.createElement("span", { style: dimenTextStyle(theme) }, +width.toFixed(3), " × ", +height.toFixed(3))))); } } ]), BoxInspector; }(React.Component); BoxInspector.contextTypes = { theme: PropTypes.object.isRequired }; var labelStyle = function(theme) { return { flex: 1, color: theme.special03 }; }, positionTextStyle = function(theme) { return { color: theme.base03, fontSize: sansSerif.sizes.normal, textAlign: "center" }; }, dimenTextStyle = function(theme) { return { color: theme.special02, textAlign: "center" }; }, boxStyle = function(theme) { return { position: "relative", padding: 8, margin: 8, width: 184, border: "1px dashed " + theme.base05, alignItems: "center", alignSelf: "center" }; }, styles = { row: { display: "flex", alignItems: "center", justifyContent: "space-between" }, measureLayout: { display: "flex", flexDirection: "column", margin: 4 }, boxText: { textAlign: "center" } }; module.exports = BoxInspector; }, function(module, exports, __webpack_require__) { "use strict"; function _classCallCheck(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 || !1, descriptor.configurable = !0, "value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor); } } return function(Constructor, protoProps, staticProps) { return protoProps && defineProperties(Constructor.prototype, protoProps), staticProps && defineProperties(Constructor, staticProps), Constructor; }; }(), React = __webpack_require__(12), provideStore = __webpack_require__(347), ProfilerStore = __webpack_require__(348), ProfilerTab = __webpack_require__(356)["default"], StoreWrapper = provideStore("profilerStore"), ProfilerPlugin = function() { function ProfilerPlugin(store, bridge, refresh) { var _this = this; _classCallCheck(this, ProfilerPlugin), this.bridge = bridge, this.store = store, this.profilingIsSupported = !1, this.profilerStore = new ProfilerStore(bridge, store), bridge.onCall("profiler:update", function(profilingIsSupported) { _this.profilingIsSupported !== profilingIsSupported && (_this.profilingIsSupported = profilingIsSupported, refresh()); }); } return _createClass(ProfilerPlugin, [ { key: "panes", value: function() { return []; } }, { key: "teardown", value: function() {} }, { key: "tabs", value: function() { var _this2 = this; return this.profilingIsSupported ? { Profiler: function() { return React.createElement(StoreWrapper, { store: _this2.profilerStore }, function() { return React.createElement(ProfilerTab, null); }); } } : null; } } ]), ProfilerPlugin; }(); module.exports = ProfilerPlugin; }, function(module, exports, __webpack_require__) { "use strict"; function _defineProperty(obj, key, value) { return key in obj ? Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }) : obj[key] = value, 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 || "object" != typeof call && "function" != typeof call ? self : call; } function _inherits(subClass, superClass) { if ("function" != typeof superClass && null !== superClass) 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: !1, writable: !0, configurable: !0 } }), superClass && (Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass); } var _createClass = function() { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0, "value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor); } } return function(Constructor, protoProps, staticProps) { return protoProps && defineProperties(Constructor.prototype, protoProps), staticProps && defineProperties(Constructor, staticProps), Constructor; }; }(), PropTypes = __webpack_require__(7), React = __webpack_require__(12); module.exports = function(name) { var Wrapper = function(_React$Component) { function Wrapper() { return _classCallCheck(this, Wrapper), _possibleConstructorReturn(this, (Wrapper.__proto__ || Object.getPrototypeOf(Wrapper)).apply(this, arguments)); } return _inherits(Wrapper, _React$Component), _createClass(Wrapper, [ { key: "getChildContext", value: function() { return _defineProperty({}, name, this.props.store); } }, { key: "render", value: function() { return this.props.children(); } } ]), Wrapper; }(React.Component); return Wrapper.childContextTypes = _defineProperty({}, name, PropTypes.object), Wrapper.displayName = "StoreProvider(" + name + ")", Wrapper; }; }, function(module, exports, __webpack_require__) { "use strict"; 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 || "object" != typeof call && "function" != typeof call ? self : call; } function _inherits(subClass, superClass) { if ("function" != typeof superClass && null !== superClass) 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: !1, writable: !0, configurable: !0 } }), superClass && (Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass); } var _createClass = function() { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0, "value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor); } } return function(Constructor, protoProps, staticProps) { return protoProps && defineProperties(Constructor.prototype, protoProps), staticProps && defineProperties(Constructor, staticProps), Constructor; }; }(), _require = __webpack_require__(317), List = _require.List, _require2 = __webpack_require__(328), EventEmitter = _require2.EventEmitter, _require3 = __webpack_require__(332), get = _require3.get, set = _require3.set, LRU = __webpack_require__(349), LOCAL_STORAGE_COMMIT_THRESHOLD = "profiler:commitThreshold", LOCAL_STORAGE_HIDE_COMMITS_BELOW_THRESHOLD = "profiler:hideCommitsBelowThreshold", LOCAL_STORAGE_SHOW_NATIVE_NODES_KEY = "profiler:showNativeNodes", ProfilerStore = function(_EventEmitter) { function ProfilerStore(bridge, mainStore) { _classCallCheck(this, ProfilerStore); var _this = _possibleConstructorReturn(this, (ProfilerStore.__proto__ || Object.getPrototypeOf(ProfilerStore)).call(this)); return _this.cachedData = LRU(50), _this.commitThreshold = get(LOCAL_STORAGE_COMMIT_THRESHOLD, 0), _this.hideCommitsBelowThreshold = get(LOCAL_STORAGE_HIDE_COMMITS_BELOW_THRESHOLD, !1), _this.isRecording = !1, _this.isSettingsPanelActive = !1, _this.processedInteractions = {}, _this.rootsToProfilerData = new Map(), _this.roots = new List(), _this.selectedChartType = "flamegraph", _this.selectedRoot = null, _this.showNativeNodes = get(LOCAL_STORAGE_SHOW_NATIVE_NODES_KEY, !1), _this.clearSnapshots = function() { _this.cachedData.reset(), _this.processedInteractions = {}, _this.rootsToProfilerData = new Map(), _this.emit("profilerData", _this.rootsToProfilerData); }, _this.saveRoots = function() { _this.roots = _this._mainStore.roots, _this.emit("roots", _this._mainStore.roots); }, _this.setCommitThrehsold = function(commitThreshold) { _this.commitThreshold = commitThreshold, _this.emit("commitThreshold", commitThreshold), set(LOCAL_STORAGE_COMMIT_THRESHOLD, commitThreshold); }, _this.storeSnapshot = function() { _this._mainStore.snapshotQueue.forEach(function(snapshot) { var root = snapshot.root; _this.rootsToProfilerData.has(root) || _this.rootsToProfilerData.set(root, { interactionsToSnapshots: new Map(), snapshots: [], timestampsToInteractions: new Map() }); var _ref = _this.rootsToProfilerData.get(root), interactionsToSnapshots = _ref.interactionsToSnapshots, snapshots = _ref.snapshots, timestampsToInteractions = _ref.timestampsToInteractions; snapshots.push(snapshot), snapshot.memoizedInteractions = snapshot.memoizedInteractions.map(function(interaction) { return _this.processInteraction(interaction); }), snapshot.memoizedInteractions.forEach(function(interaction) { interactionsToSnapshots.has(interaction) ? interactionsToSnapshots.get(interaction).add(snapshot) : interactionsToSnapshots.set(interaction, new Set([ snapshot ])), timestampsToInteractions.has(interaction.timestamp) ? timestampsToInteractions.get(interaction.timestamp).add(interaction) : timestampsToInteractions.set(interaction.timestamp, new Set([ interaction ])); }); }), _this._mainStore.snapshotQueue.length = 0, _this.emit("profilerData", _this.rootsToProfilerData); }, _this.updateSelected = function() { for (var currentID = _this._mainStore.selected; ;) { var parentID = _this._mainStore.getParent(currentID); if (null == parentID) break; currentID = parentID; } _this.selectedRoot = currentID, _this.emit("selectedRoot", _this.selectedRoot); }, _this._bridge = bridge, _this._mainStore = mainStore, _this._mainStore.on("clearSnapshots", _this.clearSnapshots), _this._mainStore.on("roots", _this.saveRoots), _this._mainStore.on("selected", _this.updateSelected), _this._mainStore.on("storeSnapshot", _this.storeSnapshot), _this; } return _inherits(ProfilerStore, _EventEmitter), _createClass(ProfilerStore, [ { key: "off", value: function() {} }, { key: "cacheDataForSnapshot", value: function(snapshotIndex, snapshotRootID, key, data) { this.cachedData.set(snapshotIndex + "-" + snapshotRootID + "-" + key, data); } }, { key: "cacheInteractionData", value: function(rootID, data) { this.cachedData.set(rootID + "-interactions", data); } }, { key: "getCachedDataForSnapshot", value: function(snapshotIndex, snapshotRootID, key) { return this.cachedData.get(snapshotIndex + "-" + snapshotRootID + "-" + key) || null; } }, { key: "getCachedInteractionData", value: function(rootID) { return this.cachedData.get(rootID + "-interactions") || null; } }, { key: "processInteraction", value: function(interaction) { var key = interaction.name + " at " + interaction.timestamp; return this.processedInteractions.hasOwnProperty(key) ? this.processedInteractions[key] : (this.processedInteractions[key] = interaction, interaction); } }, { key: "setHideCommitsBelowThreshold", value: function(hideCommitsBelowThreshold) { this.hideCommitsBelowThreshold = hideCommitsBelowThreshold, this.emit("hideCommitsBelowThreshold", hideCommitsBelowThreshold), set(LOCAL_STORAGE_HIDE_COMMITS_BELOW_THRESHOLD, hideCommitsBelowThreshold); } }, { key: "setIsRecording", value: function(isRecording) { this.isRecording = isRecording, this.emit("isRecording", isRecording), this._mainStore.setIsRecording(isRecording); } }, { key: "setIsSettingsPanelActive", value: function(isSettingsPanelActive) { this.isSettingsPanelActive = isSettingsPanelActive, this.emit("isSettingsPanelActive", isSettingsPanelActive); } }, { key: "setSelectedChartType", value: function(selectedChartType) { this.selectedChartType = selectedChartType, this.emit("selectedChartType", selectedChartType); } }, { key: "setShowNativeNodes", value: function(showNativeNodes) { this.showNativeNodes = showNativeNodes, this.emit("showNativeNodes", showNativeNodes), set(LOCAL_STORAGE_SHOW_NATIVE_NODES_KEY, showNativeNodes); } } ]), ProfilerStore; }(EventEmitter); module.exports = ProfilerStore; }, function(module, exports, __webpack_require__) { "use strict"; function naiveLength() { return 1; } function LRUCache(options) { if (!(this instanceof LRUCache)) return new LRUCache(options); "number" == typeof options && (options = { max: options }), options || (options = {}); var max = this[MAX] = options.max; (!max || "number" != typeof max || max <= 0) && (this[MAX] = 1 / 0); var lc = options.length || naiveLength; "function" != typeof lc && (lc = naiveLength), this[LENGTH_CALCULATOR] = lc, this[ALLOW_STALE] = options.stale || !1, this[MAX_AGE] = options.maxAge || 0, this[DISPOSE] = options.dispose, this[NO_DISPOSE_ON_SET] = options.noDisposeOnSet || !1, this.reset(); } function forEachStep(self, fn, node, thisp) { var hit = node.value; isStale(self, hit) && (del(self, node), self[ALLOW_STALE] || (hit = void 0)), hit && fn.call(thisp, hit.value, hit.key, self); } function get(self, key, doUse) { var node = self[CACHE].get(key); if (node) { var hit = node.value; isStale(self, hit) ? (del(self, node), self[ALLOW_STALE] || (hit = void 0)) : doUse && self[LRU_LIST].unshiftNode(node), hit && (hit = hit.value); } return hit; } function isStale(self, hit) { if (!hit || !hit.maxAge && !self[MAX_AGE]) return !1; var stale = !1, diff = Date.now() - hit.now; return stale = hit.maxAge ? diff > hit.maxAge : self[MAX_AGE] && diff > self[MAX_AGE]; } function trim(self) { if (self[LENGTH] > self[MAX]) for (var walker = self[LRU_LIST].tail; self[LENGTH] > self[MAX] && null !== walker; ) { var prev = walker.prev; del(self, walker), walker = prev; } } function del(self, node) { if (node) { var hit = node.value; self[DISPOSE] && self[DISPOSE](hit.key, hit.value), self[LENGTH] -= hit.length, self[CACHE]["delete"](hit.key), self[LRU_LIST].removeNode(node); } } function Entry(key, value, length, now, maxAge) { this.key = key, this.value = value, this.length = length, this.now = now, this.maxAge = maxAge || 0; } module.exports = LRUCache; var makeSymbol, Map = __webpack_require__(350), util = __webpack_require__(352), Yallist = __webpack_require__(355), hasSymbol = "function" == typeof Symbol; makeSymbol = hasSymbol ? function(key) { return Symbol(key); } : function(key) { return "_" + key; }; var MAX = makeSymbol("max"), LENGTH = makeSymbol("length"), LENGTH_CALCULATOR = makeSymbol("lengthCalculator"), ALLOW_STALE = makeSymbol("allowStale"), MAX_AGE = makeSymbol("maxAge"), DISPOSE = makeSymbol("dispose"), NO_DISPOSE_ON_SET = makeSymbol("noDisposeOnSet"), LRU_LIST = makeSymbol("lruList"), CACHE = makeSymbol("cache"); Object.defineProperty(LRUCache.prototype, "max", { set: function(mL) { (!mL || "number" != typeof mL || mL <= 0) && (mL = 1 / 0), this[MAX] = mL, trim(this); }, get: function() { return this[MAX]; }, enumerable: !0 }), Object.defineProperty(LRUCache.prototype, "allowStale", { set: function(allowStale) { this[ALLOW_STALE] = !!allowStale; }, get: function() { return this[ALLOW_STALE]; }, enumerable: !0 }), Object.defineProperty(LRUCache.prototype, "maxAge", { set: function(mA) { (!mA || "number" != typeof mA || mA < 0) && (mA = 0), this[MAX_AGE] = mA, trim(this); }, get: function() { return this[MAX_AGE]; }, enumerable: !0 }), Object.defineProperty(LRUCache.prototype, "lengthCalculator", { set: function(lC) { "function" != typeof lC && (lC = naiveLength), lC !== this[LENGTH_CALCULATOR] && (this[LENGTH_CALCULATOR] = lC, this[LENGTH] = 0, this[LRU_LIST].forEach(function(hit) { hit.length = this[LENGTH_CALCULATOR](hit.value, hit.key), this[LENGTH] += hit.length; }, this)), trim(this); }, get: function() { return this[LENGTH_CALCULATOR]; }, enumerable: !0 }), Object.defineProperty(LRUCache.prototype, "length", { get: function() { return this[LENGTH]; }, enumerable: !0 }), Object.defineProperty(LRUCache.prototype, "itemCount", { get: function() { return this[LRU_LIST].length; }, enumerable: !0 }), LRUCache.prototype.rforEach = function(fn, thisp) { thisp = thisp || this; for (var walker = this[LRU_LIST].tail; null !== walker; ) { var prev = walker.prev; forEachStep(this, fn, walker, thisp), walker = prev; } }, LRUCache.prototype.forEach = function(fn, thisp) { thisp = thisp || this; for (var walker = this[LRU_LIST].head; null !== walker; ) { var next = walker.next; forEachStep(this, fn, walker, thisp), walker = next; } }, LRUCache.prototype.keys = function() { return this[LRU_LIST].toArray().map(function(k) { return k.key; }, this); }, LRUCache.prototype.values = function() { return this[LRU_LIST].toArray().map(function(k) { return k.value; }, this); }, LRUCache.prototype.reset = function() { this[DISPOSE] && this[LRU_LIST] && this[LRU_LIST].length && this[LRU_LIST].forEach(function(hit) { this[DISPOSE](hit.key, hit.value); }, this), this[CACHE] = new Map(), this[LRU_LIST] = new Yallist(), this[LENGTH] = 0; }, LRUCache.prototype.dump = function() { return this[LRU_LIST].map(function(hit) { if (!isStale(this, hit)) return { k: hit.key, v: hit.value, e: hit.now + (hit.maxAge || 0) }; }, this).toArray().filter(function(h) { return h; }); }, LRUCache.prototype.dumpLru = function() { return this[LRU_LIST]; }, LRUCache.prototype.inspect = function(n, opts) { var str = "LRUCache {", extras = !1, as = this[ALLOW_STALE]; as && (str += "\n allowStale: true", extras = !0); var max = this[MAX]; max && max !== 1 / 0 && (extras && (str += ","), str += "\n max: " + util.inspect(max, opts), extras = !0); var maxAge = this[MAX_AGE]; maxAge && (extras && (str += ","), str += "\n maxAge: " + util.inspect(maxAge, opts), extras = !0); var lc = this[LENGTH_CALCULATOR]; lc && lc !== naiveLength && (extras && (str += ","), str += "\n length: " + util.inspect(this[LENGTH], opts), extras = !0); var didFirst = !1; return this[LRU_LIST].forEach(function(item) { didFirst ? str += ",\n " : (extras && (str += ",\n"), didFirst = !0, str += "\n "); var key = util.inspect(item.key).split("\n").join("\n "), val = { value: item.value }; item.maxAge !== maxAge && (val.maxAge = item.maxAge), lc !== naiveLength && (val.length = item.length), isStale(this, item) && (val.stale = !0), val = util.inspect(val, opts).split("\n").join("\n "), str += key + " => " + val; }), (didFirst || extras) && (str += "\n"), str += "}"; }, LRUCache.prototype.set = function(key, value, maxAge) { maxAge = maxAge || this[MAX_AGE]; var now = maxAge ? Date.now() : 0, len = this[LENGTH_CALCULATOR](value, key); if (this[CACHE].has(key)) { if (len > this[MAX]) return del(this, this[CACHE].get(key)), !1; var node = this[CACHE].get(key), item = node.value; return this[DISPOSE] && (this[NO_DISPOSE_ON_SET] || this[DISPOSE](key, item.value)), item.now = now, item.maxAge = maxAge, item.value = value, this[LENGTH] += len - item.length, item.length = len, this.get(key), trim(this), !0; } var hit = new Entry(key, value, len, now, maxAge); return hit.length > this[MAX] ? (this[DISPOSE] && this[DISPOSE](key, value), !1) : (this[LENGTH] += hit.length, this[LRU_LIST].unshift(hit), this[CACHE].set(key, this[LRU_LIST].head), trim(this), !0); }, LRUCache.prototype.has = function(key) { if (!this[CACHE].has(key)) return !1; var hit = this[CACHE].get(key).value; return !isStale(this, hit); }, LRUCache.prototype.get = function(key) { return get(this, key, !0); }, LRUCache.prototype.peek = function(key) { return get(this, key, !1); }, LRUCache.prototype.pop = function() { var node = this[LRU_LIST].tail; return node ? (del(this, node), node.value) : null; }, LRUCache.prototype.del = function(key) { del(this, this[CACHE].get(key)); }, LRUCache.prototype.load = function(arr) { this.reset(); for (var now = Date.now(), l = arr.length - 1; l >= 0; l--) { var hit = arr[l], expiresAt = hit.e || 0; if (0 === expiresAt) this.set(hit.k, hit.v); else { var maxAge = expiresAt - now; maxAge > 0 && this.set(hit.k, hit.v, maxAge); } } }, LRUCache.prototype.prune = function() { var self = this; this[CACHE].forEach(function(value, key) { get(self, key, !1); }); }; }, function(module, exports, __webpack_require__) { (function(process) { "pseudomap" === process.env.npm_package_name && "test" === process.env.npm_lifecycle_script && (process.env.TEST_PSEUDOMAP = "true"), "function" != typeof Map || process.env.TEST_PSEUDOMAP ? module.exports = __webpack_require__(351) : module.exports = Map; }).call(exports, __webpack_require__(72)); }, function(module, exports) { function PseudoMap(set) { if (!(this instanceof PseudoMap)) throw new TypeError("Constructor PseudoMap requires 'new'"); if (this.clear(), set) if (set instanceof PseudoMap || "function" == typeof Map && set instanceof Map) set.forEach(function(value, key) { this.set(key, value); }, this); else { if (!Array.isArray(set)) throw new TypeError("invalid argument"); set.forEach(function(kv) { this.set(kv[0], kv[1]); }, this); } } function same(a, b) { return a === b || a !== a && b !== b; } function Entry(k, v, i) { this.key = k, this.value = v, this._index = i; } function find(data, k) { for (var i = 0, s = "_" + k, key = s; hasOwnProperty.call(data, key); key = s + i++) if (same(data[key].key, k)) return data[key]; } function set(data, k, v) { for (var i = 0, s = "_" + k, key = s; hasOwnProperty.call(data, key); key = s + i++) if (same(data[key].key, k)) return void (data[key].value = v); data.size++, data[key] = new Entry(k, v, key); } var hasOwnProperty = Object.prototype.hasOwnProperty; module.exports = PseudoMap, PseudoMap.prototype.forEach = function(fn, thisp) { thisp = thisp || this, Object.keys(this._data).forEach(function(k) { "size" !== k && fn.call(thisp, this._data[k].value, this._data[k].key); }, this); }, PseudoMap.prototype.has = function(k) { return !!find(this._data, k); }, PseudoMap.prototype.get = function(k) { var res = find(this._data, k); return res && res.value; }, PseudoMap.prototype.set = function(k, v) { set(this._data, k, v); }, PseudoMap.prototype["delete"] = function(k) { var res = find(this._data, k); res && (delete this._data[res._index], this._data.size--); }, PseudoMap.prototype.clear = function() { var data = Object.create(null); data.size = 0, Object.defineProperty(this, "_data", { value: data, enumerable: !1, configurable: !0, writable: !1 }); }, Object.defineProperty(PseudoMap.prototype, "size", { get: function() { return this._data.size; }, set: function(n) {}, enumerable: !0, configurable: !0 }), PseudoMap.prototype.values = PseudoMap.prototype.keys = PseudoMap.prototype.entries = function() { throw new Error("iterators are not implemented in this version"); }; }, function(module, exports, __webpack_require__) { (function(global, process) { function inspect(obj, opts) { var ctx = { seen: [], stylize: stylizeNoColor }; return arguments.length >= 3 && (ctx.depth = arguments[2]), arguments.length >= 4 && (ctx.colors = arguments[3]), isBoolean(opts) ? ctx.showHidden = opts : opts && exports._extend(ctx, opts), isUndefined(ctx.showHidden) && (ctx.showHidden = !1), isUndefined(ctx.depth) && (ctx.depth = 2), isUndefined(ctx.colors) && (ctx.colors = !1), isUndefined(ctx.customInspect) && (ctx.customInspect = !0), ctx.colors && (ctx.stylize = stylizeWithColor), formatValue(ctx, obj, ctx.depth); } function stylizeWithColor(str, styleType) { var style = inspect.styles[styleType]; return style ? "[" + inspect.colors[style][0] + "m" + str + "[" + inspect.colors[style][1] + "m" : str; } function stylizeNoColor(str, styleType) { return str; } function arrayToHash(array) { var hash = {}; return array.forEach(function(val, idx) { hash[val] = !0; }), hash; } function formatValue(ctx, value, recurseTimes) { if (ctx.customInspect && value && isFunction(value.inspect) && value.inspect !== exports.inspect && (!value.constructor || value.constructor.prototype !== value)) { var ret = value.inspect(recurseTimes, ctx); return isString(ret) || (ret = formatValue(ctx, ret, recurseTimes)), ret; } var primitive = formatPrimitive(ctx, value); if (primitive) return primitive; var keys = Object.keys(value), visibleKeys = arrayToHash(keys); if (ctx.showHidden && (keys = Object.getOwnPropertyNames(value)), isError(value) && (keys.indexOf("message") >= 0 || keys.indexOf("description") >= 0)) return formatError(value); if (0 === keys.length) { if (isFunction(value)) { var name = value.name ? ": " + value.name : ""; return ctx.stylize("[Function" + name + "]", "special"); } if (isRegExp(value)) return ctx.stylize(RegExp.prototype.toString.call(value), "regexp"); if (isDate(value)) return ctx.stylize(Date.prototype.toString.call(value), "date"); if (isError(value)) return formatError(value); } var base = "", array = !1, braces = [ "{", "}" ]; if (isArray(value) && (array = !0, braces = [ "[", "]" ]), isFunction(value)) { var n = value.name ? ": " + value.name : ""; base = " [Function" + n + "]"; } if (isRegExp(value) && (base = " " + RegExp.prototype.toString.call(value)), isDate(value) && (base = " " + Date.prototype.toUTCString.call(value)), isError(value) && (base = " " + formatError(value)), 0 === keys.length && (!array || 0 == value.length)) return braces[0] + base + braces[1]; if (recurseTimes < 0) return isRegExp(value) ? ctx.stylize(RegExp.prototype.toString.call(value), "regexp") : ctx.stylize("[Object]", "special"); ctx.seen.push(value); var output; return output = array ? formatArray(ctx, value, recurseTimes, visibleKeys, keys) : keys.map(function(key) { return formatProperty(ctx, value, recurseTimes, visibleKeys, key, array); }), ctx.seen.pop(), reduceToSingleString(output, base, braces); } function formatPrimitive(ctx, value) { if (isUndefined(value)) return ctx.stylize("undefined", "undefined"); if (isString(value)) { var simple = "'" + JSON.stringify(value).replace(/^"|"$/g, "").replace(/'/g, "\\'").replace(/\\"/g, '"') + "'"; return ctx.stylize(simple, "string"); } return isNumber(value) ? ctx.stylize("" + value, "number") : isBoolean(value) ? ctx.stylize("" + value, "boolean") : isNull(value) ? ctx.stylize("null", "null") : void 0; } function formatError(value) { return "[" + Error.prototype.toString.call(value) + "]"; } function formatArray(ctx, value, recurseTimes, visibleKeys, keys) { for (var output = [], i = 0, l = value.length; i < l; ++i) hasOwnProperty(value, String(i)) ? output.push(formatProperty(ctx, value, recurseTimes, visibleKeys, String(i), !0)) : output.push(""); return keys.forEach(function(key) { key.match(/^\d+$/) || output.push(formatProperty(ctx, value, recurseTimes, visibleKeys, key, !0)); }), output; } function formatProperty(ctx, value, recurseTimes, visibleKeys, key, array) { var name, str, desc; if (desc = Object.getOwnPropertyDescriptor(value, key) || { value: value[key] }, desc.get ? str = desc.set ? ctx.stylize("[Getter/Setter]", "special") : ctx.stylize("[Getter]", "special") : desc.set && (str = ctx.stylize("[Setter]", "special")), hasOwnProperty(visibleKeys, key) || (name = "[" + key + "]"), str || (ctx.seen.indexOf(desc.value) < 0 ? (str = isNull(recurseTimes) ? formatValue(ctx, desc.value, null) : formatValue(ctx, desc.value, recurseTimes - 1), str.indexOf("\n") > -1 && (str = array ? str.split("\n").map(function(line) { return " " + line; }).join("\n").substr(2) : "\n" + str.split("\n").map(function(line) { return " " + line; }).join("\n"))) : str = ctx.stylize("[Circular]", "special")), isUndefined(name)) { if (array && key.match(/^\d+$/)) return str; name = JSON.stringify("" + key), name.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/) ? (name = name.substr(1, name.length - 2), name = ctx.stylize(name, "name")) : (name = name.replace(/'/g, "\\'").replace(/\\"/g, '"').replace(/(^"|"$)/g, "'"), name = ctx.stylize(name, "string")); } return name + ": " + str; } function reduceToSingleString(output, base, braces) { var numLinesEst = 0, length = output.reduce(function(prev, cur) { return numLinesEst++, cur.indexOf("\n") >= 0 && numLinesEst++, prev + cur.replace(/\u001b\[\d\d?m/g, "").length + 1; }, 0); return length > 60 ? braces[0] + ("" === base ? "" : base + "\n ") + " " + output.join(",\n ") + " " + braces[1] : braces[0] + base + " " + output.join(", ") + " " + braces[1]; } function isArray(ar) { return Array.isArray(ar); } function isBoolean(arg) { return "boolean" == typeof arg; } function isNull(arg) { return null === arg; } function isNullOrUndefined(arg) { return null == arg; } function isNumber(arg) { return "number" == typeof arg; } function isString(arg) { return "string" == typeof arg; } function isSymbol(arg) { return "symbol" == typeof arg; } function isUndefined(arg) { return void 0 === arg; } function isRegExp(re) { return isObject(re) && "[object RegExp]" === objectToString(re); } function isObject(arg) { return "object" == typeof arg && null !== arg; } function isDate(d) { return isObject(d) && "[object Date]" === objectToString(d); } function isError(e) { return isObject(e) && ("[object Error]" === objectToString(e) || e instanceof Error); } function isFunction(arg) { return "function" == typeof arg; } function isPrimitive(arg) { return null === arg || "boolean" == typeof arg || "number" == typeof arg || "string" == typeof arg || "symbol" == typeof arg || "undefined" == typeof arg; } function objectToString(o) { return Object.prototype.toString.call(o); } function pad(n) { return n < 10 ? "0" + n.toString(10) : n.toString(10); } function timestamp() { var d = new Date(), time = [ pad(d.getHours()), pad(d.getMinutes()), pad(d.getSeconds()) ].join(":"); return [ d.getDate(), months[d.getMonth()], time ].join(" "); } function hasOwnProperty(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); } var formatRegExp = /%[sdj%]/g; exports.format = function(f) { if (!isString(f)) { for (var objects = [], i = 0; i < arguments.length; i++) objects.push(inspect(arguments[i])); return objects.join(" "); } for (var i = 1, args = arguments, len = args.length, str = String(f).replace(formatRegExp, function(x) { if ("%%" === x) return "%"; if (i >= len) return x; switch (x) { case "%s": return String(args[i++]); case "%d": return Number(args[i++]); case "%j": try { return JSON.stringify(args[i++]); } catch (_) { return "[Circular]"; } default: return x; } }), x = args[i]; i < len; x = args[++i]) str += isNull(x) || !isObject(x) ? " " + x : " " + inspect(x); return str; }, exports.deprecate = function(fn, msg) { function deprecated() { if (!warned) { if (process.throwDeprecation) throw new Error(msg); process.traceDeprecation ? console.trace(msg) : console.error(msg), warned = !0; } return fn.apply(this, arguments); } if (isUndefined(global.process)) return function() { return exports.deprecate(fn, msg).apply(this, arguments); }; if (process.noDeprecation === !0) return fn; var warned = !1; return deprecated; }; var debugEnviron, debugs = {}; exports.debuglog = function(set) { if (isUndefined(debugEnviron) && (debugEnviron = process.env.NODE_DEBUG || ""), set = set.toUpperCase(), !debugs[set]) if (new RegExp("\\b" + set + "\\b", "i").test(debugEnviron)) { var pid = process.pid; debugs[set] = function() { var msg = exports.format.apply(exports, arguments); console.error("%s %d: %s", set, pid, msg); }; } else debugs[set] = function() {}; return debugs[set]; }, exports.inspect = inspect, inspect.colors = { bold: [ 1, 22 ], italic: [ 3, 23 ], underline: [ 4, 24 ], inverse: [ 7, 27 ], white: [ 37, 39 ], grey: [ 90, 39 ], black: [ 30, 39 ], blue: [ 34, 39 ], cyan: [ 36, 39 ], green: [ 32, 39 ], magenta: [ 35, 39 ], red: [ 31, 39 ], yellow: [ 33, 39 ] }, inspect.styles = { special: "cyan", number: "yellow", "boolean": "yellow", undefined: "grey", "null": "bold", string: "green", date: "magenta", regexp: "red" }, exports.isArray = isArray, exports.isBoolean = isBoolean, exports.isNull = isNull, exports.isNullOrUndefined = isNullOrUndefined, exports.isNumber = isNumber, exports.isString = isString, exports.isSymbol = isSymbol, exports.isUndefined = isUndefined, exports.isRegExp = isRegExp, exports.isObject = isObject, exports.isDate = isDate, exports.isError = isError, exports.isFunction = isFunction, exports.isPrimitive = isPrimitive, exports.isBuffer = __webpack_require__(353); var months = [ "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" ]; exports.log = function() { console.log("%s - %s", timestamp(), exports.format.apply(exports, arguments)); }, exports.inherits = __webpack_require__(354), exports._extend = function(origin, add) { if (!add || !isObject(add)) return origin; for (var keys = Object.keys(add), i = keys.length; i--; ) origin[keys[i]] = add[keys[i]]; return origin; }; }).call(exports, function() { return this; }(), __webpack_require__(72)); }, function(module, exports) { module.exports = function(arg) { return arg && "object" == typeof arg && "function" == typeof arg.copy && "function" == typeof arg.fill && "function" == typeof arg.readUInt8; }; }, function(module, exports) { "function" == typeof Object.create ? module.exports = function(ctor, superCtor) { ctor.super_ = superCtor, ctor.prototype = Object.create(superCtor.prototype, { constructor: { value: ctor, enumerable: !1, writable: !0, configurable: !0 } }); } : module.exports = function(ctor, superCtor) { ctor.super_ = superCtor; var TempCtor = function() {}; TempCtor.prototype = superCtor.prototype, ctor.prototype = new TempCtor(), ctor.prototype.constructor = ctor; }; }, function(module, exports) { function Yallist(list) { var self = this; if (self instanceof Yallist || (self = new Yallist()), self.tail = null, self.head = null, self.length = 0, list && "function" == typeof list.forEach) list.forEach(function(item) { self.push(item); }); else if (arguments.length > 0) for (var i = 0, l = arguments.length; i < l; i++) self.push(arguments[i]); return self; } function push(self, item) { self.tail = new Node(item, self.tail, null, self), self.head || (self.head = self.tail), self.length++; } function unshift(self, item) { self.head = new Node(item, null, self.head, self), self.tail || (self.tail = self.head), self.length++; } function Node(value, prev, next, list) { return this instanceof Node ? (this.list = list, this.value = value, prev ? (prev.next = this, this.prev = prev) : this.prev = null, void (next ? (next.prev = this, this.next = next) : this.next = null)) : new Node(value, prev, next, list); } module.exports = Yallist, Yallist.Node = Node, Yallist.create = Yallist, Yallist.prototype.removeNode = function(node) { if (node.list !== this) throw new Error("removing node which does not belong to this list"); var next = node.next, prev = node.prev; next && (next.prev = prev), prev && (prev.next = next), node === this.head && (this.head = next), node === this.tail && (this.tail = prev), node.list.length--, node.next = null, node.prev = null, node.list = null; }, Yallist.prototype.unshiftNode = function(node) { if (node !== this.head) { node.list && node.list.removeNode(node); var head = this.head; node.list = this, node.next = head, head && (head.prev = node), this.head = node, this.tail || (this.tail = node), this.length++; } }, Yallist.prototype.pushNode = function(node) { if (node !== this.tail) { node.list && node.list.removeNode(node); var tail = this.tail; node.list = this, node.prev = tail, tail && (tail.next = node), this.tail = node, this.head || (this.head = node), this.length++; } }, Yallist.prototype.push = function() { for (var i = 0, l = arguments.length; i < l; i++) push(this, arguments[i]); return this.length; }, Yallist.prototype.unshift = function() { for (var i = 0, l = arguments.length; i < l; i++) unshift(this, arguments[i]); return this.length; }, Yallist.prototype.pop = function() { if (this.tail) { var res = this.tail.value; return this.tail = this.tail.prev, this.tail ? this.tail.next = null : this.head = null, this.length--, res; } }, Yallist.prototype.shift = function() { if (this.head) { var res = this.head.value; return this.head = this.head.next, this.head ? this.head.prev = null : this.tail = null, this.length--, res; } }, Yallist.prototype.forEach = function(fn, thisp) { thisp = thisp || this; for (var walker = this.head, i = 0; null !== walker; i++) fn.call(thisp, walker.value, i, this), walker = walker.next; }, Yallist.prototype.forEachReverse = function(fn, thisp) { thisp = thisp || this; for (var walker = this.tail, i = this.length - 1; null !== walker; i--) fn.call(thisp, walker.value, i, this), walker = walker.prev; }, Yallist.prototype.get = function(n) { for (var i = 0, walker = this.head; null !== walker && i < n; i++) walker = walker.next; if (i === n && null !== walker) return walker.value; }, Yallist.prototype.getReverse = function(n) { for (var i = 0, walker = this.tail; null !== walker && i < n; i++) walker = walker.prev; if (i === n && null !== walker) return walker.value; }, Yallist.prototype.map = function(fn, thisp) { thisp = thisp || this; for (var res = new Yallist(), walker = this.head; null !== walker; ) res.push(fn.call(thisp, walker.value, this)), walker = walker.next; return res; }, Yallist.prototype.mapReverse = function(fn, thisp) { thisp = thisp || this; for (var res = new Yallist(), walker = this.tail; null !== walker; ) res.push(fn.call(thisp, walker.value, this)), walker = walker.prev; return res; }, Yallist.prototype.reduce = function(fn, initial) { var acc, walker = this.head; if (arguments.length > 1) acc = initial; else { if (!this.head) throw new TypeError("Reduce of empty list with no initial value"); walker = this.head.next, acc = this.head.value; } for (var i = 0; null !== walker; i++) acc = fn(acc, walker.value, i), walker = walker.next; return acc; }, Yallist.prototype.reduceReverse = function(fn, initial) { var acc, walker = this.tail; if (arguments.length > 1) acc = initial; else { if (!this.tail) throw new TypeError("Reduce of empty list with no initial value"); walker = this.tail.prev, acc = this.tail.value; } for (var i = this.length - 1; null !== walker; i--) acc = fn(acc, walker.value, i), walker = walker.prev; return acc; }, Yallist.prototype.toArray = function() { for (var arr = new Array(this.length), i = 0, walker = this.head; null !== walker; i++) arr[i] = walker.value, walker = walker.next; return arr; }, Yallist.prototype.toArrayReverse = function() { for (var arr = new Array(this.length), i = 0, walker = this.tail; null !== walker; i++) arr[i] = walker.value, walker = walker.prev; return arr; }, Yallist.prototype.slice = function(from, to) { to = to || this.length, to < 0 && (to += this.length), from = from || 0, from < 0 && (from += this.length); var ret = new Yallist(); if (to < from || to < 0) return ret; from < 0 && (from = 0), to > this.length && (to = this.length); for (var i = 0, walker = this.head; null !== walker && i < from; i++) walker = walker.next; for (;null !== walker && i < to; i++, walker = walker.next) ret.push(walker.value); return ret; }, Yallist.prototype.sliceReverse = function(from, to) { to = to || this.length, to < 0 && (to += this.length), from = from || 0, from < 0 && (from += this.length); var ret = new Yallist(); if (to < from || to < 0) return ret; from < 0 && (from = 0), to > this.length && (to = this.length); for (var i = this.length, walker = this.tail; null !== walker && i > to; i--) walker = walker.prev; for (;null !== walker && i > from; i--, walker = walker.prev) ret.push(walker.value); return ret; }, Yallist.prototype.reverse = function() { for (var head = this.head, tail = this.tail, walker = head; null !== walker; walker = walker.prev) { var p = walker.prev; walker.prev = walker.next, walker.next = p; } return this.head = tail, this.tail = head, this; }; }, function(module, exports, __webpack_require__) { "use strict"; 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 || "object" != typeof call && "function" != typeof call ? self : call; } function _inherits(subClass, superClass) { if ("function" != typeof superClass && null !== superClass) 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: !1, writable: !0, configurable: !0 } }), superClass && (Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass); } Object.defineProperty(exports, "__esModule", { value: !0 }); var _createClass = function() { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0, "value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor); } } return function(Constructor, protoProps, staticProps) { return protoProps && defineProperties(Constructor.prototype, protoProps), staticProps && defineProperties(Constructor, staticProps), Constructor; }; }(), _propTypes = __webpack_require__(7), _propTypes2 = _interopRequireDefault(_propTypes), _react = __webpack_require__(12), _react2 = _interopRequireDefault(_react), _decorate = __webpack_require__(20), _decorate2 = _interopRequireDefault(_decorate), _Fonts = __webpack_require__(17), _constants = __webpack_require__(357), _FiberRenderDurations = __webpack_require__(359), _FiberRenderDurations2 = _interopRequireDefault(_FiberRenderDurations), _InteractionTimeline = __webpack_require__(364), _InteractionTimeline2 = _interopRequireDefault(_InteractionTimeline), _NoProfilingDataMessage = __webpack_require__(366), _NoProfilingDataMessage2 = _interopRequireDefault(_NoProfilingDataMessage), _SnapshotFlamegraph = __webpack_require__(367), _SnapshotFlamegraph2 = _interopRequireDefault(_SnapshotFlamegraph), _SnapshotRanked = __webpack_require__(369), _SnapshotRanked2 = _interopRequireDefault(_SnapshotRanked), _ProfilerTabToolbar = __webpack_require__(370), _ProfilerTabToolbar2 = _interopRequireDefault(_ProfilerTabToolbar), _ProfilerFiberDetailPane = __webpack_require__(373), _ProfilerFiberDetailPane2 = _interopRequireDefault(_ProfilerFiberDetailPane), _ProfilerSnapshotDetailPane = __webpack_require__(374), _ProfilerSnapshotDetailPane2 = _interopRequireDefault(_ProfilerSnapshotDetailPane), _ProfilerInteractionDetailPane = __webpack_require__(375), _ProfilerInteractionDetailPane2 = _interopRequireDefault(_ProfilerInteractionDetailPane), _ProfilerSettings = __webpack_require__(376), _ProfilerSettings2 = _interopRequireDefault(_ProfilerSettings), ProfilerTab = function(_React$Component) { function ProfilerTab() { var _ref, _temp, _this, _ret; _classCallCheck(this, ProfilerTab); for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) args[_key] = arguments[_key]; return _temp = _this = _possibleConstructorReturn(this, (_ref = ProfilerTab.__proto__ || Object.getPrototypeOf(ProfilerTab)).call.apply(_ref, [ this ].concat(args))), _this.state = { isInspectingSelectedFiber: !1, prevIsRecording: _this.props.isRecording, prevSelectedChartType: _this.props.selectedChartType, prevShowNativeNodes: _this.props.showNativeNodes, selectedFiberID: null, selectedFiberName: null, selectedInteraction: null, snapshotIndex: 0 }, _this.deselectFiber = function() { return _this.setState({ selectedFiberID: null, selectedFiberName: null }); }, _this.handleSnapshotSliderChange = function(event) { return _this.setState({ snapshotIndex: parseInt(event.currentTarget.value, 10) }); }, _this.inspectFiber = function(id, name) { return _this.setState({ isInspectingSelectedFiber: !0, selectedFiberID: id, selectedFiberName: name }); }, _this.selectFiber = function(id, name) { return _this.setState({ selectedFiberID: id, selectedFiberName: name }); }, _this.selectInteraction = function(interaction) { return _this.setState({ selectedInteraction: interaction }); }, _this.selectSnapshot = function(snapshot) { return _this.setState({ snapshotIndex: _this.props.snapshots.indexOf(snapshot) }); }, _this.stopInspecting = function() { return _this.setState({ isInspectingSelectedFiber: !1 }); }, _this.toggleInspectingSelectedFiber = function() { return _this.setState(function(state) { return { isInspectingSelectedFiber: !state.isInspectingSelectedFiber }; }); }, _this.viewInteraction = function(interaction) { return _this.setState({ selectedInteraction: interaction }, function() { return _this.props.setSelectedChartType("interactions"); }); }, _this.viewSnapshot = function(snapshot) { return _this.setState({ isInspectingSelectedFiber: !1, selectedFiberID: null, selectedFiberName: null, snapshotIndex: _this.props.snapshots.indexOf(snapshot) }, function() { return _this.props.setSelectedChartType("flamegraph"); }); }, _ret = _temp, _possibleConstructorReturn(_this, _ret); } return _inherits(ProfilerTab, _React$Component), _createClass(ProfilerTab, [ { key: "render", value: function() { var theme = this.context.theme, _props = this.props, cacheDataForSnapshot = _props.cacheDataForSnapshot, cacheInteractionData = _props.cacheInteractionData, commitThreshold = _props.commitThreshold, getCachedDataForSnapshot = _props.getCachedDataForSnapshot, getCachedInteractionData = _props.getCachedInteractionData, hasMultipleRoots = _props.hasMultipleRoots, hideCommitsBelowThreshold = _props.hideCommitsBelowThreshold, interactionsToSnapshots = _props.interactionsToSnapshots, isRecording = _props.isRecording, profilerData = _props.profilerData, selectedChartType = _props.selectedChartType, selectedRootID = _props.selectedRootID, showNativeNodes = _props.showNativeNodes, snapshots = _props.snapshots, timestampsToInteractions = _props.timestampsToInteractions, toggleIsRecording = _props.toggleIsRecording, toggleIsSettingsPanelActive = _props.toggleIsSettingsPanelActive, _state = this.state, isInspectingSelectedFiber = _state.isInspectingSelectedFiber, selectedFiberID = _state.selectedFiberID, selectedFiberName = _state.selectedFiberName, selectedInteraction = _state.selectedInteraction, snapshotIndex = _state.snapshotIndex, snapshot = snapshots[snapshotIndex], snapshotFiber = selectedFiberID && snapshot.nodes.get(selectedFiberID) || null, maxDuration = (0, _constants.getMaxDuration)(snapshots), content = void 0; if (isRecording) content = _react2["default"].createElement(RecordingInProgress, { theme: theme, stopRecording: toggleIsRecording }); else if (null === selectedRootID || null === profilerData) content = _react2["default"].createElement(_NoProfilingDataMessage2["default"], { hasMultipleRoots: hasMultipleRoots, startRecording: toggleIsRecording, theme: theme }); else if (snapshots.length > 0) if (isInspectingSelectedFiber && null !== selectedFiberID) content = _react2["default"].createElement(_FiberRenderDurations2["default"], { commitThreshold: commitThreshold, hideCommitsBelowThreshold: hideCommitsBelowThreshold, selectedFiberID: selectedFiberID, selectedSnapshot: snapshot, selectSnapshot: this.selectSnapshot, snapshotIndex: snapshotIndex, snapshots: snapshots, stopInspecting: this.stopInspecting, theme: theme }); else if ("interactions" === selectedChartType) content = _react2["default"].createElement(_InteractionTimeline2["default"], { cacheInteractionData: cacheInteractionData, getCachedInteractionData: getCachedInteractionData, hasMultipleRoots: hasMultipleRoots, interactionsToSnapshots: interactionsToSnapshots, maxDuration: maxDuration, selectedInteraction: selectedInteraction, selectedSnapshot: snapshot, selectInteraction: this.selectInteraction, theme: theme, timestampsToInteractions: timestampsToInteractions }); else { var ChartComponent = "ranked" === selectedChartType ? _SnapshotRanked2["default"] : _SnapshotFlamegraph2["default"]; content = _react2["default"].createElement(ChartComponent, { cacheDataForSnapshot: cacheDataForSnapshot, deselectFiber: this.deselectFiber, getCachedDataForSnapshot: getCachedDataForSnapshot, inspectFiber: this.inspectFiber, selectedFiberID: selectedFiberID, selectFiber: this.selectFiber, showNativeNodes: showNativeNodes, snapshot: snapshot, snapshotIndex: snapshotIndex, theme: theme }); } else content = _react2["default"].createElement(_NoProfilingDataMessage2["default"], { hasMultipleRoots: hasMultipleRoots, startRecording: toggleIsRecording, theme: theme }); var details = void 0; return details = isRecording || null === selectedRootID || null === profilerData ? _react2["default"].createElement(DetailsNoData, { theme: theme }) : "flamegraph" !== selectedChartType && "ranked" !== selectedChartType || null !== selectedFiberName ? "interactions" === selectedChartType && null !== selectedInteraction ? _react2["default"].createElement(_ProfilerInteractionDetailPane2["default"], { interaction: selectedInteraction, maxDuration: (0, _constants.getMaxDuration)(snapshots), selectedSnapshot: snapshot, snapshots: interactionsToSnapshots.get(selectedInteraction), theme: theme, viewSnapshot: this.viewSnapshot }) : "interactions" !== selectedChartType && null !== selectedFiberName ? _react2["default"].createElement(_ProfilerFiberDetailPane2["default"], { deselectFiber: this.deselectFiber, isInspectingSelectedFiber: isInspectingSelectedFiber, name: selectedFiberName, snapshot: snapshot, snapshotFiber: snapshotFiber, toggleInspectingSelectedFiber: this.toggleInspectingSelectedFiber, theme: theme }) : _react2["default"].createElement(DetailsNoData, { theme: theme }) : _react2["default"].createElement(_ProfilerSnapshotDetailPane2["default"], { selectedInteraction: selectedInteraction, snapshot: snapshot, theme: theme, viewInteraction: this.viewInteraction }), _react2["default"].createElement("div", { style: { width: "100%", flex: 1, display: "flex", alignItems: "stretch", justifyContent: "stretch", flexDirection: "row", color: theme.base05, fontFamily: _Fonts.sansSerif.family, fontSize: _Fonts.sansSerif.sizes.normal } }, _react2["default"].createElement("div", { style: { flex: "1 1 200px", display: "flex", flexDirection: "column" } }, _react2["default"].createElement("div", { style: { position: "relative", backgroundColor: theme.base01, borderBottom: "1px solid " + theme.base03 } }, _react2["default"].createElement(_ProfilerTabToolbar2["default"], { commitThreshold: commitThreshold, hideCommitsBelowThreshold: hideCommitsBelowThreshold, interactionsCount: interactionsToSnapshots.size, isInspectingSelectedFiber: isInspectingSelectedFiber, isRecording: isRecording, selectChart: this.props.setSelectedChartType, selectedChartType: selectedChartType, selectedFiberID: selectedFiberID, selectedSnapshot: snapshot, selectSnapshot: this.selectSnapshot, snapshotIndex: snapshotIndex, snapshots: snapshots, theme: theme, toggleIsRecording: toggleIsRecording, toggleIsSettingsPanelActive: toggleIsSettingsPanelActive })), _react2["default"].createElement("div", { style: { flex: 1, padding: "0.5rem", boxSizing: "border-box", position: "relative" } }, content, _react2["default"].createElement(_ProfilerSettings2["default"], null))), _react2["default"].createElement("div", { style: { flex: "1 1 100px", maxWidth: "300px", display: "flex", flexDirection: "column", alignItems: "stretch", justifyContent: "stretch", borderLeft: "1px solid " + theme.base03, boxSizing: "border-box" } }, details)); } } ], [ { key: "getDerivedStateFromProps", value: function(props, state) { return props.isRecording !== state.prevIsRecording ? { isInspectingSelectedFiber: !1, prevIsRecording: props.isRecording, selectedFiberID: null, selectedFiberName: null, selectedInteraction: null, snapshotIndex: 0 } : props.selectedChartType !== state.prevSelectedChartType ? { isInspectingSelectedFiber: !1, prevSelectedChartType: props.selectedChartType, selectedFiberID: null, selectedFiberName: null } : props.showNativeNodes !== state.prevShowNativeNodes ? { isInspectingSelectedFiber: !1, prevShowNativeNodes: props.showNativeNodes, selectedFiberID: null, selectedFiberName: null } : null; } } ]), ProfilerTab; }(_react2["default"].Component); ProfilerTab.contextTypes = { theme: _propTypes2["default"].object.isRequired }; var DetailsNoData = function(_ref2) { var theme = _ref2.theme; return _react2["default"].createElement("div", { style: { color: theme.base04, fontSize: _Fonts.sansSerif.sizes.large, height: "100%", flex: 1, display: "flex", alignItems: "center", justifyContent: "center", padding: "0.25rem" } }, "Nothing selected"); }, RecordingInProgress = function(_ref3) { var stopRecording = _ref3.stopRecording, theme = _ref3.theme; return _react2["default"].createElement("span", { style: { height: "100%", flex: 1, display: "flex", flexDirection: "column", alignItems: "center", justifyContent: "center" } }, "Recording profiling data...", _react2["default"].createElement("button", { onClick: stopRecording, style: { display: "flex", background: theme.state00, border: "none", outline: "none", cursor: "pointer", color: theme.base00, padding: ".5rem 0.75rem", marginTop: "0.5rem" }, title: "Stop recording" }, "Stop")); }; exports["default"] = (0, _decorate2["default"])({ store: "profilerStore", listeners: function() { return [ "commitThreshold", "hideCommitsBelowThreshold", "isRecording", "profilerData", "selectedChartType", "selectedRoot", "showNativeNodes" ]; }, props: function(store) { var profilerData = store.rootsToProfilerData.has(store.selectedRoot) ? store.rootsToProfilerData.get(store.selectedRoot) : null; return { cacheDataForSnapshot: function() { return store.cacheDataForSnapshot.apply(store, arguments); }, cacheInteractionData: function() { return store.cacheInteractionData.apply(store, arguments); }, getCachedDataForSnapshot: function() { return store.getCachedDataForSnapshot.apply(store, arguments); }, getCachedInteractionData: function() { return store.getCachedInteractionData.apply(store, arguments); }, commitThreshold: store.commitThreshold, hasMultipleRoots: store.roots.size > 1, hideCommitsBelowThreshold: store.hideCommitsBelowThreshold, interactionsToSnapshots: null !== profilerData ? profilerData.interactionsToSnapshots : new Map(), isRecording: !!store.isRecording, profilerData: profilerData, selectedChartType: store.selectedChartType, setSelectedChartType: function(chartType) { return store.setSelectedChartType(chartType); }, showNativeNodes: store.showNativeNodes, snapshots: null !== profilerData ? profilerData.snapshots : [], timestampsToInteractions: null !== profilerData ? profilerData.timestampsToInteractions : new Map(), toggleIsRecording: function() { return store.setIsRecording(!store.isRecording); }, toggleIsSettingsPanelActive: function() { return store.setIsSettingsPanelActive(!store.isSettingsPanelActive); } }; } }, ProfilerTab); }, function(module, exports, __webpack_require__) { "use strict"; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } Object.defineProperty(exports, "__esModule", { value: !0 }), exports.calculateSelfDuration = exports.getFilteredSnapshotData = exports.getMaxDuration = exports.formatTime = exports.formatPercentage = exports.formatDuration = exports.getGradientColor = exports.scale = exports.textHeight = exports.minBarWidth = exports.minBarHeight = exports.barWidthThreshold = exports.barWidth = exports.barHeight = exports.didNotRender = exports.gradient = void 0; var _memoizeOne = __webpack_require__(358), _memoizeOne2 = _interopRequireDefault(_memoizeOne), gradient = exports.gradient = [ "#37afa9", "#63b19e", "#80b393", "#97b488", "#abb67d", "#beb771", "#cfb965", "#dfba57", "#efbb49", "#febc38" ], gradientMaxIndex = (exports.didNotRender = "#ddd", exports.barHeight = 20, exports.barWidth = 100, exports.barWidthThreshold = 2, exports.minBarHeight = 5, exports.minBarWidth = 5, exports.textHeight = 18, exports.scale = function(minValue, maxValue, minRange, maxRange) { return function(value, fallbackValue) { return maxValue - minValue === 0 ? fallbackValue : (value - minValue) / (maxValue - minValue) * (maxRange - minRange); }; }, gradient.length - 1); exports.getGradientColor = function(value) { var index = void 0; return index = Number.isNaN(value) ? 0 : Number.isFinite(value) ? Math.max(0, Math.min(gradientMaxIndex, value)) * gradientMaxIndex : gradient.length - 1, gradient[Math.round(index)]; }, exports.formatDuration = function(duration) { return Math.round(10 * duration) / 10; }, exports.formatPercentage = function(percentage) { return Math.round(100 * percentage); }, exports.formatTime = function(timestamp) { return Math.round(Math.round(timestamp) / 100) / 10; }, exports.getMaxDuration = function(snapshots) { return snapshots.reduce(function(maxDuration, snapshot) { return Math.max(maxDuration, snapshot.duration || 0); }, 0); }, exports.getFilteredSnapshotData = (0, _memoizeOne2["default"])(function(commitThreshold, hideCommitsBelowThreshold, isInspectingSelectedFiber, selectedFiberID, selectedSnapshot, snapshotIndex, snapshots) { var filteredSnapshots = snapshots; isInspectingSelectedFiber && (filteredSnapshots = filteredSnapshots.filter(function(snapshot) { return snapshot.committedNodes.includes(selectedFiberID); })), hideCommitsBelowThreshold && (filteredSnapshots = filteredSnapshots.filter(function(snapshot) { return snapshot.duration >= commitThreshold; })); var filteredSnapshotIndex = filteredSnapshots.indexOf(selectedSnapshot); return { snapshotIndex: filteredSnapshotIndex, snapshots: filteredSnapshots }; }), exports.calculateSelfDuration = function(snapshot, nodeID) { var nodes = snapshot.nodes, node = nodes.get(nodeID), actualDuration = node.get("actualDuration"), selfDuration = actualDuration, children = node.get("children"); return Array.isArray(children) && children.forEach(function(childID) { var childActualDuration = nodes.getIn([ childID, "actualDuration" ]); childActualDuration > 0 && (selfDuration -= childActualDuration); }), selfDuration; }; }, function(module, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: !0 }), exports["default"] = function(resultFn) { var isEqual = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : simpleIsEqual, lastThis = void 0, lastArgs = [], lastResult = void 0, calledOnce = !1, isNewArgEqualToLast = function(newArg, index) { return isEqual(newArg, lastArgs[index]); }, result = function() { for (var _len = arguments.length, newArgs = Array(_len), _key = 0; _key < _len; _key++) newArgs[_key] = arguments[_key]; return calledOnce && lastThis === this && newArgs.length === lastArgs.length && newArgs.every(isNewArgEqualToLast) ? lastResult : (calledOnce = !0, lastThis = this, lastArgs = newArgs, lastResult = resultFn.apply(this, newArgs)); }; return result; }; var simpleIsEqual = function(a, b) { return a === b; }; }, function(module, exports, __webpack_require__) { "use strict"; 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 || "object" != typeof call && "function" != typeof call ? self : call; } function _inherits(subClass, superClass) { if ("function" != typeof superClass && null !== superClass) 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: !1, writable: !0, configurable: !0 } }), superClass && (Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass); } Object.defineProperty(exports, "__esModule", { value: !0 }); var _createClass = function() { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0, "value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor); } } return function(Constructor, protoProps, staticProps) { return protoProps && defineProperties(Constructor.prototype, protoProps), staticProps && defineProperties(Constructor, staticProps), Constructor; }; }(), _memoizeOne = __webpack_require__(358), _memoizeOne2 = _interopRequireDefault(_memoizeOne), _react = __webpack_require__(12), _react2 = _interopRequireDefault(_react), _reactVirtualizedAutoSizer = __webpack_require__(360), _reactVirtualizedAutoSizer2 = _interopRequireDefault(_reactVirtualizedAutoSizer), _reactWindow = __webpack_require__(361), _ChartNode = __webpack_require__(362), _ChartNode2 = _interopRequireDefault(_ChartNode), _constants = __webpack_require__(357), _NoRenderTimesMessage = __webpack_require__(363), _NoRenderTimesMessage2 = _interopRequireDefault(_NoRenderTimesMessage); exports["default"] = function(_ref) { var commitThreshold = _ref.commitThreshold, hideCommitsBelowThreshold = _ref.hideCommitsBelowThreshold, selectedFiberID = _ref.selectedFiberID, selectedSnapshot = _ref.selectedSnapshot, selectSnapshot = _ref.selectSnapshot, snapshotIndex = _ref.snapshotIndex, snapshots = _ref.snapshots, stopInspecting = _ref.stopInspecting, theme = _ref.theme, filteredData = (0, _constants.getFilteredSnapshotData)(commitThreshold, hideCommitsBelowThreshold, !0, selectedFiberID, selectedSnapshot, snapshotIndex, snapshots); return _react2["default"].createElement(_reactVirtualizedAutoSizer2["default"], null, function(_ref2) { var height = _ref2.height, width = _ref2.width; return _react2["default"].createElement(RenderDurations, { commitThreshold: commitThreshold, height: height, hideCommitsBelowThreshold: hideCommitsBelowThreshold, selectedFiberID: selectedFiberID, selectedSnapshot: selectedSnapshot, selectSnapshot: selectSnapshot, snapshots: filteredData.snapshots, stopInspecting: stopInspecting, theme: theme, width: width }); }); }; var RenderDurations = function(_ref3) { var commitThreshold = _ref3.commitThreshold, height = _ref3.height, hideCommitsBelowThreshold = _ref3.hideCommitsBelowThreshold, selectedFiberID = _ref3.selectedFiberID, selectedSnapshot = _ref3.selectedSnapshot, selectSnapshot = _ref3.selectSnapshot, snapshots = _ref3.snapshots, stopInspecting = _ref3.stopInspecting, theme = _ref3.theme, width = _ref3.width, chartData = getChartData(selectedFiberID, snapshots, width), itemSize = chartData.itemSize, maxValue = chartData.maxValue, nodes = chartData.nodes; if (0 === maxValue) return _react2["default"].createElement(_NoRenderTimesMessage2["default"], { commitThreshold: commitThreshold, height: height, hideCommitsBelowThreshold: hideCommitsBelowThreshold, stopInspecting: stopInspecting, width: width }); var itemData = getItemData(height, maxValue, nodes, selectedSnapshot, selectSnapshot, stopInspecting, theme); return _react2["default"].createElement(_reactWindow.FixedSizeList, { direction: "horizontal", height: height, innerTagName: "svg", itemCount: nodes.length, itemData: itemData, itemSize: itemSize, width: width }, ListItem); }, ListItem = function(_PureComponent) { function ListItem() { return _classCallCheck(this, ListItem), _possibleConstructorReturn(this, (ListItem.__proto__ || Object.getPrototypeOf(ListItem)).apply(this, arguments)); } return _inherits(ListItem, _PureComponent), _createClass(ListItem, [ { key: "render", value: function() { var _props = this.props, index = _props.index, style = _props.style, itemData = this.props.data, height = itemData.height, nodes = itemData.nodes, scaleY = itemData.scaleY, selectedSnapshot = itemData.selectedSnapshot, selectSnapshot = itemData.selectSnapshot, stopInspecting = itemData.stopInspecting, theme = itemData.theme, node = nodes[index], safeHeight = Math.max(_constants.minBarHeight, scaleY(node.value, _constants.minBarHeight)), left = parseInt(style.left, 10), width = parseInt(style.width, 10); return _react2["default"].createElement(_ChartNode2["default"], { color: (0, _constants.getGradientColor)(0 === node.maxCommitValue ? 0 : node.value / node.maxCommitValue), height: safeHeight, isDimmed: node.parentSnapshot === selectedSnapshot, key: index, label: node.value.toFixed(1) + "ms", onClick: function() { return selectSnapshot(node.parentSnapshot); }, onDoubleClick: stopInspecting, theme: theme, title: node.value.toFixed(3) + "ms", width: width, x: left, y: height - safeHeight }); } } ]), ListItem; }(_react.PureComponent), getChartData = (0, _memoizeOne2["default"])(function(nodeID, snapshots, width) { var maxValue = 0, nodes = snapshots.filter(function(snapshot) { return snapshot.committedNodes.indexOf(nodeID) >= 0; }).map(function(snapshot) { var maxCommitValue = snapshot.committedNodes.reduce(function(reduced, currentNodeID) { return Math.max(reduced, snapshot.nodes.getIn([ currentNodeID, "actualDuration" ]) || 0); }, 0), value = snapshot.nodes.getIn([ nodeID, "actualDuration" ]); return maxValue = Math.max(maxValue, value), { maxCommitValue: maxCommitValue, parentSnapshot: snapshot, value: value }; }), itemSize = Math.max(_constants.minBarWidth, width / nodes.length); return { itemSize: itemSize, maxValue: maxValue, nodes: nodes }; }), getItemData = (0, _memoizeOne2["default"])(function(height, maxValue, nodes, selectedSnapshot, selectSnapshot, stopInspecting, theme) { return { height: height, nodes: nodes, scaleY: (0, _constants.scale)(0, maxValue, 0, height), selectedSnapshot: selectedSnapshot, selectSnapshot: selectSnapshot, stopInspecting: stopInspecting, theme: theme }; }); }, function(module, exports, __webpack_require__) { (function(global) { "use strict"; function createDetectElementResize(nonce) { var _window; _window = "undefined" != typeof window ? window : "undefined" != typeof self ? self : global; var attachEvent = "undefined" != typeof document && document.attachEvent; if (!attachEvent) { var requestFrame = function() { var raf = _window.requestAnimationFrame || _window.mozRequestAnimationFrame || _window.webkitRequestAnimationFrame || function(fn) { return _window.setTimeout(fn, 20); }; return function(fn) { return raf(fn); }; }(), cancelFrame = function() { var cancel = _window.cancelAnimationFrame || _window.mozCancelAnimationFrame || _window.webkitCancelAnimationFrame || _window.clearTimeout; return function(id) { return cancel(id); }; }(), resetTriggers = function(element) { var triggers = element.__resizeTriggers__, expand = triggers.firstElementChild, contract = triggers.lastElementChild, expandChild = expand.firstElementChild; contract.scrollLeft = contract.scrollWidth, contract.scrollTop = contract.scrollHeight, expandChild.style.width = expand.offsetWidth + 1 + "px", expandChild.style.height = expand.offsetHeight + 1 + "px", expand.scrollLeft = expand.scrollWidth, expand.scrollTop = expand.scrollHeight; }, checkTriggers = function(element) { return element.offsetWidth != element.__resizeLast__.width || element.offsetHeight != element.__resizeLast__.height; }, scrollListener = function(e) { if (!(e.target.className.indexOf("contract-trigger") < 0 && e.target.className.indexOf("expand-trigger") < 0)) { var element = this; resetTriggers(this), this.__resizeRAF__ && cancelFrame(this.__resizeRAF__), this.__resizeRAF__ = requestFrame(function() { checkTriggers(element) && (element.__resizeLast__.width = element.offsetWidth, element.__resizeLast__.height = element.offsetHeight, element.__resizeListeners__.forEach(function(fn) { fn.call(element, e); })); }); } }, animation = !1, keyframeprefix = "", animationstartevent = "animationstart", domPrefixes = "Webkit Moz O ms".split(" "), startEvents = "webkitAnimationStart animationstart oAnimationStart MSAnimationStart".split(" "), pfx = "", elm = document.createElement("fakeelement"); if (void 0 !== elm.style.animationName && (animation = !0), animation === !1) for (var i = 0; i < domPrefixes.length; i++) if (void 0 !== elm.style[domPrefixes[i] + "AnimationName"]) { pfx = domPrefixes[i], keyframeprefix = "-" + pfx.toLowerCase() + "-", animationstartevent = startEvents[i], animation = !0; break; } var animationName = "resizeanim", animationKeyframes = "@" + keyframeprefix + "keyframes " + animationName + " { from { opacity: 0; } to { opacity: 0; } } ", animationStyle = keyframeprefix + "animation: 1ms " + animationName + "; "; } var createStyles = function(doc) { if (!doc.getElementById("detectElementResize")) { var css = (animationKeyframes ? animationKeyframes : "") + ".resize-triggers { " + (animationStyle ? animationStyle : "") + 'visibility: hidden; opacity: 0; } .resize-triggers, .resize-triggers > div, .contract-trigger:before { content: " "; display: block; position: absolute; top: 0; left: 0; height: 100%; width: 100%; overflow: hidden; z-index: -1; } .resize-triggers > div { background: #eee; overflow: auto; } .contract-trigger:before { width: 200%; height: 200%; }', head = doc.head || doc.getElementsByTagName("head")[0], style = doc.createElement("style"); style.id = "detectElementResize", style.type = "text/css", null != nonce && style.setAttribute("nonce", nonce), style.styleSheet ? style.styleSheet.cssText = css : style.appendChild(doc.createTextNode(css)), head.appendChild(style); } }, addResizeListener = function(element, fn) { if (attachEvent) element.attachEvent("onresize", fn); else { if (!element.__resizeTriggers__) { var doc = element.ownerDocument, elementStyle = _window.getComputedStyle(element); elementStyle && "static" == elementStyle.position && (element.style.position = "relative"), createStyles(doc), element.__resizeLast__ = {}, element.__resizeListeners__ = [], (element.__resizeTriggers__ = doc.createElement("div")).className = "resize-triggers", element.__resizeTriggers__.innerHTML = '
', element.appendChild(element.__resizeTriggers__), resetTriggers(element), element.addEventListener("scroll", scrollListener, !0), animationstartevent && (element.__resizeTriggers__.__animationListener__ = function(e) { e.animationName == animationName && resetTriggers(element); }, element.__resizeTriggers__.addEventListener(animationstartevent, element.__resizeTriggers__.__animationListener__)); } element.__resizeListeners__.push(fn); } }, removeResizeListener = function(element, fn) { if (attachEvent) element.detachEvent("onresize", fn); else if (element.__resizeListeners__.splice(element.__resizeListeners__.indexOf(fn), 1), !element.__resizeListeners__.length) { element.removeEventListener("scroll", scrollListener, !0), element.__resizeTriggers__.__animationListener__ && (element.__resizeTriggers__.removeEventListener(animationstartevent, element.__resizeTriggers__.__animationListener__), element.__resizeTriggers__.__animationListener__ = null); try { element.__resizeTriggers__ = !element.removeChild(element.__resizeTriggers__); } catch (e) {} } }; return { addResizeListener: addResizeListener, removeResizeListener: removeResizeListener }; } var React = __webpack_require__(12), classCallCheck = function(instance, Constructor) { if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function"); }, createClass = function() { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0, "value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor); } } return function(Constructor, protoProps, staticProps) { return protoProps && defineProperties(Constructor.prototype, protoProps), staticProps && defineProperties(Constructor, staticProps), Constructor; }; }(), _extends = Object.assign || function(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) Object.prototype.hasOwnProperty.call(source, key) && (target[key] = source[key]); } return target; }, inherits = function(subClass, superClass) { if ("function" != typeof superClass && null !== superClass) 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: !1, writable: !0, configurable: !0 } }), superClass && (Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass); }, possibleConstructorReturn = function(self, call) { if (!self) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return !call || "object" != typeof call && "function" != typeof call ? self : call; }, AutoSizer = function(_React$PureComponent) { function AutoSizer() { var _ref, _temp, _this, _ret; classCallCheck(this, AutoSizer); for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) args[_key] = arguments[_key]; return _temp = _this = possibleConstructorReturn(this, (_ref = AutoSizer.__proto__ || Object.getPrototypeOf(AutoSizer)).call.apply(_ref, [ this ].concat(args))), _this.state = { height: _this.props.defaultHeight || 0, width: _this.props.defaultWidth || 0 }, _this._onResize = function() { var _this$props = _this.props, disableHeight = _this$props.disableHeight, disableWidth = _this$props.disableWidth, onResize = _this$props.onResize; if (_this._parentNode) { var _height = _this._parentNode.offsetHeight || 0, _width = _this._parentNode.offsetWidth || 0, _style = window.getComputedStyle(_this._parentNode) || {}, paddingLeft = parseInt(_style.paddingLeft, 10) || 0, paddingRight = parseInt(_style.paddingRight, 10) || 0, paddingTop = parseInt(_style.paddingTop, 10) || 0, paddingBottom = parseInt(_style.paddingBottom, 10) || 0, newHeight = _height - paddingTop - paddingBottom, newWidth = _width - paddingLeft - paddingRight; (!disableHeight && _this.state.height !== newHeight || !disableWidth && _this.state.width !== newWidth) && (_this.setState({ height: _height - paddingTop - paddingBottom, width: _width - paddingLeft - paddingRight }), onResize({ height: _height, width: _width })); } }, _this._setRef = function(autoSizer) { _this._autoSizer = autoSizer; }, _ret = _temp, possibleConstructorReturn(_this, _ret); } return inherits(AutoSizer, _React$PureComponent), createClass(AutoSizer, [ { key: "componentDidMount", value: function() { var nonce = this.props.nonce; this._autoSizer && this._autoSizer.parentNode && this._autoSizer.parentNode.ownerDocument && this._autoSizer.parentNode.ownerDocument.defaultView && this._autoSizer.parentNode instanceof this._autoSizer.parentNode.ownerDocument.defaultView.HTMLElement && (this._parentNode = this._autoSizer.parentNode, this._detectElementResize = createDetectElementResize(nonce), this._detectElementResize.addResizeListener(this._parentNode, this._onResize), this._onResize()); } }, { key: "componentWillUnmount", value: function() { this._detectElementResize && this._parentNode && this._detectElementResize.removeResizeListener(this._parentNode, this._onResize); } }, { key: "render", value: function() { var _props = this.props, children = _props.children, className = _props.className, disableHeight = _props.disableHeight, disableWidth = _props.disableWidth, style = _props.style, _state = this.state, height = _state.height, width = _state.width, outerStyle = { overflow: "visible" }, childParams = {}, bailoutOnChildren = !1; return disableHeight || (0 === height && (bailoutOnChildren = !0), outerStyle.height = 0, childParams.height = height), disableWidth || (0 === width && (bailoutOnChildren = !0), outerStyle.width = 0, childParams.width = width), React.createElement("div", { className: className, ref: this._setRef, style: _extends({}, outerStyle, style) }, !bailoutOnChildren && children(childParams)); } } ]), AutoSizer; }(React.PureComponent); AutoSizer.defaultProps = { onResize: function() {}, disableHeight: !1, disableWidth: !1, style: {} }, module.exports = AutoSizer; }).call(exports, function() { return this; }()); }, function(module, exports, __webpack_require__) { "use strict"; function _interopDefault(ex) { return ex && "object" == typeof ex && "default" in ex ? ex["default"] : ex; } function createGridComponent(_ref2) { var _class, _temp, getColumnOffset = _ref2.getColumnOffset, getColumnStartIndexForOffset = _ref2.getColumnStartIndexForOffset, getColumnStopIndexForStartIndex = _ref2.getColumnStopIndexForStartIndex, getColumnWidth = _ref2.getColumnWidth, getEstimatedTotalHeight = _ref2.getEstimatedTotalHeight, getEstimatedTotalWidth = _ref2.getEstimatedTotalWidth, getOffsetForColumnAndAlignment = _ref2.getOffsetForColumnAndAlignment, getOffsetForRowAndAlignment = _ref2.getOffsetForRowAndAlignment, getRowHeight = _ref2.getRowHeight, getRowOffset = _ref2.getRowOffset, getRowStartIndexForOffset = _ref2.getRowStartIndexForOffset, getRowStopIndexForStartIndex = _ref2.getRowStopIndexForStartIndex, initInstanceProps = _ref2.initInstanceProps, shouldResetStyleCacheOnItemSizeChange = _ref2.shouldResetStyleCacheOnItemSizeChange, validateProps = _ref2.validateProps; return _temp = _class = function(_PureComponent) { function Grid(props) { classCallCheck(this, Grid); var _this = possibleConstructorReturn(this, _PureComponent.call(this, props)); return _this._instanceProps = initInstanceProps(_this.props, _this), _this._resetIsScrollingTimeoutId = null, _this.state = { isScrolling: !1, horizontalScrollDirection: "forward", scrollLeft: "number" == typeof _this.props.initialScrollLeft ? _this.props.initialScrollLeft : 0, scrollTop: "number" == typeof _this.props.initialScrollTop ? _this.props.initialScrollTop : 0, scrollUpdateWasRequested: !1, verticalScrollDirection: "forward" }, _this._callOnItemsRendered = memoizeOne(function(overscanColumnStartIndex, overscanColumnStopIndex, overscanRowStartIndex, overscanRowStopIndex, visibleColumnStartIndex, visibleColumnStopIndex, visibleRowStartIndex, visibleRowStopIndex) { return _this.props.onItemsRendered({ overscanColumnStartIndex: overscanColumnStartIndex, overscanColumnStopIndex: overscanColumnStopIndex, overscanRowStartIndex: overscanRowStartIndex, overscanRowStopIndex: overscanRowStopIndex, visibleColumnStartIndex: visibleColumnStartIndex, visibleColumnStopIndex: visibleColumnStopIndex, visibleRowStartIndex: visibleRowStartIndex, visibleRowStopIndex: visibleRowStopIndex }); }), _this._callOnScroll = memoizeOne(function(scrollLeft, scrollTop, horizontalScrollDirection, verticalScrollDirection, scrollUpdateWasRequested) { return _this.props.onScroll({ horizontalScrollDirection: horizontalScrollDirection, scrollLeft: scrollLeft, scrollTop: scrollTop, verticalScrollDirection: verticalScrollDirection, scrollUpdateWasRequested: scrollUpdateWasRequested }); }), _this._getItemStyle = function(rowIndex, columnIndex) { var key = rowIndex + ":" + columnIndex, itemStyleCache = _this._getItemStyleCache(shouldResetStyleCacheOnItemSizeChange && _this.props.columnWidth, shouldResetStyleCacheOnItemSizeChange && _this.props.rowHeight), style = void 0; return itemStyleCache.hasOwnProperty(key) ? style = itemStyleCache[key] : itemStyleCache[key] = style = { position: "absolute", left: getColumnOffset(_this.props, columnIndex, _this._instanceProps), top: getRowOffset(_this.props, rowIndex, _this._instanceProps), height: getRowHeight(_this.props, rowIndex, _this._instanceProps), width: getColumnWidth(_this.props, columnIndex, _this._instanceProps) }, style; }, _this._getItemStyleCache = memoizeOne(function(_, __) { return {}; }), _this._onScroll = function(event) { var _event$currentTarget = event.currentTarget, scrollLeft = _event$currentTarget.scrollLeft, scrollTop = _event$currentTarget.scrollTop; _this.setState(function(prevState) { return prevState.scrollLeft === scrollLeft && prevState.scrollTop === scrollTop ? null : { isScrolling: !0, horizontalScrollDirection: prevState.scrollLeft < scrollLeft ? "forward" : "backward", scrollLeft: scrollLeft, scrollTop: scrollTop, verticalScrollDirection: prevState.scrollTop < scrollTop ? "forward" : "backward", scrollUpdateWasRequested: !1 }; }, _this._resetIsScrollingDebounced); }, _this._outerRefSetter = function(ref) { var outerRef = _this.props.outerRef; _this._outerRef = ref, "function" == typeof outerRef ? outerRef(ref) : null != outerRef && "object" === ("undefined" == typeof outerRef ? "undefined" : _typeof(outerRef)) && outerRef.hasOwnProperty("current") && (outerRef.current = ref); }, _this._resetIsScrollingDebounced = function() { null !== _this._resetIsScrollingTimeoutId && clearTimeout(_this._resetIsScrollingTimeoutId), _this._resetIsScrollingTimeoutId = setTimeout(_this._resetIsScrolling, IS_SCROLLING_DEBOUNCE_INTERVAL); }, _this._resetIsScrollingDebounced = function() { null !== _this._resetIsScrollingTimeoutId && clearTimeout(_this._resetIsScrollingTimeoutId), _this._resetIsScrollingTimeoutId = setTimeout(_this._resetIsScrolling, IS_SCROLLING_DEBOUNCE_INTERVAL); }, _this._resetIsScrolling = function() { _this._resetIsScrollingTimeoutId = null, _this.setState({ isScrolling: !1 }, function() { _this._getItemStyleCache(-1); }); }, _this; } return inherits(Grid, _PureComponent), Grid.getDerivedStateFromProps = function(nextProps, prevState) { return validateSharedProps(nextProps), validateProps(nextProps), null; }, Grid.prototype.scrollTo = function(_ref3) { var scrollLeft = _ref3.scrollLeft, scrollTop = _ref3.scrollTop; this.setState(function(prevState) { return { horizontalScrollDirection: prevState.scrollLeft < scrollLeft ? "forward" : "backward", scrollLeft: scrollLeft, scrollTop: scrollTop, scrollUpdateWasRequested: !0, verticalScrollDirection: prevState.scrollTop < scrollTop ? "forward" : "backward" }; }, this._resetIsScrollingDebounced); }, Grid.prototype.scrollToItem = function(_ref4) { var _ref4$align = _ref4.align, align = void 0 === _ref4$align ? "auto" : _ref4$align, columnIndex = _ref4.columnIndex, rowIndex = _ref4.rowIndex, _state = this.state, scrollLeft = _state.scrollLeft, scrollTop = _state.scrollTop; this.scrollTo({ scrollLeft: getOffsetForColumnAndAlignment(this.props, columnIndex, align, scrollLeft, this._instanceProps), scrollTop: getOffsetForRowAndAlignment(this.props, rowIndex, align, scrollTop, this._instanceProps) }); }, Grid.prototype.componentDidMount = function() { var _props = this.props, initialScrollLeft = _props.initialScrollLeft, initialScrollTop = _props.initialScrollTop; "number" == typeof initialScrollLeft && null != this._outerRef && (this._outerRef.scrollLeft = initialScrollLeft), "number" == typeof initialScrollTop && null != this._outerRef && (this._outerRef.scrollTop = initialScrollTop), this._callPropsCallbacks(); }, Grid.prototype.componentDidUpdate = function() { var _state2 = this.state, scrollLeft = _state2.scrollLeft, scrollTop = _state2.scrollTop, scrollUpdateWasRequested = _state2.scrollUpdateWasRequested; scrollUpdateWasRequested && null !== this._outerRef && (this._outerRef.scrollLeft = scrollLeft, this._outerRef.scrollTop = scrollTop), this._callPropsCallbacks(); }, Grid.prototype.componentWillUnmount = function() { null !== this._resetIsScrollingTimeoutId && clearTimeout(this._resetIsScrollingTimeoutId); }, Grid.prototype.render = function() { var _props2 = this.props, children = _props2.children, className = _props2.className, columnCount = _props2.columnCount, height = _props2.height, innerRef = _props2.innerRef, innerTagName = _props2.innerTagName, itemData = _props2.itemData, _props2$itemKey = _props2.itemKey, itemKey = void 0 === _props2$itemKey ? defaultItemKey : _props2$itemKey, outerTagName = _props2.outerTagName, rowCount = _props2.rowCount, style = _props2.style, useIsScrolling = _props2.useIsScrolling, width = _props2.width, isScrolling = this.state.isScrolling, _getHorizontalRangeTo = this._getHorizontalRangeToRender(), columnStartIndex = _getHorizontalRangeTo[0], columnStopIndex = _getHorizontalRangeTo[1], _getVerticalRangeToRe = this._getVerticalRangeToRender(), rowStartIndex = _getVerticalRangeToRe[0], rowStopIndex = _getVerticalRangeToRe[1], items = []; if (columnCount > 0 && rowCount) for (var _rowIndex = rowStartIndex; _rowIndex <= rowStopIndex; _rowIndex++) for (var _columnIndex = columnStartIndex; _columnIndex <= columnStopIndex; _columnIndex++) items.push(react.createElement(children, { columnIndex: _columnIndex, data: itemData, isScrolling: useIsScrolling ? isScrolling : void 0, key: itemKey({ columnIndex: _columnIndex, rowIndex: _rowIndex }), rowIndex: _rowIndex, style: this._getItemStyle(_rowIndex, _columnIndex) })); var estimatedTotalHeight = getEstimatedTotalHeight(this.props, this._instanceProps), estimatedTotalWidth = getEstimatedTotalWidth(this.props, this._instanceProps); return react.createElement(outerTagName, { className: className, onScroll: this._onScroll, ref: this._outerRefSetter, style: _extends({ position: "relative", height: height, width: width, overflow: "auto", WebkitOverflowScrolling: "touch", willChange: "transform" }, style) }, react.createElement(innerTagName, { children: items, ref: innerRef, style: { height: estimatedTotalHeight, overflow: "hidden", pointerEvents: isScrolling ? "none" : "", width: estimatedTotalWidth } })); }, Grid.prototype._callPropsCallbacks = function() { var _props3 = this.props, columnCount = _props3.columnCount, onItemsRendered = _props3.onItemsRendered, onScroll = _props3.onScroll, rowCount = _props3.rowCount; if ("function" == typeof onItemsRendered && columnCount > 0 && rowCount > 0) { var _getHorizontalRangeTo2 = this._getHorizontalRangeToRender(), _overscanColumnStartIndex = _getHorizontalRangeTo2[0], _overscanColumnStopIndex = _getHorizontalRangeTo2[1], _visibleColumnStartIndex = _getHorizontalRangeTo2[2], _visibleColumnStopIndex = _getHorizontalRangeTo2[3], _getVerticalRangeToRe2 = this._getVerticalRangeToRender(), _overscanRowStartIndex = _getVerticalRangeToRe2[0], _overscanRowStopIndex = _getVerticalRangeToRe2[1], _visibleRowStartIndex = _getVerticalRangeToRe2[2], _visibleRowStopIndex = _getVerticalRangeToRe2[3]; this._callOnItemsRendered(_overscanColumnStartIndex, _overscanColumnStopIndex, _overscanRowStartIndex, _overscanRowStopIndex, _visibleColumnStartIndex, _visibleColumnStopIndex, _visibleRowStartIndex, _visibleRowStopIndex); } if ("function" == typeof onScroll) { var _state3 = this.state, _horizontalScrollDirection = _state3.horizontalScrollDirection, _scrollLeft = _state3.scrollLeft, _scrollTop = _state3.scrollTop, _scrollUpdateWasRequested = _state3.scrollUpdateWasRequested, _verticalScrollDirection = _state3.verticalScrollDirection; this._callOnScroll(_scrollLeft, _scrollTop, _horizontalScrollDirection, _verticalScrollDirection, _scrollUpdateWasRequested); } }, Grid.prototype._getHorizontalRangeToRender = function() { var _props4 = this.props, columnCount = _props4.columnCount, overscanCount = _props4.overscanCount, _state4 = this.state, horizontalScrollDirection = _state4.horizontalScrollDirection, scrollLeft = _state4.scrollLeft, startIndex = getColumnStartIndexForOffset(this.props, scrollLeft, this._instanceProps), stopIndex = getColumnStopIndexForStartIndex(this.props, startIndex, scrollLeft, this._instanceProps), overscanBackward = "backward" === horizontalScrollDirection ? Math.max(1, overscanCount) : 1, overscanForward = "forward" === horizontalScrollDirection ? Math.max(1, overscanCount) : 1; return [ Math.max(0, startIndex - overscanBackward), Math.max(0, Math.min(columnCount - 1, stopIndex + overscanForward)), startIndex, stopIndex ]; }, Grid.prototype._getVerticalRangeToRender = function() { var _props5 = this.props, rowCount = _props5.rowCount, overscanCount = _props5.overscanCount, _state5 = this.state, verticalScrollDirection = _state5.verticalScrollDirection, scrollTop = _state5.scrollTop, startIndex = getRowStartIndexForOffset(this.props, scrollTop, this._instanceProps), stopIndex = getRowStopIndexForStartIndex(this.props, startIndex, scrollTop, this._instanceProps), overscanBackward = "backward" === verticalScrollDirection ? Math.max(1, overscanCount) : 1, overscanForward = "forward" === verticalScrollDirection ? Math.max(1, overscanCount) : 1; return [ Math.max(0, startIndex - overscanBackward), Math.max(0, Math.min(rowCount - 1, stopIndex + overscanForward)), startIndex, stopIndex ]; }, Grid; }(react.PureComponent), _class.defaultProps = { innerTagName: "div", outerTagName: "div", overscanCount: 1, useIsScrolling: !1 }, _temp; } function createListComponent(_ref) { var _class, _temp, getItemOffset = _ref.getItemOffset, getEstimatedTotalSize = _ref.getEstimatedTotalSize, getItemSize = _ref.getItemSize, getOffsetForIndexAndAlignment = _ref.getOffsetForIndexAndAlignment, getStartIndexForOffset = _ref.getStartIndexForOffset, getStopIndexForStartIndex = _ref.getStopIndexForStartIndex, initInstanceProps = _ref.initInstanceProps, shouldResetStyleCacheOnItemSizeChange = _ref.shouldResetStyleCacheOnItemSizeChange, validateProps = _ref.validateProps; return _temp = _class = function(_PureComponent) { function List(props) { classCallCheck(this, List); var _this = possibleConstructorReturn(this, _PureComponent.call(this, props)); return _this._instanceProps = initInstanceProps(_this.props, _this), _this._resetIsScrollingTimeoutId = null, _this.state = { isScrolling: !1, scrollDirection: "forward", scrollOffset: "number" == typeof _this.props.initialScrollOffset ? _this.props.initialScrollOffset : 0, scrollUpdateWasRequested: !1 }, _this._callOnItemsRendered = memoizeOne(function(overscanStartIndex, overscanStopIndex, visibleStartIndex, visibleStopIndex) { return _this.props.onItemsRendered({ overscanStartIndex: overscanStartIndex, overscanStopIndex: overscanStopIndex, visibleStartIndex: visibleStartIndex, visibleStopIndex: visibleStopIndex }); }), _this._callOnScroll = memoizeOne(function(scrollDirection, scrollOffset, scrollUpdateWasRequested) { return _this.props.onScroll({ scrollDirection: scrollDirection, scrollOffset: scrollOffset, scrollUpdateWasRequested: scrollUpdateWasRequested }); }), _this._getItemStyle = function(index) { var _this$props = _this.props, direction = _this$props.direction, itemSize = _this$props.itemSize, itemStyleCache = _this._getItemStyleCache(shouldResetStyleCacheOnItemSizeChange && itemSize), style = void 0; return itemStyleCache.hasOwnProperty(index) ? style = itemStyleCache[index] : itemStyleCache[index] = style = { position: "absolute", left: "horizontal" === direction ? getItemOffset(_this.props, index, _this._instanceProps) : 0, top: "vertical" === direction ? getItemOffset(_this.props, index, _this._instanceProps) : 0, height: "vertical" === direction ? getItemSize(_this.props, index, _this._instanceProps) : "100%", width: "horizontal" === direction ? getItemSize(_this.props, index, _this._instanceProps) : "100%" }, style; }, _this._getItemStyleCache = memoizeOne(function(_) { return {}; }), _this._onScrollHorizontal = function(event) { var scrollLeft = event.currentTarget.scrollLeft; _this.setState(function(prevState) { return prevState.scrollOffset === scrollLeft ? null : { isScrolling: !0, scrollDirection: prevState.scrollOffset < scrollLeft ? "forward" : "backward", scrollOffset: scrollLeft, scrollUpdateWasRequested: !1 }; }, _this._resetIsScrollingDebounced); }, _this._onScrollVertical = function(event) { var scrollTop = event.currentTarget.scrollTop; _this.setState(function(prevState) { return prevState.scrollOffset === scrollTop ? null : { isScrolling: !0, scrollDirection: prevState.scrollOffset < scrollTop ? "forward" : "backward", scrollOffset: scrollTop, scrollUpdateWasRequested: !1 }; }, _this._resetIsScrollingDebounced); }, _this._outerRefSetter = function(ref) { var outerRef = _this.props.outerRef; _this._outerRef = ref, "function" == typeof outerRef ? outerRef(ref) : null != outerRef && "object" === ("undefined" == typeof outerRef ? "undefined" : _typeof(outerRef)) && outerRef.hasOwnProperty("current") && (outerRef.current = ref); }, _this._resetIsScrollingDebounced = function() { null !== _this._resetIsScrollingTimeoutId && clearTimeout(_this._resetIsScrollingTimeoutId), _this._resetIsScrollingTimeoutId = setTimeout(_this._resetIsScrolling, IS_SCROLLING_DEBOUNCE_INTERVAL$1); }, _this._resetIsScrolling = function() { _this._resetIsScrollingTimeoutId = null, _this.setState({ isScrolling: !1 }, function() { _this._getItemStyleCache(-1); }); }, _this; } return inherits(List, _PureComponent), List.getDerivedStateFromProps = function(props, state) { return validateSharedProps$1(props), validateProps(props), null; }, List.prototype.scrollTo = function(scrollOffset) { this.setState(function(prevState) { return { scrollDirection: prevState.scrollOffset < scrollOffset ? "forward" : "backward", scrollOffset: scrollOffset, scrollUpdateWasRequested: !0 }; }, this._resetIsScrollingDebounced); }, List.prototype.scrollToItem = function(index) { var align = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : "auto", scrollOffset = this.state.scrollOffset; this.scrollTo(getOffsetForIndexAndAlignment(this.props, index, align, scrollOffset, this._instanceProps)); }, List.prototype.componentDidMount = function() { var _props = this.props, initialScrollOffset = _props.initialScrollOffset, direction = _props.direction; "number" == typeof initialScrollOffset && null !== this._outerRef && ("horizontal" === direction ? this._outerRef.scrollLeft = initialScrollOffset : this._outerRef.scrollTop = initialScrollOffset), this._callPropsCallbacks(); }, List.prototype.componentDidUpdate = function() { var direction = this.props.direction, _state = this.state, scrollOffset = _state.scrollOffset, scrollUpdateWasRequested = _state.scrollUpdateWasRequested; scrollUpdateWasRequested && null !== this._outerRef && ("horizontal" === direction ? this._outerRef.scrollLeft = scrollOffset : this._outerRef.scrollTop = scrollOffset), this._callPropsCallbacks(); }, List.prototype.componentWillUnmount = function() { null !== this._resetIsScrollingTimeoutId && clearTimeout(this._resetIsScrollingTimeoutId); }, List.prototype.render = function() { var _props2 = this.props, children = _props2.children, className = _props2.className, direction = _props2.direction, height = _props2.height, innerRef = _props2.innerRef, innerTagName = _props2.innerTagName, itemCount = _props2.itemCount, itemData = _props2.itemData, _props2$itemKey = _props2.itemKey, itemKey = void 0 === _props2$itemKey ? defaultItemKey$1 : _props2$itemKey, outerTagName = _props2.outerTagName, style = _props2.style, useIsScrolling = _props2.useIsScrolling, width = _props2.width, isScrolling = this.state.isScrolling, onScroll = "vertical" === direction ? this._onScrollVertical : this._onScrollHorizontal, _getRangeToRender2 = this._getRangeToRender(), startIndex = _getRangeToRender2[0], stopIndex = _getRangeToRender2[1], items = []; if (itemCount > 0) for (var _index = startIndex; _index <= stopIndex; _index++) items.push(react.createElement(children, { data: itemData, key: itemKey(_index), index: _index, isScrolling: useIsScrolling ? isScrolling : void 0, style: this._getItemStyle(_index) })); var estimatedTotalSize = getEstimatedTotalSize(this.props, this._instanceProps); return react.createElement(outerTagName, { className: className, onScroll: onScroll, ref: this._outerRefSetter, style: _extends({ position: "relative", height: height, width: width, overflow: "auto", WebkitOverflowScrolling: "touch", willChange: "transform" }, style) }, react.createElement(innerTagName, { children: items, ref: innerRef, style: { height: "horizontal" === direction ? "100%" : estimatedTotalSize, overflow: "hidden", pointerEvents: isScrolling ? "none" : "", width: "horizontal" === direction ? estimatedTotalSize : "100%" } })); }, List.prototype._callPropsCallbacks = function() { if ("function" == typeof this.props.onItemsRendered) { var _itemCount = this.props.itemCount; if (_itemCount > 0) { var _getRangeToRender3 = this._getRangeToRender(), _overscanStartIndex = _getRangeToRender3[0], _overscanStopIndex = _getRangeToRender3[1], _visibleStartIndex = _getRangeToRender3[2], _visibleStopIndex = _getRangeToRender3[3]; this._callOnItemsRendered(_overscanStartIndex, _overscanStopIndex, _visibleStartIndex, _visibleStopIndex); } } if ("function" == typeof this.props.onScroll) { var _state2 = this.state, _scrollDirection = _state2.scrollDirection, _scrollOffset = _state2.scrollOffset, _scrollUpdateWasRequested = _state2.scrollUpdateWasRequested; this._callOnScroll(_scrollDirection, _scrollOffset, _scrollUpdateWasRequested); } }, List.prototype._getRangeToRender = function() { var _props3 = this.props, itemCount = _props3.itemCount, overscanCount = _props3.overscanCount, _state3 = this.state, scrollDirection = _state3.scrollDirection, scrollOffset = _state3.scrollOffset, startIndex = getStartIndexForOffset(this.props, scrollOffset, this._instanceProps), stopIndex = getStopIndexForStartIndex(this.props, startIndex, scrollOffset, this._instanceProps), overscanBackward = "backward" === scrollDirection ? Math.max(1, overscanCount) : 1, overscanForward = "forward" === scrollDirection ? Math.max(1, overscanCount) : 1; return [ Math.max(0, startIndex - overscanBackward), Math.max(0, Math.min(itemCount - 1, stopIndex + overscanForward)), startIndex, stopIndex ]; }, List; }(react.PureComponent), _class.defaultProps = { direction: "vertical", innerTagName: "div", outerTagName: "div", overscanCount: 2, useIsScrolling: !1 }, _temp; } Object.defineProperty(exports, "__esModule", { value: !0 }); var memoizeOne = _interopDefault(__webpack_require__(358)), react = __webpack_require__(12), _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj) { return typeof obj; } : function(obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, classCallCheck = function(instance, Constructor) { if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function"); }, _extends = Object.assign || function(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) Object.prototype.hasOwnProperty.call(source, key) && (target[key] = source[key]); } return target; }, inherits = function(subClass, superClass) { if ("function" != typeof superClass && null !== superClass) 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: !1, writable: !0, configurable: !0 } }), superClass && (Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass); }, possibleConstructorReturn = function(self, call) { if (!self) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return !call || "object" != typeof call && "function" != typeof call ? self : call; }, IS_SCROLLING_DEBOUNCE_INTERVAL = 150, defaultItemKey = function(_ref) { var columnIndex = _ref.columnIndex, rowIndex = _ref.rowIndex; return rowIndex + ":" + columnIndex; }, validateSharedProps = function(_ref5) { _ref5.children, _ref5.height, _ref5.width; }, DEFAULT_ESTIMATED_ITEM_SIZE = 50, getEstimatedTotalHeight = function(_ref, _ref2) { var rowCount = _ref.rowCount, rowMetadataMap = _ref2.rowMetadataMap, estimatedRowHeight = _ref2.estimatedRowHeight, lastMeasuredRowIndex = _ref2.lastMeasuredRowIndex, totalSizeOfMeasuredRows = 0; if (lastMeasuredRowIndex >= 0) { var itemMetadata = rowMetadataMap[lastMeasuredRowIndex]; totalSizeOfMeasuredRows = itemMetadata.offset + itemMetadata.size; } var numUnmeasuredItems = rowCount - lastMeasuredRowIndex - 1, totalSizeOfUnmeasuredItems = numUnmeasuredItems * estimatedRowHeight; return totalSizeOfMeasuredRows + totalSizeOfUnmeasuredItems; }, getEstimatedTotalWidth = function(_ref3, _ref4) { var columnCount = _ref3.columnCount, columnMetadataMap = _ref4.columnMetadataMap, estimatedColumnWidth = _ref4.estimatedColumnWidth, lastMeasuredColumnIndex = _ref4.lastMeasuredColumnIndex, totalSizeOfMeasuredRows = 0; if (lastMeasuredColumnIndex >= 0) { var itemMetadata = columnMetadataMap[lastMeasuredColumnIndex]; totalSizeOfMeasuredRows = itemMetadata.offset + itemMetadata.size; } var numUnmeasuredItems = columnCount - lastMeasuredColumnIndex - 1, totalSizeOfUnmeasuredItems = numUnmeasuredItems * estimatedColumnWidth; return totalSizeOfMeasuredRows + totalSizeOfUnmeasuredItems; }, getItemMetadata = function(itemType, props, index, instanceProps) { var itemMetadataMap = void 0, itemSize = void 0, lastMeasuredIndex = void 0; if ("column" === itemType ? (itemMetadataMap = instanceProps.columnMetadataMap, itemSize = props.columnWidth, lastMeasuredIndex = instanceProps.lastMeasuredColumnIndex) : (itemMetadataMap = instanceProps.rowMetadataMap, itemSize = props.rowHeight, lastMeasuredIndex = instanceProps.lastMeasuredRowIndex), index > lastMeasuredIndex) { var _offset = 0; if (lastMeasuredIndex >= 0) { var itemMetadata = itemMetadataMap[lastMeasuredIndex]; _offset = itemMetadata.offset + itemMetadata.size; } for (var i = lastMeasuredIndex + 1; i <= index; i++) { var _size = itemSize(i); itemMetadataMap[i] = { offset: _offset, size: _size }, _offset += _size; } "column" === itemType ? instanceProps.lastMeasuredColumnIndex = index : instanceProps.lastMeasuredRowIndex = index; } return itemMetadataMap[index]; }, findNearestItem = function(itemType, props, instanceProps, offset) { var itemMetadataMap = void 0, lastMeasuredIndex = void 0; "column" === itemType ? (itemMetadataMap = instanceProps.columnMetadataMap, lastMeasuredIndex = instanceProps.lastMeasuredColumnIndex) : (itemMetadataMap = instanceProps.rowMetadataMap, lastMeasuredIndex = instanceProps.lastMeasuredRowIndex); var lastMeasuredItemOffset = lastMeasuredIndex > 0 ? itemMetadataMap[lastMeasuredIndex].offset : 0; return lastMeasuredItemOffset >= offset ? findNearestItemBinarySearch(itemType, props, instanceProps, lastMeasuredIndex, 0, offset) : findNearestItemExponentialSearch(itemType, props, instanceProps, Math.max(0, lastMeasuredIndex), offset); }, findNearestItemBinarySearch = function(itemType, props, instanceProps, high, low, offset) { for (;low <= high; ) { var middle = low + Math.floor((high - low) / 2), currentOffset = getItemMetadata(itemType, props, middle, instanceProps).offset; if (currentOffset === offset) return middle; currentOffset < offset ? low = middle + 1 : currentOffset > offset && (high = middle - 1); } return low > 0 ? low - 1 : 0; }, findNearestItemExponentialSearch = function(itemType, props, instanceProps, index, offset) { for (var itemCount = "column" === itemType ? props.columnCount : props.rowCount, interval = 1; index < itemCount && getItemMetadata(itemType, props, index, instanceProps).offset < offset; ) index += interval, interval *= 2; return findNearestItemBinarySearch(itemType, props, instanceProps, Math.min(index, itemCount - 1), Math.floor(index / 2), offset); }, getOffsetForIndexAndAlignment = function(itemType, props, index, align, scrollOffset, instanceProps) { var size = "column" === itemType ? props.width : props.height, itemMetadata = getItemMetadata(itemType, props, index, instanceProps), estimatedTotalSize = "column" === itemType ? getEstimatedTotalWidth(props, instanceProps) : getEstimatedTotalHeight(props, instanceProps), maxOffset = Math.min(estimatedTotalSize - size, itemMetadata.offset), minOffset = Math.max(0, itemMetadata.offset - size + itemMetadata.size); switch (align) { case "start": return maxOffset; case "end": return minOffset; case "center": return Math.round(minOffset + (maxOffset - minOffset) / 2); case "auto": default: return scrollOffset >= minOffset && scrollOffset <= maxOffset ? scrollOffset : scrollOffset - minOffset < maxOffset - scrollOffset ? minOffset : maxOffset; } }, VariableSizeGrid = createGridComponent({ getColumnOffset: function(props, index, instanceProps) { return getItemMetadata("column", props, index, instanceProps).offset; }, getColumnStartIndexForOffset: function(props, scrollLeft, instanceProps) { return findNearestItem("column", props, instanceProps, scrollLeft); }, getColumnStopIndexForStartIndex: function(props, startIndex, scrollLeft, instanceProps) { for (var columnCount = props.columnCount, width = props.width, itemMetadata = getItemMetadata("column", props, startIndex, instanceProps), maxOffset = scrollLeft + width, offset = itemMetadata.offset + itemMetadata.size, stopIndex = startIndex; stopIndex < columnCount - 1 && offset < maxOffset; ) stopIndex++, offset += getItemMetadata("column", props, stopIndex, instanceProps).size; return stopIndex; }, getColumnWidth: function(props, index, instanceProps) { return instanceProps.columnMetadataMap[index].size; }, getEstimatedTotalHeight: getEstimatedTotalHeight, getEstimatedTotalWidth: getEstimatedTotalWidth, getOffsetForColumnAndAlignment: function(props, index, align, scrollOffset, instanceProps) { return getOffsetForIndexAndAlignment("column", props, index, align, scrollOffset, instanceProps); }, getOffsetForRowAndAlignment: function(props, index, align, scrollOffset, instanceProps) { return getOffsetForIndexAndAlignment("row", props, index, align, scrollOffset, instanceProps); }, getRowOffset: function(props, index, instanceProps) { return getItemMetadata("row", props, index, instanceProps).offset; }, getRowHeight: function(props, index, instanceProps) { return instanceProps.rowMetadataMap[index].size; }, getRowStartIndexForOffset: function(props, scrollTop, instanceProps) { return findNearestItem("row", props, instanceProps, scrollTop); }, getRowStopIndexForStartIndex: function(props, startIndex, scrollTop, instanceProps) { for (var rowCount = props.rowCount, height = props.height, itemMetadata = getItemMetadata("row", props, startIndex, instanceProps), maxOffset = scrollTop + height, offset = itemMetadata.offset + itemMetadata.size, stopIndex = startIndex; stopIndex < rowCount - 1 && offset < maxOffset; ) stopIndex++, offset += getItemMetadata("row", props, stopIndex, instanceProps).size; return stopIndex; }, initInstanceProps: function(props, instance) { var _this = this, _ref5 = props, estimatedColumnWidth = _ref5.estimatedColumnWidth, estimatedRowHeight = _ref5.estimatedRowHeight, instanceProps = { columnMetadataMap: {}, estimatedColumnWidth: estimatedColumnWidth || DEFAULT_ESTIMATED_ITEM_SIZE, estimatedRowHeight: estimatedRowHeight || DEFAULT_ESTIMATED_ITEM_SIZE, lastMeasuredColumnIndex: -1, lastMeasuredRowIndex: -1, rowMetadataMap: {} }; return instance.resetAfterColumnIndex = function(columnIndex) { var shouldForceUpdate = !(arguments.length > 1 && void 0 !== arguments[1]) || arguments[1]; _this.resetAfterIndices({ columnIndex: columnIndex, shouldForceUpdate: shouldForceUpdate }); }, instance.resetAfterRowIndex = function(rowIndex) { var shouldForceUpdate = !(arguments.length > 1 && void 0 !== arguments[1]) || arguments[1]; _this.resetAfterIndices({ rowIndex: rowIndex, shouldForceUpdate: shouldForceUpdate }); }, instance.resetAfterIndices = function(_ref6) { var columnIndex = _ref6.columnIndex, rowIndex = _ref6.rowIndex, _ref6$shouldForceUpda = _ref6.shouldForceUpdate, shouldForceUpdate = void 0 === _ref6$shouldForceUpda || _ref6$shouldForceUpda; "number" == typeof columnIndex && (instanceProps.lastMeasuredColumnIndex = Math.min(instanceProps.lastMeasuredColumnIndex, columnIndex - 1)), "number" == typeof rowIndex && (instanceProps.lastMeasuredRowIndex = Math.min(instanceProps.lastMeasuredRowIndex, rowIndex - 1)), instance._getItemStyleCache(-1), shouldForceUpdate && instance.forceUpdate(); }, instanceProps; }, shouldResetStyleCacheOnItemSizeChange: !1, validateProps: function(_ref7) { _ref7.columnWidth, _ref7.rowHeight; } }), IS_SCROLLING_DEBOUNCE_INTERVAL$1 = 150, defaultItemKey$1 = function(index) { return index; }, validateSharedProps$1 = function(_ref2) { _ref2.children, _ref2.direction, _ref2.height, _ref2.width; }, DEFAULT_ESTIMATED_ITEM_SIZE$1 = 50, getItemMetadata$1 = function(props, index, instanceProps) { var _ref = props, itemSize = _ref.itemSize, itemMetadataMap = instanceProps.itemMetadataMap, lastMeasuredIndex = instanceProps.lastMeasuredIndex; if (index > lastMeasuredIndex) { var _offset = 0; if (lastMeasuredIndex >= 0) { var itemMetadata = itemMetadataMap[lastMeasuredIndex]; _offset = itemMetadata.offset + itemMetadata.size; } for (var i = lastMeasuredIndex + 1; i <= index; i++) { var _size = itemSize(i); itemMetadataMap[i] = { offset: _offset, size: _size }, _offset += _size; } instanceProps.lastMeasuredIndex = index; } return itemMetadataMap[index]; }, findNearestItem$1 = function(props, instanceProps, offset) { var itemMetadataMap = instanceProps.itemMetadataMap, lastMeasuredIndex = instanceProps.lastMeasuredIndex, lastMeasuredItemOffset = lastMeasuredIndex > 0 ? itemMetadataMap[lastMeasuredIndex].offset : 0; return lastMeasuredItemOffset >= offset ? findNearestItemBinarySearch$1(props, instanceProps, lastMeasuredIndex, 0, offset) : findNearestItemExponentialSearch$1(props, instanceProps, Math.max(0, lastMeasuredIndex), offset); }, findNearestItemBinarySearch$1 = function(props, instanceProps, high, low, offset) { for (;low <= high; ) { var middle = low + Math.floor((high - low) / 2), currentOffset = getItemMetadata$1(props, middle, instanceProps).offset; if (currentOffset === offset) return middle; currentOffset < offset ? low = middle + 1 : currentOffset > offset && (high = middle - 1); } return low > 0 ? low - 1 : 0; }, findNearestItemExponentialSearch$1 = function(props, instanceProps, index, offset) { for (var itemCount = props.itemCount, interval = 1; index < itemCount && getItemMetadata$1(props, index, instanceProps).offset < offset; ) index += interval, interval *= 2; return findNearestItemBinarySearch$1(props, instanceProps, Math.min(index, itemCount - 1), Math.floor(index / 2), offset); }, getEstimatedTotalSize = function(_ref2, _ref3) { var itemCount = _ref2.itemCount, itemMetadataMap = _ref3.itemMetadataMap, estimatedItemSize = _ref3.estimatedItemSize, lastMeasuredIndex = _ref3.lastMeasuredIndex, totalSizeOfMeasuredItems = 0; if (lastMeasuredIndex >= 0) { var itemMetadata = itemMetadataMap[lastMeasuredIndex]; totalSizeOfMeasuredItems = itemMetadata.offset + itemMetadata.size; } var numUnmeasuredItems = itemCount - lastMeasuredIndex - 1, totalSizeOfUnmeasuredItems = numUnmeasuredItems * estimatedItemSize; return totalSizeOfMeasuredItems + totalSizeOfUnmeasuredItems; }, VariableSizeList = createListComponent({ getItemOffset: function(props, index, instanceProps) { return getItemMetadata$1(props, index, instanceProps).offset; }, getItemSize: function(props, index, instanceProps) { return instanceProps.itemMetadataMap[index].size; }, getEstimatedTotalSize: getEstimatedTotalSize, getOffsetForIndexAndAlignment: function(props, index, align, scrollOffset, instanceProps) { var direction = props.direction, height = props.height, width = props.width, size = "horizontal" === direction ? width : height, itemMetadata = getItemMetadata$1(props, index, instanceProps), estimatedTotalSize = getEstimatedTotalSize(props, instanceProps), maxOffset = Math.min(estimatedTotalSize - size, itemMetadata.offset), minOffset = Math.max(0, itemMetadata.offset - size + itemMetadata.size); switch (align) { case "start": return maxOffset; case "end": return minOffset; case "center": return Math.round(minOffset + (maxOffset - minOffset) / 2); case "auto": default: return scrollOffset >= minOffset && scrollOffset <= maxOffset ? scrollOffset : scrollOffset - minOffset < maxOffset - scrollOffset ? minOffset : maxOffset; } }, getStartIndexForOffset: function(props, offset, instanceProps) { return findNearestItem$1(props, instanceProps, offset); }, getStopIndexForStartIndex: function(props, startIndex, scrollOffset, instanceProps) { for (var direction = props.direction, height = props.height, itemCount = props.itemCount, width = props.width, size = "horizontal" === direction ? width : height, itemMetadata = getItemMetadata$1(props, startIndex, instanceProps), maxOffset = scrollOffset + size, offset = itemMetadata.offset + itemMetadata.size, stopIndex = startIndex; stopIndex < itemCount - 1 && offset < maxOffset; ) stopIndex++, offset += getItemMetadata$1(props, stopIndex, instanceProps).size; return stopIndex; }, initInstanceProps: function(props, instance) { var _ref4 = props, estimatedItemSize = _ref4.estimatedItemSize, instanceProps = { itemMetadataMap: {}, estimatedItemSize: estimatedItemSize || DEFAULT_ESTIMATED_ITEM_SIZE$1, lastMeasuredIndex: -1 }; return instance.resetAfterIndex = function(index) { var shouldForceUpdate = !(arguments.length > 1 && void 0 !== arguments[1]) || arguments[1]; instanceProps.lastMeasuredIndex = Math.min(instanceProps.lastMeasuredIndex, index - 1), instance._getItemStyleCache(-1), shouldForceUpdate && instance.forceUpdate(); }, instanceProps; }, shouldResetStyleCacheOnItemSizeChange: !1, validateProps: function(_ref5) { _ref5.itemSize; } }), FixedSizeGrid = createGridComponent({ getColumnOffset: function(_ref, index) { var columnWidth = _ref.columnWidth; return index * columnWidth; }, getColumnWidth: function(_ref2, index) { var columnWidth = _ref2.columnWidth; return columnWidth; }, getRowOffset: function(_ref3, index) { var rowHeight = _ref3.rowHeight; return index * rowHeight; }, getRowHeight: function(_ref4, index) { var rowHeight = _ref4.rowHeight; return rowHeight; }, getEstimatedTotalHeight: function(_ref5) { var rowCount = _ref5.rowCount, rowHeight = _ref5.rowHeight; return rowHeight * rowCount; }, getEstimatedTotalWidth: function(_ref6) { var columnCount = _ref6.columnCount, columnWidth = _ref6.columnWidth; return columnWidth * columnCount; }, getOffsetForColumnAndAlignment: function(_ref7, columnIndex, align, scrollLeft) { var columnCount = _ref7.columnCount, columnWidth = _ref7.columnWidth, width = _ref7.width, maxOffset = Math.min(columnCount * columnWidth - width, columnIndex * columnWidth), minOffset = Math.max(0, columnIndex * columnWidth - width + columnWidth); switch (align) { case "start": return maxOffset; case "end": return minOffset; case "center": return Math.round(minOffset + (maxOffset - minOffset) / 2); case "auto": default: return scrollLeft >= minOffset && scrollLeft <= maxOffset ? scrollLeft : scrollLeft - minOffset < maxOffset - scrollLeft ? minOffset : maxOffset; } }, getOffsetForRowAndAlignment: function(_ref8, rowIndex, align, scrollTop) { var rowHeight = _ref8.rowHeight, height = _ref8.height, rowCount = _ref8.rowCount, maxOffset = Math.min(rowCount * rowHeight - height, rowIndex * rowHeight), minOffset = Math.max(0, rowIndex * rowHeight - height + rowHeight); switch (align) { case "start": return maxOffset; case "end": return minOffset; case "center": return Math.round(minOffset + (maxOffset - minOffset) / 2); case "auto": default: return scrollTop >= minOffset && scrollTop <= maxOffset ? scrollTop : scrollTop - minOffset < maxOffset - scrollTop ? minOffset : maxOffset; } }, getColumnStartIndexForOffset: function(_ref9, scrollLeft) { var columnWidth = _ref9.columnWidth, columnCount = _ref9.columnCount; return Math.max(0, Math.min(columnCount - 1, Math.floor(scrollLeft / columnWidth))); }, getColumnStopIndexForStartIndex: function(_ref10, startIndex, scrollLeft) { var columnWidth = _ref10.columnWidth, columnCount = _ref10.columnCount, width = _ref10.width, left = startIndex * columnWidth; return Math.max(0, Math.min(columnCount - 1, startIndex + Math.floor((width + (scrollLeft - left)) / columnWidth))); }, getRowStartIndexForOffset: function(_ref11, scrollTop) { var rowHeight = _ref11.rowHeight, rowCount = _ref11.rowCount; return Math.max(0, Math.min(rowCount - 1, Math.floor(scrollTop / rowHeight))); }, getRowStopIndexForStartIndex: function(_ref12, startIndex, scrollTop) { var rowHeight = _ref12.rowHeight, rowCount = _ref12.rowCount, height = _ref12.height, left = startIndex * rowHeight; return Math.max(0, Math.min(rowCount - 1, startIndex + Math.floor((height + (scrollTop - left)) / rowHeight))); }, initInstanceProps: function(props) {}, shouldResetStyleCacheOnItemSizeChange: !0, validateProps: function(_ref13) { _ref13.columnWidth, _ref13.rowHeight; } }), FixedSizeList = createListComponent({ getItemOffset: function(_ref, index) { var itemSize = _ref.itemSize; _ref.size; return index * itemSize; }, getItemSize: function(_ref2, index) { var itemSize = _ref2.itemSize; _ref2.size; return itemSize; }, getEstimatedTotalSize: function(_ref3) { var itemCount = _ref3.itemCount, itemSize = _ref3.itemSize; return itemSize * itemCount; }, getOffsetForIndexAndAlignment: function(_ref4, index, align, scrollOffset) { var direction = _ref4.direction, height = _ref4.height, itemCount = _ref4.itemCount, itemSize = _ref4.itemSize, width = _ref4.width, size = "horizontal" === direction ? width : height, maxOffset = Math.min(itemCount * itemSize - size, index * itemSize), minOffset = Math.max(0, index * itemSize - size + itemSize); switch (align) { case "start": return maxOffset; case "end": return minOffset; case "center": return Math.round(minOffset + (maxOffset - minOffset) / 2); case "auto": default: return scrollOffset >= minOffset && scrollOffset <= maxOffset ? scrollOffset : scrollOffset - minOffset < maxOffset - scrollOffset ? minOffset : maxOffset; } }, getStartIndexForOffset: function(_ref5, offset) { var itemCount = _ref5.itemCount, itemSize = _ref5.itemSize; return Math.max(0, Math.min(itemCount - 1, Math.floor(offset / itemSize))); }, getStopIndexForStartIndex: function(_ref6, startIndex, scrollOffset) { var direction = _ref6.direction, height = _ref6.height, itemCount = _ref6.itemCount, itemSize = _ref6.itemSize, width = _ref6.width, offset = startIndex * itemSize, size = "horizontal" === direction ? width : height; return Math.max(0, Math.min(itemCount - 1, startIndex + Math.floor((size + (scrollOffset - offset)) / itemSize))); }, initInstanceProps: function(props) {}, shouldResetStyleCacheOnItemSizeChange: !0, validateProps: function(_ref7) { _ref7.itemSize; } }); exports.VariableSizeGrid = VariableSizeGrid, exports.VariableSizeList = VariableSizeList, exports.FixedSizeGrid = FixedSizeGrid, exports.FixedSizeList = FixedSizeList; }, function(module, exports, __webpack_require__) { "use strict"; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } Object.defineProperty(exports, "__esModule", { value: !0 }); var _extends = Object.assign || function(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) Object.prototype.hasOwnProperty.call(source, key) && (target[key] = source[key]); } return target; }, _react = __webpack_require__(12), _react2 = _interopRequireDefault(_react), _constants = __webpack_require__(357), minWidthToDisplay = 35, ChartNode = function(_ref) { var color = _ref.color, height = _ref.height, _ref$isDimmed = _ref.isDimmed, isDimmed = void 0 !== _ref$isDimmed && _ref$isDimmed, label = _ref.label, onClick = _ref.onClick, onDoubleClick = _ref.onDoubleClick, theme = _ref.theme, title = _ref.title, width = _ref.width, x = _ref.x, y = _ref.y; return _react2["default"].createElement("g", { style: ChartAnimatedNode, transform: "translate(" + x + "," + y + ")" }, _react2["default"].createElement("title", null, title), _react2["default"].createElement("rect", { width: width, height: height, fill: color, onClick: onClick, onDoubleClick: onDoubleClick, style: ChartRect(theme, isDimmed) }), width >= minWidthToDisplay && _react2["default"].createElement("foreignObject", { width: width, height: height, style: _extends({}, ChartAnimatedNode, { opacity: isDimmed ? .75 : 1, display: width < minWidthToDisplay ? "none" : "block", paddingLeft: x < 0 ? -x : 0, pointerEvents: "none" }), y: height < _constants.textHeight ? -_constants.textHeight : 0 }, _react2["default"].createElement("div", { style: ChartLabel }, label))); }, ChartAnimatedNode = { transition: "all ease-in-out 250ms" }, ChartRect = function(theme, isDimmed) { return _extends({ cursor: "pointer", opacity: isDimmed ? .5 : 1, stroke: theme.base00 }, ChartAnimatedNode); }, ChartLabel = _extends({ pointerEvents: "none", whiteSpace: "nowrap", textOverflow: "ellipsis", overflow: "hidden", fontSize: "12px", fontFamily: "sans-serif", marginLeft: "4px", marginRight: "4px", lineHeight: "1.5", padding: "0 0 0", fontWeight: "400", color: "black", textAlign: "left" }, ChartAnimatedNode); exports["default"] = ChartNode; }, function(module, exports, __webpack_require__) { "use strict"; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } Object.defineProperty(exports, "__esModule", { value: !0 }); var _react = __webpack_require__(12), _react2 = _interopRequireDefault(_react), _Fonts = __webpack_require__(17); exports["default"] = function(_ref) { var height = (_ref.commitThreshold, _ref.height), hideCommitsBelowThreshold = _ref.hideCommitsBelowThreshold, stopInspecting = _ref.stopInspecting, width = _ref.width; return _react2["default"].createElement("div", { style: { display: "flex", flexDirection: "column", alignItems: "center", justifyContent: "center", textAlign: "center", height: height, width: width } }, !hideCommitsBelowThreshold && _react2["default"].createElement("p", { style: { fontSize: _Fonts.sansSerif.sizes.large } }, "No render times were recorded for the selected element."), hideCommitsBelowThreshold && _react2["default"].createElement("p", { style: { fontSize: _Fonts.sansSerif.sizes.large } }, "No render times were recorded for the selected element based on the current commit threshold."), _react2["default"].createElement("p", null, _react2["default"].createElement("button", { onClick: stopInspecting }, "Return to the previous view"))); }; }, function(module, exports, __webpack_require__) { "use strict"; 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 || "object" != typeof call && "function" != typeof call ? self : call; } function _inherits(subClass, superClass) { if ("function" != typeof superClass && null !== superClass) 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: !1, writable: !0, configurable: !0 } }), superClass && (Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass); } Object.defineProperty(exports, "__esModule", { value: !0 }); var _slicedToArray = function() { function sliceIterator(arr, i) { var _arr = [], _n = !0, _d = !1, _e = void 0; try { for (var _s, _i = arr[Symbol.iterator](); !(_n = (_s = _i.next()).done) && (_arr.push(_s.value), !i || _arr.length !== i); _n = !0) ; } catch (err) { _d = !0, _e = err; } finally { try { !_n && _i["return"] && _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function(arr, i) { if (Array.isArray(arr)) return arr; if (Symbol.iterator in Object(arr)) return sliceIterator(arr, i); throw new TypeError("Invalid attempt to destructure non-iterable instance"); }; }(), _extends = Object.assign || function(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) Object.prototype.hasOwnProperty.call(source, key) && (target[key] = source[key]); } return target; }, _createClass = function() { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0, "value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor); } } return function(Constructor, protoProps, staticProps) { return protoProps && defineProperties(Constructor.prototype, protoProps), staticProps && defineProperties(Constructor, staticProps), Constructor; }; }(), _memoizeOne = __webpack_require__(358), _memoizeOne2 = _interopRequireDefault(_memoizeOne), _react = __webpack_require__(12), _react2 = _interopRequireDefault(_react), _reactWindow = __webpack_require__(361), _reactVirtualizedAutoSizer = __webpack_require__(360), _reactVirtualizedAutoSizer2 = _interopRequireDefault(_reactVirtualizedAutoSizer), _NoInteractionsMessage = __webpack_require__(365), _NoInteractionsMessage2 = _interopRequireDefault(_NoInteractionsMessage), _constants = __webpack_require__(357), INTERACTION_SIZE = 4, ITEM_SIZE = 25, SNAPSHOT_SIZE = 10, InteractionTimeline = function(_ref) { var cacheInteractionData = _ref.cacheInteractionData, getCachedInteractionData = _ref.getCachedInteractionData, hasMultipleRoots = _ref.hasMultipleRoots, interactionsToSnapshots = _ref.interactionsToSnapshots, maxDuration = _ref.maxDuration, selectedInteraction = _ref.selectedInteraction, selectedSnapshot = _ref.selectedSnapshot, selectInteraction = _ref.selectInteraction, theme = _ref.theme, timestampsToInteractions = _ref.timestampsToInteractions, chartData = getCachedInteractionData(selectedSnapshot.root); return null === chartData && (chartData = getChartData(interactionsToSnapshots, maxDuration, timestampsToInteractions), cacheInteractionData(selectedSnapshot.root, chartData)), _react2["default"].createElement(_reactVirtualizedAutoSizer2["default"], null, function(_ref2) { var height = _ref2.height, width = _ref2.width; return _react2["default"].createElement(InteractionsList, { chartData: chartData, hasMultipleRoots: hasMultipleRoots, height: height, selectedInteraction: selectedInteraction, selectedSnapshot: selectedSnapshot, selectInteraction: selectInteraction, theme: theme, width: width }); }); }, InteractionsList = function(_PureComponent) { function InteractionsList() { var _ref3, _temp, _this, _ret; _classCallCheck(this, InteractionsList); for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) args[_key] = arguments[_key]; return _temp = _this = _possibleConstructorReturn(this, (_ref3 = InteractionsList.__proto__ || Object.getPrototypeOf(InteractionsList)).call.apply(_ref3, [ this ].concat(args))), _this.handleKeyDown = function(event) { event.keyCode !== UP_ARROW && event.keyCode !== DOWN_ARROW || !function() { event.preventDefault(); var _this$props = _this.props, chartData = _this$props.chartData, selectedInteraction = _this$props.selectedInteraction, selectInteraction = _this$props.selectInteraction, items = chartData.items, index = items.findIndex(function(_ref4) { var interaction = _ref4.interaction; return selectedInteraction === interaction; }), newIndex = 0; newIndex = event.keyCode === UP_ARROW ? index > 0 ? index - 1 : items.length - 1 : index < items.length - 1 ? index + 1 : 0, selectInteraction(items[newIndex].interaction); }(); }, _ret = _temp, _possibleConstructorReturn(_this, _ret); } return _inherits(InteractionsList, _PureComponent), _createClass(InteractionsList, [ { key: "render", value: function() { var _props = this.props, chartData = _props.chartData, hasMultipleRoots = _props.hasMultipleRoots, height = _props.height, selectedInteraction = _props.selectedInteraction, selectedSnapshot = _props.selectedSnapshot, selectInteraction = _props.selectInteraction, theme = _props.theme, width = _props.width; if (0 === chartData.items.length) return _react2["default"].createElement(_NoInteractionsMessage2["default"], { hasMultipleRoots: hasMultipleRoots, height: height, width: width }); var itemData = getItemData(chartData, selectedInteraction, selectedSnapshot, selectInteraction, theme, width); return _react2["default"].createElement("div", { onKeyDown: this.handleKeyDown, style: { outline: "none", height: height, width: width }, tabIndex: 0 }, _react2["default"].createElement(_reactWindow.FixedSizeList, { height: height, itemCount: chartData.items.length, itemData: itemData, itemSize: ITEM_SIZE, width: width }, ListItem)); } } ]), InteractionsList; }(_react.PureComponent), UP_ARROW = 38, DOWN_ARROW = 40, ListItem = function(_PureComponent2) { function ListItem() { var _ref5, _temp2, _this2, _ret3; _classCallCheck(this, ListItem); for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) args[_key2] = arguments[_key2]; return _temp2 = _this2 = _possibleConstructorReturn(this, (_ref5 = ListItem.__proto__ || Object.getPrototypeOf(ListItem)).call.apply(_ref5, [ this ].concat(args))), _this2.state = { isHovered: !1 }, _this2.handleMouseEnter = function() { return _this2.setState({ isHovered: !0 }); }, _this2.handleMouseLeave = function() { return _this2.setState({ isHovered: !1 }); }, _ret3 = _temp2, _possibleConstructorReturn(_this2, _ret3); } return _inherits(ListItem, _PureComponent2), _createClass(ListItem, [ { key: "render", value: function() { var _props2 = this.props, itemData = _props2.data, itemIndex = _props2.index, style = _props2.style, isHovered = this.state.isHovered, chartData = itemData.chartData, labelColumnWidth = itemData.labelColumnWidth, scaleX = itemData.scaleX, selectedInteraction = itemData.selectedInteraction, selectedSnapshot = itemData.selectedSnapshot, theme = itemData.theme, items = chartData.items, maxDuration = chartData.maxDuration, item = items[itemIndex], interaction = item.interaction, lastSnapshotCommitTime = item.lastSnapshotCommitTime; return _react2["default"].createElement("div", { onClick: function() { return itemData.selectInteraction(interaction); }, onMouseEnter: this.handleMouseEnter, onMouseLeave: this.handleMouseLeave, style: _extends({}, style, { display: "flex", alignItems: "center", backgroundColor: isHovered ? theme.state03 : selectedInteraction === interaction ? theme.base01 : "transparent", borderBottom: "1px solid " + theme.base01, cursor: "pointer" }) }, _react2["default"].createElement("div", { style: { width: labelColumnWidth, overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap", lineHeight: ITEM_SIZE + "px", boxSizing: "border-box", padding: "0 0.25rem", color: isHovered ? theme.state00 : theme.base05, textDecoration: isHovered ? "underline" : "none", userSelect: "none" }, title: interaction.name }, interaction.name), _react2["default"].createElement("div", { style: { position: "absolute", left: labelColumnWidth + scaleX(interaction.timestamp, 0) + "px", width: scaleX(lastSnapshotCommitTime - interaction.timestamp, 0) + SNAPSHOT_SIZE + "px", height: INTERACTION_SIZE + "px", backgroundColor: theme.base03, borderRadius: "0.125rem" } }), item.snapshots.map(function(snapshot, snapshotIndex) { var percentage = Math.min(1, Math.max(0, snapshot.duration / maxDuration)) || 0; return _react2["default"].createElement("div", { key: snapshotIndex, style: { position: "absolute", left: labelColumnWidth + scaleX(snapshot.commitTime, 0) + "px", width: SNAPSHOT_SIZE + "px", height: SNAPSHOT_SIZE + "px", backgroundColor: selectedSnapshot === snapshot ? theme.state06 : (0, _constants.getGradientColor)(percentage), boxSizing: "border-box", cursor: "pointer" } }); })); } } ]), ListItem; }(_react.PureComponent), getChartData = (0, _memoizeOne2["default"])(function(interactionsToSnapshots, maxDuration, timestampsToInteractions) { var items = [], stopTime = Number.MIN_VALUE, _iteratorNormalCompletion = !0, _didIteratorError = !1, _iteratorError = void 0; try { for (var _step, _iterator = timestampsToInteractions[Symbol.iterator](); !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0) { var _step$value = _slicedToArray(_step.value, 2), interactions = (_step$value[0], _step$value[1]), _iteratorNormalCompletion2 = !0, _didIteratorError2 = !1, _iteratorError2 = void 0; try { for (var _step2, _iterator2 = interactions[Symbol.iterator](); !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = !0) { var _interaction = _step2.value, _snapshots = Array.from(interactionsToSnapshots.get(_interaction)), _lastSnapshotCommitTime = _snapshots[_snapshots.length - 1].commitTime; stopTime = Math.max(stopTime, _lastSnapshotCommitTime), items.push({ interaction: _interaction, lastSnapshotCommitTime: _lastSnapshotCommitTime, snapshots: _snapshots }); } } catch (err) { _didIteratorError2 = !0, _iteratorError2 = err; } finally { try { !_iteratorNormalCompletion2 && _iterator2["return"] && _iterator2["return"](); } finally { if (_didIteratorError2) throw _iteratorError2; } } } } catch (err) { _didIteratorError = !0, _iteratorError = err; } finally { try { !_iteratorNormalCompletion && _iterator["return"] && _iterator["return"](); } finally { if (_didIteratorError) throw _iteratorError; } } return { items: items, maxDuration: maxDuration, stopTime: stopTime }; }), getItemData = (0, _memoizeOne2["default"])(function(chartData, selectedInteraction, selectedSnapshot, selectInteraction, theme, width) { var labelColumnWidth = Math.min(200, width / 5), graphColumnWidth = width - labelColumnWidth - SNAPSHOT_SIZE; return { chartData: chartData, graphColumnWidth: graphColumnWidth, labelColumnWidth: labelColumnWidth, scaleX: (0, _constants.scale)(0, chartData.stopTime, 0, graphColumnWidth), selectedInteraction: selectedInteraction, selectedSnapshot: selectedSnapshot, selectInteraction: selectInteraction, theme: theme }; }); exports["default"] = InteractionTimeline; }, function(module, exports, __webpack_require__) { "use strict"; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } Object.defineProperty(exports, "__esModule", { value: !0 }); var _react = __webpack_require__(12), _react2 = _interopRequireDefault(_react), _Fonts = __webpack_require__(17); exports["default"] = function(_ref) { var hasMultipleRoots = _ref.hasMultipleRoots, height = _ref.height, width = _ref.width, headerText = void 0; return headerText = hasMultipleRoots ? "No interactions were recorded for the selected root." : "No interactions were recorded.", _react2["default"].createElement("div", { style: { height: height, width: width, flex: 1, display: "flex", flexDirection: "column", alignItems: "center", justifyContent: "center" } }, _react2["default"].createElement("p", { style: { fontSize: _Fonts.sansSerif.sizes.large } }, headerText), hasMultipleRoots && _react2["default"].createElement("p", null, "You may want to select a different root in the ", _react2["default"].createElement("strong", null, "Elements"), " panel."), _react2["default"].createElement("p", null, _react2["default"].createElement("a", { href: "https://fb.me/react-interaction-tracking", target: "_blank" }, "Learn more about the interaction tracking API here"), ".")); }; }, function(module, exports, __webpack_require__) { "use strict"; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } Object.defineProperty(exports, "__esModule", { value: !0 }); var _react = __webpack_require__(12), _react2 = _interopRequireDefault(_react), _Icons = __webpack_require__(61), _Icons2 = _interopRequireDefault(_Icons), _SvgIcon = __webpack_require__(60), _SvgIcon2 = _interopRequireDefault(_SvgIcon), _Fonts = __webpack_require__(17); exports["default"] = function(_ref) { var hasMultipleRoots = _ref.hasMultipleRoots, startRecording = _ref.startRecording, theme = _ref.theme, buttonPreMessage = void 0, headerText = void 0; return hasMultipleRoots ? (buttonPreMessage = _react2["default"].createElement(_react.Fragment, null, "Select a different root in the ", _react2["default"].createElement("strong", null, "Elements"), " panel, or click the record button"), headerText = "No profiling data has been recorded for the selected root.") : (buttonPreMessage = _react2["default"].createElement(_react.Fragment, null, "Click the record button"), headerText = "No profiling data has been recorded."), _react2["default"].createElement("div", { style: { height: "100%", flex: 1, display: "flex", flexDirection: "column", alignItems: "center", justifyContent: "center" } }, _react2["default"].createElement("p", { style: { fontSize: _Fonts.sansSerif.sizes.large } }, headerText), _react2["default"].createElement("p", null, buttonPreMessage, _react2["default"].createElement("button", { onClick: startRecording, style: { display: "inline-block", background: theme.base01, outline: "none", cursor: "pointer", color: theme.base05, padding: ".5rem", margin: "0 0.25rem", border: "1px solid " + theme.base03 }, title: "Start recording" }, _react2["default"].createElement(_SvgIcon2["default"], { path: _Icons2["default"].RECORD, style: { flex: "0 0 1rem", width: "1rem", height: "1rem", fill: "currentColor", display: "inline", verticalAlign: "sub" } })), "to start a new recording.")); }; }, function(module, exports, __webpack_require__) { "use strict"; 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 || "object" != typeof call && "function" != typeof call ? self : call; } function _inherits(subClass, superClass) { if ("function" != typeof superClass && null !== superClass) 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: !1, writable: !0, configurable: !0 } }), superClass && (Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass); } Object.defineProperty(exports, "__esModule", { value: !0 }); var _slicedToArray = function() { function sliceIterator(arr, i) { var _arr = [], _n = !0, _d = !1, _e = void 0; try { for (var _s, _i = arr[Symbol.iterator](); !(_n = (_s = _i.next()).done) && (_arr.push(_s.value), !i || _arr.length !== i); _n = !0) ; } catch (err) { _d = !0, _e = err; } finally { try { !_n && _i["return"] && _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function(arr, i) { if (Array.isArray(arr)) return arr; if (Symbol.iterator in Object(arr)) return sliceIterator(arr, i); throw new TypeError("Invalid attempt to destructure non-iterable instance"); }; }(), _createClass = function() { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0, "value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor); } } return function(Constructor, protoProps, staticProps) { return protoProps && defineProperties(Constructor.prototype, protoProps), staticProps && defineProperties(Constructor, staticProps), Constructor; }; }(), _memoizeOne = __webpack_require__(358), _memoizeOne2 = _interopRequireDefault(_memoizeOne), _react = __webpack_require__(12), _react2 = _interopRequireDefault(_react), _reactVirtualizedAutoSizer = __webpack_require__(360), _reactVirtualizedAutoSizer2 = _interopRequireDefault(_reactVirtualizedAutoSizer), _reactWindow = __webpack_require__(361), _ChartNode = __webpack_require__(362), _ChartNode2 = _interopRequireDefault(_ChartNode), _NoSnapshotDataMessage = __webpack_require__(368), _NoSnapshotDataMessage2 = _interopRequireDefault(_NoSnapshotDataMessage), _constants = __webpack_require__(357), SnapshotFlamegraph = function(_ref) { var cacheDataForSnapshot = _ref.cacheDataForSnapshot, deselectFiber = _ref.deselectFiber, getCachedDataForSnapshot = _ref.getCachedDataForSnapshot, inspectFiber = _ref.inspectFiber, selectedFiberID = _ref.selectedFiberID, selectFiber = _ref.selectFiber, showNativeNodes = _ref.showNativeNodes, snapshot = _ref.snapshot, snapshotIndex = _ref.snapshotIndex, theme = _ref.theme, dataKey = showNativeNodes ? "SnapshotFlamegraphWithNativeNodes" : "SnapshotFlamegraphWithoutNativeNodes", flamegraphData = getCachedDataForSnapshot(snapshotIndex, snapshot.root, dataKey); return null === flamegraphData && (flamegraphData = convertSnapshotToChartData(showNativeNodes, snapshot), cacheDataForSnapshot(snapshotIndex, snapshot.root, dataKey, flamegraphData)), _react2["default"].createElement(_reactVirtualizedAutoSizer2["default"], null, function(_ref2) { var height = _ref2.height, width = _ref2.width; return _react2["default"].createElement(Flamegraph, { deselectFiber: deselectFiber, flamegraphData: flamegraphData, height: height, inspectFiber: inspectFiber, selectedFiberID: selectedFiberID, selectFiber: selectFiber, showNativeNodes: showNativeNodes, snapshot: snapshot, theme: theme, width: width }); }); }, Flamegraph = function(_ref3) { var deselectFiber = _ref3.deselectFiber, flamegraphData = _ref3.flamegraphData, height = _ref3.height, inspectFiber = _ref3.inspectFiber, selectedFiberID = _ref3.selectedFiberID, selectFiber = _ref3.selectFiber, snapshot = (_ref3.showNativeNodes, _ref3.snapshot), theme = _ref3.theme, width = _ref3.width, flameGraphDepth = flamegraphData.flameGraphDepth, lazyIDToDepthMap = flamegraphData.lazyIDToDepthMap, lazyIDsByDepth = flamegraphData.lazyIDsByDepth; if (null !== selectedFiberID) for (var index = lazyIDsByDepth.length; void 0 === lazyIDToDepthMap[selectedFiberID] && index < flameGraphDepth; ) calculateFibersAtDepth(flamegraphData, index, snapshot), index++; var itemData = getItemData(flamegraphData, inspectFiber, selectedFiberID, selectFiber, snapshot, theme, width); return 0 === flameGraphDepth ? _react2["default"].createElement(_NoSnapshotDataMessage2["default"], { height: height, width: width }) : _react2["default"].createElement("div", { onClick: deselectFiber, style: { height: height, width: width } }, _react2["default"].createElement(_reactWindow.FixedSizeList, { height: height, innerTagName: "svg", itemCount: flameGraphDepth, itemData: itemData, itemSize: _constants.barHeight, width: width }, ListItem)); }, ListItem = function(_PureComponent) { function ListItem() { var _ref4, _temp, _this, _ret; _classCallCheck(this, ListItem); for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) args[_key] = arguments[_key]; return _temp = _this = _possibleConstructorReturn(this, (_ref4 = ListItem.__proto__ || Object.getPrototypeOf(ListItem)).call.apply(_ref4, [ this ].concat(args))), _this.handleClick = function(id, name, event) { event.stopPropagation(); var itemData = _this.props.data; itemData.selectFiber(id, name); }, _this.handleDoubleClick = function(id, name, event) { event.stopPropagation(); var itemData = _this.props.data; itemData.inspectFiber(id, name); }, _ret = _temp, _possibleConstructorReturn(_this, _ret); } return _inherits(ListItem, _PureComponent), _createClass(ListItem, [ { key: "render", value: function() { var _this2 = this, _props = this.props, index = _props.index, style = _props.style, itemData = this.props.data, flamegraphData = itemData.flamegraphData, scaleX = itemData.scaleX, selectedFiberID = itemData.selectedFiberID, snapshot = itemData.snapshot, width = itemData.width, lazyIDToDepthMap = flamegraphData.lazyIDToDepthMap, lazyIDToXMap = flamegraphData.lazyIDToXMap, maxSelfDuration = flamegraphData.maxSelfDuration, selfDurations = flamegraphData.selfDurations, committedNodes = snapshot.committedNodes, nodes = snapshot.nodes, top = parseInt(style.top, 10), ids = calculateFibersAtDepth(flamegraphData, index, snapshot), focusedNodeIndex = 0, focusedNodeX = 0; return null !== selectedFiberID && (focusedNodeIndex = lazyIDToDepthMap[selectedFiberID] || 0, focusedNodeX = scaleX(lazyIDToXMap[selectedFiberID], 0) || 0), _react2["default"].createElement(_react.Fragment, null, ids.map(function(id) { var fiber = nodes.get(id), treeBaseDuration = fiber.get("treeBaseDuration"), nodeWidth = scaleX(treeBaseDuration, width); if (nodeWidth < _constants.barWidthThreshold) return null; var nodeX = scaleX(lazyIDToXMap[id], 0); if (nodeX + nodeWidth < focusedNodeX || nodeX > focusedNodeX + width) return null; var actualDuration = fiber.get("actualDuration") || 0, selfDuration = selfDurations[id] || 0, name = fiber.get("name") || "Unknown", didRender = committedNodes.includes(id), color = _constants.didNotRender, label = name; return didRender && (color = (0, _constants.getGradientColor)(selfDuration / maxSelfDuration), label = name + " (" + selfDuration.toFixed(1) + "ms of " + actualDuration.toFixed(1) + "ms)"), _react2["default"].createElement(_ChartNode2["default"], { color: color, height: _constants.barHeight, isDimmed: index < focusedNodeIndex, key: id, label: label, onClick: _this2.handleClick.bind(_this2, id, name), onDoubleClick: _this2.handleDoubleClick.bind(_this2, id, name), theme: itemData.theme, title: label, width: nodeWidth, x: nodeX - focusedNodeX, y: top }); })); } } ]), ListItem; }(_react.PureComponent), convertSnapshotToChartData = function(showNativeNodes, snapshot) { var _computeSelfDurations = computeSelfDurations(snapshot, showNativeNodes), _computeSelfDurations2 = _slicedToArray(_computeSelfDurations, 2), selfDurations = _computeSelfDurations2[0], maxSelfDuration = _computeSelfDurations2[1], flamegraphData = { flameGraphDepth: calculateFlameGraphDepth(showNativeNodes, snapshot), lazyIDToDepthMap: {}, lazyIDToXMap: {}, lazyIDsByDepth: [], maxSelfDuration: maxSelfDuration, selfDurations: selfDurations, showNativeNodes: showNativeNodes }; return flamegraphData.lazyIDsByDepth[0] = calculateFibersAtDepthCrawler(0, flamegraphData, snapshot.root, 0, [], snapshot), flamegraphData; }, calculateFlameGraphDepth = function(showNativeNodes, snapshot) { var maxDepth = 0, walkTree = function walkTree(nodeID) { var currentDepth = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 0, nodeType = snapshot.nodes.getIn([ nodeID, "nodeType" ]); if (void 0 !== nodeType) { ("Composite" === nodeType || showNativeNodes && "Native" === nodeType) && (currentDepth++, maxDepth = Math.max(maxDepth, currentDepth)); var children = snapshot.nodes.getIn([ nodeID, "children" ]); Array.isArray(children) ? children.forEach(function(childID) { return walkTree(childID, currentDepth); }) : null != children && walkTree(children, currentDepth); } }; return walkTree(snapshot.root), maxDepth; }, getItemData = (0, _memoizeOne2["default"])(function(flamegraphData, inspectFiber, selectedFiberID, selectFiber, snapshot, theme, width) { var maxTreeBaseDuration = getMaxTreeBaseDuration(flamegraphData, selectedFiberID, snapshot); return { flamegraphData: flamegraphData, inspectFiber: inspectFiber, maxTreeBaseDuration: maxTreeBaseDuration, scaleX: (0, _constants.scale)(0, maxTreeBaseDuration, 0, width), selectedFiberID: selectedFiberID, selectFiber: selectFiber, snapshot: snapshot, theme: theme, width: width }; }), getMaxTreeBaseDuration = function(flamegraphData, selectedFiberID, snapshot) { var baseNodeID = flamegraphData.lazyIDsByDepth[0][0]; return snapshot.nodes.getIn([ selectedFiberID, "treeBaseDuration" ]) || snapshot.nodes.getIn([ baseNodeID, "treeBaseDuration" ]); }, computeSelfDurations = (0, _memoizeOne2["default"])(function(snapshot, showNativeNodes) { var committedNodes = snapshot.committedNodes, nodes = snapshot.nodes, selfDurations = {}, maxSelfDuration = 0; return committedNodes.filter(function(nodeID) { var nodeType = nodes.getIn([ nodeID, "nodeType" ]); return "Composite" === nodeType || "Native" === nodeType && showNativeNodes; }).forEach(function(nodeID) { var selfDuration = (0, _constants.calculateSelfDuration)(snapshot, nodeID); selfDurations[nodeID] = selfDuration, maxSelfDuration = Math.max(maxSelfDuration, selfDuration); }), [ selfDurations, maxSelfDuration ]; }), calculateFibersAtDepth = function(flamegraphData, depth, snapshot) { for (var lazyIDsByDepth = flamegraphData.lazyIDsByDepth, lazyIDToXMap = flamegraphData.lazyIDToXMap, _loop = function(index) { var nodesAtPreviousDepth = lazyIDsByDepth[index - 1]; lazyIDsByDepth[index] = nodesAtPreviousDepth.reduce(function(nodesAtDepth, parentID) { return calculateFibersAtDepthCrawler(index, flamegraphData, parentID, lazyIDToXMap[parentID], nodesAtDepth, snapshot); }, []); }, index = lazyIDsByDepth.length; index <= depth; index++) _loop(index); return lazyIDsByDepth[depth]; }, calculateFibersAtDepthCrawler = function calculateFibersAtDepthCrawler(depth, flamegraphData, id) { var leftOffset = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : 0, nodesAtDepth = arguments[4], snapshot = arguments[5], lazyIDToDepthMap = flamegraphData.lazyIDToDepthMap, lazyIDToXMap = flamegraphData.lazyIDToXMap, showNativeNodes = flamegraphData.showNativeNodes, nodes = snapshot.nodes, children = nodes.getIn([ id, "children" ]), childArray = null; return Array.isArray(children) ? childArray = children : null != children && (childArray = [ children ]), null !== childArray && childArray.forEach(function(childID) { var fiber = nodes.get(childID); if (void 0 !== fiber) { var nodeType = fiber.get("nodeType"); if ("Composite" === nodeType || "Native" === nodeType && showNativeNodes) { var prevID = nodesAtDepth.length ? nodesAtDepth[nodesAtDepth.length - 1] : null, prevNodeTreeBaseDuration = nodes.getIn([ prevID, "treeBaseDuration" ]) || 0, prevNodeX = null !== prevID ? lazyIDToXMap[prevID] : 0, x = Math.max(leftOffset, prevNodeX + prevNodeTreeBaseDuration); nodesAtDepth.push(childID), lazyIDToDepthMap[childID] = depth, lazyIDToXMap[childID] = x; } else calculateFibersAtDepthCrawler(depth, flamegraphData, childID, leftOffset, nodesAtDepth, snapshot); } }), nodesAtDepth; }; exports["default"] = SnapshotFlamegraph; }, function(module, exports, __webpack_require__) { "use strict"; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } Object.defineProperty(exports, "__esModule", { value: !0 }); var _react = __webpack_require__(12), _react2 = _interopRequireDefault(_react), _Fonts = __webpack_require__(17); exports["default"] = function(_ref) { var height = _ref.height, width = _ref.width; return _react2["default"].createElement("div", { style: { display: "flex", flexDirection: "column", alignItems: "center", justifyContent: "center", textAlign: "center", height: height, width: width } }, _react2["default"].createElement("p", { style: { fontSize: _Fonts.sansSerif.sizes.large } }, "There is no timing data to display for the currently selected commit."), _react2["default"].createElement("p", null, "This can indicate that a render occurred too quickly for the timing API to measure. Try selecting another commit in the upper, right-hand corner.")); }; }, function(module, exports, __webpack_require__) { "use strict"; 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 || "object" != typeof call && "function" != typeof call ? self : call; } function _inherits(subClass, superClass) { if ("function" != typeof superClass && null !== superClass) 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: !1, writable: !0, configurable: !0 } }), superClass && (Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass); } Object.defineProperty(exports, "__esModule", { value: !0 }); var _createClass = function() { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0, "value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor); } } return function(Constructor, protoProps, staticProps) { return protoProps && defineProperties(Constructor.prototype, protoProps), staticProps && defineProperties(Constructor, staticProps), Constructor; }; }(), _memoizeOne = __webpack_require__(358), _memoizeOne2 = _interopRequireDefault(_memoizeOne), _react = __webpack_require__(12), _react2 = _interopRequireDefault(_react), _reactVirtualizedAutoSizer = __webpack_require__(360), _reactVirtualizedAutoSizer2 = _interopRequireDefault(_reactVirtualizedAutoSizer), _reactWindow = __webpack_require__(361), _ChartNode = __webpack_require__(362), _ChartNode2 = _interopRequireDefault(_ChartNode), _NoSnapshotDataMessage = __webpack_require__(368), _NoSnapshotDataMessage2 = _interopRequireDefault(_NoSnapshotDataMessage), _constants = __webpack_require__(357), SnapshotRanked = function(_ref) { var cacheDataForSnapshot = _ref.cacheDataForSnapshot, deselectFiber = _ref.deselectFiber, getCachedDataForSnapshot = _ref.getCachedDataForSnapshot, inspectFiber = _ref.inspectFiber, selectedFiberID = _ref.selectedFiberID, selectFiber = _ref.selectFiber, showNativeNodes = _ref.showNativeNodes, snapshot = _ref.snapshot, snapshotIndex = _ref.snapshotIndex, theme = _ref.theme, dataKey = showNativeNodes ? "SnapshotRankedDataWithNativeNodes" : "SnapshotRankedDataWithoutNativeNodes", rankedData = getCachedDataForSnapshot(snapshotIndex, snapshot.root, dataKey); return null === rankedData && (rankedData = convertSnapshotToChartData(snapshot, showNativeNodes), cacheDataForSnapshot(snapshotIndex, snapshot.root, dataKey, rankedData)), _react2["default"].createElement(_reactVirtualizedAutoSizer2["default"], null, function(_ref2) { var height = _ref2.height, width = _ref2.width; return _react2["default"].createElement(SnapshotRankedInner, { deselectFiber: deselectFiber, height: height, inspectFiber: inspectFiber, rankedData: rankedData, selectedFiberID: selectedFiberID, selectFiber: selectFiber, snapshot: snapshot, theme: theme, width: width }); }); }, SnapshotRankedInner = function(_ref3) { var deselectFiber = _ref3.deselectFiber, height = _ref3.height, inspectFiber = _ref3.inspectFiber, rankedData = _ref3.rankedData, selectedFiberID = _ref3.selectedFiberID, selectFiber = _ref3.selectFiber, snapshot = _ref3.snapshot, theme = _ref3.theme, width = _ref3.width; if (0 === rankedData.nodes.length) return _react2["default"].createElement(_NoSnapshotDataMessage2["default"], { height: height, width: width }); var focusedNodeIndex = getNodeIndex(rankedData, selectedFiberID), itemData = getItemData(focusedNodeIndex, inspectFiber, rankedData, selectFiber, snapshot, theme, width); return _react2["default"].createElement("div", { onClick: deselectFiber, style: { height: height, width: width } }, _react2["default"].createElement(_reactWindow.FixedSizeList, { height: height, innerTagName: "svg", itemCount: rankedData.nodes.length, itemData: itemData, itemSize: _constants.barHeight, width: width }, ListItem)); }, ListItem = function(_PureComponent) { function ListItem() { var _ref4, _temp, _this, _ret; _classCallCheck(this, ListItem); for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) args[_key] = arguments[_key]; return _temp = _this = _possibleConstructorReturn(this, (_ref4 = ListItem.__proto__ || Object.getPrototypeOf(ListItem)).call.apply(_ref4, [ this ].concat(args))), _this.handleClick = function(event) { event.stopPropagation(); var _this$props = _this.props, data = _this$props.data, index = _this$props.index, node = data.nodes[index]; data.selectFiber(node.id, node.name, data.snapshot.root); }, _this.handleDoubleClick = function(event) { event.stopPropagation(); var _this$props2 = _this.props, data = _this$props2.data, index = _this$props2.index, node = data.nodes[index]; data.inspectFiber(node.id, node.name, data.snapshot.root); }, _ret = _temp, _possibleConstructorReturn(_this, _ret); } return _inherits(ListItem, _PureComponent), _createClass(ListItem, [ { key: "render", value: function() { var _props = this.props, data = _props.data, index = _props.index, style = _props.style, node = data.nodes[index], scaleX = data.scaleX, width = data.width, top = parseInt(style.top, 10); return _react2["default"].createElement(_ChartNode2["default"], { color: (0, _constants.getGradientColor)(node.value / data.maxValue), height: _constants.barHeight, isDimmed: index < data.focusedNodeIndex, key: node.id, label: node.label, onClick: this.handleClick, onDoubleClick: this.handleDoubleClick, theme: data.theme, title: node.title, width: Math.max(_constants.minBarWidth, scaleX(node.value, width)), x: 0, y: top }); } } ]), ListItem; }(_react.PureComponent), getItemData = (0, _memoizeOne2["default"])(function(focusedNodeIndex, inspectFiber, rankedData, selectFiber, snapshot, theme, width) { return { focusedNode: rankedData.nodes[focusedNodeIndex], focusedNodeIndex: focusedNodeIndex, inspectFiber: inspectFiber, nodes: rankedData.nodes, maxValue: rankedData.maxValue, scaleX: (0, _constants.scale)(0, rankedData.nodes[focusedNodeIndex].value, 0, width), selectFiber: selectFiber, snapshot: snapshot, theme: theme, width: width }; }), getNodeIndex = (0, _memoizeOne2["default"])(function(rankedData, id) { if (null === id) return 0; for (var nodes = rankedData.nodes, index = 0; index < nodes.length; index++) if (nodes[index].id === id) return index; return 0; }), convertSnapshotToChartData = function(snapshot, showNativeNodes) { var maxSelfDuration = 0, nodes = snapshot.committedNodes.filter(function(nodeID) { var node = snapshot.nodes.get(nodeID), nodeType = node && node.get("nodeType"); return "Composite" === nodeType || "Native" === nodeType && showNativeNodes; }).map(function(nodeID, index) { var selfDuration = (0, _constants.calculateSelfDuration)(snapshot, nodeID); maxSelfDuration = Math.max(maxSelfDuration, selfDuration); var name = snapshot.nodes.getIn([ nodeID, "name" ]) || "Unknown", label = name + " (" + selfDuration.toFixed(1) + "ms)"; return { id: nodeID, label: label, name: name, title: label, value: selfDuration }; }).sort(function(a, b) { return b.value - a.value; }); return { maxValue: maxSelfDuration, nodes: nodes }; }; exports["default"] = SnapshotRanked; }, function(module, exports, __webpack_require__) { "use strict"; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } Object.defineProperty(exports, "__esModule", { value: !0 }); var _extends = Object.assign || function(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) Object.prototype.hasOwnProperty.call(source, key) && (target[key] = source[key]); } return target; }, _react = __webpack_require__(12), _react2 = _interopRequireDefault(_react), _reactVirtualizedAutoSizer = __webpack_require__(360), _reactVirtualizedAutoSizer2 = _interopRequireDefault(_reactVirtualizedAutoSizer), _Hoverable = __webpack_require__(62), _Hoverable2 = _interopRequireDefault(_Hoverable), _SvgIcon = __webpack_require__(60), _SvgIcon2 = _interopRequireDefault(_SvgIcon), _Icons = __webpack_require__(61), _Icons2 = _interopRequireDefault(_Icons), _IconButton = __webpack_require__(371), _IconButton2 = _interopRequireDefault(_IconButton), _SnapshotSelector = __webpack_require__(372), _SnapshotSelector2 = _interopRequireDefault(_SnapshotSelector), CHART_RADIO_LABEL_WIDTH_THRESHOLD = 650; exports["default"] = function(props) { return _react2["default"].createElement(_reactVirtualizedAutoSizer2["default"], { disableHeight: !0 }, function(_ref) { var width = _ref.width; return _react2["default"].createElement(ProfilerTabToolbar, _extends({}, props, { width: width })); }); }; var ProfilerTabToolbar = function(_ref2) { var commitThreshold = _ref2.commitThreshold, hideCommitsBelowThreshold = _ref2.hideCommitsBelowThreshold, interactionsCount = _ref2.interactionsCount, isInspectingSelectedFiber = _ref2.isInspectingSelectedFiber, isRecording = _ref2.isRecording, selectChart = _ref2.selectChart, selectedChartType = _ref2.selectedChartType, selectedFiberID = _ref2.selectedFiberID, selectedSnapshot = _ref2.selectedSnapshot, selectSnapshot = _ref2.selectSnapshot, snapshotIndex = _ref2.snapshotIndex, snapshots = _ref2.snapshots, theme = _ref2.theme, toggleIsRecording = _ref2.toggleIsRecording, toggleIsSettingsPanelActive = _ref2.toggleIsSettingsPanelActive, width = _ref2.width; return _react2["default"].createElement("div", { style: { display: "flex", flex: "0 0 auto", padding: "0.25rem", flexWrap: "wrap", alignItems: "center", position: "relative", boxSizing: "border-box", width: width, userSelect: "none" } }, _react2["default"].createElement(RecordButton, { isActive: isRecording, onClick: toggleIsRecording, theme: theme }), _react2["default"].createElement(HRule, { theme: theme }), isRecording || 0 === snapshots.length && _react2["default"].createElement(_react.Fragment, null, _react2["default"].createElement("div", { style: { flex: 1 } }), _react2["default"].createElement(_IconButton2["default"], { icon: _Icons2["default"].SETTINGS, isTransparent: !0, label: "Profiler settings", onClick: toggleIsSettingsPanelActive, theme: theme })), !isRecording && snapshots.length > 0 && _react2["default"].createElement(_react.Fragment, null, _react2["default"].createElement(RadioOption, { icon: _Icons2["default"].FLAME_CHART, isChecked: "flamegraph" === selectedChartType, isDisabled: isInspectingSelectedFiber, label: "Flamegraph", onChange: function() { return selectChart("flamegraph"); }, theme: theme, width: width }), " ", _react2["default"].createElement(RadioOption, { icon: _Icons2["default"].RANKED_CHART, isChecked: "ranked" === selectedChartType, isDisabled: isInspectingSelectedFiber, label: "Ranked", onChange: function() { return selectChart("ranked"); }, theme: theme, width: width }), " ", _react2["default"].createElement(RadioOption, { icon: _Icons2["default"].INTERACTION, isChecked: "interactions" === selectedChartType, isDisabled: isInspectingSelectedFiber, label: "Interactions (" + interactionsCount + ")", onChange: function() { return selectChart("interactions"); }, theme: theme, width: width }), _react2["default"].createElement("div", { style: { flex: 1 } }), _react2["default"].createElement(_IconButton2["default"], { icon: _Icons2["default"].SETTINGS, isTransparent: !0, label: "Profiler settings", onClick: toggleIsSettingsPanelActive, theme: theme }), "interactions" !== selectedChartType && _react2["default"].createElement(_react.Fragment, null, _react2["default"].createElement(HRule, { theme: theme }), _react2["default"].createElement(_SnapshotSelector2["default"], { commitThreshold: commitThreshold, hideCommitsBelowThreshold: hideCommitsBelowThreshold, isInspectingSelectedFiber: isInspectingSelectedFiber, selectedFiberID: selectedFiberID, selectedSnapshot: selectedSnapshot, selectSnapshot: selectSnapshot, snapshotIndex: snapshotIndex, snapshots: snapshots, theme: theme })))); }, HRule = function(_ref3) { var theme = _ref3.theme; return _react2["default"].createElement("div", { style: { height: "18px", width: "1px", backgroundColor: theme.base03, margin: "0px 0.5rem 0 0.25rem" } }); }, RadioOption = (0, _Hoverable2["default"])(function(_ref4) { var icon = _ref4.icon, isChecked = _ref4.isChecked, _ref4$isDisabled = _ref4.isDisabled, isDisabled = void 0 !== _ref4$isDisabled && _ref4$isDisabled, isHovered = _ref4.isHovered, label = _ref4.label, onChange = _ref4.onChange, onMouseEnter = _ref4.onMouseEnter, onMouseLeave = _ref4.onMouseLeave, theme = _ref4.theme, width = _ref4.width; return _react2["default"].createElement("label", { onMouseEnter: onMouseEnter, onMouseLeave: onMouseLeave, style: { color: isHovered ? theme.state06 : "inherit", marginRight: "0.5rem", cursor: "pointer", opacity: isDisabled ? .5 : 1, pointerEvents: isDisabled ? "none" : "auto" }, title: label }, _react2["default"].createElement("input", { disabled: isDisabled, type: "radio", checked: isChecked, onChange: onChange }), _react2["default"].createElement(_SvgIcon2["default"], { path: icon, style: { flex: "0 0 1rem", width: "1rem", height: "1rem", fill: "currentColor", display: "inline", verticalAlign: "sub", margin: "0 0.25rem" } }), width >= CHART_RADIO_LABEL_WIDTH_THRESHOLD && _react2["default"].createElement("span", null, label)); }), RecordButton = (0, _Hoverable2["default"])(function(_ref5) { var isActive = _ref5.isActive, isHovered = _ref5.isHovered, onClick = _ref5.onClick, onMouseEnter = _ref5.onMouseEnter, onMouseLeave = _ref5.onMouseLeave, theme = _ref5.theme; return _react2["default"].createElement("button", { onClick: onClick, onMouseEnter: onMouseEnter, onMouseLeave: onMouseLeave, style: { background: "none", border: "none", outline: "none", cursor: "pointer", color: isActive ? theme.special03 : isHovered ? theme.state06 : theme.base05, filter: isActive ? "drop-shadow( 0 0 2px " + theme.special03 + " )" : "none", padding: "4px" }, title: isActive ? "Stop profiling" : "Start profiling" }, _react2["default"].createElement(_SvgIcon2["default"], { path: _Icons2["default"].RECORD, style: { flex: "0 0 1rem", width: "1rem", height: "1rem", fill: "currentColor", display: "inline", verticalAlign: "sub" } })); }); }, function(module, exports, __webpack_require__) { "use strict"; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } Object.defineProperty(exports, "__esModule", { value: !0 }); var _extends = Object.assign || function(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) Object.prototype.hasOwnProperty.call(source, key) && (target[key] = source[key]); } return target; }, _react = __webpack_require__(12), _react2 = _interopRequireDefault(_react), _Hoverable = __webpack_require__(62), _Hoverable2 = _interopRequireDefault(_Hoverable), _SvgIcon = __webpack_require__(60), _SvgIcon2 = _interopRequireDefault(_SvgIcon), IconButton = (0, _Hoverable2["default"])(function(_ref) { var disabled = _ref.disabled, icon = _ref.icon, _ref$isActive = _ref.isActive, isActive = void 0 !== _ref$isActive && _ref$isActive, isHovered = _ref.isHovered, _ref$isTransparent = _ref.isTransparent, isTransparent = void 0 !== _ref$isTransparent && _ref$isTransparent, onClick = _ref.onClick, onMouseEnter = _ref.onMouseEnter, onMouseLeave = _ref.onMouseLeave, style = _ref.style, theme = _ref.theme, title = _ref.title; return _react2["default"].createElement("button", { disabled: disabled, onClick: onClick, onMouseEnter: onMouseEnter, onMouseLeave: onMouseLeave, style: _extends({ position: "relative", width: "1.5rem", height: "1.5rem", background: isTransparent ? "none" : theme.base00, border: "none", borderRadius: "0.125rem", outline: "none", cursor: disabled ? "default" : "pointer", color: isActive ? theme.state00 : isHovered ? theme.state06 : theme.base05, opacity: disabled ? .5 : 1 }, style), title: title }, _react2["default"].createElement(_SvgIcon2["default"], { path: icon, style: { position: "absolute", top: "50%", bottom: "50%", transform: "translate(-50%, -50%)" } })); }); exports["default"] = IconButton; }, function(module, exports, __webpack_require__) { "use strict"; 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 || "object" != typeof call && "function" != typeof call ? self : call; } function _inherits(subClass, superClass) { if ("function" != typeof superClass && null !== superClass) 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: !1, writable: !0, configurable: !0 } }), superClass && (Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass); } Object.defineProperty(exports, "__esModule", { value: !0 }); var _extends = Object.assign || function(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) Object.prototype.hasOwnProperty.call(source, key) && (target[key] = source[key]); } return target; }, _createClass = function() { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0, "value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor); } } return function(Constructor, protoProps, staticProps) { return protoProps && defineProperties(Constructor.prototype, protoProps), staticProps && defineProperties(Constructor, staticProps), Constructor; }; }(), _memoizeOne = __webpack_require__(358), _memoizeOne2 = _interopRequireDefault(_memoizeOne), _react = __webpack_require__(12), _react2 = _interopRequireDefault(_react), _reactVirtualizedAutoSizer = __webpack_require__(360), _reactVirtualizedAutoSizer2 = _interopRequireDefault(_reactVirtualizedAutoSizer), _reactWindow = __webpack_require__(361), _constants = __webpack_require__(357), _Icons = __webpack_require__(61), _Icons2 = _interopRequireDefault(_Icons), _IconButton = __webpack_require__(371), _IconButton2 = _interopRequireDefault(_IconButton), HEIGHT = 20; exports["default"] = function(_ref) { var commitThreshold = _ref.commitThreshold, hideCommitsBelowThreshold = _ref.hideCommitsBelowThreshold, isInspectingSelectedFiber = _ref.isInspectingSelectedFiber, selectedFiberID = _ref.selectedFiberID, selectedSnapshot = _ref.selectedSnapshot, selectSnapshot = _ref.selectSnapshot, snapshotIndex = _ref.snapshotIndex, snapshots = _ref.snapshots, theme = _ref.theme, filteredData = (0, _constants.getFilteredSnapshotData)(commitThreshold, hideCommitsBelowThreshold, isInspectingSelectedFiber, selectedFiberID, selectedSnapshot, snapshotIndex, snapshots); return _react2["default"].createElement(SnapshotSelectorWrapper, { commitThreshold: commitThreshold, hideCommitsBelowThreshold: hideCommitsBelowThreshold, isInspectingSelectedFiber: isInspectingSelectedFiber, selectedFiberID: selectedFiberID, selectedSnapshot: selectedSnapshot, selectSnapshot: selectSnapshot, snapshotIndex: filteredData.snapshotIndex, snapshots: filteredData.snapshots, theme: theme }); }; var SnapshotSelectorWrapper = function(_PureComponent) { function SnapshotSelectorWrapper() { var _ref2, _temp, _this, _ret; _classCallCheck(this, SnapshotSelectorWrapper); for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) args[_key] = arguments[_key]; return _temp = _this = _possibleConstructorReturn(this, (_ref2 = SnapshotSelectorWrapper.__proto__ || Object.getPrototypeOf(SnapshotSelectorWrapper)).call.apply(_ref2, [ this ].concat(args))), _this.handleKeyDown = function(event) { event.keyCode !== LEFT_ARROW && event.keyCode !== RIGHT_ARROW || (event.preventDefault(), event.keyCode === LEFT_ARROW ? _this.selectPreviousSnapshotIndex() : _this.selectNextSnapshotIndex()); }, _this.selectNextSnapshotIndex = function() { var _this$props = _this.props, selectSnapshot = _this$props.selectSnapshot, snapshotIndex = _this$props.snapshotIndex, snapshots = _this$props.snapshots; if (snapshots.length > 0 && snapshotIndex < snapshots.length - 1) { var newIndex = snapshotIndex + 1; selectSnapshot(snapshots[newIndex]); } }, _this.selectPreviousSnapshotIndex = function() { var _this$props2 = _this.props, selectSnapshot = _this$props2.selectSnapshot, snapshotIndex = _this$props2.snapshotIndex, snapshots = _this$props2.snapshots; if (snapshots.length > 0 && snapshotIndex > 0) { var newIndex = snapshotIndex - 1; selectSnapshot(snapshots[newIndex]); } }, _ret = _temp, _possibleConstructorReturn(_this, _ret); } return _inherits(SnapshotSelectorWrapper, _PureComponent), _createClass(SnapshotSelectorWrapper, [ { key: "render", value: function() { var _props = this.props, commitThreshold = _props.commitThreshold, hideCommitsBelowThreshold = _props.hideCommitsBelowThreshold, isInspectingSelectedFiber = _props.isInspectingSelectedFiber, selectedFiberID = _props.selectedFiberID, selectedSnapshot = _props.selectedSnapshot, selectSnapshot = _props.selectSnapshot, snapshotIndex = _props.snapshotIndex, snapshots = _props.snapshots, theme = _props.theme, numSnapshots = snapshots.length; return _react2["default"].createElement("div", { onKeyDown: this.handleKeyDown, style: { display: "flex", flex: "1 0 auto", alignItems: "center", outline: "none" }, tabIndex: 0 }, 0 === numSnapshots && _react2["default"].createElement("span", { style: { whiteSpace: "nowrap" } }, "0 / 0"), numSnapshots > 0 && _react2["default"].createElement("span", { style: { whiteSpace: "nowrap" } }, ("" + (snapshotIndex >= 0 ? snapshotIndex + 1 : "-")).padStart(("" + numSnapshots).length, "0"), " / ", numSnapshots), _react2["default"].createElement(_IconButton2["default"], { disabled: snapshotIndex <= 0, icon: _Icons2["default"].BACK, isTransparent: !0, onClick: this.selectPreviousSnapshotIndex, theme: theme, title: "Previous render" }), _react2["default"].createElement(AutoSizedSnapshotSelector, { commitThreshold: commitThreshold, hideCommitsBelowThreshold: hideCommitsBelowThreshold, isInspectingSelectedFiber: isInspectingSelectedFiber, selectedFiberID: selectedFiberID, selectedSnapshot: selectedSnapshot, selectSnapshot: selectSnapshot, snapshotIndex: snapshotIndex, snapshots: snapshots, theme: theme }), _react2["default"].createElement(_IconButton2["default"], { disabled: 0 === numSnapshots || snapshotIndex >= numSnapshots - 1, icon: _Icons2["default"].FORWARD, isTransparent: !0, onClick: this.selectNextSnapshotIndex, theme: theme, title: "Next render" })); } } ]), SnapshotSelectorWrapper; }(_react.PureComponent), AutoSizedSnapshotSelector = function(_ref3) { var selectedFiberID = (_ref3.isInspectingSelectedFiber, _ref3.selectedFiberID), selectedSnapshot = _ref3.selectedSnapshot, selectSnapshot = _ref3.selectSnapshot, snapshotIndex = _ref3.snapshotIndex, snapshots = _ref3.snapshots, theme = _ref3.theme; return _react2["default"].createElement("div", { style: { flex: "1 1 100px", height: HEIGHT, display: "grid", alignitems: "flex-end", gridGap: "1px", gridAutoFlow: "column", backgroundColor: theme.base00 } }, _react2["default"].createElement(_reactVirtualizedAutoSizer2["default"], { disableHeight: !0 }, function(_ref4) { var width = (_ref4.height, _ref4.width); return _react2["default"].createElement(SnapshotSelector, { height: HEIGHT, selectedFiberID: selectedFiberID, selectedSnapshot: selectedSnapshot, selectSnapshot: selectSnapshot, snapshotIndex: snapshotIndex, snapshots: snapshots, theme: theme, width: width }); })); }, LEFT_ARROW = 37, RIGHT_ARROW = 39, SnapshotSelector = function(_PureComponent2) { function SnapshotSelector() { var _ref5, _temp2, _this2, _ret2; _classCallCheck(this, SnapshotSelector); for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) args[_key2] = arguments[_key2]; return _temp2 = _this2 = _possibleConstructorReturn(this, (_ref5 = SnapshotSelector.__proto__ || Object.getPrototypeOf(SnapshotSelector)).call.apply(_ref5, [ this ].concat(args))), _this2.listRef = _react2["default"].createRef(), _this2.state = { isMouseDown: !1 }, _this2.handleMouseDown = function(event) { return _this2.setState({ isMouseDown: !0 }, function() { window.addEventListener("mouseup", _this2.handleMouseUp); }); }, _this2.handleMouseUp = function(event) { return _this2.setState({ isMouseDown: !1 }); }, _ret2 = _temp2, _possibleConstructorReturn(_this2, _ret2); } return _inherits(SnapshotSelector, _PureComponent2), _createClass(SnapshotSelector, [ { key: "componentDidUpdate", value: function(prevProps) { this.props.snapshotIndex !== prevProps.snapshotIndex && null !== this.listRef.current && this.listRef.current.scrollToItem(this.props.snapshotIndex); } }, { key: "componentWillUnmount", value: function() { window.removeEventListener("mouseup", this.handleMouseUp); } }, { key: "render", value: function() { var _props2 = this.props, height = _props2.height, selectedSnapshot = _props2.selectedSnapshot, selectSnapshot = _props2.selectSnapshot, snapshots = _props2.snapshots, theme = _props2.theme, width = _props2.width, isMouseDown = this.state.isMouseDown, listData = getListData(snapshots, width), itemData = getItemData(isMouseDown, listData.maxDuration, selectSnapshot, selectedSnapshot, snapshots, theme), numSnapshots = snapshots.length; return _react2["default"].createElement("div", { onMouseDown: this.handleMouseDown, onMouseUp: this.handleMouseUp, style: { height: height, width: width } }, numSnapshots > 0 && _react2["default"].createElement(_reactWindow.FixedSizeList, { direction: "horizontal", height: height, itemCount: snapshots.length, itemData: itemData, itemSize: listData.itemSize, ref: this.listRef, width: width }, ListItem)); } } ]), SnapshotSelector; }(_react.PureComponent), ListItem = function(_PureComponent3) { function ListItem() { var _ref6, _temp3, _this3, _ret3; _classCallCheck(this, ListItem); for (var _len3 = arguments.length, args = Array(_len3), _key3 = 0; _key3 < _len3; _key3++) args[_key3] = arguments[_key3]; return _temp3 = _this3 = _possibleConstructorReturn(this, (_ref6 = ListItem.__proto__ || Object.getPrototypeOf(ListItem)).call.apply(_ref6, [ this ].concat(args))), _this3.handleMouseEnter = function() { var itemData = _this3.props.data; itemData.isMouseDown && itemData.selectSnapshot(itemData.snapshots[_this3.props.index]); }, _ret3 = _temp3, _possibleConstructorReturn(_this3, _ret3); } return _inherits(ListItem, _PureComponent3), _createClass(ListItem, [ { key: "render", value: function() { var _props3 = this.props, index = _props3.index, style = _props3.style, itemData = this.props.data, maxDuration = itemData.maxDuration, selectedSnapshot = itemData.selectedSnapshot, selectSnapshot = itemData.selectSnapshot, snapshots = itemData.snapshots, theme = itemData.theme, snapshot = snapshots[index], percentage = Math.min(1, Math.max(0, snapshot.duration / maxDuration)) || 0, isSelected = selectedSnapshot === snapshot, width = parseFloat(style.width) - 1; return _react2["default"].createElement("div", { onClick: function() { return selectSnapshot(snapshot); }, onMouseEnter: this.handleMouseEnter, style: _extends({}, style, { width: width, backgroundColor: isSelected ? theme.base01 : "transparent", userSelect: "none", cursor: "pointer" }), title: "Duration " + (0, _constants.formatDuration)(snapshot.duration) + "ms at " + (0, _constants.formatTime)(snapshot.commitTime) + "s" }, _react2["default"].createElement("div", { style: { position: "absolute", bottom: 0, width: width, height: Math.max(_constants.minBarHeight, percentage * HEIGHT), backgroundColor: isSelected ? theme.state06 : 0 === percentage ? _constants.didNotRender : (0, _constants.getGradientColor)(percentage) } })); } } ]), ListItem; }(_react.PureComponent), getListData = (0, _memoizeOne2["default"])(function(snapshots, width) { return { itemSize: Math.max(_constants.minBarWidth, width / snapshots.length), maxDuration: snapshots.reduce(function(maxDuration, snapshot) { return Math.max(maxDuration, snapshot.duration); }, 0) }; }), getItemData = (0, _memoizeOne2["default"])(function(isMouseDown, maxDuration, selectSnapshot, selectedSnapshot, snapshots, theme) { return { isMouseDown: isMouseDown, maxDuration: maxDuration, selectSnapshot: selectSnapshot, selectedSnapshot: selectedSnapshot, snapshots: snapshots, theme: theme }; }); }, function(module, exports, __webpack_require__) { "use strict"; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } Object.defineProperty(exports, "__esModule", { value: !0 }); var _react = __webpack_require__(12), _react2 = _interopRequireDefault(_react), _Fonts = __webpack_require__(17), _DataView = __webpack_require__(24), _DataView2 = _interopRequireDefault(_DataView), _DetailPane = __webpack_require__(52), _DetailPane2 = _interopRequireDefault(_DetailPane), _DetailPaneSection = __webpack_require__(53), _DetailPaneSection2 = _interopRequireDefault(_DetailPaneSection), _Icons = __webpack_require__(61), _Icons2 = _interopRequireDefault(_Icons), _IconButton = __webpack_require__(371), _IconButton2 = _interopRequireDefault(_IconButton), emptyFunction = function() {}, ProfilerFiberDetailPane = function(_ref) { var deselectFiber = _ref.deselectFiber, isInspectingSelectedFiber = _ref.isInspectingSelectedFiber, _ref$name = _ref.name, name = void 0 === _ref$name ? "Unknown" : _ref$name, snapshotFiber = (_ref.snapshot, _ref.snapshotFiber), theme = _ref.theme, toggleInspectingSelectedFiber = _ref.toggleInspectingSelectedFiber; return _react2["default"].createElement(_react.Fragment, null, _react2["default"].createElement("div", { style: { height: "2rem", lineHeight: "2rem", backgroundColor: theme.base01, borderBottom: "1px solid " + theme.base03 } }, _react2["default"].createElement("div", { style: { width: "100%", height: "100%", display: "flex", flexDirection: "row", alignItems: "center", padding: "0.25rem", boxSizing: "border-box" } }, _react2["default"].createElement("div", { style: { fontFamily: _Fonts.monospace.family, fontSize: _Fonts.monospace.sizes.large, overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap", flex: "1 1 auto" }, title: name }, name), _react2["default"].createElement(_IconButton2["default"], { disabled: isInspectingSelectedFiber, icon: _Icons2["default"].BARS, onClick: toggleInspectingSelectedFiber, style: { backgroundColor: theme.state00, color: theme.base00, flex: "0 0 auto" }, theme: theme, title: "Inspect " + name }), _react2["default"].createElement(_IconButton2["default"], { icon: _Icons2["default"].CLOSE, onClick: isInspectingSelectedFiber ? toggleInspectingSelectedFiber : deselectFiber, style: { marginLeft: "0.25rem", backgroundColor: theme.base03, color: theme.base05, flex: "0 0 auto" }, theme: theme, title: "Close" }))), null !== snapshotFiber && _react2["default"].createElement("div", { style: { flex: 1, overflow: "auto" } }, _react2["default"].createElement("div", { style: { padding: "0.25rem", fontSize: _Fonts.monospace.sizes.normal, fontFamily: _Fonts.monospace.family } }, _react2["default"].createElement("strong", null, "Total renders"), ": ", snapshotFiber.get("renders")), _react2["default"].createElement(_DetailPane2["default"], { theme: theme }, _react2["default"].createElement(_DetailPaneSection2["default"], { title: "Props" }, _react2["default"].createElement(_DataView2["default"], { path: [ "props" ], readOnly: !0, inspect: emptyFunction, showMenu: emptyFunction, data: snapshotFiber.get("props") })), snapshotFiber.get("state") && _react2["default"].createElement(_DetailPaneSection2["default"], { title: "State" }, _react2["default"].createElement(_DataView2["default"], { path: [ "state" ], readOnly: !0, inspect: emptyFunction, showMenu: emptyFunction, data: snapshotFiber.get("state") }))))); }; exports["default"] = ProfilerFiberDetailPane; }, function(module, exports, __webpack_require__) { "use strict"; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } Object.defineProperty(exports, "__esModule", { value: !0 }); var _react = __webpack_require__(12), _react2 = _interopRequireDefault(_react), _constants = __webpack_require__(357), _Fonts = __webpack_require__(17), _Hoverable = __webpack_require__(62), _Hoverable2 = _interopRequireDefault(_Hoverable), ProfilerSnapshotDetailPane = function(_ref) { var selectedInteraction = _ref.selectedInteraction, snapshot = _ref.snapshot, theme = _ref.theme, viewInteraction = _ref.viewInteraction; return _react2["default"].createElement(_react.Fragment, null, _react2["default"].createElement("div", { style: { height: "2rem", lineHeight: "2rem", padding: "0 0.5rem", backgroundColor: theme.base01, borderBottom: "1px solid " + theme.base03, fontSize: _Fonts.sansSerif.sizes.large, overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" } }, "Commit information"), _react2["default"].createElement("div", { style: { padding: "0.5rem" } }, _react2["default"].createElement("div", null, _react2["default"].createElement("strong", null, "Committed at"), ": ", (0, _constants.formatTime)(snapshot.commitTime), "s"), _react2["default"].createElement("div", { style: { marginTop: "0.5rem" } }, _react2["default"].createElement("strong", null, "Render duration"), ": ", (0, _constants.formatDuration)(snapshot.duration), "ms"), _react2["default"].createElement("div", { style: { margin: "0.5rem 0" } }, _react2["default"].createElement("strong", null, "Interactions"), ":"), _react2["default"].createElement("ul", { style: { listStyle: "none", margin: 0, padding: 0 } }, 0 === snapshot.memoizedInteractions.length && _react2["default"].createElement("li", { style: { padding: "0.5rem" } }, "None"), snapshot.memoizedInteractions.map(function(interaction, index) { return _react2["default"].createElement(InteractionLink, { interaction: interaction, key: index, onClick: function() { return viewInteraction(interaction); }, selectedInteraction: selectedInteraction, theme: theme }); })))); }, InteractionLink = (0, _Hoverable2["default"])(function(_ref2) { var interaction = _ref2.interaction, isHovered = _ref2.isHovered, onClick = _ref2.onClick, onMouseEnter = _ref2.onMouseEnter, onMouseLeave = _ref2.onMouseLeave, selectedInteraction = _ref2.selectedInteraction, theme = _ref2.theme; return _react2["default"].createElement("li", { onClick: onClick, onMouseEnter: onMouseEnter, onMouseLeave: onMouseLeave, style: { backgroundColor: isHovered ? theme.state03 : selectedInteraction === interaction ? theme.base01 : "transparent", color: isHovered ? theme.state00 : "inherit", textDecoration: isHovered ? "underline" : "none", cursor: "pointer", padding: "0.5rem", borderBottom: "1px solid " + theme.base01 } }, '"', interaction.name, '" at ', (0, _constants.formatTime)(interaction.timestamp), "s"); }); exports["default"] = ProfilerSnapshotDetailPane; }, function(module, exports, __webpack_require__) { "use strict"; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } Object.defineProperty(exports, "__esModule", { value: !0 }); var _react = __webpack_require__(12), _react2 = _interopRequireDefault(_react), _constants = __webpack_require__(357), _Fonts = __webpack_require__(17), _Hoverable = __webpack_require__(62), _Hoverable2 = _interopRequireDefault(_Hoverable), ProfilerInteractionDetailPane = function(_ref) { var interaction = _ref.interaction, maxDuration = _ref.maxDuration, selectedSnapshot = _ref.selectedSnapshot, snapshots = _ref.snapshots, theme = _ref.theme, viewSnapshot = _ref.viewSnapshot, currentTimestamp = interaction.timestamp; return _react2["default"].createElement(_react.Fragment, null, _react2["default"].createElement("div", { style: { height: "2rem", lineHeight: "2rem", padding: "0 0.5rem", backgroundColor: theme.base01, borderBottom: "1px solid " + theme.base03, fontSize: _Fonts.sansSerif.sizes.large, overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap", display: "flex", justifyContent: "space-between" }, title: interaction.name }, interaction.name, " at ", (0, _constants.formatTime)(interaction.timestamp), "s"), _react2["default"].createElement("div", { style: { padding: "0.5rem" } }, _react2["default"].createElement("div", { style: { marginBottom: "0.5rem" } }, _react2["default"].createElement("strong", null, "Commits"), ":"), _react2["default"].createElement("ul", { style: { listStyle: "none", margin: 0, padding: 0 } }, Array.from(snapshots).map(function(snapshot, index) { var previousTimestamp = currentTimestamp; return currentTimestamp = snapshot.commitTime, _react2["default"].createElement(SnapshotLink, { key: index, maxDuration: maxDuration, onClick: function() { return viewSnapshot(snapshot); }, previousTimestamp: previousTimestamp, selectedSnapshot: selectedSnapshot, snapshot: snapshot, theme: theme, viewSnapshot: viewSnapshot }); })))); }, SnapshotLink = (0, _Hoverable2["default"])(function(_ref2) { var isHovered = _ref2.isHovered, maxDuration = _ref2.maxDuration, onClick = _ref2.onClick, onMouseEnter = _ref2.onMouseEnter, onMouseLeave = _ref2.onMouseLeave, selectedSnapshot = (_ref2.previousTimestamp, _ref2.selectedSnapshot), snapshot = _ref2.snapshot, theme = _ref2.theme; _ref2.viewSnapshot; return _react2["default"].createElement("li", { onClick: onClick, onMouseEnter: onMouseEnter, onMouseLeave: onMouseLeave, style: { backgroundColor: isHovered ? theme.state03 : selectedSnapshot === snapshot ? theme.base01 : "transparent", color: isHovered ? theme.state00 : "inherit", textDecoration: isHovered ? "underline" : "none", cursor: "pointer", display: "flex", alignItems: "center", padding: "0.5rem", borderTop: "1px solid " + theme.base01 } }, _react2["default"].createElement("div", { style: { width: "1rem", height: "1rem", backgroundColor: selectedSnapshot === snapshot ? theme.state06 : (0, _constants.getGradientColor)(snapshot.duration / maxDuration) } }), _react2["default"].createElement("ul", { style: { paddingLeft: "1.5rem" } }, _react2["default"].createElement("li", { style: { marginBottom: "0.25rem" } }, "Timestamp: ", (0, _constants.formatTime)(snapshot.commitTime), "s"), _react2["default"].createElement("li", null, "Duration: ", (0, _constants.formatDuration)(snapshot.duration), "ms"))); }); exports["default"] = ProfilerInteractionDetailPane; }, function(module, exports, __webpack_require__) { "use strict"; 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 || "object" != typeof call && "function" != typeof call ? self : call; } function _inherits(subClass, superClass) { if ("function" != typeof superClass && null !== superClass) 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: !1, writable: !0, configurable: !0 } }), superClass && (Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass); } Object.defineProperty(exports, "__esModule", { value: !0 }); var _createClass = function() { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0, "value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor); } } return function(Constructor, protoProps, staticProps) { return protoProps && defineProperties(Constructor.prototype, protoProps), staticProps && defineProperties(Constructor, staticProps), Constructor; }; }(), _propTypes = __webpack_require__(7), _propTypes2 = _interopRequireDefault(_propTypes), _react = __webpack_require__(12), _react2 = _interopRequireDefault(_react), _decorate = __webpack_require__(20), _decorate2 = _interopRequireDefault(_decorate), _Fonts = __webpack_require__(17), ProfilerSettings = function(_PureComponent) { function ProfilerSettings() { var _ref, _temp, _this, _ret; _classCallCheck(this, ProfilerSettings); for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) args[_key] = arguments[_key]; return _temp = _this = _possibleConstructorReturn(this, (_ref = ProfilerSettings.__proto__ || Object.getPrototypeOf(ProfilerSettings)).call.apply(_ref, [ this ].concat(args))), _this.handleCommitThresholdChange = function(event) { var _this$props = _this.props, hideCommitsBelowThreshold = _this$props.hideCommitsBelowThreshold, setCommitThrehsold = _this$props.setCommitThrehsold, toggleHideCommitsBelowThreshold = _this$props.toggleHideCommitsBelowThreshold, commitThreshold = parseFloat(event.currentTarget.value); Number.isNaN(commitThreshold) || (setCommitThrehsold(commitThreshold), hideCommitsBelowThreshold || toggleHideCommitsBelowThreshold()); }, _this.stopClickEventFromBubbling = function(event) { return event.stopPropagation(); }, _ret = _temp, _possibleConstructorReturn(_this, _ret); } return _inherits(ProfilerSettings, _PureComponent), _createClass(ProfilerSettings, [ { key: "render", value: function() { var theme = this.context.theme, _props = this.props, commitThreshold = _props.commitThreshold, hideCommitsBelowThreshold = _props.hideCommitsBelowThreshold, isSettingsPanelActive = _props.isSettingsPanelActive, toggleHideCommitsBelowThreshold = _props.toggleHideCommitsBelowThreshold, toggleIsSettingsPanelActive = _props.toggleIsSettingsPanelActive, toggleShowNativeNodes = _props.toggleShowNativeNodes, showNativeNodes = _props.showNativeNodes; return isSettingsPanelActive ? _react2["default"].createElement("div", { onClick: toggleIsSettingsPanelActive, style: { position: "absolute", top: 0, left: 0, width: "100%", height: "100%", display: "flex", alignItems: "center", justifyContent: "center" } }, _react2["default"].createElement("div", { onClick: this.stopClickEventFromBubbling, style: { fontFamily: _Fonts.sansSerif.family, backgroundColor: theme.base01, border: "1px solid " + theme.base03, color: theme.base05, borderRadius: "0.25rem", maxWidth: "100%", minWidth: "250px", padding: "0.5rem", margin: "0.5rem" } }, _react2["default"].createElement("h4", { style: { margin: "0 0 0.5rem" } }, "Profiler settings"), _react2["default"].createElement("label", { style: { display: "flex", alignItems: "center", cursor: "pointer", marginBottom: "0.25rem" }, title: "Show native elements" }, _react2["default"].createElement("input", { type: "checkbox", checked: showNativeNodes, onChange: toggleShowNativeNodes }), " Show native elements"), _react2["default"].createElement("label", { style: { display: "flex", alignItems: "center", cursor: "pointer" }, title: "Hide commits below threshold" }, _react2["default"].createElement("input", { type: "checkbox", checked: hideCommitsBelowThreshold, onChange: toggleHideCommitsBelowThreshold }), " Hide commits below ", _react2["default"].createElement("input", { type: "number", style: { width: "3rem" }, defaultValue: commitThreshold, min: 1, onChange: this.handleCommitThresholdChange }), " ms"))) : null; } } ]), ProfilerSettings; }(_react.PureComponent); ProfilerSettings.contextTypes = { theme: _propTypes2["default"].object.isRequired }, exports["default"] = (0, _decorate2["default"])({ store: "profilerStore", listeners: function() { return [ "commitThreshold", "hideCommitsBelowThreshold", "isSettingsPanelActive", "showNativeNodes" ]; }, props: function(store) { return { commitThreshold: store.commitThreshold, hideCommitsBelowThreshold: store.hideCommitsBelowThreshold, isSettingsPanelActive: store.isSettingsPanelActive, showNativeNodes: store.showNativeNodes, setCommitThrehsold: store.setCommitThrehsold, toggleHideCommitsBelowThreshold: function() { return store.setHideCommitsBelowThreshold(!store.hideCommitsBelowThreshold); }, toggleIsSettingsPanelActive: function() { return store.setIsSettingsPanelActive(!store.isSettingsPanelActive); }, toggleShowNativeNodes: function() { return store.setShowNativeNodes(!store.showNativeNodes); } }; } }, ProfilerSettings); }, function(module, exports, __webpack_require__) { "use strict"; function _classCallCheck(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 || !1, descriptor.configurable = !0, "value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor); } } return function(Constructor, protoProps, staticProps) { return protoProps && defineProperties(Constructor.prototype, protoProps), staticProps && defineProperties(Constructor, staticProps), Constructor; }; }(), React = __webpack_require__(12), provideStore = __webpack_require__(347), RelayStore = __webpack_require__(378), QueriesTab = __webpack_require__(379), ElementPanel = __webpack_require__(384), StoreWrapper = provideStore("relayStore"), RelayPlugin = function() { function RelayPlugin(store, bridge, refresh) { var _this = this; _classCallCheck(this, RelayPlugin), this.bridge = bridge, this.store = store, this.hasRelay = !1, this.relayStore = new RelayStore(bridge, store), setTimeout(function() { bridge.call("relay:check", [], function(hasRelay) { _this.hasRelay = hasRelay, refresh(); }); }, 1e3); } return _createClass(RelayPlugin, [ { key: "panes", value: function() { var _this2 = this; return this.hasRelay ? [ function(node, id) { return React.createElement(StoreWrapper, { store: _this2.relayStore, key: "relay" }, function() { return React.createElement(ElementPanel, { node: node, id: id }); }); } ] : []; } }, { key: "teardown", value: function() {} }, { key: "tabs", value: function() { var _this3 = this; return this.hasRelay ? { Relay: function() { return React.createElement(StoreWrapper, { store: _this3.relayStore }, function() { return React.createElement(QueriesTab, null); }); } } : null; } } ]), RelayPlugin; }(); module.exports = RelayPlugin; }, function(module, exports, __webpack_require__) { "use strict"; 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 || "object" != typeof call && "function" != typeof call ? self : call; } function _inherits(subClass, superClass) { if ("function" != typeof superClass && null !== superClass) 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: !1, writable: !0, configurable: !0 } }), superClass && (Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass); } function getDataIDs(obj) { var collector = []; return getDataIDsInternal(obj, collector), collector; } function getDataIDsInternal(obj, collector) { for (var name in obj) "id" === name && "string" == typeof obj[name] ? collector.push(obj[name]) : "object" === _typeof(obj[name]) && getDataIDs(obj[name]); } var _extends = Object.assign || function(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) Object.prototype.hasOwnProperty.call(source, key) && (target[key] = source[key]); } return target; }, _createClass = function() { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0, "value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor); } } return function(Constructor, protoProps, staticProps) { return protoProps && defineProperties(Constructor.prototype, protoProps), staticProps && defineProperties(Constructor, staticProps), Constructor; }; }(), _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj) { return typeof obj; } : function(obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _require = __webpack_require__(328), EventEmitter = _require.EventEmitter, _require2 = __webpack_require__(317), OrderedMap = _require2.OrderedMap, Map = _require2.Map, assign = __webpack_require__(19), consts = __webpack_require__(32), invariant = __webpack_require__(56), Store = function(_EventEmitter) { function Store(bridge, mainStore) { _classCallCheck(this, Store); var _this = _possibleConstructorReturn(this, (Store.__proto__ || Object.getPrototypeOf(Store)).call(this)); return _this.storeData = null, _this.storeDateSubscriptionCount = 0, _this.selectedQuery = null, _this.queries = new OrderedMap(), _this._bridge = bridge, _this._mainStore = mainStore, bridge.on("relay:store", function(data) { _this.storeData = data, _this.emit("storeData"); }), _this.queriesByDataID = {}, bridge.on("relay:pending", function(pendingQueries) { pendingQueries.forEach(function(pendingQuery) { _this.queries = _this.queries.set(pendingQuery.id, new Map(_extends({}, pendingQuery, { status: "pending", text: pendingQuery.text.join("") }))), _this.emit("queries"), _this.emit(pendingQuery.id), getDataIDs(pendingQuery.variables).forEach(function(id) { _this.queriesByDataID[id] ? _this.queriesByDataID[id].push(pendingQuery.id) : _this.queriesByDataID[id] = [ pendingQuery.id ]; }); }); }), bridge.on("relay:success", function(_ref) { var id = _ref.id, response = _ref.response, end = _ref.end; _this.queries = _this.queries.mergeIn([ id ], new Map({ status: "success", response: response, end: end })), _this.emit("queries"), _this.emit(id); }), bridge.on("relay:failure", function(_ref2) { var id = _ref2.id, error = _ref2.error, end = _ref2.end; _this.queries = _this.queries.mergeIn([ id ], new Map({ status: "failure", error: error, end: end })), _this.emit("queries"), _this.emit(id); }), _this.dataIDsToNodes = {}, _this.nodesToDataIDs = {}, bridge.on("mount", function(data) { if (data.props && (data.props.relay || 0 === data.name.indexOf("Relay("))) { _this.nodesToDataIDs[data.id] = new window.Set(); for (var name in data.props) { var id = data.props[name] && data.props[name].__dataID__; id && (_this.dataIDsToNodes[id] || (_this.dataIDsToNodes[id] = new window.Set()), _this.dataIDsToNodes[id].add(data.id), _this.nodesToDataIDs[data.id].add(id)); } } }), bridge.on("update", function(data) { if (data.props && _this.nodesToDataIDs[data.id]) { var newIds = new window.Set(); for (var name in data.props) { var id = data.props[name] && data.props[name].__dataID__; id && (newIds.add(id), _this.nodesToDataIDs[data.id].has(id) || (_this.dataIDsToNodes[id] || (_this.dataIDsToNodes[id] = new window.Set()), _this.dataIDsToNodes[id].add(data.id))); } var _iteratorNormalCompletion = !0, _didIteratorError = !1, _iteratorError = void 0; try { for (var _step, _iterator = _this.nodesToDataIDs[data.id][Symbol.iterator](); !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0) { var item = _step.value; newIds.has(item) || _this.dataIDsToNodes[item]["delete"](data.id); } } catch (err) { _didIteratorError = !0, _iteratorError = err; } finally { try { !_iteratorNormalCompletion && _iterator["return"] && _iterator["return"](); } finally { if (_didIteratorError) throw _iteratorError; } } _this.nodesToDataIDs[id] = newIds; } }), bridge.on("unmount", function(id) { if (_this.nodesToDataIDs[id]) { var _iteratorNormalCompletion2 = !0, _didIteratorError2 = !1, _iteratorError2 = void 0; try { for (var _step2, _iterator2 = _this.nodesToDataIDs[id][Symbol.iterator](); !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = !0) { var item = _step2.value; _this.dataIDsToNodes[item]["delete"](id); } } catch (err) { _didIteratorError2 = !0, _iteratorError2 = err; } finally { try { !_iteratorNormalCompletion2 && _iterator2["return"] && _iterator2["return"](); } finally { if (_didIteratorError2) throw _iteratorError2; } } _this.nodesToDataIDs[id] = null; } }), _this; } return _inherits(Store, _EventEmitter), _createClass(Store, [ { key: "jumpToDataID", value: function(dataID) { this._mainStore.setSelectedTab("RelayStore"), this.selectedDataNode = dataID, this.emit("selectedDataNode"); } }, { key: "jumpToQuery", value: function(queryID) { this._mainStore.setSelectedTab("Relay"), this.selectedQuery = queryID, this.emit("selectedQuery"), this.emit("queries"); } }, { key: "inspect", value: function(id, path, cb) { var _this2 = this; this._bridge.inspect(id, path, function(value) { var base; "relay:store" === id ? (invariant(_this2.storeData, "RelayStore.inspect: this.storeData should be defined."), base = _this2.storeData.nodes) : base = _this2.queries.get(id).get(path[0]); var inspected = path.slice(1).reduce(function(obj, attr) { return obj ? obj[attr] : null; }, base); inspected && (assign(inspected, value), inspected[consts.inspected] = !0), cb(); }); } }, { key: "on", value: function(evt, fn) { "storeData" === evt && (this.storeDateSubscriptionCount++, 1 === this.storeDateSubscriptionCount && this._bridge.call("relay:store:enable", [], function() {})), this.addListener(evt, fn); } }, { key: "off", value: function(evt, fn) { "storeData" === evt && (this.storeDateSubscriptionCount--, 0 === this.storeDateSubscriptionCount && this._bridge.call("relay:store:disable", [], function() {})), this.removeListener(evt, fn); } }, { key: "selectQuery", value: function(id) { this.selectedQuery = id, this.emit("selectedQuery"); } } ]), Store; }(EventEmitter); module.exports = Store; }, function(module, exports, __webpack_require__) { "use strict"; 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 || "object" != typeof call && "function" != typeof call ? self : call; } function _inherits(subClass, superClass) { if ("function" != typeof superClass && null !== superClass) 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: !1, writable: !0, configurable: !0 } }), superClass && (Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass); } var _createClass = function() { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0, "value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor); } } return function(Constructor, protoProps, staticProps) { return protoProps && defineProperties(Constructor.prototype, protoProps), staticProps && defineProperties(Constructor, staticProps), Constructor; }; }(), React = __webpack_require__(12), decorate = __webpack_require__(20), _require = __webpack_require__(17), sansSerif = _require.sansSerif, QueryList = __webpack_require__(380), QueryViewer = __webpack_require__(382), SplitPane = __webpack_require__(324), QueriesTab = function(_React$Component) { function QueriesTab() { return _classCallCheck(this, QueriesTab), _possibleConstructorReturn(this, (QueriesTab.__proto__ || Object.getPrototypeOf(QueriesTab)).apply(this, arguments)); } return _inherits(QueriesTab, _React$Component), _createClass(QueriesTab, [ { key: "render", value: function() { var contents; return contents = this.props.isSplit ? React.createElement(SplitPane, { initialWidth: 500, initialHeight: 500, left: function() { return React.createElement(QueryList, null); }, right: function() { return React.createElement(QueryViewer, null); }, isVertical: !1 }) : React.createElement(QueryList, null), React.createElement("div", { style: styles.container }, contents); } } ]), QueriesTab; }(React.Component), styles = { container: { fontFamily: sansSerif.family, fontSize: sansSerif.sizes.normal, flex: 1, display: "flex" } }; module.exports = decorate({ store: "relayStore", listeners: function() { return [ "selectedQuery" ]; }, props: function(store) { return { isSplit: !!store.selectedQuery }; } }, QueriesTab); }, function(module, exports, __webpack_require__) { "use strict"; 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 || "object" != typeof call && "function" != typeof call ? self : call; } function _inherits(subClass, superClass) { if ("function" != typeof superClass && null !== superClass) 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: !1, writable: !0, configurable: !0 } }), superClass && (Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass); } var _createClass = function() { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0, "value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor); } } return function(Constructor, protoProps, staticProps) { return protoProps && defineProperties(Constructor.prototype, protoProps), staticProps && defineProperties(Constructor, staticProps), Constructor; }; }(), React = __webpack_require__(12), decorate = __webpack_require__(20), _require = __webpack_require__(17), sansSerif = _require.sansSerif, Query = __webpack_require__(381), QueryList = function(_React$Component) { function QueryList() { return _classCallCheck(this, QueryList), _possibleConstructorReturn(this, (QueryList.__proto__ || Object.getPrototypeOf(QueryList)).apply(this, arguments)); } return _inherits(QueryList, _React$Component), _createClass(QueryList, [ { key: "render", value: function() { var _this2 = this; if (!this.props.queries.count()) return React.createElement("div", { style: styles.empty }, "No Relay Queries logged"); var rows = [], odd = !1, lastRequestNumber = -1; return this.props.queries.forEach(function(query) { var requestNumber = query.get("requestNumber"); lastRequestNumber !== requestNumber && (lastRequestNumber = requestNumber, rows.push(React.createElement("tr", { key: "request" + requestNumber }, React.createElement("td", { colSpan: "4", style: styles.grouper }, "Request ", requestNumber))), odd = !1), rows.push(React.createElement(Query, { data: query, isSelected: query.get("id") === _this2.props.selectedQuery, key: query.get("id"), oddRow: odd, onSelect: function() { return _this2.props.selectQuery(query.get("id")); } })), odd = !odd; }), React.createElement("div", { style: styles.container }, React.createElement("table", { style: styles.table }, React.createElement("tbody", null, rows))); } } ]), QueryList; }(React.Component), styles = { container: { position: "relative", flex: 1, overflow: "scroll" }, table: { flex: 1, borderCollapse: "collapse", width: "100%" }, grouper: { fontWeight: "bold", fontSize: sansSerif.sizes.normal }, empty: { flex: 1, padding: 50, textAlign: "center" } }; module.exports = decorate({ store: "relayStore", listeners: function() { return [ "queries", "selectedQuery" ]; }, props: function(store, _props) { return { queries: store.queries, selectQuery: function(id) { return store.selectQuery(id); }, selectedQuery: store.selectedQuery }; } }, QueryList); }, function(module, exports, __webpack_require__) { "use strict"; 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 || "object" != typeof call && "function" != typeof call ? self : call; } function _inherits(subClass, superClass) { if ("function" != typeof superClass && null !== superClass) 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: !1, writable: !0, configurable: !0 } }), superClass && (Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass); } var _extends = Object.assign || function(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) Object.prototype.hasOwnProperty.call(source, key) && (target[key] = source[key]); } return target; }, _createClass = function() { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0, "value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor); } } return function(Constructor, protoProps, staticProps) { return protoProps && defineProperties(Constructor.prototype, protoProps), staticProps && defineProperties(Constructor, staticProps), Constructor; }; }(), _require = __webpack_require__(17), sansSerif = _require.sansSerif, PropTypes = __webpack_require__(7), React = __webpack_require__(12), Query = function(_React$Component) { function Query() { return _classCallCheck(this, Query), _possibleConstructorReturn(this, (Query.__proto__ || Object.getPrototypeOf(Query)).apply(this, arguments)); } return _inherits(Query, _React$Component), _createClass(Query, [ { key: "render", value: function() { var theme = this.context.theme, data = this.props.data, containerStyle = baseContainer; this.props.isSelected ? containerStyle = containerSelectedStyle(theme) : this.props.oddRow && (containerStyle = containeroOddRowStyle(theme)); var status = data.get("status"), start = data.get("start"), end = data.get("end"); return React.createElement("tr", { onClick: this.props.onSelect, style: containerStyle }, React.createElement("td", { style: tdFirstStyle(theme) }, React.createElement("span", { style: statusStyle(status), title: status })), React.createElement("td", { style: tdNameStyle(theme) }, data.get("name")), React.createElement("td", { style: baseTDStyle(theme) }, Math.round(start) / 1e3, "s"), React.createElement("td", { style: baseTDStyle(theme) }, Math.round(end - start), "ms")); } } ]), Query; }(React.Component); Query.contextTypes = { theme: PropTypes.object.isRequired }; var baseContainer = { cursor: "pointer", fontSize: sansSerif.sizes.normal, height: 21, lineHeight: "21px", fontFamily: sansSerif.family }, baseTDStyle = function(theme) { return { whiteSpace: "nowrap", padding: "1px 4px", lineHeight: "17px", borderLeft: "1px solid " + theme.base01 }; }, tdFirstStyle = function(theme) { return _extends({}, baseTDStyle(theme), { borderLeft: "" }); }, tdNameStyle = function(theme) { return _extends({}, baseTDStyle(theme), { width: "100%" }); }, containeroOddRowStyle = function(theme) { return _extends({}, baseContainer, { backgroundColor: theme.base01 }); }, containerSelectedStyle = function(theme) { return _extends({}, baseContainer, { backgroundColor: theme.state00, color: theme.base04 }); }, statusColors = { pending: "orange", success: "green", failure: "red", error: "#aaa" }, statusStyle = function(status) { return { display: "inline-block", width: 11, height: 11, borderRadius: 6, backgroundColor: statusColors[status] || statusColors.error }; }; module.exports = Query; }, function(module, exports, __webpack_require__) { "use strict"; 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 || "object" != typeof call && "function" != typeof call ? self : call; } function _inherits(subClass, superClass) { if ("function" != typeof superClass && null !== superClass) 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: !1, writable: !0, configurable: !0 } }), superClass && (Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass); } var _createClass = function() { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0, "value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor); } } return function(Constructor, protoProps, staticProps) { return protoProps && defineProperties(Constructor.prototype, protoProps), staticProps && defineProperties(Constructor, staticProps), Constructor; }; }(), _DataView = __webpack_require__(24), _DataView2 = _interopRequireDefault(_DataView), _DetailPane = __webpack_require__(52), _DetailPane2 = _interopRequireDefault(_DetailPane), _DetailPaneSection = __webpack_require__(53), _DetailPaneSection2 = _interopRequireDefault(_DetailPaneSection), _Fonts = __webpack_require__(17), _react = __webpack_require__(12), _react2 = _interopRequireDefault(_react), _decorate = __webpack_require__(20), _decorate2 = _interopRequireDefault(_decorate), _tidyGraphQL = __webpack_require__(383), _tidyGraphQL2 = _interopRequireDefault(_tidyGraphQL), QueryViewer = function(_React$Component) { function QueryViewer() { return _classCallCheck(this, QueryViewer), _possibleConstructorReturn(this, (QueryViewer.__proto__ || Object.getPrototypeOf(QueryViewer)).apply(this, arguments)); } return _inherits(QueryViewer, _React$Component), _createClass(QueryViewer, [ { key: "render", value: function() { var data = this.props.data, status = data.get("status"), resultBlock = null; "success" === status ? resultBlock = _react2["default"].createElement(_DetailPaneSection2["default"], { title: "Response" }, _react2["default"].createElement(_DataView2["default"], { data: data.get("response"), readOnly: !0, showMenu: !1, inspect: this.props.inspect, path: [ "response" ] })) : "failure" === status && (resultBlock = _react2["default"].createElement(_DetailPaneSection2["default"], { title: "Error" }, _react2["default"].createElement(_DataView2["default"], { data: data.get("error"), readOnly: !0, showMenu: !1, inspect: this.props.inspect, path: [ "error" ] }))); var start = data.get("start"), end = data.get("end"); return _react2["default"].createElement(_DetailPane2["default"], { header: data.get("type") + ": " + data.get("name") }, _react2["default"].createElement(_DetailPaneSection2["default"], { title: "Start" }, _react2["default"].createElement("div", null, Math.round(start) / 1e3, "s since page load")), _react2["default"].createElement(_DetailPaneSection2["default"], { title: "Status" }, _react2["default"].createElement("div", null, status)), _react2["default"].createElement(_DetailPaneSection2["default"], { title: "Duration" }, _react2["default"].createElement("div", null, Math.round(end - start), "ms")), _react2["default"].createElement(_DetailPaneSection2["default"], { title: "Query" }, _react2["default"].createElement("div", { style: styles.query }, (0, _tidyGraphQL2["default"])(data.get("text")))), _react2["default"].createElement(_DetailPaneSection2["default"], { title: "Variables" }, _react2["default"].createElement(_DataView2["default"], { data: data.get("variables"), readOnly: !0, showMenu: !1, inspect: this.props.inspect, path: [ "variables" ] })), resultBlock); } } ]), QueryViewer; }(_react2["default"].Component), styles = { query: { cursor: "text", fontFamily: _Fonts.monospace.family, fontSize: _Fonts.monospace.sizes.normal, userSelect: "text", MozUserSelect: "text", WebkitUserSelect: "text", whiteSpace: "pre", wordWrap: "break-word" } }; module.exports = (0, _decorate2["default"])({ store: "relayStore", listeners: function(props, store) { return [ "selectedQuery", store.selectedQuery ]; }, props: function(store) { return { data: store.queries.get(store.selectedQuery), inspect: store.inspect.bind(store, store.selectedQuery) }; } }, QueryViewer); }, function(module, exports) { "use strict"; function tidyGraphQL(input) { for (var indent = "", lastWasNewline = !1, parenCount = 0, line = "", head = [], stack = [ head ], i = 0; i < input.length; i++) { var c = input.charAt(i); if ("(" == c ? parenCount++ : ")" == c && parenCount--, "{" == c) indent += " ", lastWasNewline = !0, head.push(line + "{"), line = indent, head = [], stack.push(head); else if ("," == c && 0 == parenCount) head.push(line), lastWasNewline = !0, line = indent; else if ("}" == c) indent = indent.substr(2), head.push(line.replace(/ +$/, "")), head.sort(), line = head.join(",\n"), stack.pop(), head = stack[stack.length - 1], line = head.pop() + "\n" + line + "\n" + indent + "}"; else { if (" " == c && lastWasNewline) continue; " " != c && i + 1 < input.length && "{" == input.charAt(i + 1) ? line += c + " " : (lastWasNewline = !1, line += c); } } return line.replace(/^} /gm, "}\n\n"); } module.exports = tidyGraphQL; }, function(module, exports, __webpack_require__) { "use strict"; 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 || "object" != typeof call && "function" != typeof call ? self : call; } function _inherits(subClass, superClass) { if ("function" != typeof superClass && null !== superClass) 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: !1, writable: !0, configurable: !0 } }), superClass && (Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass); } var _createClass = function() { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0, "value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor); } } return function(Constructor, protoProps, staticProps) { return protoProps && defineProperties(Constructor.prototype, protoProps), staticProps && defineProperties(Constructor, staticProps), Constructor; }; }(), PropTypes = __webpack_require__(7), React = __webpack_require__(12), decorate = __webpack_require__(20), ElementPanel = function(_React$Component) { function ElementPanel() { return _classCallCheck(this, ElementPanel), _possibleConstructorReturn(this, (ElementPanel.__proto__ || Object.getPrototypeOf(ElementPanel)).apply(this, arguments)); } return _inherits(ElementPanel, _React$Component), _createClass(ElementPanel, [ { key: "render", value: function() { var _this2 = this; if (!this.props.dataIDs.length) return React.createElement("span", null); var theme = this.context.theme; return React.createElement("div", null, "Relay Nodes", React.createElement("ul", { style: styles.dataIDs }, this.props.dataIDs.map(function(_ref) { var id = _ref.id, queries = _ref.queries; return React.createElement("li", { style: dataNodeStyle(theme) }, React.createElement("div", { style: dataIDStyle(theme), onClick: function() { return _this2.props.jumpToData(id); } }, "ID: ", id), React.createElement("ul", { style: styles.queries }, queries.map(function(query) { return React.createElement("li", { style: styles.queryID, onClick: function() { var queryID = query.get("id"); queryID && _this2.props.jumpToQuery(queryID); } }, query.get("name")); }), !queries.length && React.createElement("li", { style: noQueriesStyle(theme) }, "No Queries"))); }))); } } ]), ElementPanel; }(React.Component); ElementPanel.contextTypes = { theme: PropTypes.object.isRequired }; var dataNodeStyle = function(theme) { return { marginBottom: 5, border: "1px solid " + theme.base02 }; }, dataIDStyle = function(theme) { return { cursor: "pointer", padding: "2px 4px", backgroundColor: theme.base02 }; }, noQueriesStyle = function(theme) { return { color: theme.base03, padding: "2px 4px" }; }, styles = { dataIDs: { listStyle: "none", padding: 0, margin: 0 }, queries: { listStyle: "none", padding: 0, margin: 0 }, queryID: { cursor: "pointer", padding: "2px 4px" } }; module.exports = decorate({ store: "relayStore", listeners: function(props, store) { return [ props.id ]; }, shouldUpdate: function(props, prevProps) { return props.id !== prevProps.id; }, props: function(store, _props) { var dataIDs = []; if (store.nodesToDataIDs[_props.id]) { var _iteratorNormalCompletion = !0, _didIteratorError = !1, _iteratorError = void 0; try { for (var _step, _iterator = store.nodesToDataIDs[_props.id][Symbol.iterator](); !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0) { var id = _step.value; dataIDs.push({ id: id, queries: (store.queriesByDataID[id] || []).map(function(qid) { return store.queries.get(qid); }) }); } } catch (err) { _didIteratorError = !0, _iteratorError = err; } finally { try { !_iteratorNormalCompletion && _iterator["return"] && _iterator["return"](); } finally { if (_didIteratorError) throw _iteratorError; } } } return { dataIDs: dataIDs, jumpToData: function(dataID) { return store.jumpToDataID(dataID); }, jumpToQuery: function(queryID) { return store.jumpToQuery(queryID); } }; } }, ElementPanel); } ]); ================================================ FILE: dev/react-dev-tools/main.html ================================================ ================================================ FILE: dev/react-dev-tools/manifest.json ================================================ { "update_url": "https://clients2.google.com/service/update2/crx", "manifest_version": 2, "name": "React Developer Tools", "description": "Adds React debugging tools to the Chrome Developer Tools.", "version": "3.4.2", "minimum_chrome_version": "49", "icons": { "16": "icons/16-production.png", "32": "icons/32-production.png", "48": "icons/48-production.png", "128": "icons/128-production.png" }, "browser_action": { "default_icon": { "16": "icons/16-disabled.png", "32": "icons/32-disabled.png", "48": "icons/48-disabled.png", "128": "icons/128-disabled.png" }, "default_popup": "popups/disabled.html" }, "devtools_page": "main.html", "content_security_policy": "script-src 'self' 'unsafe-eval'; object-src 'self'", "web_accessible_resources": [ "main.html", "panel.html", "build/backend.js"], "background": { "scripts": [ "build/background.js" ], "persistent": false }, "permissions": [ "file:///*", "http://*/*", "https://*/*" ], "content_scripts": [ { "matches": [""], "js": ["build/inject.js"], "run_at": "document_start" } ] } ================================================ FILE: dev/react-dev-tools/panel.html ================================================
Unable to find React on the page.
================================================ FILE: dev/react-dev-tools/popups/deadcode.html ================================================

This page includes an extra development build of React. 🚧

The React build on this page includes both development and production versions because dead code elimination has not been applied correctly.

This makes its size larger, and causes React to run slower.

Make sure to set up dead code elimination before deployment.


Open the developer tools, and the React tab will appear to the right.

================================================ FILE: dev/react-dev-tools/popups/development.html ================================================

This page is using the development build of React. 🚧

Note that the development build is not suitable for production.
Make sure to use the production build before deployment.


Open the developer tools, and the React tab will appear to the right.

================================================ FILE: dev/react-dev-tools/popups/disabled.html ================================================

This page doesn’t appear to be using React.
If this seems wrong, follow the troubleshooting instructions.

================================================ FILE: dev/react-dev-tools/popups/outdated.html ================================================

This page is using an outdated version of React. ⌛

We recommend updating React to ensure that you receive important bugfixes and performance improvements.

You can find the upgrade instructions on the React blog.


Open the developer tools, and the React tab will appear to the right.

================================================ FILE: dev/react-dev-tools/popups/production.html ================================================

This page is using the production build of React. ✅
Open the developer tools, and the React tab will appear to the right.

================================================ FILE: dev/react-dev-tools/popups/shared.js ================================================ /* globals chrome */ document.addEventListener('DOMContentLoaded', function() { // Make links work var links = document.getElementsByTagName('a'); for (var i = 0; i < links.length; i++) { (function() { var ln = links[i]; var location = ln.href; ln.onclick = function() { chrome.tabs.create({active: true, url: location}); }; })(); } // Work around https://bugs.chromium.org/p/chromium/issues/detail?id=428044 document.body.style.opacity = 0; document.body.style.transition = 'opacity ease-out .4s'; requestAnimationFrame(function() { document.body.style.opacity = 1; }); }); ================================================ FILE: dev/react-dev-tools/popups/unminified.html ================================================

This page is using an unminified build of React. 🚧

The React build on this page appears to be unminified.
This makes its size larger, and causes React to run slower.

Make sure to set up minification before deployment.


Open the developer tools, and the React tab will appear to the right.

================================================ FILE: dist/.gitignore ================================================ * !.gitignore ================================================ FILE: index.html ================================================ Dat Desktop
================================================ FILE: index.js ================================================ 'use strict' const { app, BrowserWindow, shell, Menu, ipcMain } = require('electron') const { neutral } = require('dat-colors') const autoUpdater = require('./lib/auto-updater') const defaultMenu = require('electron-default-menu') const doctor = require('dat-doctor') const path = require('path') const isDev = process.env.NODE_ENV === 'development' const isTest = process.env.NODE_ENV === 'test' const { Writable } = require('stream') if (typeof process.env.NODE_V === 'string' && process.env.NODE_V !== process.version) { console.error(` WARNING: You are using a different version of Node than is used in this electron release! - Used Version: ${process.env.NODE_V} - Electron's Node Version: ${process.version} We recommend running: $ nvm install ${process.version}; npm rebuild; `) } const menu = defaultMenu(app, shell) menu[menu.length - 1].submenu.push({ label: 'Doctor', click: () => { win.webContents.openDevTools({ mode: 'detach' }) const out = Writable({ write (chunk, env, done) { if (win) win.webContents.send('log', chunk.toString()) done() } }) doctor({ out }) } }) let win let watchProcess app.on('ready', () => { if (isDev) { BrowserWindow.addDevToolsExtension(path.join(__dirname, 'dev', 'react-dev-tools')) watchAndReload() } win = new BrowserWindow({ // Extending the size of the browserwindow to make sure that the developer bar is visible. width: 800 + (isDev ? 50 : 0), height: 600 + (isDev ? 200 : 0), titleBarStyle: 'hiddenInset', minWidth: 640, minHeight: 395, backgroundColor: neutral, icon: path.resolve(`${__dirname}/build/icon.png`), // Spectron doesn't work with "preload" enabled, loading is handled in index.html webPreferences: (!isTest ? { nodeIntegration: false, preload: `${__dirname}/preload.js` } : { nodeIntegration: true } ) }) win.loadURL(`file://${__dirname}/index.html#${process.env.NODE_ENV}`) Menu.setApplicationMenu(Menu.buildFromTemplate(menu)) ipcMain.on('progress', (_, progress) => win && win.setProgressBar(progress)) if (isDev) { win.webContents.openDevTools() } else { const log = str => win && win.webContents.send('log', str) autoUpdater({ log }) } }) app.on('will-finish-launching', () => { app.on('open-url', (_, url) => win.webContents.send('link', url)) app.on('open-file', (_, path) => win.webContents.send('file', path)) }) app.on('window-all-closed', () => { if (watchProcess) { watchProcess.close() watchProcess = null } app.quit() }) // const quit = app.makeSingleInstance(() => { // if (!win) return // if (win.isMinimized()) win.restore() // win.focus() // }) // // if (quit) app.quit() function watchAndReload () { let gaze let first = true try { gaze = require('gaze') } catch (e) { console.warn('Gaze is not installed, wont be able to reload the app') // In case dev dependencies are not installed return } gaze([ `preload.js`, `static/**/*` ], { debounceDelay: 60, cwd: __dirname }, (err, process) => { if (err) { console.warn('Gaze doesnt run well, wont be able to reload the app') console.warn(err) return } watchProcess = process watchProcess.on('all', () => { if (first) { first = false return } win && win.reload() }) }) } ================================================ FILE: lib/auto-updater.js ================================================ const os = require('os') const { app, dialog, autoUpdater } = require('electron') const ms = require('ms') module.exports = ({ log }) => { const onerror = err => err && log(err.stack || err) const platform = `${os.platform()}_${os.arch()}` const version = app.getVersion() try { autoUpdater.setFeedURL(`http://dat.land:6000/update/${platform}/${version}`) } catch (e) { onerror(e) return } autoUpdater.on('error', onerror) autoUpdater.on('checking-for-update', () => log('checking for update')) autoUpdater.on('update-available', () => log('update available, downloading…') ) autoUpdater.on('update-not-available', () => log('update not available')) autoUpdater.on('download-progress', p => log('download progress ' + p.percent) ) autoUpdater.once('update-downloaded', (ev, notes, version) => { log('update downloaded') dialog.showMessageBox( { type: 'question', buttons: ['Install and Relaunch', 'Dismiss'], defaultId: 0, title: 'A new version of Dat Desktop is ready to install!', message: `Dat Desktop ${version} has been downloaded and is ready to use! Would you like to install it and relaunch Dat Desktop now?` }, res => { const update = res === 0 if (!update) return log('dismiss') log('updating…') autoUpdater.quitAndInstall() } ) }) setTimeout(() => autoUpdater.checkForUpdates(), ms('10s')) setInterval(() => autoUpdater.checkForUpdates(), ms('30m')) } ================================================ FILE: package.json ================================================ { "name": "dat-desktop", "productName": "Dat Desktop", "version": "3.0.3", "license": "MIT", "repository": "datproject/dat-desktop", "description": "Peer to peer data sharing app built for humans.", "author": { "name": "Dat Team", "email": "community@datproject.org" }, "scripts": { "prestart": "npm run build:dev", "start": "cross-env NODE_ENV=development npm-run-all -p start:watch start:electron", "start:electron": "cross-env NODE_V=\"$(node -v)\" NODE_ENV=development electron .", "start:watch": "webpack --watch --mode=development", "test": "npm run test:deps && npm run test:lint && npm run test:unit && npm run test:integration", "test:deps": "cross-env DEBUG=* dependency-check . --detective precinct --entry app/index.js", "test:lint": "prettier-standard 'app/**/*.js' 'tests/**/*.js' 'lib/**/*.js' 'unit-tests/*.js' && standard", "test:unit": "cross-env NODE_ENV=test babel-tape-runner -r ./unit-tests/_helpers/*.js unit-tests/*.js", "test:integration": "npm run build:prod && node ./tests/index.js", "clean": "npm run clean:git && npm run clean:dirs", "clean:git": "git clean -dfX", "clean:dirs": "rm -rf ~/.electron && rm -f package-lock.json", "update-rdt": "rm -rf dev/react-dev-tools && ced fmkadmapgofadopljbjfkapdkoienihi dev/react-dev-tools", "build:dev": "webpack --mode=development --progress --profile --colors", "build:prod": "webpack --mode=production --profile --colors", "pack": "npm run build:prod && npm run pack:all", "pack:os": "electron-builder --x64 --ia32 --dir", "pack:all": "npm run pack:os -- --linux --mac --win", "dist": "npm run build:prod && npm run dist:os", "dist:os": "electron-builder --x64 --ia32", "dist:all": "npm run dist:os -- --linux --mac --win", "dist:publish": "npm run dist -- --publish onTagOrDraft", "release": "standard-version" }, "standard": { "ignore": [ "dev/**" ] }, "devDependencies": { "@babel/core": "^7.0.0", "@babel/plugin-proposal-object-rest-spread": "^7.0.0", "@babel/preset-env": "^7.0.0", "@babel/preset-react": "^7.0.0", "babel-loader": "^8.0.0", "babel-tape-runner": "^3.0.0", "chrome-ext-downloader": "^1.0.4", "clipboardy": "^1.2.3", "cross-env": "^5.1.6", "del": "^3.0.0", "dependency-check": "^3.1.0", "electron": "^6.1.7", "electron-builder": "^21.2.0", "enzyme": "^3.3.0", "enzyme-adapter-react-16": "^1.1.1", "enzyme-adapter-react-helper": "^1.2.3", "gaze": "^1.1.3", "npm-run-all": "^4.1.3", "precinct": "^5.1.0", "prettier-standard": "^8.0.1", "spectron": "^5.0.0", "standard": "^12.0.1", "tape": "^4.9.0", "webpack": "^4.20.2", "webpack-cli": "^3.1.1", "webpack-node-externals": "^1.7.2" }, "dependencies": { "dat-colors": "^3.5.1", "dat-doctor": "^1.4.0", "dat-encoding": "^5.0.1", "dat-icons": "^2.5.2", "dat-node": "^3.5.8", "electron-default-menu": "^1.0.1", "minimist": "^1.2.0", "mirror-folder": "^3.0.0", "mkdirp-promise": "^5.0.1", "ms": "^2.1.1", "polished": "^2.3.0", "prettier-bytes": "^1.0.4", "react": "^16.3.2", "react-dom": "^16.3.2", "react-file-drop": "^0.2.7", "react-redux": "^5.0.7", "react-swap": "^2.0.2", "redux": "^4.0.0", "redux-logger": "^3.0.6", "redux-thunk": "^2.2.0", "standard-version": "^6.0.1", "styled-components": "^4.1.1", "tachyons": "^4.9.1", "util-promisify": "^2.1.0" }, "build": { "appId": "land.dat.dat-desktop", "asar": true, "directories": { "output": "dist" }, "mac": { "category": "public.app-category.utilities", "icon": "build/icon.icns" }, "dmg": { "icon": "build/icon.icns", "contents": [ { "x": 220, "y": 200 }, { "x": 448, "y": 200, "type": "link", "path": "/Applications" } ] }, "linux": { "category": "Utility", "packageCategory": "Utility", "target": [ "AppImage", "deb" ] }, "deb": { "synopsis": "Dat Desktop App" }, "win": { "target": "NSIS", "icon": "build/icon.png" }, "protocols": [ { "name": "Dat Link", "schemes": [ "dat" ] } ] } } ================================================ FILE: preload.js ================================================ 'use strict' /** * This file exists for security reasons! * * It prepares by removing dangerous scripts from the global scopes * Before running the app. * * See: https://electronjs.org/docs/tutorial/security * & https://eslint.org/docs/rules/no-implied-eval */ const platform = require('os').platform() window.__defineGetter__('DAT_ENV', () => ({ platform })) // eslint-disable-next-line no-eval window.eval = global.eval = function () { throw new Error('Sorry, this app does not support window.eval().') } const setTimeout = global.setTimeout window.setTimeout = global.setTimeout = function (fn, ms) { if (typeof fn !== 'function') { throw new Error('Sorry, this app does not support setTimeout() with a string') } return setTimeout(fn, ms) } const setInterval = global.setInterval window.setInterval = global.setInterval = function (fn, ms) { if (typeof fn !== 'function') { throw new Error('Sorry, this app does not support setInterval() with a string') } return setInterval(fn, ms) } process.once('loaded', () => { document.addEventListener('DOMContentLoaded', () => require('./static/bundle')) }) ================================================ FILE: static/base.css ================================================ @font-face { font-family: 'SourceSansPro'; src: url('fonts/SourceSansPro-Regular.ttf') format('truetype') } @font-face { font-family: 'SourceCodePro'; src: url('fonts/SourceCodePro-Regular.ttf') format('truetype') } html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, b, u, i, center, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td, article, aside, canvas, details, embed, figure, figcaption, footer, header, hgroup, menu, nav, output, ruby, section, summary, time, mark, audio, video { margin: 0; padding: 0; border: 0; } html { overflow: auto; } body { line-height: 1.5; overflow: hidden; min-width: 800px; height: 100vh; } main { background-color: var(--color-white); } body, input, textarea, select, button { font-family: 'SourceSansPro', sans-serif; &:focus { outline: none; } } pre, code { font-family: 'SourceCodePro', monospace; } input, textarea, select, button { -webkit-user-drag: none; } html { -webkit-user-select: none; -webkit-user-drag: none; cursor: default; } h1, h2, h3, h4, h5, h6 { font-size: 1rem; font-weight: bold; } img { -webkit-user-drag: none; } button { border: none; } .is-selectable { -webkit-user-select: auto; cursor: auto; } .is-draggable { -webkit-app-region: drag; } /* fading animation to highlight new dats */ .fade-highlight { animation: fade-highlight 2.25s ease-in-out; } @keyframes fade-highlight { 0% { background-color: rgba(42,202,75,.2); } 35% { background-color: rgba(42,202,75,.2); } 100% { background-color: rgba(42,202,75,0); } } #app-root { display: flex; flex-direction: column; height: 100vh; } #app-root > main { flex: 1; } ================================================ FILE: tests/fixtures/dat.json ================================================ {"title": "hello world", "author": "karissa"} ================================================ FILE: tests/fixtures/hello.txt ================================================ mundo ================================================ FILE: tests/index.js ================================================ #!/usr/bin/env node var clipboard = require('clipboardy') var spectron = require('spectron') var path = require('path') var test = require('tape').test var del = require('del') var { exec } = require('child_process') var props = require('bluebird').props var waitForAndClick = require('./utils/waitForAndClick') var waitForMatch = require('./utils/waitForMatch') var wait = require('./utils/wait') var TEST_DATA = path.join(__dirname, 'test_data') var TEST_DATA_DB = path.join(TEST_DATA, 'multidat.json') var FIXTURES = path.join(__dirname, 'fixtures') test('init', function (t) { t.test('should be able to boot up the app', function (t) { const app = createApp() return init(app, t) .then(() => props({ getWindowCount: app.client.getWindowCount(), isMinimized: app.browserWindow.isMinimized(), isDevToolsOpened: app.browserWindow.isDevToolsOpened(), isFocused: app.browserWindow.isFocused(), bounds: app.browserWindow .getBounds() .then(bounds => ({ width: bounds.width, height: bounds.height })) }) ) .then(props => t.deepEquals( props, { getWindowCount: 1, isMinimized: false, isDevToolsOpened: false, isFocused: true, bounds: { width: 800, height: 600 } }, 'All settings match' ) ) .catch(e => t.fail(e)) .then(() => endTest(app, t)) }) t.end() }) test('onboarding', function (t) { t.test( 'intro should show every time you open the app as long as you have no dats', function (t) { var app = createApp() return initAndSkipIntro(app, t) .then(() => app.stop()) .then(() => Promise.resolve((app = createApp()))) .then(() => waitForLoad(app, t)) .then(() => app.browserWindow .isVisible() .then(isVisible => t.ok(isVisible, 'App is visible.')) ) .then(() => waitForAndClick(t, app, '.btn-get-started')) .then(() => app.client.waitForExist('.btn-skip')) .catch(e => t.fail(e)) .then(() => endTest(app, t)) } ) t.end() }) function initAndSkipIntro (app, t) { return init(app, t) .then(() => app.browserWindow .getTitle() .then(title => t.equals( title, 'Dat Desktop | Welcome', 'intro title shown in the beginning' ) ) ) .then(() => waitForAndClick(t, app, '.btn-get-started')) .then(() => waitForAndClick(t, app, '.btn-skip')) .then(() => app.browserWindow .getTitle() .then(title => t.equals(title, 'Dat Desktop', 'dat title shown after the intro') ) ) } test('working with dats', function (t) { var app = createApp() return initAndSkipIntro(app, t) .then(() => waitForAndClick(t, app, '.btn-share-folder')) .then(() => Promise.all([ waitForMatch(t, app, '.network', /0/), waitForMatch(t, app, '.size', /([1-9]\d*) B/) ]) ) .then(() => Promise.all([ clipboard.write('').then(() => t.ok(true, 'Cleared clipboard')), waitForAndClick(t, app, '.btn-link') ]) ) .then(() => waitForAndClick(t, app, '.btn-copy-to-clipboard')) .then(() => wait(200)) .then(() => clipboard .read() .then(text => t.ok( text.match(/^dat:\/\/[0-9a-f]{32}/), 'link copied to clipboard: ' + text ) ) ) .then(() => app.stop()) .then(() => Promise.resolve((app = createApp()))) .then(() => waitForLoad(app, t)) .then(() => app.browserWindow .isVisible() .then(isVisible => t.equal(isVisible, true, 'reloaded and is visible')) ) .then(() => waitForMatch(t, app, '.size', /([1-9]\d*) B/) ) .then(() => waitForAndClick(t, app, '.btn-delete')) .then(() => waitForAndClick(t, app, '.btn-cancel')) .then(() => waitForAndClick(t, app, '.btn-delete')) .then(() => waitForAndClick(t, app, '.btn-confirm')) .then(() => waitForMatch( t, app, '.tutorial', /share/i, 'now the dat is gone and welcome screen is back' ) ) // now the dat is gone and welcome screen is back .catch(e => t.fail(e)) .then(() => endTest(app, t)) }) // Create a new app instance function createApp (t) { let electronPath = path.resolve(__dirname, '..', 'node_modules', '.bin', 'electron') if (process.platform === 'win32') { electronPath += '.cmd' } const index = path.join(__dirname, '..', 'index.js') var app = new spectron.Application({ path: electronPath, args: [index, '--data', TEST_DATA, '--db', TEST_DATA_DB], env: { NODE_ENV: 'test', RUNNING_IN_SPECTRON: true, OPEN_RESULT: FIXTURES } }) process.on('SIGTERM', () => endTest(app)) return app } function clear () { return Promise.all([ del(FIXTURES).then( () => new Promise((resolve, reject) => exec( `git checkout -- "${FIXTURES}"`, error => (error ? reject(error) : resolve()) ) ) ), del(TEST_DATA) ]) } function init (app, t) { return clear().then(() => waitForLoad(app, t)) } // Starts the app, waits for it to load, returns a promise function waitForLoad (app, t) { return app .start() .then(() => { app.client.waitUntilWindowLoaded() }) .then(function () { // Switch to the main window return app.client.windowByIndex(0) }) .then(() => { app.client.waitUntilWindowLoaded() }) .then(() => { app.browserWindow.focus() app.browserWindow .isVisible() .then(isVisible => { t.ok(isVisible, 'isVisible') }) }) .then(() => app) } // Quit the app, end the test, either in success (!err) or failure (err) function endTest (app, t) { return app .stop() .then(() => clear()) .then(() => t && t.end()) } ================================================ FILE: tests/utils/wait.js ================================================ // Returns a promise that resolves after 'ms' milliseconds. Default: 1 second module.exports = function wait (ms) { ms = ms || 3000 return new Promise(function (resolve, reject) { setTimeout(resolve, ms) }) } ================================================ FILE: tests/utils/waitForAndClick.js ================================================ const waitForVisible = require('./waitForVisible') module.exports = function waitForAndClick (t, app, selector, ms, reverse) { return waitForVisible(t, app, selector, ms, reverse) .then(selector => { return app.client.click(selector) }) .then(() => t.ok(true, selector + ' clicked.')) } ================================================ FILE: tests/utils/waitForMatch.js ================================================ var wait = require('./wait') module.exports = function waitForMatch (t, app, selector, regexp, ms, reverse) { if (reverse) { reverse = true } else { reverse = false } if (!ms) { ms = 15000 } var lastValue var end = Date.now() + ms function check () { if (Date.now() > end) { return Promise.reject( new Error( `Timeout after ${ms}ms tryin to match "${selector}" with ${String( regexp )}; last value: ${lastValue}` ) ) } return app.client .getText(selector) .then(function (text) { lastValue = text var match = regexp.test(text) ? !reverse : reverse if (!match) { return Promise.reject(new Error('no-match')) } t.ok(true, '"' + selector + '" matches ' + String(regexp)) return Promise.resolve(text) }) .catch(function (e) { return wait(100).then(check) }) } return check() } ================================================ FILE: tests/utils/waitForVisible.js ================================================ module.exports = function waitForVisible (t, app, selector, ms, reverse) { return app.client.waitForVisible(selector, ms, reverse).then(() => { t.ok(true, selector + ' exists.') return selector }) } ================================================ FILE: unit-tests/_helpers/enzymeSetup.js ================================================ import configure from 'enzyme-adapter-react-helper' configure({ disableLifecycleMethods: true }) ================================================ FILE: unit-tests/_helpers/mockWindow.js ================================================ global.window = { addEventListener: function () {} } ================================================ FILE: unit-tests/dat-import.js ================================================ import test from 'tape' import React from 'react' import { shallow } from 'enzyme' import DatImport from '../app/components/dat-import' import Icon from '../app/components/icon' test('dat import should render input element and icon', t => { const wrapper = shallow( {}} />) t.equal(wrapper.find('input').length, 1) t.equal(wrapper.find(Icon).length, 1) t.end() }) ================================================ FILE: unit-tests/file-list.js ================================================ import test from 'tape' import React from 'react' import { shallow, render } from 'enzyme' import FileList from '../app/components/file-list' test('file list should render div with class pa2', t => { const files = [] const wrapper = shallow( ) t.equal(wrapper.find('.pa2').length, 0) t.end() }) test('file list should render tr(s) equal to number of files in dat', t => { const files = [ { path: '/foo', size: 30, isFile: true }, { path: '/bar', size: 30, isFile: true }, { path: '/baz', size: 30, isFile: false } ] const wrapper = render( ) t.equal(wrapper.find('tr').length, files.length) t.end() }) test('file list should render a tr(s) even if directories without isEditing and size property given', t => { const files = [ { path: '/foo' }, { path: '/bar' }, { path: '/baz' } ] const wrapper = render( ) t.equal(wrapper.find('tr').length, files.length) t.end() }) ================================================ FILE: unit-tests/hex-content.js ================================================ import test from 'tape' import React from 'react' import { shallow } from 'enzyme' import HexContent from '../app/components/hex-content' test('hexagon should be blue when loading dat', t => { const wrapper = shallow( ) t.equal(wrapper.find('.color-blue.hover-color-blue-hover').length, 2) t.end() }) test('hexagon should be neutral colored when dat is paused', t => { const wrapper = shallow( ) t.equal(wrapper.find('.color-neutral-30.hover-color-neutral-40').length, 2) t.end() }) test('hexagon should be green colored when dat is completed', t => { const wrapper = shallow( ) t.equal(wrapper.find('.color-green.hover-color-green-hover').length, 1) t.end() }) test('hexagon should be neutral colored when dat is resumed but neighter loading nor completed', t => { const wrapper = shallow( ) t.equal(wrapper.find('.color-neutral-30.hover-color-neutral-40').length, 1) t.end() }) ================================================ FILE: unit-tests/inspect.js ================================================ import test from 'tape' import React from 'react' import { shallow } from 'enzyme' import Inspect from '../app/components/inspect' test('should render empty', t => { const wrapper = shallow( {}} />) t.equal(wrapper.isEmptyRender(), true) t.end() }) test('should set title to dat key when metadata is not present on dat', t => { const key = '40a7f6b6147ae695bcbcff432f684c7bb5291ea339c28c1755196cdeb80bd3f8' const wrapper = shallow( {}} /> ) t.equal(wrapper.find('h2').text(), key) t.end() }) test('should show default values when metadata is not present on dat ', t => { const key = '40a7f6b6147ae695bcbcff432f684c7bb5291ea339c28c1755196cdeb80bd3f8' const wrapper = shallow( {}} /> ) t.equal( wrapper .children() .find('[data-test="key"]') .childAt(0) .text(), key ) t.equal( wrapper .children() .find('[data-test="size"]') .childAt(0) .text(), '0 B' ) t.equal( wrapper .children() .find('[data-test="author"]') .childAt(0) .text(), 'N/A' ) t.equal( wrapper .children() .find('[data-test="description"]') .childAt(0) .text(), 'N/A' ) t.end() }) test('should show info when present on dat', t => { const key = '40a7f6b6147ae695bcbcff432f684c7bb5291ea339c28c1755196cdeb80bd3f8' const wrapper = shallow( {}} /> ) t.equal( wrapper .children() .find('[data-test="key"]') .childAt(0) .text(), key ) t.equal( wrapper .children() .find('[data-test="size"]') .childAt(0) .text(), '9 B' ) t.equal( wrapper .children() .find('[data-test="peers"]') .childAt(0) .text(), '2' ) t.equal( wrapper .children() .find('[data-test="author"]') .childAt(0) .text(), 'A-author' ) t.equal( wrapper .children() .find('[data-test="description"]') .childAt(0) .text(), 'A-desc' ) t.equal( wrapper .children() .find('[data-test="path"]') .childAt(0) .text(), 'A-path' ) t.end() }) ================================================ FILE: unit-tests/intro.js ================================================ import test from 'tape' import React from 'react' import { shallow } from 'enzyme' import Intro from '../app/components/intro' import { Green as GreenButton, Plain as PlainButton } from '../app/components/button' test('intro screen should render only empty div when show is false', t => { const wrapper = shallow() t.equal(wrapper.find('div').length, 1) t.end() }) test('intro screen should render only one

element when screen given', t => { const fn = () => {} const show = true const wrapper = shallow( ) t.equal(wrapper.find('p').length, 1) t.end() }) test('intro screen should not render plain button when screen is 1', t => { const fn = () => {} const show = true const wrapper = shallow( ) t.equal(wrapper.find(PlainButton).length, 0) t.end() }) test('intro screen should render plain button when screen is not 1', t => { const fn = () => {} const show = true const wrapper = shallow( ) t.equal(wrapper.find(PlainButton).length, 1) t.end() }) test('intro screen should render Done button when screen is not less than 5', t => { const fn = () => {} const show = true const wrapper = shallow( ) t.equal( wrapper .find(GreenButton) .children() .text(), 'Done' ) t.end() }) test('intro screen should render Next button when screen is less than 5', t => { const fn = () => {} const show = true const wrapper = shallow( ) t.equal( wrapper .find(GreenButton) .children() .text(), 'Next' ) t.end() }) ================================================ FILE: unit-tests/status-bar.js ================================================ import test from 'tape' import React from 'react' import { shallow } from 'enzyme' import StatusBar from '../app/components/status-bar' test('status bar should render empty when show is false', t => { const wrapper = shallow() t.equal(wrapper.isEmptyRender(), true) t.end() }) test('status bar should render a Bar with two childrens when show is true', t => { const show = true const wrapper = shallow() t.equal(wrapper.find('span').length, 2) t.end() }) ================================================ FILE: unit-tests/status.js ================================================ import test from 'tape' import React from 'react' import { shallow } from 'enzyme' import Status from '../app/components/status' test('progress text should read "Paused" when dat is paused', t => { const wrapper = shallow( ) t.equal( wrapper .find('.f7.f6-l') .children() .children() .text(), 'Paused.' ) t.end() }) test('progress text should show upload speed when dat is completed', t => { const wrapper = shallow( ) t.equal( wrapper .find('.f7.f6-l') .children() .children() .text(), 'Complete. ↑ 30 B/s' ) t.end() }) test('progress text should show wait message when dat is stale', t => { const wrapper = shallow( ) t.equal( wrapper .find('.f7.f6-l') .children() .children() .text(), 'waiting for peers…' ) t.end() }) test('progress text should show up/down speed when dat is loading', t => { const wrapper = shallow( ) t.equal( wrapper .find('.f7.f6-l') .children() .children() .text(), '↓ 40 B/s↑ 30 B/s' ) t.end() }) ================================================ FILE: unit-tests/table-row.js ================================================ import test from 'tape' import React from 'react' import { shallow } from 'enzyme' import TableRow from '../app/components/table-row' test('table row should render author as Anonymous if not present on dat', t => { const fn = () => {} const wrapper = shallow( ) t.equal(wrapper.find('.author').text(), 'Anonymous • ') t.end() }) test('table row should render author name if present on dat', t => { const fn = () => {} const wrapper = shallow( ) t.equal(wrapper.find('.author').text(), 'A-author • ') t.end() }) test('table row should render writable state as Read-only if not present on dat', t => { const fn = () => {} const wrapper = shallow( ) t.equal(wrapper.find('.title').text(), 'Read-only') t.end() }) test('table row should render writable state as Read & Write if dat is writable', t => { const fn = () => {} const wrapper = shallow( ) t.equal(wrapper.find('.title').text(), 'Read & Write') t.end() }) test('table row should render size equals to 0 when length is not defined on dat', t => { const fn = () => {} const wrapper = shallow( ) t.equal(wrapper.find('.size').text(), '0 B') t.end() }) test('table row should render size equals to length property on stats', t => { const fn = () => {} const wrapper = shallow( ) t.equal(wrapper.find('.size').text(), '40 B') t.end() }) test('table row should render peers', t => { const fn = () => {} const wrapper = shallow( ) t.equal(wrapper.find('.network').text(), '2') t.end() }) ================================================ FILE: unit-tests/table.js ================================================ import test from 'tape' import React from 'react' import { shallow } from 'enzyme' import Table from '../app/components/table' import TableRowContainer from '../app/containers/table-row' test('table should render columns (Link, Status, Size, Peers)', t => { const show = true const wrapper = shallow() const columns = wrapper.find('.tl').map(node => node.text().toLowerCase()) t.deepLooseEqual(columns.sort(), ['link', 'status', 'size', 'peers'].sort()) t.end() }) test('table should render same number of table rows as given dats', t => { const show = true const wrapper = shallow(
) t.equal(wrapper.find(TableRowContainer).length, 3) t.end() }) ================================================ FILE: unit-tests/title-field.js ================================================ import test from 'tape' import React from 'react' import { shallow } from 'enzyme' import TitleField from '../app/components/title-field' import { Plain as PlainButton, Green as GreenButton } from '../app/components/button' import Icon from '../app/components/icon' test('title field show not be editable if dat is not writable', t => { const wrapper = shallow() t.equal(wrapper.find(PlainButton).length, 0) t.equal(wrapper.find(GreenButton).length, 0) t.end() }) test('title field show edit button if dat is editable and is not editing', t => { const wrapper = shallow() t.equal(wrapper.find(Icon).length, 1) t.end() }) test('title field show plain button if title value is equal to input field value when editing', async t => { const field = const wrapper = shallow(field) wrapper.setState({ editing: true, modified: false }) t.equal(wrapper.find(PlainButton).length, 1) t.equal(wrapper.find(GreenButton).length, 0) t.end() }) test('title field show green button if title value is not equal to input field value when editing', t => { const field = const wrapper = shallow(field) wrapper.setState({ editing: true, modified: true }) t.equal(wrapper.find(PlainButton).length, 0) t.equal(wrapper.find(GreenButton).length, 1) t.end() }) ================================================ FILE: webpack.config.js ================================================ const nodeExternals = require('webpack-node-externals') const path = require('path') module.exports = (_, argv) => ({ entry: path.normalize(`${__dirname}/app/index.js`), target: 'electron-main', externals: [nodeExternals({ whitelist: /react-file-drop/ })], output: { path: path.normalize(`${__dirname}/static`), filename: 'bundle.js', libraryTarget: 'commonjs2' }, optimization: { nodeEnv: argv.mode }, devtool: 'inline-source-map', node: { __dirname: true }, module: { rules: [ { test: /\.js$/, include: path.normalize(`${__dirname}/app`), loader: 'babel-loader', query: { presets: ['@babel/preset-react'], plugins: [ '@babel/plugin-transform-modules-commonjs' ] } } ] } })