diff --git a/.gitignore b/.gitignore index 2a05e65..c0522eb 100644 --- a/.gitignore +++ b/.gitignore @@ -22,6 +22,73 @@ npm-debug.log* yarn-debug.log* yarn-error.log* -.idea +/.env -.env \ No newline at end of file +# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and WebStorm +# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 + +# User-specific stuff +.idea/**/workspace.xml +.idea/**/tasks.xml +.idea/**/usage.statistics.xml +.idea/**/dictionaries +.idea/**/shelf + +# Generated files +.idea/**/contentModel.xml + +# Sensitive or high-churn files +.idea/**/dataSources/ +.idea/**/dataSources.ids +.idea/**/dataSources.local.xml +.idea/**/sqlDataSources.xml +.idea/**/dynamic.xml +.idea/**/uiDesigner.xml +.idea/**/dbnavigator.xml + +# Gradle +.idea/**/gradle.xml +.idea/**/libraries + +# Gradle and Maven with auto-import +# When using Gradle or Maven with auto-import, you should exclude module files, +# since they will be recreated, and may cause churn. Uncomment if using +# auto-import. +# .idea/modules.xml +# .idea/*.iml +# .idea/modules +# *.iml +# *.ipr + +# CMake +cmake-build-*/ + +# Mongo Explorer plugin +.idea/**/mongoSettings.xml + +# File-based project format +*.iws + +# IntelliJ +out/ + +# mpeltonen/sbt-idea plugin +.idea_modules/ + +# JIRA plugin +atlassian-ide-plugin.xml + +# Cursive Clojure plugin +.idea/replstate.xml + +# Crashlytics plugin (for Android Studio and IntelliJ) +com_crashlytics_export_strings.xml +crashlytics.properties +crashlytics-build.properties +fabric.properties + +# Editor-based Rest Client +.idea/httpRequests + +# Android studio 3.1+ serialized cache file +.idea/caches/build_file_checksums.ser diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..5c98b42 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,2 @@ +# Default ignored files +/workspace.xml \ No newline at end of file diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml new file mode 100644 index 0000000..e0069b6 --- /dev/null +++ b/.idea/codeStyles/Project.xml @@ -0,0 +1,38 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/codeStyles/codeStyleConfig.xml b/.idea/codeStyles/codeStyleConfig.xml new file mode 100644 index 0000000..79ee123 --- /dev/null +++ b/.idea/codeStyles/codeStyleConfig.xml @@ -0,0 +1,5 @@ + + + + \ No newline at end of file diff --git a/.idea/dictionaries/Alex.xml b/.idea/dictionaries/Alex.xml new file mode 100644 index 0000000..6875562 --- /dev/null +++ b/.idea/dictionaries/Alex.xml @@ -0,0 +1,9 @@ + + + + aedes + mqtt + sequelize + + + \ No newline at end of file diff --git a/.idea/encodings.xml b/.idea/encodings.xml new file mode 100644 index 0000000..15a15b2 --- /dev/null +++ b/.idea/encodings.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml new file mode 100644 index 0000000..0006aea --- /dev/null +++ b/.idea/inspectionProfiles/Project_Default.xml @@ -0,0 +1,9 @@ + + + + \ No newline at end of file diff --git a/.idea/jsLibraryMappings.xml b/.idea/jsLibraryMappings.xml new file mode 100644 index 0000000..d23208f --- /dev/null +++ b/.idea/jsLibraryMappings.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..24eb271 --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..0aff3a6 --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/runConfigurations/backend_start.xml b/.idea/runConfigurations/backend_start.xml new file mode 100644 index 0000000..ec52d3f --- /dev/null +++ b/.idea/runConfigurations/backend_start.xml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/.idea/runConfigurations/frontend_start.xml b/.idea/runConfigurations/frontend_start.xml new file mode 100644 index 0000000..933bde1 --- /dev/null +++ b/.idea/runConfigurations/frontend_start.xml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/.idea/sh.iml b/.idea/sh.iml new file mode 100644 index 0000000..24643cc --- /dev/null +++ b/.idea/sh.iml @@ -0,0 +1,12 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..35eb1dd --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/watcherTasks.xml b/.idea/watcherTasks.xml new file mode 100644 index 0000000..d94620f --- /dev/null +++ b/.idea/watcherTasks.xml @@ -0,0 +1,25 @@ + + + + + + + + \ No newline at end of file diff --git a/README.md b/README.md index 05ce66f..a472618 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,10 @@ -Solomaha Home +Solomaha Home ==== +*Currently in ALPHA* + +Smart Home hub & control panel written using JS, MQTT and React. + ## Installation 1. Clone repo && cd: @@ -23,13 +27,16 @@ Solomaha Home ``` npm i ``` + 3. Copy (if dev) and configure env variables: ```sh cp .env.example .env ``` + +4. If needed configure & build the frontend (in `./frontend` folder) -## Topic structure: +## Topic structure: (probably outdated) ### Web Panel diff --git a/components/auth/UserModel.js b/components/auth/UserModel.js new file mode 100644 index 0000000..bb22e48 --- /dev/null +++ b/components/auth/UserModel.js @@ -0,0 +1,27 @@ +const Sequelize = require('sequelize'); + +module.exports = sequelize => sequelize.define('user', { + user_id: { + type: Sequelize.STRING(128), + allowNull: false, + }, + password_hash: { + type: Sequelize.STRING(), + allowNull: false, + }, + api_key: Sequelize.STRING(64), + name: Sequelize.STRING(128), + room_id: Sequelize.STRING(128), + last_login_at: Sequelize.INTEGER.UNSIGNED, +}, { + updatedAt: false, + indexes: [ + { + fields: ['user_id'], + unique: true, + }, + { + fields: ['api_key'], + }, + ], +}); diff --git a/components/auth/UserTokenModel.js b/components/auth/UserTokenModel.js new file mode 100644 index 0000000..ef7285b --- /dev/null +++ b/components/auth/UserTokenModel.js @@ -0,0 +1,23 @@ +const Sequelize = require('sequelize'); + +module.exports = sequelize => sequelize.define('user_token', { + user_id: { + type: Sequelize.STRING(100), + allowNull: false, + }, + token: { + type: Sequelize.STRING, + allowNull: false, + }, +}, { + updatedAt: false, + indexes: [ + { + fields: ['token'], + unique: true, + }, + { + fields: ['user_id'], + }, + ], +}); \ No newline at end of file diff --git a/components/auth/index.js b/components/auth/index.js new file mode 100644 index 0000000..2aa2a75 --- /dev/null +++ b/components/auth/index.js @@ -0,0 +1,244 @@ +const crypto = require('crypto'); +const express = require('express'); +const argon2 = require('argon2'); + +const UserTokenModel = require('./UserTokenModel'); +const UserModel = require('./UserModel'); + +class Auth { + constructor(core) { + /** + * @type Core + */ + this.core = core; + /** + * @type UserModel + */ + this.UserModel = UserModel(this.core.sequelize); + /** + * @type UserTokenModel + */ + this.UserTokenModel = UserTokenModel(this.core.sequelize); + /** + * user_id => token[] + * @type {Object.} + */ + this.userTokens = {}; + + this.authenticatedMiddleware = async (req, res, next) => { + try { + const token = Auth.extractTokenFromRequest(req); + + if (await this.authenticate(token)) { + return next(); + } + + const err = new Error('Unauthorized'); + err.status = 400; + return next(err); + } catch (e) { + return next(e); + } + }; + + Promise.all([ + this.checkUsers(), + this.loadTokens(), + ]); + } + + async checkUsers() { + const count = await this.UserModel.count(); + const rootExists = await this.UserModel.count({ + where: { + user_id: 'root', + }, + }) > 0; + + if (count === 0 && !rootExists) { + const rootModel = await this.createUser({ + user_id: 'root', + name: 'Root', + password: 'root', + }); + + if (rootModel) { + console.log('Root user with password \'root\' was created'); + } + } + } + + async loadTokens() { + const userTokenModels = await this.UserTokenModel.findAll(); + + userTokenModels.forEach(userTokenModel => { + if (!this.userTokens[userTokenModel.user_id]) { + this.userTokens[userTokenModel.user_id] = []; + } + + this.userTokens[userTokenModel.user_id].push(userTokenModel.token); + }); + } + + getRouter() { + const authRouter = express.Router(); + + authRouter.post('/login', async (req, res, next) => { + const { username = '', password } = req.body; + + const user = await this.UserModel.findOne({ + where: { + user_id: username.toLocaleLowerCase(), + }, + attributes: ['id', 'user_id', 'password_hash', 'name'], + }); + + if (!user) { + const err = new Error('Wrong username or password'); + err.status = 401; + return next(err); + } + + const passwordVerified = await argon2.verify(user.password_hash, password); + + if (!passwordVerified) { + const err = new Error('Wrong username or password'); + err.status = 401; + return next(err); + } + + const token = await this.generateToken(); + + this.UserTokenModel.create({ + user_id: user.user_id, + token, + }); + + if (!this.userTokens[user.user_id]) { + this.userTokens[user.user_id] = []; + } + + this.userTokens[user.user_id].push(token); + + user.update({ + last_login_at: Date.now() / 1000, + }); + + return res.send({ + ok: true, + user: { + id: user.user_id, + name: user.name, + token, + }, + }); + }); + + authRouter.post('/logout', async (req, res, next) => { + const token = Auth.extractTokenFromRequest(req); + + const tokenModel = await this.UserTokenModel.findOne({ + where: { token }, + }); + + if (!tokenModel) { + const err = new Error('Token was not found'); + err.status = 401; + return next(err); + } + + if (this.userTokens[tokenModel.user_id]) { + this.userTokens[tokenModel.user_id] = this.userTokens[tokenModel.user_id].filter(token => token !== tokenModel.token) + } + + const tokenDestroyed = await tokenModel.destroy(); + + return res.send({ ok: tokenDestroyed }); + }); + + return authRouter; + } + + /** + * @param req + * @returns {string|null} + */ + static extractTokenFromRequest(req) { + if (req.headers.authorization) { + return req.headers.authorization; + } + + if (req.query.token) { + return req.query.token; + } + + if (req.body.token) { + return req.body.token; + } + + return null; + } + + /** + * @returns {Promise} + */ + async generateToken() { + return new Promise((resolve, reject) => { + crypto.randomBytes(this.core.config.auth.tokenSize, (err, buffer) => { + if (err) return reject(err); + + const token = buffer.toString('base64'); + + return resolve(token); + }); + }); + } + + /** + * @param {string} token + * @returns {boolean} + */ + async authenticate(token) { + for (const user_id in this.userTokens) { + // noinspection JSUnfilteredForInLoop + if (this.userTokens[user_id].includes(token)) { + return true; + } + } + + const user = await this.UserModel.findOne({ + where: { + api_key: token, + }, + }); + + return !!user; + } + + /** + * Hash password and remove it form object + * @param data Request data + * @returns {Promise} + */ + async dataPasswordHash(data) { + const { password, ...restData } = data; + + const hash = await argon2.hash(password); + + return { + ...restData, + password_hash: hash, + }; + } + + /** + * @param {Object} data + */ + async createUser(data) { + const values = await this.dataPasswordHash(data); + + return this.UserModel.create(values); + } +} + +module.exports = (core) => new Auth(core); diff --git a/utils/items.js b/components/items.js similarity index 100% rename from utils/items.js rename to components/items.js diff --git a/components/loaders/db.js b/components/loaders/db.js new file mode 100644 index 0000000..ddddbab --- /dev/null +++ b/components/loaders/db.js @@ -0,0 +1,23 @@ +const Sequelize = require('sequelize'); + +/** + * @param {Core} core + * @constructor + */ +const DBLoader = (core) => { + core.sequelize = new Sequelize(core.config.db.name, core.config.db.username, core.config.db.password, { + host: core.config.db.host, + port: core.config.db.port, + dialect: 'mysql', + logging: process.env.NODE_ENV === 'production' ? false : console.log, + }); + + core.sequelize.authenticate() + .then(() => console.log('DB connected')) + .catch(err => { + console.error('DB Error:', err); + process.exit(); + }); +}; + +module.exports = DBLoader; \ No newline at end of file diff --git a/components/loaders/mqtt.js b/components/loaders/mqtt.js new file mode 100644 index 0000000..1f40cd8 --- /dev/null +++ b/components/loaders/mqtt.js @@ -0,0 +1,117 @@ +const Aedes = require('aedes'); + +/** + * @param {Core} core + * @returns {aedes.Aedes} + * @constructor + */ +const MQTTLoader = (core) => { + core.aedes = Aedes({ + id: 'sh', + authenticate: (client, username, password, callback) => { + if (!password || !username) { + console.log(`Auth failed: ${client.id}, ${username}, ${password}`); + + const error = new Error('No credentials provided'); + error.returnCode = 4; + return callback(error, null); + } + + client.isDevice = username === 'device'; + + if (client.isDevice) { + if (core.config.devices.find(device => device.id === client.id && device.password === password.toString())) { + return callback(null, true); + } + + console.log(`Auth failed for Client ID ${client.id} with username: ${username}, password: ${password}`); + + const error = new Error('Wrong credentials'); + error.returnCode = 4; + return callback(error, null); + } else { + core.auth.authenticate(password.toString()).then(authenticated => { + if (authenticated) { + return callback(null, true); + } + + console.log(`Auth failed for Client ID ${client.id} with username: ${username}, password: ${password}`); + + const error = new Error('Wrong credentials'); + error.returnCode = 4; + return callback(error, null); + }); + } + }, + }); + + core.aedes.on('publish', (packet, client) => { + if (client) { + console.log(packet.topic, packet.payload.toString(), client.id); + } + + const [module, ...params] = packet.topic.split('/'); + + if (core.modules[module] && typeof core.modules[module].onMessage === 'function') { + try { + core.modules[module].onMessage.call( + core.modules[module], + params, + packet.payload.toString(), + client, + packet, + ); + } catch (e) { + console.error(`Error in ${module}.onMessage()`, e); + } + } + }); + + core.aedes.on('client', client => { + console.log(`${client.id} connected`); + + let connectedTopic; + + if (client.isDevice) { + connectedTopic = `devices/${client.id}/online`; + + core.emit('device.connected', client.id); + } else { + const [userId] = client.id.split('@'); + + connectedTopic = `users/${userId}/online`; + + core.emit('user.connected', userId); + } + + core.aedes.publish({ + topic: connectedTopic, + payload: JSON.stringify(true), + }); + }); + + core.aedes.on('clientDisconnect', client => { + console.log(`${client.id} disconnected`); + + let disconnectedTopic; + + if (client.isDevice) { + disconnectedTopic = `devices/${client.id}/online`; + + core.emit('device.disconnected', client.id); + } else { + const [userId] = client.id.split('@'); + + disconnectedTopic = `users/${userId}/online`; + + core.emit('user.disconnected', userId); + } + + core.aedes.publish({ + topic: disconnectedTopic, + payload: JSON.stringify(false), + }, () => null); + }); +}; + +module.exports = MQTTLoader; diff --git a/components/loaders/web.js b/components/loaders/web.js new file mode 100644 index 0000000..6cb76a4 --- /dev/null +++ b/components/loaders/web.js @@ -0,0 +1,253 @@ +const express = require('express'); +const cors = require('cors'); +const Auth = require('../auth'); +const Modules = require('../modules'); + +/** + * @param {Core} core + * @constructor + */ +const DBLoader = (core) => { + core.express = express(); + + core.express.use(cors()); + core.express.disable('x-powered-by'); + core.express.use(express.json()); + + core.auth = Auth(core); + core.express.use('/api/auth', core.auth.getRouter()); + + core.express.apiRouter = express.Router(); + core.express.apiRouter.use(core.auth.authenticatedMiddleware); + + core.modules = Modules(core); + + core.express.apiRouter.get('/dashboard/:dashboardId', (req, res, next) => { + const dashboard = core.config.dashboards.find(dashboard => dashboard.id === req.params.dashboardId); + + if (!dashboard) { + const error = new Error('Dashboard not found'); + error.status = 404; + return next(); + } + + const responseData = { + ...JSON.parse(JSON.stringify(dashboard)), // Clone dashboard configuration + modules: [], + }; + + // Unique array of module ids used by items in this dashboard + const moduleIDs = []; + + // Replace item_id with config and current state + for (let i = 0; i < responseData.items.length; i++) { + const room = responseData.items[i]; + + if (!Array.isArray(room.items)) { + continue; + } + + for (let j = 0; j < room.items.length; j++) { + const itemGroup = room.items[j]; + + if (!Array.isArray(itemGroup)) { + continue; + } + + for (let k = 0; k < itemGroup.length; k++) { + const itemId = itemGroup[k]; + const item = core.config.items.find(item => item.id === itemId); + + if (!item) { + console.error(`Item with id '${itemId}' was not found in dashboard '${dashboard.id}'`); + + // Remove item_id + itemGroup.splice(k, 1); + + continue; + } + + if (!core.modules.hasOwnProperty(item.module)) { + console.error(`Invalid module specified for item '${item.id}': ${item.module}`); + + // Remove item_id + itemGroup.splice(k, 1); + + continue; + } + + if (moduleIDs.indexOf(item.module) === -1) { + moduleIDs.push(item.module); + } + + // Replace the item_id with state and config + itemGroup[k] = core.modules[item.module].getItemData(item.id); + } + } + } + + // Replace module_id with module config + for (let i = 0; i < moduleIDs.length; i++) { + const moduleConfig = core.config.modules.find(module => module.id === moduleIDs[i]); + + if (!moduleConfig.frontend) continue; + + responseData.modules.push(moduleConfig); + } + + return res.send({ + ok: true, + ...responseData, + }); + }); + + core.express.apiRouter.get('/dashboards', (req, res) => { + const dashboards = []; + + core.config.dashboards.forEach(dashboard => { + if (!dashboard.displayInMenu) return; + + dashboards.push({ + id: dashboard.id, + name: dashboard.name, + }); + }); + + return res.send({ + ok: true, + dashboards, + }); + }); + + core.express.apiRouter.get('/users', async (req, res, next) => { + try { + const users = await core.auth.UserModel.findAll({ + attributes: [ + 'id', + 'user_id', + 'name', + ], + }); + + return res.send({ + ok: true, + users, + }); + } catch (e) { + return next(e); + } + }); + + core.express.apiRouter.post('/users', async (req, res, next) => { + if (!req.body.user_id || !req.body.name || !req.body.password) { + const e = new Error('Wrong parameters'); + e.status = 400; + return next(e); + } + + try { + const user = await core.auth.createUser({ + user_id: req.body.user_id, + name: req.body.name, + password: req.body.password, + api_key: req.body.api_key, + room_id: req.body.room_id, + }); + + return res.send({ + ok: true, + user, + }); + } catch (e) { + return next(e); + } + }); + + core.express.apiRouter.get('/users/:userId', async (req, res, next) => { + try { + const { userId } = req.params; + + const user = await core.auth.UserModel.findByPk(userId, { + attributes: [ + 'id', + 'user_id', + 'api_key', + 'name', + 'room_id', + 'last_login_at', + ], + }); + + return res.send({ + ok: true, + user, + }); + } catch (e) { + return next(e); + } + }); + + core.express.apiRouter.put('/users/:userId', async (req, res, next) => { + try { + const { userId } = req.params; + const data = await core.auth.dataPasswordHash(req.body); + + delete data.user_id; + delete data.last_login_at; + + const user = await core.auth.UserModel.update(data, { + where: { + id: userId, + }, + }); + + return res.send({ + ok: true, + user, + }); + } catch (e) { + return next(e); + } + }); + + core.express.apiRouter.delete('/users/:userId', async (req, res, next) => { + try { + const { userId } = req.params; + + await core.auth.UserModel.destroy({ + where: { + id: userId, + }, + }); + + await core.auth.UserTokenModel.destroy({ + where: { + user_id: userId, + }, + }); + + return res.send({ + ok: true, + }); + } catch (e) { + return next(e); + } + }); + + core.express.use('/api', core.express.apiRouter); + + // Error handler + core.express.all('*', () => { + const error = new Error('Not found'); + error.status = 404; + throw error; + }); + + core.express.use((err, req, res, next) => res.status(err.status || 500).send({ + ok: false, + message: err.message, + ...err, + })); +}; + +module.exports = DBLoader; diff --git a/utils/modules.js b/components/modules.js similarity index 73% rename from utils/modules.js rename to components/modules.js index d54dfb9..9c8bb92 100644 --- a/utils/modules.js +++ b/components/modules.js @@ -4,16 +4,7 @@ */ function Modules(core) { function getModulesItems(moduleId) { - let items = []; - - core.config.dashboard.forEach(room => room.items.forEach(itemGroup => { - items = [ - ...items, - ...itemGroup.filter(item => item.module === moduleId), - ]; - })); - - return items; + return core.config.items.filter(item => item.module === moduleId); } const modules = {}; diff --git a/config/dashboard.js b/config/dashboard.js deleted file mode 100644 index b5c3310..0000000 --- a/config/dashboard.js +++ /dev/null @@ -1,132 +0,0 @@ -module.exports = [ - { - id: 'room1', - name: 'Room One', - items: [ - [ - { - id: 'room1-air_temperature', - module: 'variable', - device: 'room1-table', - name: 'Air Temperature', - suffix: ' °C', - color: 'red', - }, - { - id: 'room1-air_humidity', - module: 'variable', - device: 'room1-table', - name: 'Air Humidity', - suffix: '%', - color: 'light_blue', - }, - { - id: 'room1-plant', - module: 'plant', - device: 'room1-plant', - name: 'Plant', - }, - ], - [ - { id: 'room1-light', module: 'switch', name: 'Light' }, - { id: 'room1-secondary_light', module: 'switch', name: 'Secondary Light' }, - { id: 'room1-fan', module: 'switch', name: 'Fan' }, - { id: 'room1-rgb', module: 'rgb', name: 'LED Strip' }, - // { id: 'room1-rgb2', module: 'rgb', name: 'Mood Light 2' }, - ], - ], - }, - { - id: 'balcony', - name: 'Balcony', - items: [ - [ - { - id: 'balcony-air_temperature', - module: 'variable', - device: 'balcony-meteo', - name: 'Air Temperature', - suffix: ' °C', - color: 'red', - }, - { - id: 'balcony-air_humidity', - device: 'balcony-meteo', - module: 'variable', - name: 'Air Humidity', - suffix: '%', - color: 'light_blue', - }, - { - id: 'balcony-air_pressure', - device: 'balcony-meteo', - module: 'variable', - name: 'Air Pressure', - suffix: ' hPa', - historyCount: 60, - color: 'blue', - }, - ], - ], - }, - { - id: 'corridor', - name: 'Corridor', - items: [ - [ - { id: 'corridor-buzzer', module: 'buzzer', name: 'Intercom' }, - ], - [ - { id: 'corridor-light', module: 'motion-switch', name: 'Light' }, - ], - ], - }, - { - id: 'room2', - name: 'Room 2', - items: [ - [ - { - id: 'room2-air_temperature', - module: 'variable', - device: 'room2-table', - name: 'Air Temperature', - suffix: ' °C', - color: 'red', - }, - { - id: 'room2-air_humidity', - module: 'variable', - device: 'room2-table', - name: 'Air Humidity', - suffix: '%', - color: 'light_blue', - }, - ], - ], - }, - { - id: 'kitchen', - name: 'Kitchen', - items: [ - [ - { - id: 'kitchen-air_temperature', - module: 'variable', - device: 'kitchen-table', - name: 'Air Temperature', - suffix: ' °C', - color: 'red', - }, - { - id: 'kitchen-air_humidity', - module: 'variable', - device: 'kitchen-table', - name: 'Air Humidity', - suffix: '%', - color: 'light_blue', - }, - ], - ], - }, -]; \ No newline at end of file diff --git a/config/dashboards.js b/config/dashboards.js index ec4e2c9..0267b5e 100644 --- a/config/dashboards.js +++ b/config/dashboards.js @@ -2,10 +2,11 @@ module.exports = [ { id: 'main', name: 'Main Panel', + displayInMenu: true, items: [ { id: 'room1', - name: 'Room One', + name: 'Room 1', items: [ [ 'room1-air_temperature', @@ -15,6 +16,7 @@ module.exports = [ [ 'room1-light', 'room1-secondary_light', + 'room1-fan', 'room1-rgb', ], ], @@ -36,51 +38,33 @@ module.exports = [ items: [ [ 'corridor-buzzer', + 'door', ], [ - 'corridor-light_switch', + 'corridor-light', ], ], }, - ], - }, - { - id: 'corridor-display', - name: 'Corridor Display', - items: [ { - id: 'corridor', - name: 'Corridor', + id: 'room2', + name: 'Room 2', items: [ [ - 'corridor-buzzer', - ], - [ - 'corridor-light_switch', + 'room2-air_temperature', + 'room2-air_humidity', ], ], }, { - id: 'room1', - name: 'Room One', + id: 'kitchen', + name: 'Kitchen', items: [ [ - 'room1-light', - 'room1-secondary_light', - 'room1-rgb', - ], - ], - }, - { - id: 'balcony', - name: 'Balcony', - items: [ - [ - 'balcony-air_temperature', - 'balcony-air_pressure', + 'kitchen-air_temperature', + 'kitchen-air_humidity', ], ], }, ], }, -]; \ No newline at end of file +]; diff --git a/config/index.js b/config/index.js index 49f85b9..3c72a7c 100644 --- a/config/index.js +++ b/config/index.js @@ -1,8 +1,6 @@ module.exports = { modules: require('./modules'), - users: require('./users'), devices: require('./devices'), - dashboard: require('./dashboard'), dashboards: require('./dashboards'), items: require('./items'), ports: { diff --git a/config/items.js b/config/items.js index e37f48e..9a88d19 100644 --- a/config/items.js +++ b/config/items.js @@ -5,6 +5,7 @@ module.exports = [ device: 'room1-table', name: 'Air Temperature', suffix: ' °C', + color: 'red', }, { id: 'room1-air_humidity', @@ -12,12 +13,13 @@ module.exports = [ device: 'room1-table', name: 'Air Humidity', suffix: '%', + color: 'light_blue', }, { id: 'room1-plant', module: 'plant', device: 'room1-plant', - name: 'Plant', + name: 'Green Plant', }, { id: 'room1-light', @@ -34,12 +36,18 @@ module.exports = [ module: 'rgb', name: 'Mood Light', }, + { + id: 'room1-fan', + module: 'switch', + name: 'Fan', + }, { id: 'balcony-air_temperature', module: 'variable', device: 'balcony-meteo', name: 'Air Temperature', suffix: ' °C', + color: 'red', }, { id: 'balcony-air_humidity', @@ -47,6 +55,7 @@ module.exports = [ module: 'variable', name: 'Air Humidity', suffix: '%', + color: 'light_blue', }, { id: 'balcony-air_pressure', @@ -54,21 +63,53 @@ module.exports = [ module: 'variable', name: 'Air Pressure', suffix: ' hPa', - historyCount: 60, + color: 'blue', }, { id: 'corridor-buzzer', module: 'buzzer', - name: 'Intercom', + name: 'Buzzer', }, { id: 'corridor-light', - module: 'switch', + module: 'motion-switch', name: 'Light', }, { - id: 'corridor-door', + id: 'door', module: 'variable', name: 'Door', }, -]; \ No newline at end of file + { + id: 'room2-air_temperature', + module: 'variable', + device: 'room2-table', + name: 'Air Temperature', + suffix: ' °C', + color: 'red', + }, + { + id: 'room2-air_humidity', + module: 'variable', + device: 'room2-table', + name: 'Air Humidity', + suffix: '%', + color: 'light_blue', + }, + { + id: 'kitchen-air_temperature', + module: 'variable', + device: 'kitchen-table', + name: 'Air Temperature', + suffix: ' °C', + color: 'red', + }, + { + id: 'kitchen-air_humidity', + module: 'variable', + device: 'kitchen-table', + name: 'Air Humidity', + suffix: '%', + color: 'light_blue', + }, +]; diff --git a/config/modules.js b/config/modules.js index c119a04..d255e28 100644 --- a/config/modules.js +++ b/config/modules.js @@ -38,37 +38,42 @@ module.exports = [ listeners: [ { name: 'On server start', - callback: instance => - instance.core.on('core.init', () => - instance.send('Server started'), - ), + callback: instance => instance.core.on('core.init', () => instance.send('Server started')), }, { name: 'On device disconnect', callback: instance => setTimeout( - () => - instance.core.on('device.disconnected', - deviceId => - instance.send(`Device '${deviceId}' disconnected`), - ), + () => instance.core.on( + 'device.disconnected', + deviceId => instance.send(`Device '${deviceId}' disconnected`), + ), 5000, ), }, { name: 'On device connect', callback: instance => setTimeout( - () => - instance.core.on('device.connected', - deviceId => - instance.send(`Device '${deviceId}' connected`), - ), + () => instance.core.on( + 'device.connected', + deviceId => instance.send(`Device '${deviceId}' connected`), + ), 5000, ), }, { name: 'On buzzer unlocked', - callback: instance => instance.core.on('buzzer.unlocked', () => instance.send(`Buzzer was unlocked`)), + callback: instance => instance.core.on( + 'buzzer.unlocked', + () => instance.send(`Buzzer was unlocked`), + ), + }, + { + name: 'On buzzer auto unlock change', + callback: instance => instance.core.on( + 'buzzer.auto_unlock', + (itemId, isAutoUnlock) => instance.send(`Buzzer auto-unlock: ${isAutoUnlock}`), + ), }, ], }, -]; \ No newline at end of file +]; diff --git a/config/users.js b/config/users.js deleted file mode 100644 index d3d8065..0000000 --- a/config/users.js +++ /dev/null @@ -1,8 +0,0 @@ -module.exports = [ - { - id: 'CyanoFresh', - password: 'qwerty', - name: 'Alex', - apiKey: 'fsjfsdjhfaskhjhgkjsfdghkcxjlkvcxsdfjhkijnksdfyrt', - }, -]; \ No newline at end of file diff --git a/frontend/.env b/frontend/.env new file mode 100644 index 0000000..c284009 --- /dev/null +++ b/frontend/.env @@ -0,0 +1,2 @@ +REACT_APP_API_URL=//127.0.0.1/api +REACT_APP_MQTT_URL=mqtt://127.0.0.1:8888 \ No newline at end of file diff --git a/frontend/.gitignore b/frontend/.gitignore new file mode 100644 index 0000000..8996736 --- /dev/null +++ b/frontend/.gitignore @@ -0,0 +1,20 @@ +# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. + +# dependencies +/node_modules +/.pnp +.pnp.js + +# testing +/coverage + +# misc +.DS_Store +.env.local +.env.development.local +.env.test.local +.env.production.local + +npm-debug.log* +yarn-debug.log* +yarn-error.log* diff --git a/frontend/.prettierrc b/frontend/.prettierrc new file mode 100644 index 0000000..c1a6f66 --- /dev/null +++ b/frontend/.prettierrc @@ -0,0 +1,4 @@ +{ + "singleQuote": true, + "trailingComma": "es5" +} diff --git a/frontend/README.md b/frontend/README.md new file mode 100644 index 0000000..9d9614c --- /dev/null +++ b/frontend/README.md @@ -0,0 +1,68 @@ +This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app). + +## Available Scripts + +In the project directory, you can run: + +### `npm start` + +Runs the app in the development mode.
+Open [http://localhost:3000](http://localhost:3000) to view it in the browser. + +The page will reload if you make edits.
+You will also see any lint errors in the console. + +### `npm test` + +Launches the test runner in the interactive watch mode.
+See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information. + +### `npm run build` + +Builds the app for production to the `build` folder.
+It correctly bundles React in production mode and optimizes the build for the best performance. + +The build is minified and the filenames include the hashes.
+Your app is ready to be deployed! + +See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information. + +### `npm run eject` + +**Note: this is a one-way operation. Once you `eject`, you can’t go back!** + +If you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project. + +Instead, it will copy all the configuration files and the transitive dependencies (Webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own. + +You don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it. + +## Learn More + +You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started). + +To learn React, check out the [React documentation](https://reactjs.org/). + +### Code Splitting + +This section has moved here: https://facebook.github.io/create-react-app/docs/code-splitting + +### Analyzing the Bundle Size + +This section has moved here: https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size + +### Making a Progressive Web App + +This section has moved here: https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app + +### Advanced Configuration + +This section has moved here: https://facebook.github.io/create-react-app/docs/advanced-configuration + +### Deployment + +This section has moved here: https://facebook.github.io/create-react-app/docs/deployment + +### `npm run build` fails to minify + +This section has moved here: https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify diff --git a/frontend/build/asset-manifest.json b/frontend/build/asset-manifest.json new file mode 100644 index 0000000..db64224 --- /dev/null +++ b/frontend/build/asset-manifest.json @@ -0,0 +1,38 @@ +{ + "files": { + "static/js/0.b073b4db.chunk.js": "/static/js/0.b073b4db.chunk.js", + "static/js/1.09fac6f6.chunk.js": "/static/js/1.09fac6f6.chunk.js", + "static/js/2.eb8bba45.chunk.js": "/static/js/2.eb8bba45.chunk.js", + "static/js/3.a04abccb.chunk.js": "/static/js/3.a04abccb.chunk.js", + "static/js/4.680c68a6.chunk.js": "/static/js/4.680c68a6.chunk.js", + "static/js/5.8fc3c986.chunk.js": "/static/js/5.8fc3c986.chunk.js", + "static/js/6.35cbf03a.chunk.js": "/static/js/6.35cbf03a.chunk.js", + "static/js/7.99402dc7.chunk.js": "/static/js/7.99402dc7.chunk.js", + "static/js/8.e2ca39ba.chunk.js": "/static/js/8.e2ca39ba.chunk.js", + "static/js/9.fd0a4bba.chunk.js": "/static/js/9.fd0a4bba.chunk.js", + "static/js/10.833dd806.chunk.js": "/static/js/10.833dd806.chunk.js", + "static/js/11.fbdc9c8e.chunk.js": "/static/js/11.fbdc9c8e.chunk.js", + "static/js/12.a29ecbce.chunk.js": "/static/js/12.a29ecbce.chunk.js", + "static/js/13.6e68d259.chunk.js": "/static/js/13.6e68d259.chunk.js", + "static/js/14.e6e3ab18.chunk.js": "/static/js/14.e6e3ab18.chunk.js", + "static/js/15.a357db65.chunk.js": "/static/js/15.a357db65.chunk.js", + "static/js/16.fb198f33.chunk.js": "/static/js/16.fb198f33.chunk.js", + "static/js/17.761966a5.chunk.js": "/static/js/17.761966a5.chunk.js", + "static/js/18.434e3ddc.chunk.js": "/static/js/18.434e3ddc.chunk.js", + "static/js/19.0a0d568e.chunk.js": "/static/js/19.0a0d568e.chunk.js", + "static/js/20.96c4b4d2.chunk.js": "/static/js/20.96c4b4d2.chunk.js", + "static/js/21.25c87477.chunk.js": "/static/js/21.25c87477.chunk.js", + "static/js/22.a2f0bc9b.chunk.js": "/static/js/22.a2f0bc9b.chunk.js", + "main.js": "/static/js/main.f92110fe.chunk.js", + "runtime-main.js": "/static/js/runtime-main.7e040d09.js", + "static/js/25.c5e20682.chunk.js": "/static/js/25.c5e20682.chunk.js", + "index.html": "/index.html", + "precache-manifest.5569dc6fcef0fe931bac0831c194571e.js": "/precache-manifest.5569dc6fcef0fe931bac0831c194571e.js", + "service-worker.js": "/service-worker.js" + }, + "entrypoints": [ + "static/js/runtime-main.7e040d09.js", + "static/js/25.c5e20682.chunk.js", + "static/js/main.f92110fe.chunk.js" + ] +} \ No newline at end of file diff --git a/frontend/build/favicon.ico b/frontend/build/favicon.ico new file mode 100644 index 0000000..8c7366c Binary files /dev/null and b/frontend/build/favicon.ico differ diff --git a/frontend/build/icon_16.png b/frontend/build/icon_16.png new file mode 100644 index 0000000..1ab2d0f Binary files /dev/null and b/frontend/build/icon_16.png differ diff --git a/frontend/build/icon_32.png b/frontend/build/icon_32.png new file mode 100644 index 0000000..8c7366c Binary files /dev/null and b/frontend/build/icon_32.png differ diff --git a/frontend/build/icon_512.png b/frontend/build/icon_512.png new file mode 100644 index 0000000..698b2a0 Binary files /dev/null and b/frontend/build/icon_512.png differ diff --git a/frontend/build/icon_64.png b/frontend/build/icon_64.png new file mode 100644 index 0000000..726bd94 Binary files /dev/null and b/frontend/build/icon_64.png differ diff --git a/frontend/build/index.html b/frontend/build/index.html new file mode 100644 index 0000000..5215dd8 --- /dev/null +++ b/frontend/build/index.html @@ -0,0 +1 @@ +Solomaha Home
\ No newline at end of file diff --git a/frontend/build/manifest.json b/frontend/build/manifest.json new file mode 100644 index 0000000..f9c12cf --- /dev/null +++ b/frontend/build/manifest.json @@ -0,0 +1,30 @@ +{ + "short_name": "Solomaha Home", + "name": "Solomaha Home", + "icons": [ + { + "src": "favicon.ico", + "sizes": "32x32 16x16", + "type": "image/x-icon" + }, + { + "src": "icon_32.png", + "sizes": "32x32", + "type": "image/png" + }, + { + "src": "icon_64.png", + "sizes": "64x64", + "type": "image/png" + }, + { + "src": "icon_512.png", + "sizes": "512x512", + "type": "image/png" + } + ], + "start_url": ".", + "display": "standalone", + "theme_color": "#000000", + "background_color": "#ffffff" +} diff --git a/frontend/build/precache-manifest.5569dc6fcef0fe931bac0831c194571e.js b/frontend/build/precache-manifest.5569dc6fcef0fe931bac0831c194571e.js new file mode 100644 index 0000000..f66aab1 --- /dev/null +++ b/frontend/build/precache-manifest.5569dc6fcef0fe931bac0831c194571e.js @@ -0,0 +1,110 @@ +self.__precacheManifest = (self.__precacheManifest || []).concat([ + { + "revision": "0ec33b00db0af9b17016413dd69d183d", + "url": "/index.html" + }, + { + "revision": "600e0d225c4a74d37b14", + "url": "/static/js/0.b073b4db.chunk.js" + }, + { + "revision": "60e1746db8b8ee98238d", + "url": "/static/js/1.09fac6f6.chunk.js" + }, + { + "revision": "d1022e226882534d0110", + "url": "/static/js/10.833dd806.chunk.js" + }, + { + "revision": "7fcb29845091f8e3fdc6", + "url": "/static/js/11.fbdc9c8e.chunk.js" + }, + { + "revision": "acccbb4386bc0290e2e0", + "url": "/static/js/12.a29ecbce.chunk.js" + }, + { + "revision": "ad2cb58cde5a2a292cd3", + "url": "/static/js/13.6e68d259.chunk.js" + }, + { + "revision": "503eaaeeeb6a160cd03b", + "url": "/static/js/14.e6e3ab18.chunk.js" + }, + { + "revision": "323d5ce4127dd9596c66", + "url": "/static/js/15.a357db65.chunk.js" + }, + { + "revision": "e57f96fa69e3234dd957", + "url": "/static/js/16.fb198f33.chunk.js" + }, + { + "revision": "bb6acb9b7a66c54304f1", + "url": "/static/js/17.761966a5.chunk.js" + }, + { + "revision": "846a59d5c54b6e90a20c", + "url": "/static/js/18.434e3ddc.chunk.js" + }, + { + "revision": "46004dc6966071224972", + "url": "/static/js/19.0a0d568e.chunk.js" + }, + { + "revision": "9c8f8cf5b6209db60b6c", + "url": "/static/js/2.eb8bba45.chunk.js" + }, + { + "revision": "90849de1ca7170f79d6a", + "url": "/static/js/20.96c4b4d2.chunk.js" + }, + { + "revision": "24b69ec589507815dda0", + "url": "/static/js/21.25c87477.chunk.js" + }, + { + "revision": "6ae132aa7f368e00f7fe", + "url": "/static/js/22.a2f0bc9b.chunk.js" + }, + { + "revision": "55330775c405002b5056", + "url": "/static/js/25.c5e20682.chunk.js" + }, + { + "revision": "17ebe71e8b110f9bdffb", + "url": "/static/js/3.a04abccb.chunk.js" + }, + { + "revision": "8836e3ec8cdcfdb991ef", + "url": "/static/js/4.680c68a6.chunk.js" + }, + { + "revision": "82af0b721ed6c880fdbd", + "url": "/static/js/5.8fc3c986.chunk.js" + }, + { + "revision": "ef196fc454d875673938", + "url": "/static/js/6.35cbf03a.chunk.js" + }, + { + "revision": "fae480792d76bc091ed2", + "url": "/static/js/7.99402dc7.chunk.js" + }, + { + "revision": "474bef46988aac0d07cf", + "url": "/static/js/8.e2ca39ba.chunk.js" + }, + { + "revision": "57d2daa38c01a3b9fd05", + "url": "/static/js/9.fd0a4bba.chunk.js" + }, + { + "revision": "1a32e23d31ee1906c396", + "url": "/static/js/main.f92110fe.chunk.js" + }, + { + "revision": "5f3d2b070820cd0ab5b7", + "url": "/static/js/runtime-main.7e040d09.js" + } +]); \ No newline at end of file diff --git a/frontend/build/service-worker.js b/frontend/build/service-worker.js new file mode 100644 index 0000000..922547d --- /dev/null +++ b/frontend/build/service-worker.js @@ -0,0 +1,39 @@ +/** + * Welcome to your Workbox-powered service worker! + * + * You'll need to register this file in your web app and you should + * disable HTTP caching for this file too. + * See https://goo.gl/nhQhGp + * + * The rest of the code is auto-generated. Please don't update this file + * directly; instead, make changes to your Workbox build configuration + * and re-run your build process. + * See https://goo.gl/2aRDsh + */ + +importScripts("https://storage.googleapis.com/workbox-cdn/releases/4.3.1/workbox-sw.js"); + +importScripts( + "/precache-manifest.5569dc6fcef0fe931bac0831c194571e.js" +); + +self.addEventListener('message', (event) => { + if (event.data && event.data.type === 'SKIP_WAITING') { + self.skipWaiting(); + } +}); + +workbox.core.clientsClaim(); + +/** + * The workboxSW.precacheAndRoute() method efficiently caches and responds to + * requests for URLs in the manifest. + * See https://goo.gl/S9QRab + */ +self.__precacheManifest = [].concat(self.__precacheManifest || []); +workbox.precaching.precacheAndRoute(self.__precacheManifest, {}); + +workbox.routing.registerNavigationRoute(workbox.precaching.getCacheKeyForURL("/index.html"), { + + blacklist: [/^\/_/,/\/[^/?]+\.[^/]+$/], +}); diff --git a/frontend/build/static/js/0.b073b4db.chunk.js b/frontend/build/static/js/0.b073b4db.chunk.js new file mode 100644 index 0000000..5512397 --- /dev/null +++ b/frontend/build/static/js/0.b073b4db.chunk.js @@ -0,0 +1 @@ +(this["webpackJsonpsh-frontend"]=this["webpackJsonpsh-frontend"]||[]).push([[0],{404:function(t,n){var r=Array.isArray;t.exports=r},407:function(t,n,r){var e=r(417),o=r(408),i="[object AsyncFunction]",a="[object Function]",c="[object GeneratorFunction]",u="[object Proxy]";t.exports=function(t){if(!o(t))return!1;var n=e(t);return n==a||n==c||n==i||n==u}},408:function(t,n){t.exports=function(t){var n=typeof t;return null!=t&&("object"==n||"function"==n)}},410:function(t,n,r){var e=r(510),o="object"==typeof self&&self&&self.Object===Object&&self,i=e||o||Function("return this")();t.exports=i},411:function(t,n){t.exports=function(t){return null!=t&&"object"==typeof t}},413:function(t,n,r){var e=r(436),o=r(414),i=r(529),a=r(404);t.exports=function(t,n){return(a(t)?e:i)(t,o(n,3))}},414:function(t,n,r){var e=r(632),o=r(670),i=r(421),a=r(404),c=r(679);t.exports=function(t){return"function"==typeof t?t:null==t?i:"object"==typeof t?a(t)?o(t[0],t[1]):e(t):c(t)}},417:function(t,n,r){var e=r(428),o=r(623),i=r(624),a="[object Null]",c="[object Undefined]",u=e?e.toStringTag:void 0;t.exports=function(t){return null==t?void 0===t?c:a:u&&u in Object(t)?o(t):i(t)}},420:function(t,n,r){var e=r(407),o=r(476);t.exports=function(t){return null!=t&&o(t.length)&&!e(t)}},421:function(t,n){t.exports=function(t){return t}},422:function(t,n,r){var e=r(644),o=r(647);t.exports=function(t,n){var r=o(t,n);return e(r)?r:void 0}},428:function(t,n,r){var e=r(410).Symbol;t.exports=e},429:function(t,n,r){var e=r(512),o=r(630),i=r(420);t.exports=function(t){return i(t)?e(t):o(t)}},430:function(t,n,r){var e=r(417),o=r(411),i="[object Symbol]";t.exports=function(t){return"symbol"==typeof t||o(t)&&e(t)==i}},435:function(t,n){t.exports=function(t){return function(n){return t(n)}}},436:function(t,n){t.exports=function(t,n){for(var r=-1,e=null==t?0:t.length,o=Array(e);++r * + *":{marginLeft:8}}},{name:"MuiDialogActions"})(s)},473:function(t,n,r){var e=r(511),o=r(429);t.exports=function(t,n){return t&&e(t,n,o)}},474:function(t,n){var r=9007199254740991,e=/^(?:0|[1-9]\d*)$/;t.exports=function(t,n){var o=typeof t;return!!(n=null==n?r:n)&&("number"==o||"symbol"!=o&&e.test(t))&&t>-1&&t%1==0&&t-1&&t%1==0&&t<=r}},477:function(t,n,r){(function(t){var e=r(510),o=n&&!n.nodeType&&n,i=o&&"object"==typeof t&&t&&!t.nodeType&&t,a=i&&i.exports===o&&e.process,c=function(){try{var t=i&&i.require&&i.require("util").types;return t||a&&a.binding&&a.binding("util")}catch(n){}}();t.exports=c}).call(this,r(190)(t))},478:function(t,n){var r=Object.prototype;t.exports=function(t){var n=t&&t.constructor;return t===("function"==typeof n&&n.prototype||r)}},480:function(t,n,r){var e=r(422)(r(410),"Map");t.exports=e},481:function(t,n,r){var e=r(648),o=r(655),i=r(657),a=r(658),c=r(659);function u(t){var n=-1,r=null==t?0:t.length;for(this.clear();++n=n||r<0||x&&t-h>=p}function j(){var t=o();if(_(t))return m(t);v=setTimeout(j,function(t){var r=n-(t-d);return x?u(r,p-(t-h)):r}(t))}function m(t){return v=void 0,y&&s?g(t):(s=f=void 0,l)}function O(){var t=o(),r=_(t);if(s=arguments,f=this,d=t,r){if(void 0===v)return function(t){return h=t,v=setTimeout(j,n),b?g(t):l}(d);if(x)return clearTimeout(v),v=setTimeout(j,n),g(d)}return void 0===v&&(v=setTimeout(j,n)),l}return n=i(n)||0,e(r)&&(b=!!r.leading,p=(x="maxWait"in r)?c(i(r.maxWait)||0,n):p,y="trailing"in r?!!r.trailing:y),O.cancel=function(){void 0!==v&&clearTimeout(v),h=0,s=d=f=v=void 0},O.flush=function(){return void 0===v?l:m(o())},O}},510:function(t,n,r){(function(n){var r="object"==typeof n&&n&&n.Object===Object&&n;t.exports=r}).call(this,r(33))},511:function(t,n,r){var e=r(625)();t.exports=e},512:function(t,n,r){var e=r(626),o=r(444),i=r(404),a=r(445),c=r(474),u=r(475),s=Object.prototype.hasOwnProperty;t.exports=function(t,n){var r=i(t),f=!r&&o(t),p=!r&&!f&&a(t),l=!r&&!f&&!p&&u(t),v=r||f||p||l,d=v?e(t.length,String):[],h=d.length;for(var b in t)!n&&!s.call(t,b)||v&&("length"==b||p&&("offset"==b||"parent"==b)||l&&("buffer"==b||"byteLength"==b||"byteOffset"==b)||c(b,h))||d.push(b);return d}},513:function(t,n){t.exports=function(t,n){return function(r){return t(n(r))}}},516:function(t,n){var r=Function.prototype.toString;t.exports=function(t){if(null!=t){try{return r.call(t)}catch(n){}try{return t+""}catch(n){}}return""}},517:function(t,n,r){var e=r(483),o=r(518),i=r(484),a=1,c=2;t.exports=function(t,n,r,u,s,f){var p=r&a,l=t.length,v=n.length;if(l!=v&&!(p&&v>l))return!1;var d=f.get(t);if(d&&f.get(n))return d==n;var h=-1,b=!0,x=r&c?new e:void 0;for(f.set(t,n),f.set(n,t);++h-1}},638:function(t,n,r){var e=r(448);t.exports=function(t,n){var r=this.__data__,o=e(r,t);return o<0?(++this.size,r.push([t,n])):r[o][1]=n,this}},639:function(t,n,r){var e=r(447);t.exports=function(){this.__data__=new e,this.size=0}},640:function(t,n){t.exports=function(t){var n=this.__data__,r=n.delete(t);return this.size=n.size,r}},641:function(t,n){t.exports=function(t){return this.__data__.get(t)}},642:function(t,n){t.exports=function(t){return this.__data__.has(t)}},643:function(t,n,r){var e=r(447),o=r(480),i=r(481),a=200;t.exports=function(t,n){var r=this.__data__;if(r instanceof e){var c=r.__data__;if(!o||c.length0){if(++n>=r)return arguments[0]}else n=0;return t.apply(void 0,arguments)}}},725:function(t,n,r){var e=r(410);t.exports=function(){return e.Date.now()}}}]); \ No newline at end of file diff --git a/frontend/build/static/js/1.09fac6f6.chunk.js b/frontend/build/static/js/1.09fac6f6.chunk.js new file mode 100644 index 0000000..74f2820 --- /dev/null +++ b/frontend/build/static/js/1.09fac6f6.chunk.js @@ -0,0 +1 @@ +(this["webpackJsonpsh-frontend"]=this["webpackJsonpsh-frontend"]||[]).push([[1],{403:function(t,e,n){var r=n(415),i=n(442),o=n(551),a=n(555),u=n(558),c=function t(e,n,c){var s,l,f,h,p=e&t.F,d=e&t.G,y=e&t.P,v=e&t.B,m=d?r:e&t.S?r[n]||(r[n]={}):(r[n]||{}).prototype,g=d?i:i[n]||(i[n]={}),b=g.prototype||(g.prototype={});for(s in d&&(c=n),c)f=((l=!p&&m&&void 0!==m[s])?m:c)[s],h=v&&l?u(f,r):y&&"function"==typeof f?u(Function.call,f):f,m&&a(m,s,f,e&t.U),g[s]!=f&&o(g,s,h),y&&b[s]!=f&&(b[s]=f)};r.core=i,c.F=1,c.G=2,c.S=4,c.P=8,c.B=16,c.W=32,c.U=64,c.R=128,t.exports=c},406:function(t,e,n){var r;!function(){"use strict";var n={}.hasOwnProperty;function i(){for(var t=[],e=0;e0?r:n)(t)}},494:function(t,e,n){var r=n(458),i=n(552),o=n(495),a=Object.defineProperty;e.f=n(433)?Object.defineProperty:function(t,e,n){if(r(t),e=o(e,!0),r(n),i)try{return a(t,e,n)}catch(u){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(t[e]=n.value),t}},495:function(t,e,n){var r=n(432);t.exports=function(t,e){if(!r(t))return t;var n,i;if(e&&"function"==typeof(n=t.toString)&&!r(i=n.call(t)))return i;if("function"==typeof(n=t.valueOf)&&!r(i=n.call(t)))return i;if(!e&&"function"==typeof(n=t.toString)&&!r(i=n.call(t)))return i;throw TypeError("Can't convert object to primitive value")}},496:function(t,e){t.exports=Math.sign||function(t){return 0==(t=+t)||t!=t?t:t<0?-1:1}},497:function(t,e){var n=Math.expm1;t.exports=!n||n(10)>22025.465794806718||n(10)<22025.465794806718||-2e-17!=n(-2e-17)?function(t){return 0==(t=+t)?t:t>-1e-6&&t<1e-6?t+t*t/2:Math.exp(t)-1}:n},498:function(t,e){var n={}.toString;t.exports=function(t){return n.call(t).slice(8,-1)}},499:function(t,e,n){var r=n(833),i=n(500);t.exports=function(t){return r(i(t))}},500:function(t,e){t.exports=function(t){if(void 0==t)throw TypeError("Can't call method on "+t);return t}},501:function(t,e){t.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},502:function(t,e,n){var r=n(403),i=n(500),o=n(419),a=n(503),u="["+a+"]",c=RegExp("^"+u+u+"*"),s=RegExp(u+u+"*$"),l=function(t,e,n){var i={},u=o((function(){return!!a[t]()||"\u200b\x85"!="\u200b\x85"[t]()})),c=i[t]=u?e(f):a[t];n&&(i[n]=c),r(r.P+r.F*u,"String",i)},f=l.trim=function(t,e){return t=String(i(t)),1&e&&(t=t.replace(c,"")),2&e&&(t=t.replace(s,"")),t};t.exports=l},503:function(t,e){t.exports="\t\n\v\f\r \xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029\ufeff"},504:function(t,e,n){var r=n(505);t.exports=function(t){return r(t)&&t!=+t}},505:function(t,e,n){var r=n(417),i=n(411),o="[object Number]";t.exports=function(t){return"number"==typeof t||i(t)&&r(t)==o}},506:function(t,e,n){var r=n(482);t.exports=function(t,e){return r(t,e)}},507:function(t,e,n){var r=n(575),i=n(875),o=n(491),a=n(440),u=o((function(t,e){if(null==t)return[];var n=e.length;return n>1&&a(t,e[0],e[1])?e=[]:n>2&&a(e[0],e[1],e[2])&&(e=[e[0]]),i(t,r(e,1),[])}));t.exports=u},551:function(t,e,n){var r=n(494),i=n(554);t.exports=n(433)?function(t,e,n){return r.f(t,e,i(1,n))}:function(t,e,n){return t[e]=n,t}},552:function(t,e,n){t.exports=!n(433)&&!n(419)((function(){return 7!=Object.defineProperty(n(553)("div"),"a",{get:function(){return 7}}).a}))},553:function(t,e,n){var r=n(432),i=n(415).document,o=r(i)&&r(i.createElement);t.exports=function(t){return o?i.createElement(t):{}}},554:function(t,e){t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},555:function(t,e,n){var r=n(415),i=n(551),o=n(459),a=n(556)("src"),u=n(808),c=(""+u).split("toString");n(442).inspectSource=function(t){return u.call(t)},(t.exports=function(t,e,n,u){var s="function"==typeof n;s&&(o(n,"name")||i(n,"name",e)),t[e]!==n&&(s&&(o(n,a)||i(n,a,t[e]?""+t[e]:c.join(String(e)))),t===r?t[e]=n:u?t[e]?t[e]=n:i(t,e,n):(delete t[e],i(t,e,n)))})(Function.prototype,"toString",(function(){return"function"==typeof this&&this[a]||u.call(this)}))},556:function(t,e){var n=0,r=Math.random();t.exports=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++n+r).toString(36))}},557:function(t,e,n){var r=n(442),i=n(415),o=i["__core-js_shared__"]||(i["__core-js_shared__"]={});(t.exports=function(t,e){return o[t]||(o[t]=void 0!==e?e:{})})("versions",[]).push({version:r.version,mode:n(809)?"pure":"global",copyright:"\xa9 2019 Denis Pushkarev (zloirock.ru)"})},558:function(t,e,n){var r=n(810);t.exports=function(t,e,n){if(r(t),void 0===e)return t;switch(n){case 1:return function(n){return t.call(e,n)};case 2:return function(n,r){return t.call(e,n,r)};case 3:return function(n,r,i){return t.call(e,n,r,i)}}return function(){return t.apply(e,arguments)}}},559:function(t,e){t.exports=Math.log1p||function(t){return(t=+t)>-1e-8&&t<1e-8?t-t*t/2:Math.log(1+t)}},560:function(t,e,n){var r=n(832),i=n(554),o=n(499),a=n(495),u=n(459),c=n(552),s=Object.getOwnPropertyDescriptor;e.f=n(433)?s:function(t,e){if(t=o(t),e=a(e,!0),c)try{return s(t,e)}catch(n){}if(u(t,e))return i(!r.f.call(t,e),t[e])}},561:function(t,e,n){var r=n(459),i=n(499),o=n(835)(!1),a=n(562)("IE_PROTO");t.exports=function(t,e){var n,u=i(t),c=0,s=[];for(n in u)n!=a&&r(u,n)&&s.push(n);for(;e.length>c;)r(u,n=e[c++])&&(~o(s,n)||s.push(n));return s}},562:function(t,e,n){var r=n(557)("keys"),i=n(556);t.exports=function(t){return r[t]||(r[t]=i(t))}},563:function(t,e,n){var r=n(498);t.exports=function(t,e){if("number"!=typeof t&&"Number"!=r(t))throw TypeError(e);return+t}},564:function(t,e,n){var r=n(432),i=Math.floor;t.exports=function(t){return!r(t)&&isFinite(t)&&i(t)===t}},565:function(t,e,n){var r=n(414),i=n(856);t.exports=function(t,e){return t&&t.length?i(t,r(e,2)):[]}},566:function(t,e,n){var r=n(857);t.exports=function(t,e){return!!(null==t?0:t.length)&&r(t,e,0)>-1}},567:function(t,e){t.exports=function(t,e,n,r){for(var i=t.length,o=n+(r?1:-1);r?o--:++o=0||(i[n]=t[n]);return i}(e,["children"]);if(delete r.in,delete r.mountOnEnter,delete r.unmountOnExit,delete r.appear,delete r.enter,delete r.exit,delete r.timeout,delete r.addEndListener,delete r.onEnter,delete r.onEntering,delete r.onEntered,delete r.onExit,delete r.onExiting,delete r.onExited,"function"===typeof n)return n(t,r);var o=i.default.Children.only(n);return i.default.cloneElement(o,r)},r}(i.default.Component);function p(){}h.contextTypes={transitionGroup:r.object},h.childContextTypes={transitionGroup:function(){}},h.propTypes={},h.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:p,onEntering:p,onEntered:p,onExit:p,onExiting:p,onExited:p},h.UNMOUNTED=0,h.EXITED=1,h.ENTERING=2,h.ENTERED=3,h.EXITING=4;var d=(0,a.polyfill)(h);e.default=d},572:function(t,e,n){"use strict";function r(){var t=this.constructor.getDerivedStateFromProps(this.props,this.state);null!==t&&void 0!==t&&this.setState(t)}function i(t){this.setState(function(e){var n=this.constructor.getDerivedStateFromProps(t,e);return null!==n&&void 0!==n?n:null}.bind(this))}function o(t,e){try{var n=this.props,r=this.state;this.props=t,this.state=e,this.__reactInternalSnapshotFlag=!0,this.__reactInternalSnapshot=this.getSnapshotBeforeUpdate(n,r)}finally{this.props=n,this.state=r}}function a(t){var e=t.prototype;if(!e||!e.isReactComponent)throw new Error("Can only polyfill class components");if("function"!==typeof t.getDerivedStateFromProps&&"function"!==typeof e.getSnapshotBeforeUpdate)return t;var n=null,a=null,u=null;if("function"===typeof e.componentWillMount?n="componentWillMount":"function"===typeof e.UNSAFE_componentWillMount&&(n="UNSAFE_componentWillMount"),"function"===typeof e.componentWillReceiveProps?a="componentWillReceiveProps":"function"===typeof e.UNSAFE_componentWillReceiveProps&&(a="UNSAFE_componentWillReceiveProps"),"function"===typeof e.componentWillUpdate?u="componentWillUpdate":"function"===typeof e.UNSAFE_componentWillUpdate&&(u="UNSAFE_componentWillUpdate"),null!==n||null!==a||null!==u){var c=t.displayName||t.name,s="function"===typeof t.getDerivedStateFromProps?"getDerivedStateFromProps()":"getSnapshotBeforeUpdate()";throw Error("Unsafe legacy lifecycles will not be called for components using new component APIs.\n\n"+c+" uses "+s+" but also contains the following legacy lifecycles:"+(null!==n?"\n "+n:"")+(null!==a?"\n "+a:"")+(null!==u?"\n "+u:"")+"\n\nThe above lifecycles should be removed. Learn more about this warning here:\nhttps://fb.me/react-async-component-lifecycle-hooks")}if("function"===typeof t.getDerivedStateFromProps&&(e.componentWillMount=r,e.componentWillReceiveProps=i),"function"===typeof e.getSnapshotBeforeUpdate){if("function"!==typeof e.componentDidUpdate)throw new Error("Cannot polyfill getSnapshotBeforeUpdate() for components that do not define componentDidUpdate() on the prototype");e.componentWillUpdate=o;var l=e.componentDidUpdate;e.componentDidUpdate=function(t,e,n){var r=this.__reactInternalSnapshotFlag?this.__reactInternalSnapshot:n;l.call(this,t,e,r)}}return t}n.r(e),n.d(e,"polyfill",(function(){return a})),r.__suppressDeprecationWarning=!0,i.__suppressDeprecationWarning=!0,o.__suppressDeprecationWarning=!0},573:function(t,e,n){"use strict";e.__esModule=!0,e.classNamesShape=e.timeoutsShape=void 0;var r;(r=n(4))&&r.__esModule;e.timeoutsShape=null;e.classNamesShape=null},574:function(t,e,n){"use strict";e.__esModule=!0,e.default=void 0;var r=u(n(4)),i=u(n(0)),o=n(572),a=n(873);function u(t){return t&&t.__esModule?t:{default:t}}function c(){return(c=Object.assign||function(t){for(var e=1;e=0||(i[n]=t[n]);return i}(t,["component","childFactory"]),o=l(this.state.children).map(n);return delete r.appear,delete r.enter,delete r.exit,null===e?o:i.default.createElement(e,r,o)},r}(i.default.Component);f.childContextTypes={transitionGroup:r.default.object.isRequired},f.propTypes={},f.defaultProps={component:"div",childFactory:function(t){return t}};var h=(0,o.polyfill)(f);e.default=h,t.exports=e.default},575:function(t,e,n){var r=n(486),i=n(874);t.exports=function t(e,n,o,a,u){var c=-1,s=e.length;for(o||(o=i),u||(u=[]);++c0&&o(l)?n>1?t(l,n-1,o,a,u):r(u,l):a||(u[u.length]=l)}return u}},576:function(t,e,n){var r=n(577),i=n(884),o=n(421);t.exports=function(t){return t&&t.length?r(t,o,i):void 0}},577:function(t,e,n){var r=n(430);t.exports=function(t,e,n){for(var i=-1,o=t.length;++i(u=(a=Math.ceil(h/v))>u?a+1:u+1)&&(o=u,r.length=1),r.reverse();o--;)r.push(0);r.reverse()}for((u=s.length)-(o=l.length)<0&&(o=u,r=l,l=s,s=r),n=0;o;)n=(s[--o]=s[o]+l[o]+n)/y|0,s[o]%=y;for(n&&(s.unshift(n),++i),u=s.length;0==s[--u];)s.pop();return e.d=s,e.e=i,c?T(e,h):e}function x(t,e,n){if(t!==~~t||tn)throw Error(l+t)}function w(t){var e,n,r,i=t.length-1,o="",a=t[0];if(i>0){for(o+=a,e=1;et.e^o.s<0?1:-1;for(e=0,n=(r=o.d.length)<(i=t.d.length)?r:i;et.d[e]^o.s<0?1:-1;return r===i?0:r>i^o.s<0?1:-1},g.decimalPlaces=g.dp=function(){var t=this,e=t.d.length-1,n=(e-t.e)*v;if(e=t.d[e])for(;e%10==0;e/=10)n--;return n<0?0:n},g.dividedBy=g.div=function(t){return O(this,new this.constructor(t))},g.dividedToIntegerBy=g.idiv=function(t){var e=this.constructor;return T(O(this,new e(t),0,1),e.precision)},g.equals=g.eq=function(t){return!this.cmp(t)},g.exponent=function(){return M(this)},g.greaterThan=g.gt=function(t){return this.cmp(t)>0},g.greaterThanOrEqualTo=g.gte=function(t){return this.cmp(t)>=0},g.isInteger=g.isint=function(){return this.e>this.d.length-2},g.isNegative=g.isneg=function(){return this.s<0},g.isPositive=g.ispos=function(){return this.s>0},g.isZero=function(){return 0===this.s},g.lessThan=g.lt=function(t){return this.cmp(t)<0},g.lessThanOrEqualTo=g.lte=function(t){return this.cmp(t)<1},g.logarithm=g.log=function(t){var e,n=this,r=n.constructor,i=r.precision,a=i+5;if(void 0===t)t=new r(10);else if((t=new r(t)).s<1||t.eq(o))throw Error(s+"NaN");if(n.s<1)throw Error(s+(n.s?"NaN":"-Infinity"));return n.eq(o)?new r(0):(c=!1,e=O(S(n,a),S(t,a),a),c=!0,T(e,i))},g.minus=g.sub=function(t){var e=this;return t=new e.constructor(t),e.s==t.s?P(e,t):b(e,(t.s=-t.s,t))},g.modulo=g.mod=function(t){var e,n=this,r=n.constructor,i=r.precision;if(!(t=new r(t)).s)throw Error(s+"NaN");return n.s?(c=!1,e=O(n,t,0,1).times(t),c=!0,n.minus(e)):T(new r(n),i)},g.naturalExponential=g.exp=function(){return _(this)},g.naturalLogarithm=g.ln=function(){return S(this)},g.negated=g.neg=function(){var t=new this.constructor(this);return t.s=-t.s||0,t},g.plus=g.add=function(t){var e=this;return t=new e.constructor(t),e.s==t.s?b(e,t):P(e,(t.s=-t.s,t))},g.precision=g.sd=function(t){var e,n,r,i=this;if(void 0!==t&&t!==!!t&&1!==t&&0!==t)throw Error(l+t);if(e=M(i)+1,n=(r=i.d.length-1)*v+1,r=i.d[r]){for(;r%10==0;r/=10)n--;for(r=i.d[0];r>=10;r/=10)n++}return t&&e>n?e:n},g.squareRoot=g.sqrt=function(){var t,e,n,r,i,o,a,u=this,l=u.constructor;if(u.s<1){if(!u.s)return new l(0);throw Error(s+"NaN")}for(t=M(u),c=!1,0==(i=Math.sqrt(+u))||i==1/0?(((e=w(u.d)).length+t)%2==0&&(e+="0"),i=Math.sqrt(e),t=h((t+1)/2)-(t<0||t%2),r=new l(e=i==1/0?"1e"+t:(e=i.toExponential()).slice(0,e.indexOf("e")+1)+t)):r=new l(i.toString()),i=a=(n=l.precision)+3;;)if(r=(o=r).plus(O(u,o,a+2)).times(.5),w(o.d).slice(0,a)===(e=w(r.d)).slice(0,a)){if(e=e.slice(a-3,a+1),i==a&&"4999"==e){if(T(o,n+1,0),o.times(o).eq(u)){r=o;break}}else if("9999"!=e)break;a+=4}return c=!0,T(r,n)},g.times=g.mul=function(t){var e,n,r,i,o,a,u,s,l,f=this,h=f.constructor,p=f.d,d=(t=new h(t)).d;if(!f.s||!t.s)return new h(0);for(t.s*=f.s,n=f.e+t.e,(s=p.length)<(l=d.length)&&(o=p,p=d,d=o,a=s,s=l,l=a),o=[],r=a=s+l;r--;)o.push(0);for(r=l;--r>=0;){for(e=0,i=s+r;i>r;)u=o[i]+d[r]*p[i-r-1]+e,o[i--]=u%y|0,e=u/y|0;o[i]=(o[i]+e)%y|0}for(;!o[--a];)o.pop();return e?++n:o.shift(),t.d=o,t.e=n,c?T(t,h.precision):t},g.toDecimalPlaces=g.todp=function(t,e){var n=this,r=n.constructor;return n=new r(n),void 0===t?n:(x(t,0,a),void 0===e?e=r.rounding:x(e,0,8),T(n,t+M(n)+1,e))},g.toExponential=function(t,e){var n,r=this,i=r.constructor;return void 0===t?n=A(r,!0):(x(t,0,a),void 0===e?e=i.rounding:x(e,0,8),n=A(r=T(new i(r),t+1,e),!0,t+1)),n},g.toFixed=function(t,e){var n,r,i=this,o=i.constructor;return void 0===t?A(i):(x(t,0,a),void 0===e?e=o.rounding:x(e,0,8),n=A((r=T(new o(i),t+M(i)+1,e)).abs(),!1,t+M(r)+1),i.isneg()&&!i.isZero()?"-"+n:n)},g.toInteger=g.toint=function(){var t=this,e=t.constructor;return T(new e(t),M(t)+1,e.rounding)},g.toNumber=function(){return+this},g.toPower=g.pow=function(t){var e,n,r,i,a,u,l=this,f=l.constructor,p=+(t=new f(t));if(!t.s)return new f(o);if(!(l=new f(l)).s){if(t.s<1)throw Error(s+"Infinity");return l}if(l.eq(o))return l;if(r=f.precision,t.eq(o))return T(l,r);if(u=(e=t.e)>=(n=t.d.length-1),a=l.s,u){if((n=p<0?-p:p)<=9007199254740991){for(i=new f(o),e=Math.ceil(r/v+4),c=!1;n%2&&N((i=i.times(l)).d,e),0!==(n=h(n/2));)N((l=l.times(l)).d,e);return c=!0,t.s<0?new f(o).div(i):T(i,r)}}else if(a<0)throw Error(s+"NaN");return a=a<0&&1&t.d[Math.max(e,n)]?-1:1,l.s=1,c=!1,i=t.times(S(l,r+12)),c=!0,(i=_(i)).s=a,i},g.toPrecision=function(t,e){var n,r,i=this,o=i.constructor;return void 0===t?r=A(i,(n=M(i))<=o.toExpNeg||n>=o.toExpPos):(x(t,1,a),void 0===e?e=o.rounding:x(e,0,8),r=A(i=T(new o(i),t,e),t<=(n=M(i))||n<=o.toExpNeg,t)),r},g.toSignificantDigits=g.tosd=function(t,e){var n=this.constructor;return void 0===t?(t=n.precision,e=n.rounding):(x(t,1,a),void 0===e?e=n.rounding:x(e,0,8)),T(new n(this),t,e)},g.toString=g.valueOf=g.val=g.toJSON=function(){var t=this,e=M(t),n=t.constructor;return A(t,e<=n.toExpNeg||e>=n.toExpPos)};var O=function(){function t(t,e){var n,r=0,i=t.length;for(t=t.slice();i--;)n=t[i]*e+r,t[i]=n%y|0,r=n/y|0;return r&&t.unshift(r),t}function e(t,e,n,r){var i,o;if(n!=r)o=n>r?1:-1;else for(i=o=0;ie[i]?1:-1;break}return o}function n(t,e,n){for(var r=0;n--;)t[n]-=r,r=t[n]1;)t.shift()}return function(r,i,o,a){var u,c,l,f,h,p,d,m,g,b,x,w,O,_,E,k,S,j,P=r.constructor,A=r.s==i.s?1:-1,N=r.d,C=i.d;if(!r.s)return new P(r);if(!i.s)throw Error(s+"Division by zero");for(c=r.e-i.e,S=C.length,E=N.length,m=(d=new P(A)).d=[],l=0;C[l]==(N[l]||0);)++l;if(C[l]>(N[l]||0)&&--c,(w=null==o?o=P.precision:a?o+(M(r)-M(i))+1:o)<0)return new P(0);if(w=w/v+2|0,l=0,1==S)for(f=0,C=C[0],w++;(l1&&(C=t(C,f),N=t(N,f),S=C.length,E=N.length),_=S,b=(g=N.slice(0,S)).length;b=y/2&&++k;do{f=0,(u=e(C,g,S,b))<0?(x=g[0],S!=b&&(x=x*y+(g[1]||0)),(f=x/k|0)>1?(f>=y&&(f=y-1),1==(u=e(h=t(C,f),g,p=h.length,b=g.length))&&(f--,n(h,S16)throw Error(f+M(t));if(!t.s)return new h(o);for(null==e?(c=!1,u=d):u=e,a=new h(.03125);t.abs().gte(.1);)t=t.times(a),l+=5;for(u+=Math.log(p(2,l))/Math.LN10*2+5|0,n=r=i=new h(o),h.precision=u;;){if(r=T(r.times(t),u),n=n.times(++s),w((a=i.plus(O(r,n,u))).d).slice(0,u)===w(i.d).slice(0,u)){for(;l--;)i=T(i.times(i),u);return h.precision=d,null==e?(c=!0,T(i,d)):i}i=a}}function M(t){for(var e=t.e*v,n=t.d[0];n>=10;n/=10)e++;return e}function E(t,e,n){if(e>t.LN10.sd())throw c=!0,n&&(t.precision=n),Error(s+"LN10 precision limit exceeded");return T(new t(t.LN10),e)}function k(t){for(var e="";t--;)e+="0";return e}function S(t,e){var n,r,i,a,u,l,f,h,p,d=1,y=t,v=y.d,m=y.constructor,g=m.precision;if(y.s<1)throw Error(s+(y.s?"NaN":"-Infinity"));if(y.eq(o))return new m(0);if(null==e?(c=!1,h=g):h=e,y.eq(10))return null==e&&(c=!0),E(m,h);if(h+=10,m.precision=h,r=(n=w(v)).charAt(0),a=M(y),!(Math.abs(a)<15e14))return f=E(m,h+2,g).times(a+""),y=S(new m(r+"."+n.slice(1)),h-10).plus(f),m.precision=g,null==e?(c=!0,T(y,g)):y;for(;r<7&&1!=r||1==r&&n.charAt(1)>3;)r=(n=w((y=y.times(t)).d)).charAt(0),d++;for(a=M(y),r>1?(y=new m("0."+n),a++):y=new m(r+"."+n.slice(1)),l=u=y=O(y.minus(o),y.plus(o),h),p=T(y.times(y),h),i=3;;){if(u=T(u.times(p),h),w((f=l.plus(O(u,new m(i),h))).d).slice(0,h)===w(l.d).slice(0,h))return l=l.times(2),0!==a&&(l=l.plus(E(m,h+2,g).times(a+""))),l=O(l,new m(d),h),m.precision=g,null==e?(c=!0,T(l,g)):l;l=f,i+=2}}function j(t,e){var n,r,i;for((n=e.indexOf("."))>-1&&(e=e.replace(".","")),(r=e.search(/e/i))>0?(n<0&&(n=r),n+=+e.slice(r+1),e=e.substring(0,r)):n<0&&(n=e.length),r=0;48===e.charCodeAt(r);)++r;for(i=e.length;48===e.charCodeAt(i-1);)--i;if(e=e.slice(r,i)){if(i-=r,n=n-r-1,t.e=h(n/v),t.d=[],r=(n+1)%v,n<0&&(r+=v),rm||t.e<-m))throw Error(f+n)}else t.s=0,t.e=0,t.d=[0];return t}function T(t,e,n){var r,i,o,a,u,s,l,d,g=t.d;for(a=1,o=g[0];o>=10;o/=10)a++;if((r=e-a)<0)r+=v,i=e,l=g[d=0];else{if((d=Math.ceil((r+1)/v))>=(o=g.length))return t;for(l=o=g[d],a=1;o>=10;o/=10)a++;i=(r%=v)-v+a}if(void 0!==n&&(u=l/(o=p(10,a-i-1))%10|0,s=e<0||void 0!==g[d+1]||l%o,s=n<4?(u||s)&&(0==n||n==(t.s<0?3:2)):u>5||5==u&&(4==n||s||6==n&&(r>0?i>0?l/p(10,a-i):0:g[d-1])%10&1||n==(t.s<0?8:7))),e<1||!g[0])return s?(o=M(t),g.length=1,e=e-o-1,g[0]=p(10,(v-e%v)%v),t.e=h(-e/v)||0):(g.length=1,g[0]=t.e=t.s=0),t;if(0==r?(g.length=d,o=1,d--):(g.length=d+1,o=p(10,v-r),g[d]=i>0?(l/p(10,a-i)%p(10,i)|0)*o:0),s)for(;;){if(0==d){(g[0]+=o)==y&&(g[0]=1,++t.e);break}if(g[d]+=o,g[d]!=y)break;g[d--]=0,o=1}for(r=g.length;0===g[--r];)g.pop();if(c&&(t.e>m||t.e<-m))throw Error(f+M(t));return t}function P(t,e){var n,r,i,o,a,u,s,l,f,h,p=t.constructor,d=p.precision;if(!t.s||!e.s)return e.s?e.s=-e.s:e=new p(t),c?T(e,d):e;if(s=t.d,h=e.d,r=e.e,l=t.e,s=s.slice(),a=l-r){for((f=a<0)?(n=s,a=-a,u=h.length):(n=h,r=l,u=s.length),a>(i=Math.max(Math.ceil(d/v),u)+2)&&(a=i,n.length=1),n.reverse(),i=a;i--;)n.push(0);n.reverse()}else{for((f=(i=s.length)<(u=h.length))&&(u=i),i=0;i0;--i)s[u++]=0;for(i=h.length;i>a;){if(s[--i]0?o=o.charAt(0)+"."+o.slice(1)+k(r):a>1&&(o=o.charAt(0)+"."+o.slice(1)),o=o+(i<0?"e":"e+")+i):i<0?(o="0."+k(-i-1)+o,n&&(r=n-a)>0&&(o+=k(r))):i>=a?(o+=k(i+1-a),n&&(r=n-i-1)>0&&(o=o+"."+k(r))):((r=i+1)0&&(i+1===a&&(o+="."),o+=k(r))),t.s<0?"-"+o:o}function N(t,e){if(t.length>e)return t.length=e,!0}function C(t){if(!t||"object"!==typeof t)throw Error(s+"Object expected");var e,n,r,i=["precision",1,a,"rounding",0,8,"toExpNeg",-1/0,0,"toExpPos",0,1/0];for(e=0;e=i[e+1]&&r<=i[e+2]))throw Error(l+n+": "+r);this[n]=r}if(void 0!==(r=t[n="LN10"])){if(r!=Math.LN10)throw Error(l+n+": "+r);this[n]=new this(r)}return this}(u=function t(e){var n,r,i;function o(t){var e=this;if(!(e instanceof o))return new o(t);if(e.constructor=o,t instanceof o)return e.s=t.s,e.e=t.e,void(e.d=(t=t.d)?t.slice():t);if("number"===typeof t){if(0*t!==0)throw Error(l+t);if(t>0)e.s=1;else{if(!(t<0))return e.s=0,e.e=0,void(e.d=[0]);t=-t,e.s=-1}return t===~~t&&t<1e7?(e.e=0,void(e.d=[t])):j(e,t.toString())}if("string"!==typeof t)throw Error(l+t);if(45===t.charCodeAt(0)?(t=t.slice(1),e.s=-1):e.s=1,!d.test(t))throw Error(l+t);j(e,t)}if(o.prototype=g,o.ROUND_UP=0,o.ROUND_DOWN=1,o.ROUND_CEIL=2,o.ROUND_FLOOR=3,o.ROUND_HALF_UP=4,o.ROUND_HALF_DOWN=5,o.ROUND_HALF_EVEN=6,o.ROUND_HALF_CEIL=7,o.ROUND_HALF_FLOOR=8,o.clone=t,o.config=o.set=C,void 0===e&&(e={}),e)for(i=["precision","rounding","toExpNeg","toExpPos","LN10"],n=0;n=e?n.apply(void 0,c):t(e-l,u((function(){for(var t=arguments.length,e=new Array(t),i=0;i0?1:-1},P=function(t){return g()(t)&&t.indexOf("%")===t.length-1},A=function(t){return j()(t)&&!k()(t)},N=function(t){return A(t)||g()(t)},C=0,I=function(t){var e=++C;return"".concat(t||"").concat(e)},D=function(t,e){var n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(!A(t)&&!g()(t))return r;if(P(t)){var o=t.indexOf("%");n=e*parseFloat(t.slice(0,o))/100}else n=+t;return k()(n)&&(n=r),i&&n>e&&(n=e),n},R=function(t){if(!t)return null;var e=Object.keys(t);return e&&e.length?t[e[0]]:null},L=function(t,e){return A(t)&&A(e)?function(n){return t+n*(e-t)}:function(){return e}},B=function(t,e,n){return t&&t.length?t.find((function(t){return t&&("function"===typeof e?e(t):M()(t,e))===n})):null};function z(t,e){for(var n in t)if({}.hasOwnProperty.call(t,n)&&(!{}.hasOwnProperty.call(e,n)||t[n]!==e[n]))return!1;for(var r in e)if({}.hasOwnProperty.call(e,r)&&!{}.hasOwnProperty.call(t,r))return!1;return!0}function F(t){return function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e=0||(i[n]=t[n]);return i}(t,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(i[n]=t[n])}return i}var W={"aria-current":h.a.string,"aria-details":h.a.any,"aria-disabled":h.a.any,"aria-hidden":h.a.any,"aria-invalid":h.a.any,"aria-keyshortcuts":h.a.any,"aria-label":h.a.any,"aria-roledescription":h.a.any,"aria-autocomplete":h.a.any,"aria-checked":h.a.any,"aria-expanded":h.a.any,"aria-haspopup":h.a.any,"aria-level":h.a.any,"aria-modal":h.a.any,"aria-multiline":h.a.any,"aria-multiselectable":h.a.any,"aria-orientation":h.a.any,"aria-placeholder":h.a.any,"aria-pressed":h.a.any,"aria-readonly":h.a.any,"aria-required":h.a.any,"aria-selected":h.a.any,"aria-sort":h.a.any,"aria-valuemax":h.a.any,"aria-valuemin":h.a.any,"aria-valuenow":h.a.any,"aria-valuetext":h.a.any,"aria-atomic":h.a.any,"aria-busy":h.a.any,"aria-live":h.a.any,"aria-relevant":h.a.any,"aria-dropeffect":h.a.any,"aria-grabbed":h.a.any,"aria-activedescendant":h.a.any,"aria-colcount":h.a.any,"aria-colindex":h.a.any,"aria-colspan":h.a.any,"aria-controls":h.a.any,"aria-describedby":h.a.any,"aria-errormessage":h.a.any,"aria-flowto":h.a.any,"aria-labelledby":h.a.any,"aria-owns":h.a.any,"aria-posinset":h.a.any,"aria-rowcount":h.a.any,"aria-rowindex":h.a.any,"aria-rowspan":h.a.any,"aria-setsize":h.a.any,alignmentBaseline:h.a.string,angle:h.a.number,baselineShift:h.a.string,clip:h.a.string,clipPath:h.a.string,clipRule:h.a.string,color:h.a.string,colorInterpolation:h.a.string,colorInterpolationFilters:h.a.string,colorProfile:h.a.string,colorRendering:h.a.string,cursor:h.a.string,direction:h.a.oneOf(["ltr","rtl","inherit"]),display:h.a.string,dominantBaseline:h.a.string,enableBackground:h.a.string,fill:h.a.string,fillOpacity:h.a.oneOfType([h.a.string,h.a.number]),fillRule:h.a.oneOf(["nonzero","evenodd","inherit"]),filter:h.a.string,floodColor:h.a.string,floodOpacity:h.a.oneOfType([h.a.string,h.a.number]),font:h.a.string,fontFamily:h.a.string,fontSize:h.a.oneOfType([h.a.number,h.a.string]),fontSizeAdjust:h.a.oneOfType([h.a.number,h.a.string]),fontStretch:h.a.oneOf(["normal","wider","narrower","ultra-condensed","extra-condensed","condensed","semi-condensed","semi-expanded","expanded","extra-expanded","ultra-expanded","inherit"]),fontStyle:h.a.oneOf(["normal","italic","oblique","inherit"]),fontVariant:h.a.oneOf(["normal","small-caps","inherit"]),fontWeight:h.a.oneOf(["normal","bold","bolder","lighter",100,200,300,400,500,600,700,800,900,"inherit"]),glyphOrientationHorizontal:h.a.string,glyphOrientationVertical:h.a.string,imageRendering:h.a.oneOf(["auto","optimizeSpeed","optimizeQuality","inherit"]),kerning:h.a.oneOfType([h.a.number,h.a.string]),letterSpacing:h.a.oneOfType([h.a.number,h.a.string]),lightingColor:h.a.string,lineHeight:h.a.oneOfType([h.a.number,h.a.string]),markerEnd:h.a.string,markerMid:h.a.string,markerStart:h.a.string,mask:h.a.string,opacity:h.a.oneOfType([h.a.number,h.a.string]),overflow:h.a.oneOf(["visible","hidden","scroll","auto","inherit"]),pointerEvents:h.a.oneOf(["visiblePainted","visibleFill","visibleStroke","visible","painted","fill","stroke","all","none","inherit"]),shapeRendering:h.a.oneOf(["auto","optimizeSpeed","crispEdges","geometricPrecision","inherit"]),stopColor:h.a.string,stopOpacity:h.a.oneOfType([h.a.number,h.a.string]),stroke:h.a.oneOfType([h.a.number,h.a.string]),strokeDasharray:h.a.string,strokeDashoffset:h.a.oneOfType([h.a.number,h.a.string]),strokeLinecap:h.a.oneOf(["butt","round","square","inherit"]),strokeLinejoin:h.a.oneOf(["miter","round","bevel","inherit"]),strokeMiterlimit:h.a.oneOfType([h.a.number,h.a.string]),strokeOpacity:h.a.oneOfType([h.a.number,h.a.string]),strokeWidth:h.a.oneOfType([h.a.number,h.a.string]),textAnchor:h.a.oneOf(["start","middle","end","inherit"]),textDecoration:h.a.oneOf(["none","underline","overline","line-through","blink","inherit"]),textRendering:h.a.oneOf(["auto","optimizeSpeed","optimizeLegibility","geometricPrecision","inherit"]),unicodeBidi:h.a.oneOf(["normal","embed","bidi-override","inherit"]),visibility:h.a.oneOf(["visible","hidden","collapse","inherit"]),wordSpacing:h.a.oneOfType([h.a.number,h.a.string]),writingMode:h.a.oneOf(["lr-tb","rl-tb","tb-rl","lr","rl","tb","inherit"]),transform:h.a.string,role:h.a.string,focusable:h.a.string,tabIndex:h.a.string,style:h.a.object,width:h.a.number,height:h.a.number,dx:h.a.number,dy:h.a.number,x:h.a.number,y:h.a.number,r:h.a.number,radius:h.a.oneOfType([h.a.number,h.a.array])},G={onClick:h.a.func,onMouseDown:h.a.func,onMouseUp:h.a.func,onMouseOver:h.a.func,onMouseMove:h.a.func,onMouseOut:h.a.func,onMouseEnter:h.a.func,onMouseLeave:h.a.func,onTouchEnd:h.a.func,onTouchMove:h.a.func,onTouchStart:h.a.func,onTouchCancel:h.a.func},q={click:"onClick",mousedown:"onMouseDown",mouseup:"onMouseUp",mouseover:"onMouseOver",mousemove:"onMouseMove",mouseout:"onMouseOut",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",touchcancel:"onTouchCancel",touchend:"onTouchEnd",touchmove:"onTouchMove",touchstart:"onTouchStart"},H=["plainline","line","square","rect","circle","cross","diamond","star","triangle","wye","none"],X=["none"],V=function(t){return"string"===typeof t?t:t?t.displayName||t.name||"Component":""},Y=function(t,e){var n=[],r=[];return r=O()(e)?e.map((function(t){return V(t)})):[V(e)],l.a.Children.forEach(t,(function(t){var e=t&&t.type&&(t.type.displayName||t.type.name);-1!==r.indexOf(e)&&n.push(t)})),n},K=function(t,e){var n=Y(t,e);return n&&n[0]},$=function(t){if(!t||a()(t))return null;var e=l.a.isValidElement(t)?t.props:t;if(!x()(e))return null;var n=null;for(var r in e)({}).hasOwnProperty.call(e,r)&&W[r]&&(n||(n={}),n[r]=e[r]);return n},Z=function(t,e){return function(n){return t(e,n),null}},J=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(!t||a()(t))return null;var r=l.a.isValidElement(t)?t.props:t;if(!x()(r))return null;var i=null;for(var o in r)({}).hasOwnProperty.call(r,o)&&G[o]&&(i||(i={}),i[o]=e||(n?Z(r[o],r):r[o]));return i},Q=function(t,e,n){return function(r){return t(e,n,r),null}},tt=function(t,e,n){if(!x()(t))return null;var r=null;for(var i in t)({}).hasOwnProperty.call(t,i)&&G[i]&&a()(t[i])&&(r||(r={}),r[i]=Q(t[i],e,n));return r},et=function(t){if(!t||!t.props)return!1;var e=t.props,n=e.width,r=e.height;return!(!A(n)||n<=0||!A(r)||r<=0)},nt=function(){return!("undefined"!==typeof window&&window.document&&window.document.createElement&&window.setTimeout)},rt=["a","altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColormatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-url","foreignObject","g","glyph","glyphRef","hkern","image","line","lineGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","script","set","stop","style","svg","switch","symbol","text","textPath","title","tref","tspan","use","view","vkern"],it=function(t,e){if(v()(t)&&v()(e))return!0;if(!v()(t)&&!v()(e)){var n=t.props||{},r=n.children,i=U(n,["children"]),o=e.props||{},a=o.children,u=U(o,["children"]);return r&&a?z(i,u)&&ot(r,a):!r&&!a&&z(i,u)}return!1},ot=function t(e,n){if(e===n)return!0;if(s.Children.count(e)!==s.Children.count(n))return!1;var r=s.Children.count(e);if(0===r)return!0;if(1===r)return it(O()(e)?e[0]:e,O()(n)?n[0]:n);for(var i=0;i=0}(t))n.push(t);else if(t&&e[V(t.type)]){var o=V(t.type),a=e[o],u=a.handler,c=a.once;if(c&&!r[o]||!c){var s=u(t,o,i);O()(s)?n=[n].concat(F(s)):n.push(s),r[o]=!0}}})),n},ut=function(t){var e=t&&t.type;return e&&q[e]?q[e]:null},ct=function(t,e){var n=-1;return s.Children.forEach(e,(function(e,r){e===t&&(n=r)})),n};function st(){return(st=Object.assign||function(t){for(var e=1;e=0||(i[n]=t[n]);return i}(t,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(i[n]=t[n])}return i}var ft={width:h.a.number.isRequired,height:h.a.number.isRequired,viewBox:h.a.shape({x:h.a.number,y:h.a.number,width:h.a.number,height:h.a.number}),className:h.a.string,style:h.a.object,children:h.a.oneOfType([h.a.arrayOf(h.a.node),h.a.node])};function ht(t){var e=t.children,n=t.width,r=t.height,i=t.viewBox,o=t.className,a=t.style,u=lt(t,["children","width","height","viewBox","className","style"]),c=i||{width:n,height:r,x:0,y:0},s=d()("recharts-surface",o),f=$(u);return l.a.createElement("svg",st({},f,{className:s,width:n,height:r,style:a,viewBox:"".concat(c.x," ").concat(c.y," ").concat(c.width," ").concat(c.height),version:"1.1"}),e)}ht.propTypes=ft;var pt=ht,dt=Math.PI,yt=2*dt,vt=yt-1e-6;function mt(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function gt(){return new mt}mt.prototype=gt.prototype={constructor:mt,moveTo:function(t,e){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)},closePath:function(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function(t,e){this._+="L"+(this._x1=+t)+","+(this._y1=+e)},quadraticCurveTo:function(t,e,n,r){this._+="Q"+ +t+","+ +e+","+(this._x1=+n)+","+(this._y1=+r)},bezierCurveTo:function(t,e,n,r,i,o){this._+="C"+ +t+","+ +e+","+ +n+","+ +r+","+(this._x1=+i)+","+(this._y1=+o)},arcTo:function(t,e,n,r,i){t=+t,e=+e,n=+n,r=+r,i=+i;var o=this._x1,a=this._y1,u=n-t,c=r-e,s=o-t,l=a-e,f=s*s+l*l;if(i<0)throw new Error("negative radius: "+i);if(null===this._x1)this._+="M"+(this._x1=t)+","+(this._y1=e);else if(f>1e-6)if(Math.abs(l*u-c*s)>1e-6&&i){var h=n-o,p=r-a,d=u*u+c*c,y=h*h+p*p,v=Math.sqrt(d),m=Math.sqrt(f),g=i*Math.tan((dt-Math.acos((d+f-y)/(2*v*m)))/2),b=g/m,x=g/v;Math.abs(b-1)>1e-6&&(this._+="L"+(t+b*s)+","+(e+b*l)),this._+="A"+i+","+i+",0,0,"+ +(l*h>s*p)+","+(this._x1=t+x*u)+","+(this._y1=e+x*c)}else this._+="L"+(this._x1=t)+","+(this._y1=e);else;},arc:function(t,e,n,r,i,o){t=+t,e=+e,o=!!o;var a=(n=+n)*Math.cos(r),u=n*Math.sin(r),c=t+a,s=e+u,l=1^o,f=o?r-i:i-r;if(n<0)throw new Error("negative radius: "+n);null===this._x1?this._+="M"+c+","+s:(Math.abs(this._x1-c)>1e-6||Math.abs(this._y1-s)>1e-6)&&(this._+="L"+c+","+s),n&&(f<0&&(f=f%yt+yt),f>vt?this._+="A"+n+","+n+",0,1,"+l+","+(t-a)+","+(e-u)+"A"+n+","+n+",0,1,"+l+","+(this._x1=c)+","+(this._y1=s):f>1e-6&&(this._+="A"+n+","+n+",0,"+ +(f>=dt)+","+l+","+(this._x1=t+n*Math.cos(i))+","+(this._y1=e+n*Math.sin(i))))},rect:function(t,e,n,r){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)+"h"+ +n+"v"+ +r+"h"+-n+"Z"},toString:function(){return this._}};var bt=gt,xt=function(t){return function(){return t}},wt=(Math.abs,Math.atan2,Math.cos,Math.max,Math.min,Math.sin,Math.sqrt,1e-12),Ot=Math.PI,_t=2*Ot;function Mt(t){this._context=t}Mt.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:this._context.lineTo(t,e)}}};var Et=function(t){return new Mt(t)};function kt(t){return t[0]}function St(t){return t[1]}var jt=function(){var t=kt,e=St,n=xt(!0),r=null,i=Et,o=null;function a(a){var u,c,s,l=a.length,f=!1;for(null==r&&(o=i(s=bt())),u=0;u<=l;++u)!(u=l;--f)u.point(v[f],m[f]);u.lineEnd(),u.areaEnd()}y&&(v[s]=+t(h,s,c),m[s]=+n(h,s,c),u.point(e?+e(h,s,c):v[s],r?+r(h,s,c):m[s]))}if(p)return u=null,p+""||null}function s(){return jt().defined(i).curve(a).context(o)}return c.x=function(n){return arguments.length?(t="function"===typeof n?n:xt(+n),e=null,c):t},c.x0=function(e){return arguments.length?(t="function"===typeof e?e:xt(+e),c):t},c.x1=function(t){return arguments.length?(e=null==t?null:"function"===typeof t?t:xt(+t),c):e},c.y=function(t){return arguments.length?(n="function"===typeof t?t:xt(+t),r=null,c):n},c.y0=function(t){return arguments.length?(n="function"===typeof t?t:xt(+t),c):n},c.y1=function(t){return arguments.length?(r=null==t?null:"function"===typeof t?t:xt(+t),c):r},c.lineX0=c.lineY0=function(){return s().x(t).y(n)},c.lineY1=function(){return s().x(t).y(r)},c.lineX1=function(){return s().x(e).y(n)},c.defined=function(t){return arguments.length?(i="function"===typeof t?t:xt(!!t),c):i},c.curve=function(t){return arguments.length?(a=t,null!=o&&(u=a(o)),c):a},c.context=function(t){return arguments.length?(null==t?o=u=null:u=a(o=t),c):o},c};At(Et);function Pt(t){this._curve=t}function At(t){function e(e){return new Pt(t(e))}return e._curve=t,e}Pt.prototype={areaStart:function(){this._curve.areaStart()},areaEnd:function(){this._curve.areaEnd()},lineStart:function(){this._curve.lineStart()},lineEnd:function(){this._curve.lineEnd()},point:function(t,e){this._curve.point(e*Math.sin(t),e*-Math.cos(t))}};var Nt=Array.prototype.slice;var Ct={draw:function(t,e){var n=Math.sqrt(e/Ot);t.moveTo(n,0),t.arc(0,0,n,0,_t)}},It={draw:function(t,e){var n=Math.sqrt(e/5)/2;t.moveTo(-3*n,-n),t.lineTo(-n,-n),t.lineTo(-n,-3*n),t.lineTo(n,-3*n),t.lineTo(n,-n),t.lineTo(3*n,-n),t.lineTo(3*n,n),t.lineTo(n,n),t.lineTo(n,3*n),t.lineTo(-n,3*n),t.lineTo(-n,n),t.lineTo(-3*n,n),t.closePath()}},Dt=Math.sqrt(1/3),Rt=2*Dt,Lt={draw:function(t,e){var n=Math.sqrt(e/Rt),r=n*Dt;t.moveTo(0,-n),t.lineTo(r,0),t.lineTo(0,n),t.lineTo(-r,0),t.closePath()}},Bt=Math.sin(Ot/10)/Math.sin(7*Ot/10),zt=Math.sin(_t/10)*Bt,Ft=-Math.cos(_t/10)*Bt,Ut={draw:function(t,e){var n=Math.sqrt(.8908130915292852*e),r=zt*n,i=Ft*n;t.moveTo(0,-n),t.lineTo(r,i);for(var o=1;o<5;++o){var a=_t*o/5,u=Math.cos(a),c=Math.sin(a);t.lineTo(c*n,-u*n),t.lineTo(u*r-c*i,c*r+u*i)}t.closePath()}},Wt={draw:function(t,e){var n=Math.sqrt(e),r=-n/2;t.rect(r,r,n,n)}},Gt=Math.sqrt(3),qt={draw:function(t,e){var n=-Math.sqrt(e/(3*Gt));t.moveTo(0,2*n),t.lineTo(-Gt*n,-n),t.lineTo(Gt*n,-n),t.closePath()}},Ht=Math.sqrt(3)/2,Xt=1/Math.sqrt(12),Vt=3*(Xt/2+1),Yt={draw:function(t,e){var n=Math.sqrt(e/Vt),r=n/2,i=n*Xt,o=r,a=n*Xt+n,u=-o,c=a;t.moveTo(r,i),t.lineTo(o,a),t.lineTo(u,c),t.lineTo(-.5*r-Ht*i,Ht*r+-.5*i),t.lineTo(-.5*o-Ht*a,Ht*o+-.5*a),t.lineTo(-.5*u-Ht*c,Ht*u+-.5*c),t.lineTo(-.5*r+Ht*i,-.5*i-Ht*r),t.lineTo(-.5*o+Ht*a,-.5*a-Ht*o),t.lineTo(-.5*u+Ht*c,-.5*c-Ht*u),t.closePath()}},Kt=function(){};function $t(t,e,n){t._context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+e)/6,(t._y0+4*t._y1+n)/6)}function Zt(t){this._context=t}Zt.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:$t(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:$t(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function Jt(t){this._context=t}Jt.prototype={areaStart:Kt,areaEnd:Kt,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x2,this._y2),this._context.closePath();break;case 2:this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break;case 3:this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4)}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x2=t,this._y2=e;break;case 1:this._point=2,this._x3=t,this._y3=e;break;case 2:this._point=3,this._x4=t,this._y4=e,this._context.moveTo((this._x0+4*this._x1+t)/6,(this._y0+4*this._y1+e)/6);break;default:$t(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function Qt(t){this._context=t}Qt.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+t)/6,r=(this._y0+4*this._y1+e)/6;this._line?this._context.lineTo(n,r):this._context.moveTo(n,r);break;case 3:this._point=4;default:$t(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function te(t,e){this._basis=new Zt(t),this._beta=e}te.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var t=this._x,e=this._y,n=t.length-1;if(n>0)for(var r,i=t[0],o=e[0],a=t[n]-i,u=e[n]-o,c=-1;++c<=n;)r=c/n,this._basis.point(this._beta*t[c]+(1-this._beta)*(i+r*a),this._beta*e[c]+(1-this._beta)*(o+r*u));this._x=this._y=null,this._basis.lineEnd()},point:function(t,e){this._x.push(+t),this._y.push(+e)}};(function t(e){function n(t){return 1===e?new Zt(t):new te(t,e)}return n.beta=function(e){return t(+e)},n})(.85);function ee(t,e,n){t._context.bezierCurveTo(t._x1+t._k*(t._x2-t._x0),t._y1+t._k*(t._y2-t._y0),t._x2+t._k*(t._x1-e),t._y2+t._k*(t._y1-n),t._x2,t._y2)}function ne(t,e){this._context=t,this._k=(1-e)/6}ne.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:ee(this,this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2,this._x1=t,this._y1=e;break;case 2:this._point=3;default:ee(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};(function t(e){function n(t){return new ne(t,e)}return n.tension=function(e){return t(+e)},n})(0);function re(t,e){this._context=t,this._k=(1-e)/6}re.prototype={areaStart:Kt,areaEnd:Kt,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:ee(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};(function t(e){function n(t){return new re(t,e)}return n.tension=function(e){return t(+e)},n})(0);function ie(t,e){this._context=t,this._k=(1-e)/6}ie.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:ee(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};(function t(e){function n(t){return new ie(t,e)}return n.tension=function(e){return t(+e)},n})(0);function oe(t,e,n){var r=t._x1,i=t._y1,o=t._x2,a=t._y2;if(t._l01_a>wt){var u=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,c=3*t._l01_a*(t._l01_a+t._l12_a);r=(r*u-t._x0*t._l12_2a+t._x2*t._l01_2a)/c,i=(i*u-t._y0*t._l12_2a+t._y2*t._l01_2a)/c}if(t._l23_a>wt){var s=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,l=3*t._l23_a*(t._l23_a+t._l12_a);o=(o*s+t._x1*t._l23_2a-e*t._l12_2a)/l,a=(a*s+t._y1*t._l23_2a-n*t._l12_2a)/l}t._context.bezierCurveTo(r,i,o,a,t._x2,t._y2)}function ae(t,e){this._context=t,this._alpha=e}ae.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,r=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3;default:oe(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};(function t(e){function n(t){return e?new ae(t,e):new ne(t,0)}return n.alpha=function(e){return t(+e)},n})(.5);function ue(t,e){this._context=t,this._alpha=e}ue.prototype={areaStart:Kt,areaEnd:Kt,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,r=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:oe(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};(function t(e){function n(t){return e?new ue(t,e):new re(t,0)}return n.alpha=function(e){return t(+e)},n})(.5);function ce(t,e){this._context=t,this._alpha=e}ce.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,r=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:oe(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};(function t(e){function n(t){return e?new ce(t,e):new ie(t,0)}return n.alpha=function(e){return t(+e)},n})(.5);function se(t){this._context=t}se.prototype={areaStart:Kt,areaEnd:Kt,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(t,e){t=+t,e=+e,this._point?this._context.lineTo(t,e):(this._point=1,this._context.moveTo(t,e))}};function le(t){return t<0?-1:1}function fe(t,e,n){var r=t._x1-t._x0,i=e-t._x1,o=(t._y1-t._y0)/(r||i<0&&-0),a=(n-t._y1)/(i||r<0&&-0),u=(o*i+a*r)/(r+i);return(le(o)+le(a))*Math.min(Math.abs(o),Math.abs(a),.5*Math.abs(u))||0}function he(t,e){var n=t._x1-t._x0;return n?(3*(t._y1-t._y0)/n-e)/2:e}function pe(t,e,n){var r=t._x0,i=t._y0,o=t._x1,a=t._y1,u=(o-r)/3;t._context.bezierCurveTo(r+u,i+u*e,o-u,a-u*n,o,a)}function de(t){this._context=t}function ye(t){this._context=new ve(t)}function ve(t){this._context=t}function me(t){this._context=t}function ge(t){var e,n,r=t.length-1,i=new Array(r),o=new Array(r),a=new Array(r);for(i[0]=0,o[0]=2,a[0]=t[0]+2*t[1],e=1;e=0;--e)i[e]=(a[e]-i[e+1])/o[e];for(o[r-1]=(t[r]+i[r-1])/2,e=0;e=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,e),this._context.lineTo(t,e);else{var n=this._x*(1-this._t)+t*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,e)}}this._x=t,this._y=e}};var xe=function(t,e){if((i=t.length)>1)for(var n,r,i,o=1,a=t[e[0]],u=a.length;o=0;)n[e]=e;return n};function Oe(t,e){return t[e]}function _e(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Me(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Ee(t){return(Ee="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"===typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function ke(){return(ke=Object.assign||function(t){for(var e=1;e=0&&n>=0?{width:e,height:n}:null}},{key:"getDefaultPosition",value:function(t){var e,n,r=this.props,i=r.layout,o=r.align,a=r.verticalAlign,u=r.margin,c=r.chartWidth,s=r.chartHeight;return t&&(void 0!==t.left&&null!==t.left||void 0!==t.right&&null!==t.right)||(e="center"===o&&"vertical"===i?{left:((c||0)-(this.getBBox()||{width:0}).width)/2}:"right"===o?{right:u&&u.right||0}:{left:u&&u.left||0}),t&&(void 0!==t.top&&null!==t.top||void 0!==t.bottom&&null!==t.bottom)||(n="middle"===a?{top:((s||0)-(this.getBBox()||{height:0}).height)/2}:"bottom"===a?{bottom:u&&u.bottom||0}:{top:u&&u.top||0}),Ve({},e,{},n)}},{key:"updateBBox",value:function(){var t=this.state,e=t.boxWidth,n=t.boxHeight,r=this.props.onBBoxUpdate;if(this.wrapperNode&&this.wrapperNode.getBoundingClientRect){var i=this.wrapperNode.getBoundingClientRect();(Math.abs(i.width-e)>1||Math.abs(i.height-n)>1)&&this.setState({boxWidth:i.width,boxHeight:i.height},(function(){r&&r(i)}))}else-1===e&&-1===n||this.setState({boxWidth:-1,boxHeight:-1},(function(){r&&r(null)}))}},{key:"render",value:function(){var t=this,e=this.props,n=e.content,r=e.width,i=e.height,o=e.wrapperStyle,u=e.paylodUniqBy,c=e.payload,s=Ve({position:"absolute",width:r||"auto",height:i||"auto"},this.getDefaultPosition(o),{},o);return l.a.createElement("div",{className:"recharts-legend-wrapper",style:s,ref:function(e){t.wrapperNode=e}},function(t,e){return l.a.isValidElement(t)?l.a.cloneElement(t,e):a()(t)?t(e):l.a.createElement(qe,e)}(n,Ve({},this.props,{payload:tn(u,c)})))}}])&&Ke(n.prototype,r),i&&Ke(n,i),e}(s.PureComponent);nn.displayName="Legend",nn.propTypes={content:h.a.oneOfType([h.a.element,h.a.func]),wrapperStyle:h.a.object,chartWidth:h.a.number,chartHeight:h.a.number,width:h.a.number,height:h.a.number,iconSize:h.a.number,iconType:h.a.oneOf(en),layout:h.a.oneOf(["horizontal","vertical"]),align:h.a.oneOf(["center","left","right"]),verticalAlign:h.a.oneOf(["top","bottom","middle"]),margin:h.a.shape({top:h.a.number,left:h.a.number,bottom:h.a.number,right:h.a.number}),payload:h.a.arrayOf(h.a.shape({value:h.a.any,id:h.a.any,type:h.a.oneOf(H)})),paylodUniqBy:h.a.oneOfType([h.a.func,h.a.bool]),formatter:h.a.func,onMouseEnter:h.a.func,onMouseLeave:h.a.func,onClick:h.a.func,onBBoxUpdate:h.a.func},nn.defaultProps={iconSize:14,layout:"horizontal",align:"center",verticalAlign:"bottom"};var rn=nn,on=n(506),an=n.n(on),un=n(569),cn=n.n(un);function sn(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=-1;cn()((function r(i){n<0&&(n=i),i-n>e?(t(i),n=-1):cn()(r)}))}function ln(t){return(ln="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"===typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function fn(t){return function(t){if(Array.isArray(t))return t}(t)||function(t){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t))return Array.from(t)}(t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function hn(){var t=function(){return null},e=!1;return{stop:function(){e=!0},start:function(n){e=!1,function n(r){if(!e){if(Array.isArray(r)){if(!r.length)return;var i=fn(r),o=i[0],a=i.slice(1);return"number"===typeof o?void sn(n.bind(null,a),o):(n(o),void sn(n.bind(null,a)))}"object"===ln(r)&&t(r),"function"===typeof r&&r()}}(n)},subscribe:function(e){return t=e,function(){t=function(){return null}}}}}var pn=n(863),dn=n.n(pn);function yn(t){for(var e=1;e=0&&t<=1}));var l=jn(r,o),f=jn(i,a),h=Tn(r,o),p=function(t){return t>1?1:t<0?0:t},d=function(t){for(var e=t>1?1:t,n=e,r=0;r<8;++r){var i=l(n)-e,o=h(n);if(Math.abs(i-e)<1e-4||o<1e-4)return f(n);n=p(n-i/o)}return f(n)};return d.isStepper=!1,d},An=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.stiff,n=void 0===e?100:e,r=t.damping,i=void 0===r?8:r,o=t.dt,a=void 0===o?17:o,u=function(t,e,r){var o=r+(-(t-e)*n-r*i)*a/1e3,u=r*a/1e3+t;return Math.abs(u-e)<1e-4&&Math.abs(o)<1e-4?[e,0]:[u,o]};return u.isStepper=!0,u.dt=a,u},Nn=n(866),Cn=n.n(Nn);function In(t){return function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e=0||(i[n]=t[n]);return i}(t,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(i[n]=t[n])}return i}function Gn(t){return function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e0?n[i-1]:r,h=s||Object.keys(c);if("function"===typeof u||"spring"===u)return Gn(t).concat([e.runJSAnimation.bind(e,{from:f.style,to:c,duration:o,easing:u}),o]);var p=_n(h,o,u),d=qn({},f.style,c,{transition:p});return Gn(t).concat([d,o,l]).filter(xn)}),[a,Math.max(c,r)])),[t.onAnimationEnd]))}},{key:"runAnimation",value:function(t){this.manager||(this.manager=hn());var e=t.begin,n=t.duration,r=t.attributeName,i=t.to,o=t.easing,a=t.onAnimationStart,u=t.onAnimationEnd,c=t.steps,s=t.children,l=this.manager;if(this.unSubscribe=l.subscribe(this.handleStyleChange),"function"!==typeof o&&"function"!==typeof s&&"spring"!==o)if(c.length>1)this.runStepAnimation(t);else{var f=r?Hn({},r,i):i,h=_n(Object.keys(f),n,o);l.start([a,e,qn({},f,{transition:h}),n,u])}else this.runJSAnimation(t)}},{key:"handleStyleChange",value:function(t){this.changeStyle(t)}},{key:"changeStyle",value:function(t){this.mounted&&this.setState({style:t})}},{key:"render",value:function(){var t=this.props,e=t.children,n=(t.begin,t.duration,t.attributeName,t.easing,t.isActive),r=(t.steps,t.from,t.to,t.canBegin,t.onAnimationEnd,t.shouldReAnimate,t.onAnimationReStart,Wn(t,["children","begin","duration","attributeName","easing","isActive","steps","from","to","canBegin","onAnimationEnd","shouldReAnimate","onAnimationReStart"])),i=s.Children.count(e),o=On(this.state.style);if("function"===typeof e)return e(o);if(!n||0===i)return e;var a=function(t){var e=t.props,n=e.style,i=void 0===n?{}:n,a=e.className;return Object(s.cloneElement)(t,qn({},r,{style:qn({},i,o),className:a}))};return 1===i?a(s.Children.only(e)):l.a.createElement("div",null,s.Children.map(e,(function(t){return a(t)})))}}])&&Xn(n.prototype,r),i&&Xn(n,i),e}(s.PureComponent);Zn.displayName="Animate",Zn.propTypes={from:h.a.oneOfType([h.a.object,h.a.string]),to:h.a.oneOfType([h.a.object,h.a.string]),attributeName:h.a.string,duration:h.a.number,begin:h.a.number,easing:h.a.oneOfType([h.a.string,h.a.func]),steps:h.a.arrayOf(h.a.shape({duration:h.a.number.isRequired,style:h.a.object.isRequired,easing:h.a.oneOfType([h.a.oneOf(["ease","ease-in","ease-out","ease-in-out","linear"]),h.a.func]),properties:h.a.arrayOf("string"),onAnimationEnd:h.a.func})),children:h.a.oneOfType([h.a.node,h.a.func]),isActive:h.a.bool,canBegin:h.a.bool,onAnimationEnd:h.a.func,shouldReAnimate:h.a.bool,onAnimationStart:h.a.func,onAnimationReStart:h.a.func},Zn.defaultProps={begin:0,duration:1e3,from:"",to:"",attributeName:"",easing:"ease",isActive:!0,canBegin:!0,steps:[],onAnimationEnd:function(){},onAnimationStart:function(){}};var Jn=Zn,Qn=n(570);function tr(t){return(tr="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"===typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function er(){return(er=Object.assign||function(t){for(var e=1;e=0||(i[n]=t[n]);return i}(t,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(i[n]=t[n])}return i}function rr(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function ir(t,e){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{},e=t.steps,n=t.duration;return e&&e.length?e.reduce((function(t,e){return t+(j()(e.duration)&&e.duration>0?e.duration:0)}),0):j()(n)?n:0},sr=function(t){function e(){var t,n;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);for(var r=arguments.length,i=new Array(r),o=0;ol[e]+i?Math.max(f,l[e]):Math.max(h,l[e])},n}var n,r,i;return function(t,e){if("function"!==typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Ir(t,e)}(e,t),n=e,(r=[{key:"componentDidMount",value:function(){this.updateBBox()}},{key:"componentDidUpdate",value:function(){this.updateBBox()}},{key:"updateBBox",value:function(){var t=this.state,e=t.boxWidth,n=t.boxHeight;if(this.wrapperNode&&this.wrapperNode.getBoundingClientRect){var r=this.wrapperNode.getBoundingClientRect();(Math.abs(r.width-e)>1||Math.abs(r.height-n)>1)&&this.setState({boxWidth:r.width,boxHeight:r.height})}else-1===e&&-1===n||this.setState({boxWidth:-1,boxHeight:-1})}},{key:"render",value:function(){var t,e,n,r=this,i=this.props,o=i.payload,u=i.isAnimationActive,s=i.animationDuration,f=i.animationEasing,h=i.filterNull,p=function(t,e){return!0===t?c()(e,Rr):a()(t)?c()(e,t):e}(i.paylodUniqBy,h&&o&&o.length?o.filter((function(t){return!v()(t.value)})):o),y=p&&p.length,m=this.props,g=m.content,b=m.viewBox,x=m.coordinate,w=m.position,O=m.active,_=Tr({pointerEvents:"none",visibility:O&&y?"visible":"hidden",position:"absolute",top:0},m.wrapperStyle);if(w&&A(w.x)&&A(w.y))e=w.x,n=w.y;else{var M=this.state,E=M.boxWidth,k=M.boxHeight;E>0&&k>0&&x?(e=this.getTranslate({key:"x",tooltipDimension:E,viewBoxDimension:b.width}),n=this.getTranslate({key:"y",tooltipDimension:k,viewBoxDimension:b.height})):_.visibility="hidden"}_=Tr({},On({transform:this.props.useTranslate3d?"translate3d(".concat(e,"px, ").concat(n,"px, 0)"):"translate(".concat(e,"px, ").concat(n,"px)")}),{},_),u&&O&&(_=Tr({},On({transition:"transform ".concat(s,"ms ").concat(f)}),{},_));var S=d()(Dr,(Pr(t={},"".concat(Dr,"-right"),A(e)&&x&&A(x.x)&&e>=x.x),Pr(t,"".concat(Dr,"-left"),A(e)&&x&&A(x.x)&&e=x.y),Pr(t,"".concat(Dr,"-top"),A(n)&&x&&A(x.y)&&n0?Wr()(n.updateDimensionsImmediate,t.debounce):n.updateDimensionsImmediate,n}var n,r,i;return function(t,e){if("function"!==typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Kr(t,e)}(e,t),n=e,(r=[{key:"componentDidMount",value:function(){this.mounted=!0;var t=this.getContainerSize();t&&this.setState(t)}},{key:"componentWillUnmount",value:function(){this.mounted=!1}},{key:"getContainerSize",value:function(){return this.container?{containerWidth:this.container.clientWidth,containerHeight:this.container.clientHeight}:null}},{key:"renderChart",value:function(){var t=this.state,e=t.containerWidth,n=t.containerHeight;if(e<0||n<0)return null;var r=this.props,i=r.aspect,o=r.width,a=r.height,u=(r.minWidth,r.minHeight,r.maxHeight),c=r.children;P(o)||P(a);var s=P(o)?e:o,f=P(a)?n:a;return i&&i>0&&(s?f=s/i:f&&(s=f*i),u&&f>u&&(f=u)),l.a.cloneElement(c,{width:s,height:f})}},{key:"render",value:function(){var t=this,e=this.props,n=e.minWidth,r=e.minHeight,i=e.width,o=e.height,a=e.maxHeight,u=e.id,c=e.className,s={width:i,height:o,minWidth:n,minHeight:r,maxHeight:a};return l.a.createElement("div",{id:u,className:d()("recharts-responsive-container",c),style:s,ref:function(e){t.container=e}},this.renderChart(),l.a.createElement(qr.a,{handleWidth:!0,handleHeight:!0,onResize:this.handleResize}))}}])&&Xr(n.prototype,r),i&&Xr(n,i),e}(s.Component);$r.displayName="ResponsiveContainer",$r.propTypes={aspect:h.a.number,width:h.a.oneOfType([h.a.string,h.a.number]),height:h.a.oneOfType([h.a.string,h.a.number]),minHeight:h.a.oneOfType([h.a.string,h.a.number]),minWidth:h.a.oneOfType([h.a.string,h.a.number]),maxHeight:h.a.oneOfType([h.a.string,h.a.number]),children:h.a.node.isRequired,debounce:h.a.number,id:h.a.oneOfType([h.a.string,h.a.number]),className:h.a.oneOfType([h.a.string,h.a.number])},$r.defaultProps={width:"100%",height:"100%",debounce:0};var Zr=$r;function Jr(t){return(Jr="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"===typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Qr(){return(Qr=Object.assign||function(t){for(var e=1;e=0||(i[n]=t[n]);return i}(t,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(i[n]=t[n])}return i}function ei(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function ni(t){for(var e=1;e=0||(i[n]=t[n]);return i}(t,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(i[n]=t[n])}return i}var Li={className:h.a.string,children:h.a.oneOfType([h.a.arrayOf(h.a.node),h.a.node])};function Bi(t){var e=t.children,n=t.className,r=Ri(t,["children","className"]),i=d()("recharts-layer",n);return l.a.createElement("g",Di({className:i},r),e)}Bi.propTypes=Li;var zi=Bi,Fi=n(885),Ui=n.n(Fi),Wi=n(892),Gi=n.n(Wi);function qi(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Hi(t){for(var e=1;e=0&&i===+i?"".concat(i,"px"):i),";");var r,i,o}),"")},Ji=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(void 0===t||null===t||nt())return{width:0,height:0};var n="".concat(t),r=Zi(e),i="".concat(n,"-").concat(r);if(Yi.widthCache[i])return Yi.widthCache[i];try{var o=document.getElementById("recharts_measurement_span");o||((o=document.createElement("span")).setAttribute("id","recharts_measurement_span"),document.body.appendChild(o));var a=Hi({},Ki,{},e);Object.keys(a).map((function(t){return o.style[t]=a[t],t})),o.textContent=n;var u=o.getBoundingClientRect(),c={width:u.width,height:u.height};return Yi.widthCache[i]=c,++Yi.cacheCount>2e3&&(Yi.cacheCount=0,Yi.widthCache={}),c}catch(s){return{width:0,height:0}}};function Qi(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function to(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function eo(t){return(eo="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"===typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function no(){return(no=Object.assign||function(t){for(var e=1;e=0||(i[n]=t[n]);return i}(t,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(i[n]=t[n])}return i}function io(t,e){for(var n=0;ne?1:t>=e?0:NaN},go=function(t){var e;return 1===t.length&&(e=t,t=function(t,n){return mo(e(t),n)}),{left:function(e,n,r,i){for(null==r&&(r=0),null==i&&(i=e.length);r>>1;t(e[o],n)<0?r=o+1:i=o}return r},right:function(e,n,r,i){for(null==r&&(r=0),null==i&&(i=e.length);r>>1;t(e[o],n)>0?i=o:r=o+1}return r}}};var bo=go(mo),xo=bo.right,wo=(bo.left,xo);var Oo=function(t){return null===t?NaN:+t},_o=Array.prototype,Mo=(_o.slice,_o.map,function(t,e,n){t=+t,e=+e,n=(i=arguments.length)<2?(e=t,t=0,1):i<3?1:+n;for(var r=-1,i=0|Math.max(0,Math.ceil((e-t)/n)),o=new Array(i);++r0)return[t];if((r=e0)for(t=Math.ceil(t/a),e=Math.floor(e/a),o=new Array(i=Math.ceil(e-t+1));++u=0?(o>=Eo?10:o>=ko?5:o>=So?2:1)*Math.pow(10,i):-Math.pow(10,-i)/(o>=Eo?10:o>=ko?5:o>=So?2:1)}function Po(t,e,n){var r=Math.abs(e-t)/Math.max(0,n),i=Math.pow(10,Math.floor(Math.log(r)/Math.LN10)),o=r/i;return o>=Eo?i*=10:o>=ko?i*=5:o>=So&&(i*=2),e=1)return+n(t[r-1],r-1,t);var r,i=(r-1)*e,o=Math.floor(i),a=+n(t[o],o,t);return a+(+n(t[o+1],o+1,t)-a)*(i-o)}};function No(t,e){switch(arguments.length){case 0:break;case 1:this.range(t);break;default:this.range(e).domain(t)}return this}function Co(t,e){switch(arguments.length){case 0:break;case 1:this.interpolator(t);break;default:this.interpolator(e).domain(t)}return this}function Io(){}function Do(t,e){var n=new Io;if(t instanceof Io)t.each((function(t,e){n.set(e,t)}));else if(Array.isArray(t)){var r,i=-1,o=t.length;if(null==e)for(;++i>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?new da(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?new da(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|240&e,((15&e)<<4|15&e)/255):null):(e=ta.exec(t))?new da(e[1],e[2],e[3],1):(e=ea.exec(t))?new da(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=na.exec(t))?fa(e[1],e[2],e[3],e[4]):(e=ra.exec(t))?fa(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=ia.exec(t))?ga(e[1],e[2]/100,e[3]/100,1):(e=oa.exec(t))?ga(e[1],e[2]/100,e[3]/100,e[4]):aa.hasOwnProperty(t)?la(aa[t]):"transparent"===t?new da(NaN,NaN,NaN,0):null}function la(t){return new da(t>>16&255,t>>8&255,255&t,1)}function fa(t,e,n,r){return r<=0&&(t=e=n=NaN),new da(t,e,n,r)}function ha(t){return t instanceof Ko||(t=sa(t)),t?new da((t=t.rgb()).r,t.g,t.b,t.opacity):new da}function pa(t,e,n,r){return 1===arguments.length?ha(t):new da(t,e,n,null==r?1:r)}function da(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}function ya(){return"#"+ma(this.r)+ma(this.g)+ma(this.b)}function va(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(1===t?")":", "+t+")")}function ma(t){return((t=Math.max(0,Math.min(255,Math.round(t)||0)))<16?"0":"")+t.toString(16)}function ga(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new wa(t,e,n,r)}function ba(t){if(t instanceof wa)return new wa(t.h,t.s,t.l,t.opacity);if(t instanceof Ko||(t=sa(t)),!t)return new wa;if(t instanceof wa)return t;var e=(t=t.rgb()).r/255,n=t.g/255,r=t.b/255,i=Math.min(e,n,r),o=Math.max(e,n,r),a=NaN,u=o-i,c=(o+i)/2;return u?(a=e===o?(n-r)/u+6*(n0&&c<1?0:a,new wa(a,u,c,t.opacity)}function xa(t,e,n,r){return 1===arguments.length?ba(t):new wa(t,e,n,null==r?1:r)}function wa(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function Oa(t,e,n){return 255*(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)}function _a(t,e,n,r,i){var o=t*t,a=o*t;return((1-3*t+3*o-a)*e+(4-6*o+3*a)*n+(1+3*t+3*o-3*a)*r+a*i)/6}Vo(Ko,sa,{copy:function(t){return Object.assign(new this.constructor,this,t)},displayable:function(){return this.rgb().displayable()},hex:ua,formatHex:ua,formatHsl:function(){return ba(this).formatHsl()},formatRgb:ca,toString:ca}),Vo(da,pa,Yo(Ko,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new da(this.r*t,this.g*t,this.b*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new da(this.r*t,this.g*t,this.b*t,this.opacity)},rgb:function(){return this},displayable:function(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:ya,formatHex:ya,formatRgb:va,toString:va})),Vo(wa,xa,Yo(Ko,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new wa(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new wa(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=this.h%360+360*(this.h<0),e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*e,i=2*n-r;return new da(Oa(t>=240?t-240:t+120,i,r),Oa(t,i,r),Oa(t<120?t+240:t-120,i,r),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl:function(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"hsl(":"hsla(")+(this.h||0)+", "+100*(this.s||0)+"%, "+100*(this.l||0)+"%"+(1===t?")":", "+t+")")}}));var Ma=function(t){return function(){return t}};function Ea(t,e){return function(n){return t+n*e}}function ka(t,e){var n=e-t;return n?Ea(t,n>180||n<-180?n-360*Math.round(n/360):n):Ma(isNaN(t)?e:t)}function Sa(t){return 1===(t=+t)?ja:function(e,n){return n-e?function(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(r){return Math.pow(t+r*e,n)}}(e,n,t):Ma(isNaN(e)?n:e)}}function ja(t,e){var n=e-t;return n?Ea(t,n):Ma(isNaN(t)?e:t)}var Ta=function t(e){var n=Sa(e);function r(t,e){var r=n((t=pa(t)).r,(e=pa(e)).r),i=n(t.g,e.g),o=n(t.b,e.b),a=ja(t.opacity,e.opacity);return function(e){return t.r=r(e),t.g=i(e),t.b=o(e),t.opacity=a(e),t+""}}return r.gamma=t,r}(1);function Pa(t){return function(e){var n,r,i=e.length,o=new Array(i),a=new Array(i),u=new Array(i);for(n=0;n=1?(n=1,e-1):Math.floor(n*e),i=t[r],o=t[r+1],a=r>0?t[r-1]:2*i-o,u=ro&&(i=e.slice(o,i),u[a]?u[a]+=i:u[++a]=i),(n=n[0])===(r=r[0])?u[a]?u[a]+=r:u[++a]=r:(u[++a]=null,c.push({i:a,x:Ca(n,r)})),o=Ra.lastIndex;return o180?e+=360:e-t>180&&(t+=360),o.push({i:n.push(i(n)+"rotate(",null,r)-2,x:Ca(t,e)})):e&&n.push(i(n)+"rotate("+e+r)}(o.rotate,a.rotate,u,c),function(t,e,n,o){t!==e?o.push({i:n.push(i(n)+"skewX(",null,r)-2,x:Ca(t,e)}):e&&n.push(i(n)+"skewX("+e+r)}(o.skewX,a.skewX,u,c),function(t,e,n,r,o,a){if(t!==n||e!==r){var u=o.push(i(o)+"scale(",null,",",null,")");a.push({i:u-4,x:Ca(t,n)},{i:u-2,x:Ca(e,r)})}else 1===n&&1===r||o.push(i(o)+"scale("+n+","+r+")")}(o.scaleX,o.scaleY,a.scaleX,a.scaleY,u,c),o=a=null,function(t){for(var e,n=-1,r=c.length;++nru?Math.pow(t,1/3):t/nu+tu}function cu(t){return t>eu?t*t*t:nu*(t-tu)}function su(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function lu(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function fu(t){if(t instanceof pu)return new pu(t.h,t.c,t.l,t.opacity);if(t instanceof au||(t=iu(t)),0===t.a&&0===t.b)return new pu(NaN,0r&&(e=n,n=r,r=e),function(t){return Math.max(n,Math.min(r,t))}}function Cu(t,e,n){var r=t[0],i=t[1],o=e[0],a=e[1];return i2?Iu:Cu,i=o=null,f}function f(e){return isNaN(e=+e)?n:(i||(i=r(a.map(t),u,c)))(t(s(e)))}return f.invert=function(n){return s(e((o||(o=r(u,a.map(t),Ca)))(n)))},f.domain=function(t){return arguments.length?(a=Uo.call(t,ju),s===Pu||(s=Nu(a)),l()):a.slice()},f.range=function(t){return arguments.length?(u=Wo.call(t),l()):u.slice()},f.rangeRound=function(t){return u=Wo.call(t),c=Ga,l()},f.clamp=function(t){return arguments.length?(s=t?Nu(a):Pu,f):s!==Pu},f.interpolate=function(t){return arguments.length?(c=t,l()):c},f.unknown=function(t){return arguments.length?(n=t,f):n},function(n,r){return t=n,e=r,l()}}function Lu(t,e){return Ru()(t,e)}var Bu=function(t,e){if((n=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"))<0)return null;var n,r=t.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+t.slice(n+1)]},zu=function(t){return(t=Bu(Math.abs(t)))?t[1]:NaN},Fu=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Uu(t){if(!(e=Fu.exec(t)))throw new Error("invalid format: "+t);var e;return new Wu({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}function Wu(t){this.fill=void 0===t.fill?" ":t.fill+"",this.align=void 0===t.align?">":t.align+"",this.sign=void 0===t.sign?"-":t.sign+"",this.symbol=void 0===t.symbol?"":t.symbol+"",this.zero=!!t.zero,this.width=void 0===t.width?void 0:+t.width,this.comma=!!t.comma,this.precision=void 0===t.precision?void 0:+t.precision,this.trim=!!t.trim,this.type=void 0===t.type?"":t.type+""}Uu.prototype=Wu.prototype,Wu.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};var Gu,qu,Hu,Xu,Vu=function(t){t:for(var e,n=t.length,r=1,i=-1;r0){if(!+t[r])break t;i=0}}return i>0?t.slice(0,i)+t.slice(e+1):t},Yu=function(t,e){var n=Bu(t,e);if(!n)return t+"";var r=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")},Ku={"%":function(t,e){return(100*t).toFixed(e)},b:function(t){return Math.round(t).toString(2)},c:function(t){return t+""},d:function(t){return Math.round(t).toString(10)},e:function(t,e){return t.toExponential(e)},f:function(t,e){return t.toFixed(e)},g:function(t,e){return t.toPrecision(e)},o:function(t){return Math.round(t).toString(8)},p:function(t,e){return Yu(100*t,e)},r:Yu,s:function(t,e){var n=Bu(t,e);if(!n)return t+"";var r=n[0],i=n[1],o=i-(Gu=3*Math.max(-8,Math.min(8,Math.floor(i/3))))+1,a=r.length;return o===a?r:o>a?r+new Array(o-a+1).join("0"):o>0?r.slice(0,o)+"."+r.slice(o):"0."+new Array(1-o).join("0")+Bu(t,Math.max(0,e+o-1))[0]},X:function(t){return Math.round(t).toString(16).toUpperCase()},x:function(t){return Math.round(t).toString(16)}},$u=function(t){return t},Zu=Array.prototype.map,Ju=["y","z","a","f","p","n","\xb5","m","","k","M","G","T","P","E","Z","Y"];qu=function(t){var e,n,r=void 0===t.grouping||void 0===t.thousands?$u:(e=Zu.call(t.grouping,Number),n=t.thousands+"",function(t,r){for(var i=t.length,o=[],a=0,u=e[0],c=0;i>0&&u>0&&(c+u+1>r&&(u=Math.max(1,r-c)),o.push(t.substring(i-=u,i+u)),!((c+=u+1)>r));)u=e[a=(a+1)%e.length];return o.reverse().join(n)}),i=void 0===t.currency?"":t.currency[0]+"",o=void 0===t.currency?"":t.currency[1]+"",a=void 0===t.decimal?".":t.decimal+"",u=void 0===t.numerals?$u:function(t){return function(e){return e.replace(/[0-9]/g,(function(e){return t[+e]}))}}(Zu.call(t.numerals,String)),c=void 0===t.percent?"%":t.percent+"",s=void 0===t.minus?"-":t.minus+"",l=void 0===t.nan?"NaN":t.nan+"";function f(t){var e=(t=Uu(t)).fill,n=t.align,f=t.sign,h=t.symbol,p=t.zero,d=t.width,y=t.comma,v=t.precision,m=t.trim,g=t.type;"n"===g?(y=!0,g="g"):Ku[g]||(void 0===v&&(v=12),m=!0,g="g"),(p||"0"===e&&"="===n)&&(p=!0,e="0",n="=");var b="$"===h?i:"#"===h&&/[boxX]/.test(g)?"0"+g.toLowerCase():"",x="$"===h?o:/[%p]/.test(g)?c:"",w=Ku[g],O=/[defgprs%]/.test(g);function _(t){var i,o,c,h=b,_=x;if("c"===g)_=w(t)+_,t="";else{var M=(t=+t)<0;if(t=isNaN(t)?l:w(Math.abs(t),v),m&&(t=Vu(t)),M&&0===+t&&(M=!1),h=(M?"("===f?f:s:"-"===f||"("===f?"":f)+h,_=("s"===g?Ju[8+Gu/3]:"")+_+(M&&"("===f?")":""),O)for(i=-1,o=t.length;++i(c=t.charCodeAt(i))||c>57){_=(46===c?a+t.slice(i+1):t.slice(i))+_,t=t.slice(0,i);break}}y&&!p&&(t=r(t,1/0));var E=h.length+t.length+_.length,k=E>1)+h+t+_+k.slice(E);break;default:t=k+h+t+_}return u(t)}return v=void 0===v?6:/[gprs]/.test(g)?Math.max(1,Math.min(21,v)):Math.max(0,Math.min(20,v)),_.toString=function(){return t+""},_}return{format:f,formatPrefix:function(t,e){var n=f(((t=Uu(t)).type="f",t)),r=3*Math.max(-8,Math.min(8,Math.floor(zu(e)/3))),i=Math.pow(10,-r),o=Ju[8+r/3];return function(t){return n(i*t)+o}}}}({decimal:".",thousands:",",grouping:[3],currency:["$",""],minus:"-"}),Hu=qu.format,Xu=qu.formatPrefix;var Qu=function(t,e,n,r){var i,o=Po(t,e,n);switch((r=Uu(null==r?",f":r)).type){case"s":var a=Math.max(Math.abs(t),Math.abs(e));return null!=r.precision||isNaN(i=function(t,e){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(zu(e)/3)))-zu(Math.abs(t)))}(o,a))||(r.precision=i),Xu(r,a);case"":case"e":case"g":case"p":case"r":null!=r.precision||isNaN(i=function(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,zu(e)-zu(t))+1}(o,Math.max(Math.abs(t),Math.abs(e))))||(r.precision=i-("e"===r.type));break;case"f":case"%":null!=r.precision||isNaN(i=function(t){return Math.max(0,-zu(Math.abs(t)))}(o))||(r.precision=i-2*("%"===r.type))}return Hu(r)};function tc(t){var e=t.domain;return t.ticks=function(t){var n=e();return jo(n[0],n[n.length-1],null==t?10:t)},t.tickFormat=function(t,n){var r=e();return Qu(r[0],r[r.length-1],null==t?10:t,n)},t.nice=function(n){null==n&&(n=10);var r,i=e(),o=0,a=i.length-1,u=i[o],c=i[a];return c0?r=To(u=Math.floor(u/r)*r,c=Math.ceil(c/r)*r,n):r<0&&(r=To(u=Math.ceil(u*r)/r,c=Math.floor(c*r)/r,n)),r>0?(i[o]=Math.floor(u/r)*r,i[a]=Math.ceil(c/r)*r,e(i)):r<0&&(i[o]=Math.ceil(u*r)/r,i[a]=Math.floor(c*r)/r,e(i)),t},t}function ec(){var t=Lu(Pu,Pu);return t.copy=function(){return Du(t,ec())},No.apply(t,arguments),tc(t)}function nc(t){var e;function n(t){return isNaN(t=+t)?e:t}return n.invert=n,n.domain=n.range=function(e){return arguments.length?(t=Uo.call(e,ju),n):t.slice()},n.unknown=function(t){return arguments.length?(e=t,n):e},n.copy=function(){return nc(t).unknown(e)},t=arguments.length?Uo.call(t,ju):[0,1],tc(n)}var rc=function(t,e){var n,r=0,i=(t=t.slice()).length-1,o=t[r],a=t[i];return a0){for(;hc)break;y.push(f)}}else for(;h=1;--l)if(!((f=s*l)c)break;y.push(f)}}else y=jo(h,p,Math.min(p-h,d)).map(n);return r?y.reverse():y},r.tickFormat=function(t,i){if(null==i&&(i=10===o?".0e":","),"function"!==typeof i&&(i=Hu(i)),t===1/0)return i;null==t&&(t=10);var a=Math.max(1,o*t/r.ticks().length);return function(t){var r=t/n(Math.round(e(t)));return r*o0?r[i-1]:e[0],i=r?[i[r-1],n]:[i[a-1],i[a]]},a.unknown=function(e){return arguments.length?(t=e,a):a},a.thresholds=function(){return i.slice()},a.copy=function(){return _c().domain([e,n]).range(o).unknown(t)},No.apply(tc(a),arguments)}function Mc(){var t,e=[.5],n=[0,1],r=1;function i(i){return i<=i?n[wo(e,i,0,r)]:t}return i.domain=function(t){return arguments.length?(e=Wo.call(t),r=Math.min(e.length,n.length-1),i):e.slice()},i.range=function(t){return arguments.length?(n=Wo.call(t),r=Math.min(e.length,n.length-1),i):n.slice()},i.invertExtent=function(t){var r=n.indexOf(t);return[e[r-1],e[r]]},i.unknown=function(e){return arguments.length?(t=e,i):t},i.copy=function(){return Mc().domain(e).range(n).unknown(t)},No.apply(i,arguments)}var Ec=new Date,kc=new Date;function Sc(t,e,n,r){function i(e){return t(e=0===arguments.length?new Date:new Date(+e)),e}return i.floor=function(e){return t(e=new Date(+e)),e},i.ceil=function(n){return t(n=new Date(n-1)),e(n,1),t(n),n},i.round=function(t){var e=i(t),n=i.ceil(t);return t-e0))return u;do{u.push(a=new Date(+n)),e(n,o),t(n)}while(a=e)for(;t(e),!n(e);)e.setTime(e-1)}),(function(t,r){if(t>=t)if(r<0)for(;++r<=0;)for(;e(t,-1),!n(t););else for(;--r>=0;)for(;e(t,1),!n(t););}))},n&&(i.count=function(e,r){return Ec.setTime(+e),kc.setTime(+r),t(Ec),t(kc),Math.floor(n(Ec,kc))},i.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?i.filter(r?function(e){return r(e)%t===0}:function(e){return i.count(0,e)%t===0}):i:null}),i}var jc=Sc((function(t){t.setMonth(0,1),t.setHours(0,0,0,0)}),(function(t,e){t.setFullYear(t.getFullYear()+e)}),(function(t,e){return e.getFullYear()-t.getFullYear()}),(function(t){return t.getFullYear()}));jc.every=function(t){return isFinite(t=Math.floor(t))&&t>0?Sc((function(e){e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)}),(function(e,n){e.setFullYear(e.getFullYear()+n*t)})):null};var Tc=jc,Pc=(jc.range,Sc((function(t){t.setDate(1),t.setHours(0,0,0,0)}),(function(t,e){t.setMonth(t.getMonth()+e)}),(function(t,e){return e.getMonth()-t.getMonth()+12*(e.getFullYear()-t.getFullYear())}),(function(t){return t.getMonth()}))),Ac=Pc,Nc=(Pc.range,6e4),Cc=6048e5;function Ic(t){return Sc((function(e){e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)}),(function(t,e){t.setDate(t.getDate()+7*e)}),(function(t,e){return(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*Nc)/Cc}))}var Dc=Ic(0),Rc=Ic(1),Lc=Ic(2),Bc=Ic(3),zc=Ic(4),Fc=Ic(5),Uc=Ic(6),Wc=(Dc.range,Rc.range,Lc.range,Bc.range,zc.range,Fc.range,Uc.range,Sc((function(t){t.setHours(0,0,0,0)}),(function(t,e){t.setDate(t.getDate()+e)}),(function(t,e){return(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*Nc)/864e5}),(function(t){return t.getDate()-1}))),Gc=Wc,qc=(Wc.range,Sc((function(t){t.setTime(t-t.getMilliseconds()-1e3*t.getSeconds()-t.getMinutes()*Nc)}),(function(t,e){t.setTime(+t+36e5*e)}),(function(t,e){return(e-t)/36e5}),(function(t){return t.getHours()}))),Hc=qc,Xc=(qc.range,Sc((function(t){t.setTime(t-t.getMilliseconds()-1e3*t.getSeconds())}),(function(t,e){t.setTime(+t+e*Nc)}),(function(t,e){return(e-t)/Nc}),(function(t){return t.getMinutes()}))),Vc=Xc,Yc=(Xc.range,Sc((function(t){t.setTime(t-t.getMilliseconds())}),(function(t,e){t.setTime(+t+1e3*e)}),(function(t,e){return(e-t)/1e3}),(function(t){return t.getUTCSeconds()}))),Kc=Yc,$c=(Yc.range,Sc((function(){}),(function(t,e){t.setTime(+t+e)}),(function(t,e){return e-t})));$c.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?Sc((function(e){e.setTime(Math.floor(e/t)*t)}),(function(e,n){e.setTime(+e+n*t)}),(function(e,n){return(n-e)/t})):$c:null};var Zc=$c;$c.range;function Jc(t){return Sc((function(e){e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCDate(t.getUTCDate()+7*e)}),(function(t,e){return(e-t)/Cc}))}var Qc=Jc(0),ts=Jc(1),es=Jc(2),ns=Jc(3),rs=Jc(4),is=Jc(5),os=Jc(6),as=(Qc.range,ts.range,es.range,ns.range,rs.range,is.range,os.range,Sc((function(t){t.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCDate(t.getUTCDate()+e)}),(function(t,e){return(e-t)/864e5}),(function(t){return t.getUTCDate()-1}))),us=as,cs=(as.range,Sc((function(t){t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCFullYear(t.getUTCFullYear()+e)}),(function(t,e){return e.getUTCFullYear()-t.getUTCFullYear()}),(function(t){return t.getUTCFullYear()})));cs.every=function(t){return isFinite(t=Math.floor(t))&&t>0?Sc((function(e){e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)}),(function(e,n){e.setUTCFullYear(e.getUTCFullYear()+n*t)})):null};var ss=cs;cs.range;function ls(t){if(0<=t.y&&t.y<100){var e=new Date(-1,t.m,t.d,t.H,t.M,t.S,t.L);return e.setFullYear(t.y),e}return new Date(t.y,t.m,t.d,t.H,t.M,t.S,t.L)}function fs(t){if(0<=t.y&&t.y<100){var e=new Date(Date.UTC(-1,t.m,t.d,t.H,t.M,t.S,t.L));return e.setUTCFullYear(t.y),e}return new Date(Date.UTC(t.y,t.m,t.d,t.H,t.M,t.S,t.L))}function hs(t,e,n){return{y:t,m:e,d:n,H:0,M:0,S:0,L:0}}var ps,ds,ys,vs={"-":"",_:" ",0:"0"},ms=/^\s*\d+/,gs=/^%/,bs=/[\\^$*+?|[\]().{}]/g;function xs(t,e,n){var r=t<0?"-":"",i=(r?-t:t)+"",o=i.length;return r+(o68?1900:2e3),n+r[0].length):-1}function As(t,e,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(n,n+6));return r?(t.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function Ns(t,e,n){var r=ms.exec(e.slice(n,n+1));return r?(t.q=3*r[0]-3,n+r[0].length):-1}function Cs(t,e,n){var r=ms.exec(e.slice(n,n+2));return r?(t.m=r[0]-1,n+r[0].length):-1}function Is(t,e,n){var r=ms.exec(e.slice(n,n+2));return r?(t.d=+r[0],n+r[0].length):-1}function Ds(t,e,n){var r=ms.exec(e.slice(n,n+3));return r?(t.m=0,t.d=+r[0],n+r[0].length):-1}function Rs(t,e,n){var r=ms.exec(e.slice(n,n+2));return r?(t.H=+r[0],n+r[0].length):-1}function Ls(t,e,n){var r=ms.exec(e.slice(n,n+2));return r?(t.M=+r[0],n+r[0].length):-1}function Bs(t,e,n){var r=ms.exec(e.slice(n,n+2));return r?(t.S=+r[0],n+r[0].length):-1}function zs(t,e,n){var r=ms.exec(e.slice(n,n+3));return r?(t.L=+r[0],n+r[0].length):-1}function Fs(t,e,n){var r=ms.exec(e.slice(n,n+6));return r?(t.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function Us(t,e,n){var r=gs.exec(e.slice(n,n+1));return r?n+r[0].length:-1}function Ws(t,e,n){var r=ms.exec(e.slice(n));return r?(t.Q=+r[0],n+r[0].length):-1}function Gs(t,e,n){var r=ms.exec(e.slice(n));return r?(t.s=+r[0],n+r[0].length):-1}function qs(t,e){return xs(t.getDate(),e,2)}function Hs(t,e){return xs(t.getHours(),e,2)}function Xs(t,e){return xs(t.getHours()%12||12,e,2)}function Vs(t,e){return xs(1+Gc.count(Tc(t),t),e,3)}function Ys(t,e){return xs(t.getMilliseconds(),e,3)}function Ks(t,e){return Ys(t,e)+"000"}function $s(t,e){return xs(t.getMonth()+1,e,2)}function Zs(t,e){return xs(t.getMinutes(),e,2)}function Js(t,e){return xs(t.getSeconds(),e,2)}function Qs(t){var e=t.getDay();return 0===e?7:e}function tl(t,e){return xs(Dc.count(Tc(t)-1,t),e,2)}function el(t,e){var n=t.getDay();return t=n>=4||0===n?zc(t):zc.ceil(t),xs(zc.count(Tc(t),t)+(4===Tc(t).getDay()),e,2)}function nl(t){return t.getDay()}function rl(t,e){return xs(Rc.count(Tc(t)-1,t),e,2)}function il(t,e){return xs(t.getFullYear()%100,e,2)}function ol(t,e){return xs(t.getFullYear()%1e4,e,4)}function al(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+xs(e/60|0,"0",2)+xs(e%60,"0",2)}function ul(t,e){return xs(t.getUTCDate(),e,2)}function cl(t,e){return xs(t.getUTCHours(),e,2)}function sl(t,e){return xs(t.getUTCHours()%12||12,e,2)}function ll(t,e){return xs(1+us.count(ss(t),t),e,3)}function fl(t,e){return xs(t.getUTCMilliseconds(),e,3)}function hl(t,e){return fl(t,e)+"000"}function pl(t,e){return xs(t.getUTCMonth()+1,e,2)}function dl(t,e){return xs(t.getUTCMinutes(),e,2)}function yl(t,e){return xs(t.getUTCSeconds(),e,2)}function vl(t){var e=t.getUTCDay();return 0===e?7:e}function ml(t,e){return xs(Qc.count(ss(t)-1,t),e,2)}function gl(t,e){var n=t.getUTCDay();return t=n>=4||0===n?rs(t):rs.ceil(t),xs(rs.count(ss(t),t)+(4===ss(t).getUTCDay()),e,2)}function bl(t){return t.getUTCDay()}function xl(t,e){return xs(ts.count(ss(t)-1,t),e,2)}function wl(t,e){return xs(t.getUTCFullYear()%100,e,2)}function Ol(t,e){return xs(t.getUTCFullYear()%1e4,e,4)}function _l(){return"+0000"}function Ml(){return"%"}function El(t){return+t}function kl(t){return Math.floor(+t/1e3)}!function(t){ps=function(t){var e=t.dateTime,n=t.date,r=t.time,i=t.periods,o=t.days,a=t.shortDays,u=t.months,c=t.shortMonths,s=Os(i),l=_s(i),f=Os(o),h=_s(o),p=Os(a),d=_s(a),y=Os(u),v=_s(u),m=Os(c),g=_s(c),b={a:function(t){return a[t.getDay()]},A:function(t){return o[t.getDay()]},b:function(t){return c[t.getMonth()]},B:function(t){return u[t.getMonth()]},c:null,d:qs,e:qs,f:Ks,H:Hs,I:Xs,j:Vs,L:Ys,m:$s,M:Zs,p:function(t){return i[+(t.getHours()>=12)]},q:function(t){return 1+~~(t.getMonth()/3)},Q:El,s:kl,S:Js,u:Qs,U:tl,V:el,w:nl,W:rl,x:null,X:null,y:il,Y:ol,Z:al,"%":Ml},x={a:function(t){return a[t.getUTCDay()]},A:function(t){return o[t.getUTCDay()]},b:function(t){return c[t.getUTCMonth()]},B:function(t){return u[t.getUTCMonth()]},c:null,d:ul,e:ul,f:hl,H:cl,I:sl,j:ll,L:fl,m:pl,M:dl,p:function(t){return i[+(t.getUTCHours()>=12)]},q:function(t){return 1+~~(t.getUTCMonth()/3)},Q:El,s:kl,S:yl,u:vl,U:ml,V:gl,w:bl,W:xl,x:null,X:null,y:wl,Y:Ol,Z:_l,"%":Ml},w={a:function(t,e,n){var r=p.exec(e.slice(n));return r?(t.w=d[r[0].toLowerCase()],n+r[0].length):-1},A:function(t,e,n){var r=f.exec(e.slice(n));return r?(t.w=h[r[0].toLowerCase()],n+r[0].length):-1},b:function(t,e,n){var r=m.exec(e.slice(n));return r?(t.m=g[r[0].toLowerCase()],n+r[0].length):-1},B:function(t,e,n){var r=y.exec(e.slice(n));return r?(t.m=v[r[0].toLowerCase()],n+r[0].length):-1},c:function(t,n,r){return M(t,e,n,r)},d:Is,e:Is,f:Fs,H:Rs,I:Rs,j:Ds,L:zs,m:Cs,M:Ls,p:function(t,e,n){var r=s.exec(e.slice(n));return r?(t.p=l[r[0].toLowerCase()],n+r[0].length):-1},q:Ns,Q:Ws,s:Gs,S:Bs,u:Es,U:ks,V:Ss,w:Ms,W:js,x:function(t,e,r){return M(t,n,e,r)},X:function(t,e,n){return M(t,r,e,n)},y:Ps,Y:Ts,Z:As,"%":Us};function O(t,e){return function(n){var r,i,o,a=[],u=-1,c=0,s=t.length;for(n instanceof Date||(n=new Date(+n));++u53)return null;"w"in o||(o.w=1),"Z"in o?(i=(r=fs(hs(o.y,0,1))).getUTCDay(),r=i>4||0===i?ts.ceil(r):ts(r),r=us.offset(r,7*(o.V-1)),o.y=r.getUTCFullYear(),o.m=r.getUTCMonth(),o.d=r.getUTCDate()+(o.w+6)%7):(i=(r=ls(hs(o.y,0,1))).getDay(),r=i>4||0===i?Rc.ceil(r):Rc(r),r=Gc.offset(r,7*(o.V-1)),o.y=r.getFullYear(),o.m=r.getMonth(),o.d=r.getDate()+(o.w+6)%7)}else("W"in o||"U"in o)&&("w"in o||(o.w="u"in o?o.u%7:"W"in o?1:0),i="Z"in o?fs(hs(o.y,0,1)).getUTCDay():ls(hs(o.y,0,1)).getDay(),o.m=0,o.d="W"in o?(o.w+6)%7+7*o.W-(i+5)%7:o.w+7*o.U-(i+6)%7);return"Z"in o?(o.H+=o.Z/100|0,o.M+=o.Z%100,fs(o)):ls(o)}}function M(t,e,n,r){for(var i,o,a=0,u=e.length,c=n.length;a=c)return-1;if(37===(i=e.charCodeAt(a++))){if(i=e.charAt(a++),!(o=w[i in vs?e.charAt(a++):i])||(r=o(t,n,r))<0)return-1}else if(i!=n.charCodeAt(r++))return-1}return r}return b.x=O(n,b),b.X=O(r,b),b.c=O(e,b),x.x=O(n,x),x.X=O(r,x),x.c=O(e,x),{format:function(t){var e=O(t+="",b);return e.toString=function(){return t},e},parse:function(t){var e=_(t+="",!1);return e.toString=function(){return t},e},utcFormat:function(t){var e=O(t+="",x);return e.toString=function(){return t},e},utcParse:function(t){var e=_(t+="",!0);return e.toString=function(){return t},e}}}(t),ds=ps.format,ps.parse,ys=ps.utcFormat,ps.utcParse}({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});var Sl=1e3,jl=60*Sl,Tl=60*jl,Pl=24*Tl,Al=7*Pl,Nl=30*Pl,Cl=365*Pl;function Il(t){return new Date(t)}function Dl(t){return t instanceof Date?+t:+new Date(+t)}function Rl(t,e,n,r,i,o,a,u,c){var s=Lu(Pu,Pu),l=s.invert,f=s.domain,h=c(".%L"),p=c(":%S"),d=c("%I:%M"),y=c("%I %p"),v=c("%a %d"),m=c("%b %d"),g=c("%B"),b=c("%Y"),x=[[a,1,Sl],[a,5,5*Sl],[a,15,15*Sl],[a,30,30*Sl],[o,1,jl],[o,5,5*jl],[o,15,15*jl],[o,30,30*jl],[i,1,Tl],[i,3,3*Tl],[i,6,6*Tl],[i,12,12*Tl],[r,1,Pl],[r,2,2*Pl],[n,1,Al],[e,1,Nl],[e,3,3*Nl],[t,1,Cl]];function w(u){return(a(u)=0||(i[n]=t[n]);return i}(t,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(i[n]=t[n])}return i}function lf(t,e){for(var n=0;n=0}));if(o&&o.length){var a=o.map((function(t){return t.props.dataKey}));return t.reduce((function(t,e){var r=xf(e,n,0),i=O()(r)?[ho()(r),fi()(r)]:[r,r],o=a.reduce((function(t,n){var r=xf(e,n,0),o=i[0]-Math.abs(O()(r)?r[0]:r),a=i[1]+Math.abs(O()(r)?r[1]:r);return[Math.min(o,t[0]),Math.max(a,t[1])]}),[1/0,-1/0]);return[Math.min(o[0],t[0]),Math.max(o[1],t[1])]}),[1/0,-1/0])}return null},Ef=function(t,e,n,r){var i=e.map((function(e){var i=e.props.dataKey;return"number"===n&&i&&Mf(t,e,i)||wf(t,i,n,r)}));if("number"===n)return i.reduce((function(t,e){return[Math.min(t[0],e[0]),Math.max(t[1],e[1])]}),[1/0,-1/0]);var o={};return i.reduce((function(t,e){for(var n=0,r=e.length;n=0||e.indexOf("AreaChart")>=0)?{scale:Xo(),realScaleType:"point"}:"category"===i?{scale:Ho(),realScaleType:"band"}:{scale:ec(),realScaleType:"linear"};if(g()(n)){var c="scale".concat(n.slice(0,1).toUpperCase()).concat(n.slice(1));return{scale:(r[c]||Xo)(),realScaleType:r[c]?c:"point"}}return a()(n)?{scale:n}:{scale:Xo(),realScaleType:"point"}},Af=function(t){var e=t.domain();if(e&&!(e.length<=2)){var n=e.length,r=t.range(),i=Math.min(r[0],r[1])-1e-4,o=Math.max(r[0],r[1])+1e-4,a=t(e[0]),u=t(e[n-1]);(ao||uo)&&t.domain([e[0],e[n-1]])}},Nf={sign:function(t){var e=t.length;if(!(e<=0))for(var n=0,r=t[0].length;n=0?(t[a][n][0]=i,t[a][n][1]=i+u,i=t[a][n][1]):(t[a][n][0]=o,t[a][n][1]=o+u,o=t[a][n][1])}},expand:function(t,e){if((r=t.length)>0){for(var n,r,i,o=0,a=t[0].length;o0){for(var n,r=0,i=t[e[0]],o=i.length;r0&&(r=(n=t[e[0]]).length)>0){for(var n,r,i,o=0,a=1;a=2){for(var n=dr()(e,(function(t){return t.coordinate})),r=1/0,i=1,o=n.length;io&&(c=2*Math.PI-c),{radius:a,angle:Xf(c),angleInRadian:c}},Kf=function(t,e){var n=e.startAngle,r=e.endAngle,i=Math.floor(n/360),o=Math.floor(r/360);return t+360*Math.min(i,o)},$f=function(t,e){var n=t.x,r=t.y,i=Yf({x:n,y:r},e),o=i.radius,a=i.angle,u=e.innerRadius,c=e.outerRadius;if(oc)return!1;if(0===o)return!0;var s,l=function(t){var e=t.startAngle,n=t.endAngle,r=Math.floor(e/360),i=Math.floor(n/360),o=Math.min(r,i);return{startAngle:e-360*o,endAngle:n-360*o}}(e),f=l.startAngle,h=l.endAngle,p=a;if(f<=h){for(;p>h;)p-=360;for(;p=f&&p<=h}else{for(;p>f;)p-=360;for(;p=h&&p<=f}return s?Gf({},e,{radius:o,angle:Kf(p,e)}):null};function Zf(t){return function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e=0?1:-1;"insideStart"===o?(r=y+w*u,i=g):"insideEnd"===o?(r=m-w*u,i=!g):"end"===o&&(r=m+w*u,i=g),i=x<=0?i:!i;var O=Vf(s,f,b,r),_=Vf(s,f,b,r+359*(i?1:-1)),M="M".concat(O.x,",").concat(O.y,"\n A").concat(b,",").concat(b,",0,1,").concat(i?0:1,",\n ").concat(_.x,",").concat(_.y),E=v()(t.id)?I("recharts-radial-line-"):t.id;return l.a.createElement("text",Jf({},n,{dominantBaseline:"central",className:d()("recharts-radial-bar-label",c)}),l.a.createElement("defs",null,l.a.createElement("path",{id:E,d:M})),l.a.createElement("textPath",{xlinkHref:"#".concat(E)},e))},ah=function(t){var e=t.viewBox,n=t.offset,r=t.position,i=e.cx,o=e.cy,a=e.innerRadius,u=e.outerRadius,c=(e.startAngle+e.endAngle)/2;if("outside"===r){var s=Vf(i,o,u+n,c),l=s.x;return{x:l,y:s.y,textAnchor:l>=i?"start":"end",verticalAnchor:"middle"}}if("center"===r)return{x:i,y:o,textAnchor:"middle",verticalAnchor:"middle"};if("centerTop"===r)return{x:i,y:o,textAnchor:"middle",verticalAnchor:"start"};if("centerBottom"===r)return{x:i,y:o,textAnchor:"middle",verticalAnchor:"end"};var f=Vf(i,o,(a+u)/2,c);return{x:f.x,y:f.y,textAnchor:"middle",verticalAnchor:"middle"}},uh=function(t){var e=t.viewBox,n=t.offset,r=t.position,i=e.x,o=e.y,a=e.width,u=e.height,c=u>=0?1:-1;return"top"===r?{x:i+a/2,y:o-c*n,textAnchor:"middle",verticalAnchor:c>0?"end":"start"}:"bottom"===r?{x:i+a/2,y:o+u+c*n,textAnchor:"middle",verticalAnchor:"start"}:"left"===r?{x:i-n,y:o+u/2,textAnchor:"end",verticalAnchor:"middle"}:"right"===r?{x:i+a+n,y:o+u/2,textAnchor:"start",verticalAnchor:"middle"}:"insideLeft"===r?{x:i+n,y:o+u/2,textAnchor:"start",verticalAnchor:"middle"}:"insideRight"===r?{x:i+a-n,y:o+u/2,textAnchor:"end",verticalAnchor:"middle"}:"insideTop"===r?{x:i+a/2,y:o+c*n,textAnchor:"middle",verticalAnchor:"start"}:"insideBottom"===r?{x:i+a/2,y:o+u-c*n,textAnchor:"middle",verticalAnchor:"end"}:"insideTopLeft"===r?{x:i+n,y:o+c*n,textAnchor:"start",verticalAnchor:"start"}:"insideTopRight"===r?{x:i+a-n,y:o+c*n,textAnchor:"end",verticalAnchor:"start"}:"insideBottomLeft"===r?{x:i+n,y:o+u-c*n,textAnchor:"start",verticalAnchor:"end"}:"insideBottomRight"===r?{x:i+a-n,y:o+u-c*n,textAnchor:"end",verticalAnchor:"end"}:x()(r)&&(A(r.x)||P(r.x))&&(A(r.y)||P(r.y))?{x:i+D(r.x,a),y:o+D(r.y,u),textAnchor:"end",verticalAnchor:"end"}:{x:i+a/2,y:o+u/2,textAnchor:"middle",verticalAnchor:"middle"}},ch=function(t){return A(t.cx)};function sh(t){var e,n=t.viewBox,r=t.position,i=t.value,o=t.children,u=t.content,c=t.className,f=void 0===c?"":c;if(!n||v()(i)&&v()(o)&&!Object(s.isValidElement)(u)&&!a()(u))return null;if(Object(s.isValidElement)(u))return Object(s.cloneElement)(u,t);if(a()(u)){if(e=u(t),Object(s.isValidElement)(e))return e}else e=ih(t);var h=ch(n),p=$(t),y=J(t);if(h&&("insideStart"===r||"insideEnd"===r||"end"===r))return oh(t,e,p);var m=h?ah(t):uh(t);return l.a.createElement(lo,Jf({className:d()("recharts-label",f)},p,m,y),e)}sh.displayName="Label",sh.defaultProps={offset:5},sh.propTypes=rh;var lh=function(t){var e=t.cx,n=t.cy,r=t.angle,i=t.startAngle,o=t.endAngle,a=t.r,u=t.radius,c=t.innerRadius,s=t.outerRadius,l=t.x,f=t.y,h=t.top,p=t.left,d=t.width,y=t.height,v=t.clockWise;if(A(d)&&A(y)){if(A(l)&&A(f))return{x:l,y:f,width:d,height:y};if(A(h)&&A(p))return{x:h,y:p,width:d,height:y}}return A(l)&&A(f)?{x:l,y:f,width:0,height:0}:A(e)&&A(n)?{cx:e,cy:n,startAngle:i||r||0,endAngle:o||r||0,innerRadius:c||0,outerRadius:s||u||a||0,clockWise:v}:t.viewBox?t.viewBox:{}},fh=function(t,e){return t?!0===t?l.a.createElement(sh,{key:"label-implicit",viewBox:e}):N(t)?l.a.createElement(sh,{key:"label-implicit",viewBox:e,value:t}):Object(s.isValidElement)(t)?t.type===sh?Object(s.cloneElement)(t,{key:"label-implicit",viewBox:e}):l.a.createElement(sh,{key:"label-implicit",content:t,viewBox:e}):a()(t)?l.a.createElement(sh,{key:"label-implicit",content:t,viewBox:e}):x()(t)?l.a.createElement(sh,Jf({viewBox:e},t,{key:"label-implicit"})):null:null};sh.parseViewBox=lh,sh.renderCallByParent=function(t,e){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(!t||!t.children&&n&&!t.label)return null;var r=t.children,i=lh(t),o=Y(r,sh).map((function(t,n){return Object(s.cloneElement)(t,{viewBox:e||i,key:"label-".concat(n)})}));if(!n)return o;var a=fh(t.label,e||i);return[a].concat(Zf(o))};var hh=sh;function ph(t){return function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e=0||(i[n]=t[n]);return i}(t,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(i[n]=t[n])}return i}var bh={id:h.a.string,data:h.a.arrayOf(h.a.object),valueAccessor:h.a.func,clockWise:h.a.bool,dataKey:h.a.oneOfType([h.a.string,h.a.number,h.a.func])},xh={valueAccessor:function(t){return O()(t.value)?Ui()(t.value):t.value}};function wh(t){var e=t.data,n=t.valueAccessor,r=t.dataKey,i=t.clockWise,o=t.id,a=gh(t,["data","valueAccessor","dataKey","clockWise","id"]);return e&&e.length?l.a.createElement(zi,{className:"recharts-label-list"},e.map((function(t,e){var u=v()(r)?n(t,e):xf(t&&t.payload,r),c=v()(o)?{}:{id:"".concat(o,"-").concat(e)};return l.a.createElement(hh,dh({},$(t),a,c,{index:e,value:u,viewBox:hh.parseViewBox(v()(i)?t:vh({},t,{clockWise:i})),key:"label-".concat(e)}))}))):null}wh.propTypes=bh,wh.displayName="LabelList";var Oh=function(t,e){return t?!0===t?l.a.createElement(wh,{key:"labelList-implicit",data:e}):l.a.isValidElement(t)||a()(t)?l.a.createElement(wh,{key:"labelList-implicit",data:e,content:t}):x()(t)?l.a.createElement(wh,dh({data:e},t,{key:"labelList-implicit"})):null:null};wh.renderCallByParent=function(t,e){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(!t||!t.children&&n&&!t.label)return null;var r=t.children,i=Y(r,wh).map((function(t,n){return Object(s.cloneElement)(t,{data:e,key:"labelList-".concat(n)})}));if(!n)return i;var o=Oh(t.label,e);return[o].concat(ph(i))},wh.defaultProps=xh;var _h=wh;function Mh(t){return(Mh="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"===typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Eh(){return(Eh=Object.assign||function(t){for(var e=1;e0||!an()(u,r)||!an()(c,i))?this.renderAreaWithAnimation(t,e):this.renderAreaStatically(r,i,t,e)}},{key:"render",value:function(){var t=this.props,e=t.hide,n=t.dot,r=t.points,i=t.className,o=t.top,a=t.left,u=t.xAxis,c=t.yAxis,s=t.width,f=t.height,h=t.isAnimationActive,p=t.id;if(e||!r||!r.length)return null;var y=this.state.isAnimationFinished,m=1===r.length,g=d()("recharts-area",i),b=u&&u.allowDataOverflow||c&&c.allowDataOverflow,x=v()(p)?this.id:p;return l.a.createElement(zi,{className:g},b?l.a.createElement("defs",null,l.a.createElement("clipPath",{id:"clipPath-".concat(x)},l.a.createElement("rect",{x:a,y:o,width:s,height:parseInt(f,10)}))):null,m?null:this.renderArea(b,x),(n||m)&&this.renderDots(b,x),(!h||y)&&_h.renderCallByParent(this.props,r))}}])&&Th(n.prototype,r),i&&Th(n,i),e}(s.PureComponent);Ch.displayName="Area",Ch.propTypes=Sh({},W,{},G,{className:h.a.string,dataKey:h.a.oneOfType([h.a.string,h.a.number,h.a.func]).isRequired,type:h.a.oneOfType([h.a.oneOf(["basis","basisClosed","basisOpen","linear","linearClosed","natural","monotoneX","monotoneY","monotone","step","stepBefore","stepAfter"]),h.a.func]),unit:h.a.oneOfType([h.a.string,h.a.number]),name:h.a.oneOfType([h.a.string,h.a.number]),yAxisId:h.a.oneOfType([h.a.string,h.a.number]),xAxisId:h.a.oneOfType([h.a.string,h.a.number]),yAxis:h.a.object,xAxis:h.a.object,stackId:h.a.oneOfType([h.a.number,h.a.string]),legendType:h.a.oneOf(H),tooltipType:h.a.oneOf(X),connectNulls:h.a.bool,activeDot:h.a.oneOfType([h.a.object,h.a.element,h.a.func,h.a.bool]),dot:h.a.oneOfType([h.a.func,h.a.element,h.a.object,h.a.bool]),label:h.a.oneOfType([h.a.func,h.a.element,h.a.object,h.a.bool]),hide:h.a.bool,layout:h.a.oneOf(["horizontal","vertical"]),baseLine:h.a.oneOfType([h.a.number,h.a.array]),isRange:h.a.bool,points:h.a.arrayOf(h.a.shape({x:h.a.number,y:h.a.number,value:h.a.oneOfType([h.a.number,h.a.array])})),onAnimationStart:h.a.func,onAnimationEnd:h.a.func,animationId:h.a.number,isAnimationActive:h.a.bool,animationBegin:h.a.number,animationDuration:h.a.number,animationEasing:h.a.oneOf(["ease","ease-in","ease-out","ease-in-out","linear"]),id:h.a.string}),Ch.defaultProps={stroke:"#3182bd",fill:"#3182bd",fillOpacity:.6,xAxisId:0,yAxisId:0,legendType:"line",connectNulls:!1,points:[],dot:!1,activeDot:!0,hide:!1,isAnimationActive:!nt(),animationBegin:0,animationDuration:1500,animationEasing:"ease"},Ch.getBaseValue=function(t,e,n){var r=t.layout,i=t.baseValue;if(A(i))return i;var o="horizontal"===r?n:e,a=o.scale.domain();if("number"===o.type){var u=Math.max(a[0],a[1]),c=Math.min(a[0],a[1]);return"dataMin"===i?c:"dataMax"===i?u:u<0?u:Math.max(Math.min(a[0],a[1]),0)}return"dataMin"===i?a[0]:"dataMax"===i?a[1]:a[0]},Ch.getComposedData=function(t){var e,n=t.props,r=t.xAxis,i=t.yAxis,o=t.xAxisTicks,a=t.yAxisTicks,u=t.bandSize,c=t.dataKey,s=t.stackedData,l=t.dataStartIndex,f=t.displayedData,h=t.offset,p=n.layout,d=s&&s.length,y=Ch.getBaseValue(n,r,i),m=!1,g=f.map((function(t,e){var n;return d?n=s[l+e]:(n=xf(t,c),O()(n)?m=!0:n=[y,n]),"horizontal"===p?{x:Df({axis:r,ticks:o,bandSize:u,entry:t,index:e}),y:v()(n[1])?null:i.scale(n[1]),value:n,payload:t}:{x:v()(n[1])?null:r.scale(n[1]),y:Df({axis:i,ticks:a,bandSize:u,entry:t,index:e}),value:n,payload:t}}));return e=d||m?g.map((function(t){return"horizontal"===p?{x:t.x,y:v()(M()(t,"value[0]"))?null:i.scale(M()(t,"value[0]"))}:{x:v()(M()(t,"value[0]"))?null:r.scale(M()(t,"value[0]")),y:t.y}})):"horizontal"===p?i.scale(y):r.scale(y),Sh({points:g,baseLine:e,layout:p,isRange:m},h)},Ch.renderDotItem=function(t,e){return l.a.isValidElement(t)?l.a.cloneElement(t,e):a()(t)?t(e):l.a.createElement(Ii,Eh({},e,{className:"recharts-area-dot"}))};var Ih=Ch;function Dh(t){return(Dh="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"===typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Rh(t,e){for(var n=0;n180),",").concat(+(o>u),",\n ").concat(s.x,",").concat(s.y,"\n ");if(r>0){var f=Vf(e,n,r,o),h=Vf(e,n,r,u);l+="L ".concat(h.x,",").concat(h.y,"\n A ").concat(r,",").concat(r,",0,\n ").concat(+(Math.abs(a)>180),",").concat(+(o<=u),",\n ").concat(f.x,",").concat(f.y," Z")}else l+="L ".concat(e,",").concat(n," Z");return l},_p=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),gp(this,bp(e).apply(this,arguments))}var n,r,i;return function(t,e){if("function"!==typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&xp(t,e)}(e,t),n=e,(r=[{key:"render",value:function(){var t=this.props,e=t.cx,n=t.cy,r=t.innerRadius,i=t.outerRadius,o=t.cornerRadius,a=t.forceCornerRadius,u=t.cornerIsExternal,c=t.startAngle,s=t.endAngle,f=t.className;if(i0&&Math.abs(c-s)<360?function(t){var e=t.cx,n=t.cy,r=t.innerRadius,i=t.outerRadius,o=t.cornerRadius,a=t.forceCornerRadius,u=t.cornerIsExternal,c=t.startAngle,s=t.endAngle,l=T(s-c),f=wp({cx:e,cy:n,radius:i,angle:c,sign:l,cornerRadius:o,cornerIsExternal:u}),h=f.circleTangency,p=f.lineTangency,d=f.theta,y=wp({cx:e,cy:n,radius:i,angle:s,sign:-l,cornerRadius:o,cornerIsExternal:u}),v=y.circleTangency,m=y.lineTangency,g=y.theta,b=Math.abs(c-s)-d-g;if(b<0)return a?"M ".concat(p.x,",").concat(p.y,"\n a").concat(o,",").concat(o,",0,0,1,").concat(2*o,",0\n a").concat(o,",").concat(o,",0,0,1,").concat(2*-o,",0\n "):Op({cx:e,cy:n,innerRadius:r,outerRadius:i,startAngle:c,endAngle:s});var x="M ".concat(p.x,",").concat(p.y,"\n A").concat(o,",").concat(o,",0,0,").concat(+(l<0),",").concat(h.x,",").concat(h.y,"\n A").concat(i,",").concat(i,",0,").concat(+(b>180),",").concat(+(l<0),",").concat(v.x,",").concat(v.y,"\n A").concat(o,",").concat(o,",0,0,").concat(+(l<0),",").concat(m.x,",").concat(m.y,"\n ");if(r>0){var w=wp({cx:e,cy:n,radius:r,angle:c,sign:l,isExternal:!0,cornerRadius:o,cornerIsExternal:u}),O=w.circleTangency,_=w.lineTangency,M=w.theta,E=wp({cx:e,cy:n,radius:r,angle:s,sign:-l,isExternal:!0,cornerRadius:o,cornerIsExternal:u}),k=E.circleTangency,S=E.lineTangency,j=E.theta,P=Math.abs(c-s)-M-j;if(P<0)return"".concat(x,"L").concat(e,",").concat(n,"Z");x+="L".concat(S.x,",").concat(S.y,"\n A").concat(o,",").concat(o,",0,0,").concat(+(l<0),",").concat(k.x,",").concat(k.y,"\n A").concat(r,",").concat(r,",0,").concat(+(P>180),",").concat(+(l>0),",").concat(O.x,",").concat(O.y,"\n A").concat(o,",").concat(o,",0,0,").concat(+(l<0),",").concat(_.x,",").concat(_.y,"Z")}else x+="L".concat(e,",").concat(n,"Z");return x}({cx:e,cy:n,innerRadius:r,outerRadius:i,cornerRadius:Math.min(v,y/2),forceCornerRadius:a,cornerIsExternal:u,startAngle:c,endAngle:s}):Op({cx:e,cy:n,innerRadius:r,outerRadius:i,startAngle:c,endAngle:s}),l.a.createElement("path",vp({},$(this.props),J(this.props),{className:p,d:h}))}}])&&mp(n.prototype,r),i&&mp(n,i),e}(s.PureComponent);_p.displayName="Sector",_p.propTypes=function(t){for(var e=1;e=0?1:-1,c=n>=0?1:-1,s=r>=0&&n>=0||r<0&&n<0?1:0;if(a>0&&i instanceof Array){for(var l=[],f=0;f<4;f++)l[f]=i[f]>a?a:i[f];o="M".concat(t,",").concat(e+u*l[0]),l[0]>0&&(o+="A ".concat(l[0],",").concat(l[0],",0,0,").concat(s,",").concat(t+c*l[0],",").concat(e)),o+="L ".concat(t+n-c*l[1],",").concat(e),l[1]>0&&(o+="A ".concat(l[1],",").concat(l[1],",0,0,").concat(s,",\n ").concat(t+n,",").concat(e+u*l[1])),o+="L ".concat(t+n,",").concat(e+r-u*l[2]),l[2]>0&&(o+="A ".concat(l[2],",").concat(l[2],",0,0,").concat(s,",\n ").concat(t+n-c*l[2],",").concat(e+r)),o+="L ".concat(t+c*l[3],",").concat(e+r),l[3]>0&&(o+="A ".concat(l[3],",").concat(l[3],",0,0,").concat(s,",\n ").concat(t,",").concat(e+r-u*l[3])),o+="Z"}else if(a>0&&i===+i&&i>0){var h=Math.min(a,i);o="M ".concat(t,",").concat(e+u*h,"\n A ").concat(h,",").concat(h,",0,0,").concat(s,",").concat(t+c*h,",").concat(e,"\n L ").concat(t+n-c*h,",").concat(e,"\n A ").concat(h,",").concat(h,",0,0,").concat(s,",").concat(t+n,",").concat(e+u*h,"\n L ").concat(t+n,",").concat(e+r-u*h,"\n A ").concat(h,",").concat(h,",0,0,").concat(s,",").concat(t+n-c*h,",").concat(e+r,"\n L ").concat(t+c*h,",").concat(e+r,"\n A ").concat(h,",").concat(h,",0,0,").concat(s,",").concat(t,",").concat(e+r-u*h," Z")}else o="M ".concat(t,",").concat(e," h ").concat(n," v ").concat(r," h ").concat(-n," Z");return o},Ip=function(t){function e(){var t,n;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);for(var r=arguments.length,i=new Array(r),o=0;o0,from:{width:i,height:o,x:n,y:r},to:{width:i,height:o,x:n,y:r},duration:h,animationEasing:f,isActive:v},(function(e){var n=e.width,r=e.height,i=e.x,o=e.y;return l.a.createElement(hr,{canBegin:c>0,from:"0px ".concat(-1===c?1:c,"px"),to:"".concat(c,"px 0px"),attributeName:"strokeDasharray",begin:p,duration:h,isActive:y,easing:f},l.a.createElement("path",jp({},$(t.props),J(t.props),{className:m,d:Cp(i,o,n,r,a),ref:function(e){t.node=e}})))})):l.a.createElement("path",jp({},$(this.props),J(this.props),{className:m,d:Cp(n,r,i,o,a)}))}}])&&Tp(n.prototype,r),i&&Tp(n,i),e}(s.PureComponent);Ip.displayName="Rectangle",Ip.propTypes=function(t){for(var e=1;e=0||(i[n]=t[n]);return i}(t,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(i[n]=t[n])}return i}function Wp(t,e){for(var n=0;n=2?T(v[1].coordinate-v[0].coordinate):1;if(1===b?(n="width"===y?f:h,r="width"===y?f+p:h+d):(n="width"===y?f+p:h+d,r="width"===y?f:h),e){var x=i[g-1],w=a()(o)?o(x.value):x.value,O=Ji(w)[y]+m,_=b*(x.coordinate+b*O/2-r);v[g-1]=x=zp({},x,{tickCoord:_>0?x.coordinate-_*b:x.coordinate}),b*(x.tickCoord-b*O/2-n)>=0&&b*(x.tickCoord+b*O/2-r)<=0&&(r=x.tickCoord-b*(O/2+s),v[g-1]=zp({},x,{isShow:!0}))}for(var M=e?g-1:g,E=0;E=0&&b*(k.tickCoord+b*j/2-r)<=0&&(n=k.tickCoord+b*(j/2+s),v[E]=zp({},k,{isShow:!0}))}return v.filter((function(t){return t.isShow}))}},{key:"getTicksEnd",value:function(t){var e,n,r=t.ticks,i=t.tickFormatter,o=t.viewBox,u=t.orientation,c=t.minTickGap,s=t.unit,l=o.x,f=o.y,h=o.width,p=o.height,d="top"===u||"bottom"===u?"width":"height",y=s&&"width"===d?Ji(s)[d]:0,v=(r||[]).slice(),m=v.length,g=m>=2?T(v[1].coordinate-v[0].coordinate):1;1===g?(e="width"===d?l:f,n="width"===d?l+h:f+p):(e="width"===d?l+h:f+p,n="width"===d?l:f);for(var b=m-1;b>=0;b--){var x=v[b],w=a()(i)?i(x.value):x.value,O=Ji(w)[d]+y;if(b===m-1){var _=g*(x.coordinate+g*O/2-n);v[b]=x=zp({},x,{tickCoord:_>0?x.coordinate-_*g:x.coordinate})}else v[b]=x=zp({},x,{tickCoord:x.coordinate});g*(x.tickCoord-g*O/2-e)>=0&&g*(x.tickCoord+g*O/2-n)<=0&&(n=x.tickCoord-g*(O/2+c),v[b]=zp({},x,{isShow:!0}))}return v.filter((function(t){return t.isShow}))}},{key:"renderTickItem",value:function(t,e,n){return l.a.isValidElement(t)?l.a.cloneElement(t,e):a()(t)?t(e):l.a.createElement(lo,Lp({},e,{className:"recharts-cartesian-axis-tick-value"}),n)}}],(r=[{key:"shouldComponentUpdate",value:function(t,e){var n=t.viewBox,r=Up(t,["viewBox"]),i=this.props,o=i.viewBox,a=Up(i,["viewBox"]);return!z(n,o)||!z(r,a)||!z(e,this.state)}},{key:"getTickLineCoord",value:function(t){var e,n,r,i,o,a,u=this.props,c=u.x,s=u.y,l=u.width,f=u.height,h=u.orientation,p=u.tickSize,d=u.mirror,y=u.tickMargin,v=d?-1:1,m=t.tickSize||p,g=A(t.tickCoord)?t.tickCoord:t.coordinate;switch(h){case"top":e=n=t.coordinate,a=(r=(i=s+!d*f)-v*m)-v*y,o=g;break;case"left":r=i=t.coordinate,o=(e=(n=c+!d*l)-v*m)-v*y,a=g;break;case"right":r=i=t.coordinate,o=(e=(n=c+d*l)+v*m)+v*y,a=g;break;default:e=n=t.coordinate,a=(r=(i=s+d*f)+v*m)+v*y,o=g}return{line:{x1:e,y1:r,x2:n,y2:i},tick:{x:o,y:a}}}},{key:"getTickTextAnchor",value:function(){var t,e=this.props,n=e.orientation,r=e.mirror;switch(n){case"left":t=r?"start":"end";break;case"right":t=r?"end":"start";break;default:t="middle"}return t}},{key:"getTickVerticalAnchor",value:function(){var t=this.props,e=t.orientation,n=t.mirror,r="end";switch(e){case"left":case"right":r="middle";break;case"top":r=n?"start":"end";break;default:r=n?"end":"start"}return r}},{key:"renderAxisLine",value:function(){var t=this.props,e=t.x,n=t.y,r=t.width,i=t.height,o=t.orientation,a=t.axisLine,u=t.mirror,c=zp({},$(this.props),{fill:"none"},$(a));if("top"===o||"bottom"===o){var s="top"===o&&!u||"bottom"===o&&u;c=zp({},c,{x1:e,y1:n+s*i,x2:e+r,y2:n+s*i})}else{var f="left"===o&&!u||"right"===o&&u;c=zp({},c,{x1:e+f*r,y1:n,x2:e+f*r,y2:n+i})}return l.a.createElement("line",Lp({className:"recharts-cartesian-axis-line"},c))}},{key:"renderTicks",value:function(t){var n=this,r=this.props,i=r.tickLine,o=r.stroke,u=r.tick,c=r.tickFormatter,s=r.unit,f=e.getTicks(zp({},this.props,{ticks:t})),h=this.getTickTextAnchor(),p=this.getTickVerticalAnchor(),d=$(this.props),y=$(u),v=zp({},d,{fill:"none"},$(i)),m=f.map((function(t,e){var r=n.getTickLineCoord(t),m=r.line,g=r.tick,b=zp({textAnchor:h,verticalAnchor:p},d,{stroke:"none",fill:o},y,{},g,{index:e,payload:t,visibleTicksCount:f.length});return l.a.createElement(zi,Lp({className:"recharts-cartesian-axis-tick",key:"tick-".concat(e)},tt(n.props,t,e)),i&&l.a.createElement("line",Lp({className:"recharts-cartesian-axis-tick-line"},v,m)),u&&n.constructor.renderTickItem(u,b,"".concat(a()(c)?c(t.value):t.value).concat(s||"")))}));return l.a.createElement("g",{className:"recharts-cartesian-axis-ticks"},m)}},{key:"render",value:function(){var t=this.props,e=t.axisLine,n=t.width,r=t.height,i=t.ticksGenerator,o=t.className;if(t.hide)return null;var u=this.props,c=u.ticks,s=Up(u,["ticks"]),f=c;return a()(i)&&(f=c&&c.length>0?i(this.props):i(s)),n<=0||r<=0||!f||!f.length?null:l.a.createElement(zi,{className:d()("recharts-cartesian-axis",o)},e&&this.renderAxisLine(),this.renderTicks(f),hh.renderCallByParent(this.props))}}])&&Wp(n.prototype,r),i&&Wp(n,i),e}(s.Component);Xp.displayName="CartesianAxis",Xp.propTypes=zp({},W,{},G,{className:h.a.string,x:h.a.number,y:h.a.number,width:h.a.number,height:h.a.number,orientation:h.a.oneOf(["top","bottom","left","right"]),viewBox:h.a.shape({x:h.a.number,y:h.a.number,width:h.a.number,height:h.a.number}),tick:h.a.oneOfType([h.a.bool,h.a.func,h.a.object,h.a.element]),axisLine:h.a.oneOfType([h.a.bool,h.a.object]),tickLine:h.a.oneOfType([h.a.bool,h.a.object]),mirror:h.a.bool,tickMargin:h.a.number.isRequired,minTickGap:h.a.number,ticks:h.a.array,tickSize:h.a.number,stroke:h.a.string,tickFormatter:h.a.func,ticksGenerator:h.a.func,interval:h.a.oneOfType([h.a.number,h.a.oneOf(["preserveStart","preserveEnd","preserveStartEnd"])])}),Xp.defaultProps={x:0,y:0,width:0,height:0,viewBox:{x:0,y:0,width:0,height:0},orientation:"bottom",ticks:[],stroke:"#666",tickLine:!0,axisLine:!0,tick:!0,mirror:!1,minTickGap:5,tickSize:6,tickMargin:2,interval:"preserveEnd"};var Vp=Xp;function Yp(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Kp(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var $p=["Webkit","Moz","O","ms"],Zp=function(t,e){if(!t)return null;var n=t.replace(/(\w)/,(function(t){return t.toUpperCase()})),r=$p.reduce((function(t,r){return function(t){for(var e=1;e0&&n.handleDrag(t.changedTouches[0])},n.handleDragEnd=function(){n.setState({isTravellerMoving:!1,isSlideMoving:!1})},n.handleLeaveWrapper=function(){(n.state.isTravellerMoving||n.state.isSlideMoving)&&(n.leaveTimer=setTimeout(n.handleDragEnd,n.props.leaveTimeOut))},n.handleEnterSlideOrTraveller=function(){n.setState({isTextActive:!0})},n.handleLeaveSlideOrTraveller=function(){n.setState({isTextActive:!1})},n.handleSlideDragStart=function(t){var e=t.changedTouches&&t.changedTouches.length?t.changedTouches[0]:t;n.setState({isTravellerMoving:!1,isSlideMoving:!0,slideMoveStartX:e.pageX})},n.travellerDragStartHandlers={startX:n.handleTravellerDragStart.bind(rd(n),"startX"),endX:n.handleTravellerDragStart.bind(rd(n),"endX")},n.state=t.data&&t.data.length?n.updateScale(t):{},n}var n,r,i;return function(t,e){if("function"!==typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&id(t,e)}(e,t),n=e,i=[{key:"getIndexInRange",value:function(t,e){for(var n=0,r=t.length-1;r-n>1;){var i=Math.floor((n+r)/2);t[i]>e?r=i:n=i}return e>=t[r]?r:n}}],(r=[{key:"componentWillReceiveProps",value:function(t){var e=this,n=this.props,r=n.data,i=n.width,o=n.x,a=n.travellerWidth,u=n.updateId;(t.data!==r||t.updateId!==u)&&t.data&&t.data.length?this.setState(this.updateScale(t)):t.width===i&&t.x===o&&t.travellerWidth===a||(this.scale.range([t.x,t.x+t.width-t.travellerWidth]),this.scaleValues=this.scale.domain().map((function(t){return e.scale(t)})),this.setState({startX:this.scale(t.startIndex),endX:this.scale(t.endIndex)}))}},{key:"componentWillUnmount",value:function(){this.scale=null,this.scaleValues=null,this.leaveTimer&&(clearTimeout(this.leaveTimer),this.leaveTimer=null)}},{key:"getIndex",value:function(t){var e=t.startX,n=t.endX,r=this.props,i=r.gap,o=r.data.length-1,a=Math.min(e,n),u=Math.max(e,n),c=this.constructor.getIndexInRange(this.scaleValues,a),s=this.constructor.getIndexInRange(this.scaleValues,u);return{startIndex:c-c%i,endIndex:s===o?o:s-s%i}}},{key:"getTextOfTick",value:function(t){var e=this.props,n=e.data,r=e.tickFormatter,i=e.dataKey,o=xf(n[t],i,t);return a()(r)?r(o):o}},{key:"handleSlideDrag",value:function(t){var e=this.state,n=e.slideMoveStartX,r=e.startX,i=e.endX,o=this.props,a=o.x,u=o.width,c=o.travellerWidth,s=o.startIndex,l=o.endIndex,f=o.onChange,h=t.pageX-n;h>0?h=Math.min(h,a+u-c-i,a+u-c-r):h<0&&(h=Math.max(h,a-r,a-i));var p=this.getIndex({startX:r+h,endX:i+h});p.startIndex===s&&p.endIndex===l||!f||f(p),this.setState({startX:r+h,endX:i+h,slideMoveStartX:t.pageX})}},{key:"handleTravellerDragStart",value:function(t,e){var n=e.changedTouches&&e.changedTouches.length?e.changedTouches[0]:e;this.setState({isSlideMoving:!1,isTravellerMoving:!0,movingTravellerId:t,brushMoveStartX:n.pageX})}},{key:"handleTravellerMove",value:function(t){var e,n=this.state,r=n.brushMoveStartX,i=n.movingTravellerId,o=n.endX,a=n.startX,u=this.state[i],c=this.props,s=c.x,l=c.width,f=c.travellerWidth,h=c.onChange,p=c.gap,d=c.data,y={startX:this.state.startX,endX:this.state.endX},v=t.pageX-r;v>0?v=Math.min(v,s+l-f-u):v<0&&(v=Math.max(v,s-u)),y[i]=u+v;var m=this.getIndex(y),g=m.startIndex,b=m.endIndex;this.setState((td(e={},i,u+v),td(e,"brushMoveStartX",t.pageX),e),(function(){h&&function(){var t=d.length-1;return"startX"===i&&(o>a?g%p===0:b%p===0)||oa?b%p===0:g%p===0)||o>a&&b===t}()&&h(m)}))}},{key:"updateScale",value:function(t){var e=this,n=t.data,r=t.startIndex,i=t.endIndex,o=t.x,a=t.width,u=t.travellerWidth,c=n.length;return this.scale=Xo().domain(tp()(0,c)).range([o,o+a-u]),this.scaleValues=this.scale.domain().map((function(t){return e.scale(t)})),{isTextActive:!1,isSlideMoving:!1,isTravellerMoving:!1,startX:this.scale(r),endX:this.scale(i)}}},{key:"renderBackground",value:function(){var t=this.props,e=t.x,n=t.y,r=t.width,i=t.height,o=t.fill,a=t.stroke;return l.a.createElement("rect",{stroke:a,fill:o,x:e,y:n,width:r,height:i})}},{key:"renderPanorama",value:function(){var t=this.props,e=t.x,n=t.y,r=t.width,i=t.height,o=t.data,a=t.children,u=t.padding,c=s.Children.only(a);return c?l.a.cloneElement(c,{x:e,y:n,width:r,height:i,margin:u,compact:!0,data:o}):null}},{key:"renderTraveller",value:function(t,e){var n=this.props,r=n.y,i=n.travellerWidth,o=n.height,a=n.stroke,u=Math.floor(r+o/2)-1,c=Math.max(t,this.props.x);return l.a.createElement(zi,{className:"recharts-brush-traveller",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.travellerDragStartHandlers[e],onTouchStart:this.travellerDragStartHandlers[e],style:{cursor:"col-resize"}},l.a.createElement("rect",{x:c,y:r,width:i,height:o,fill:a,stroke:"none"}),l.a.createElement("line",{x1:c+1,y1:u,x2:c+i-1,y2:u,fill:"none",stroke:"#fff"}),l.a.createElement("line",{x1:c+1,y1:u+2,x2:c+i-1,y2:u+2,fill:"none",stroke:"#fff"}))}},{key:"renderSlide",value:function(t,e){var n=this.props,r=n.y,i=n.height,o=n.stroke;return l.a.createElement("rect",{className:"recharts-brush-slide",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.handleSlideDragStart,onTouchStart:this.handleSlideDragStart,style:{cursor:"move"},stroke:"none",fill:o,fillOpacity:.2,x:Math.min(t,e),y:r,width:Math.abs(e-t),height:i})}},{key:"renderText",value:function(){var t=this.props,e=t.startIndex,n=t.endIndex,r=t.y,i=t.height,o=t.travellerWidth,a=t.stroke,u=this.state,c=u.startX,s=u.endX,f={pointerEvents:"none",fill:a};return l.a.createElement(zi,{className:"recharts-brush-texts"},l.a.createElement(lo,Qp({textAnchor:"end",verticalAnchor:"middle",x:Math.min(c,s)-5,y:r+i/2},f),this.getTextOfTick(e)),l.a.createElement(lo,Qp({textAnchor:"start",verticalAnchor:"middle",x:Math.max(c,s)+o+5,y:r+i/2},f),this.getTextOfTick(n)))}},{key:"render",value:function(){var t=this.props,e=t.data,n=t.className,r=t.children,i=t.x,o=t.y,a=t.width,u=t.height,c=t.alwaysShowText,s=this.state,f=s.startX,h=s.endX,p=s.isTextActive,y=s.isSlideMoving,v=s.isTravellerMoving;if(!e||!e.length||!A(i)||!A(o)||!A(a)||!A(u)||a<=0||u<=0)return null;var m=d()("recharts-brush",n),g=1===l.a.Children.count(r),b=Zp("userSelect","none");return l.a.createElement(zi,{className:m,onMouseMove:this.handleDrag,onMouseLeave:this.handleLeaveWrapper,onMouseUp:this.handleDragEnd,onTouchEnd:this.handleDragEnd,onTouchMove:this.handleTouchMove,style:b},this.renderBackground(),g&&this.renderPanorama(),this.renderSlide(f,h),this.renderTraveller(f,"startX"),this.renderTraveller(h,"endX"),(p||y||v||c)&&this.renderText())}}])&&ed(n.prototype,r),i&&ed(n,i),e}(s.PureComponent);od.displayName="Brush",od.propTypes={className:h.a.string,fill:h.a.string,stroke:h.a.string,x:h.a.number,y:h.a.number,width:h.a.number,height:h.a.number.isRequired,travellerWidth:h.a.number,gap:h.a.number,padding:h.a.shape({top:h.a.number,right:h.a.number,bottom:h.a.number,left:h.a.number}),dataKey:h.a.oneOfType([h.a.string,h.a.number,h.a.func]),data:h.a.array,startIndex:h.a.number,endIndex:h.a.number,tickFormatter:h.a.func,children:h.a.node,onChange:h.a.func,updateId:h.a.oneOfType([h.a.string,h.a.number]),leaveTimeOut:h.a.number,alwaysShowText:h.a.bool},od.defaultProps={height:40,travellerWidth:5,gap:1,fill:"#fff",stroke:"#666",padding:{top:1,right:1,bottom:1,left:1},leaveTimeOut:1e3,alwaysShowText:!1};var ad=od,ud=function(t,e){var n=t.alwaysShow,r=t.ifOverflow;return n&&(r="extendDomain"),r===e},cd=n(911),sd=n.n(cd);function ld(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function fd(t,e){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:{},n=e.bandAware,r=e.position;if(void 0!==t){if(r)switch(r){case"start":return this.scale(t);case"middle":var i=this.bandwidth?this.bandwidth()/2:0;return this.scale(t)+i;case"end":var o=this.bandwidth?this.bandwidth():0;return this.scale(t)+o;default:return this.scale(t)}if(n){var a=this.bandwidth?this.bandwidth()/2:0;return this.scale(t)+a}return this.scale(t)}}},{key:"isInRange",value:function(t){var e=this.range(),n=e[0],r=e[e.length-1];return n<=r?t>=n&&t<=r:t>=r&&t<=n}},{key:"domain",get:function(){return this.scale.domain}},{key:"range",get:function(){return this.scale.range}},{key:"rangeMin",get:function(){return this.range()[0]}},{key:"rangeMax",get:function(){return this.range()[1]}},{key:"bandwidth",get:function(){return this.scale.bandwidth}}]),t}();md.EPS=1e-4;var gd=function(){function t(e){ld(this,t),this.scales=sd()(e,md.create),Object.assign(this,this.scales)}return hd(t,null,[{key:"create",value:function(t){return new this(t)}}]),hd(t,[{key:"apply",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.bandAware,r=this.scales;return sd()(t,(function(t,e){return r[e].apply(t,{bandAware:n})}))}},{key:"isInRange",value:function(t){var e=this.scales;return $h()(t,(function(t,n){return e[n].isInRange(t)}))}}]),t}();function bd(t){return(bd="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"===typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function xd(){return(xd=Object.assign||function(t){for(var e=1;e=0||(i[n]=t[n]);return i}(t,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(i[n]=t[n])}return i}function uy(){return(uy=Object.assign||function(t){for(var e=1;e0&&n.handleMouseMove(t.changedTouches[0])},n.handleTouchStart=function(t){null!=t.changedTouches&&t.changedTouches.length>0&&n.handleMouseDown(t.changedTouches[0])},n.handleTouchEnd=function(t){null!=t.changedTouches&&t.changedTouches.length>0&&n.handleMouseUp(t.changedTouches[0])},n.verticalCoordinatesGenerator=function(t){var e=t.xAxis,n=t.width,r=t.height,i=t.offset;return Sf(Vp.getTicks(ly({},Vp.defaultProps,{},e,{ticks:jf(e,!0),viewBox:{x:0,y:0,width:n,height:r}})),i.left,i.left+i.width)},n.horizontalCoordinatesGenerator=function(t){var e=t.yAxis,n=t.width,r=t.height,i=t.offset;return Sf(Vp.getTicks(ly({},Vp.defaultProps,{},e,{ticks:jf(e,!0),viewBox:{x:0,y:0,width:n,height:r}})),i.top,i.top+i.height)},n.axesTicksGenerator=function(t){return jf(t,!0)},n.tooltipTicksGenerator=function(t){var e=R(t),n=jf(e,!1,!0);return{tooltipTicks:n,orderedTooltipTicks:dr()(n,(function(t){return t.coordinate})),tooltipAxis:e,tooltipAxisBandSize:Ff(e)}},n.renderCursor=function(t){var r=n.state,i=r.isTooltipActive,o=r.activeCoordinate,a=r.activePayload,u=r.offset;if(!t||!t.props.cursor||!i||!o)return null;var c,l=n.props.layout,f=ki;if("ScatterChart"===e)c=o,f=hp;else if("BarChart"===e)c=n.getCursorRectangle(),f=Dp;else if("radial"===l){var h=n.getCursorPoints(),p=h.cx,d=h.cy,y=h.radius;c={cx:p,cy:d,startAngle:h.startAngle,endAngle:h.endAngle,innerRadius:y,outerRadius:y},f=Mp}else c={points:n.getCursorPoints()},f=ki;var v=t.key||"_recharts-cursor",m=ly({stroke:"#ccc",pointerEvents:"none"},u,{},c,{},$(t.props.cursor),{payload:a,key:v,className:"recharts-tooltip-cursor"});return Object(s.isValidElement)(t.props.cursor)?Object(s.cloneElement)(t.props.cursor,m):Object(s.createElement)(f,m)},n.renderPolarAxis=function(t,e,r){var i=t.type.axisType,o=n.state["".concat(i,"Map")][t.props["".concat(i,"Id")]];return Object(s.cloneElement)(t,ly({},o,{className:i,key:t.key||"".concat(e,"-").concat(r),ticks:jf(o,!0)}))},n.renderXAxis=function(t,e,r){var i=n.state.xAxisMap[t.props.xAxisId];return n.renderAxis(i,t,e,r)},n.renderYAxis=function(t,e,r){var i=n.state.yAxisMap[t.props.yAxisId];return n.renderAxis(i,t,e,r)},n.renderGrid=function(t){var e=n.state,r=e.xAxisMap,i=e.yAxisMap,o=e.offset,a=n.props,u=a.width,c=a.height,l=R(r),f=Jh()(i,(function(t){return $h()(t.domain,Number.isFinite)}))||R(i),h=t.props||{};return Object(s.cloneElement)(t,{key:t.key||"grid",x:A(h.x)?h.x:o.left,y:A(h.y)?h.y:o.top,width:A(h.width)?h.width:o.width,height:A(h.height)?h.height:o.height,xAxis:l,yAxis:f,offset:o,chartWidth:u,chartHeight:c,verticalCoordinatesGenerator:h.verticalCoordinatesGenerator||n.verticalCoordinatesGenerator,horizontalCoordinatesGenerator:h.horizontalCoordinatesGenerator||n.horizontalCoordinatesGenerator})},n.renderPolarGrid=function(t){var e=n.state,r=e.radiusAxisMap,i=e.angleAxisMap,o=R(r),a=R(i),u=a.cx,c=a.cy,l=a.innerRadius,f=a.outerRadius;return Object(s.cloneElement)(t,{polarAngles:jf(a,!0).map((function(t){return t.coordinate})),polarRadius:jf(o,!0).map((function(t){return t.coordinate})),cx:u,cy:c,innerRadius:l,outerRadius:f,key:t.key||"polar-grid"})},n.renderBrush=function(t){var e=n.props,r=e.margin,i=e.data,o=n.state,a=o.offset,u=o.dataStartIndex,c=o.dataEndIndex,l=o.updateId;return Object(s.cloneElement)(t,{key:t.key||"_recharts-brush",onChange:Tf(n.handleBrushChange,null,t.props.onChange),data:i,x:A(t.props.x)?t.props.x:a.left,y:A(t.props.y)?t.props.y:a.top+a.height+a.brushBottom-(r.bottom||0),width:A(t.props.width)?t.props.width:a.width,startIndex:u,endIndex:c,updateId:"brush-".concat(l)})},n.renderReferenceElement=function(t,e,r){if(!t)return null;var i=dy(n).clipPathId,o=n.state,a=o.xAxisMap,u=o.yAxisMap,c=o.offset,l=t.props,f=l.xAxisId,h=l.yAxisId;return Object(s.cloneElement)(t,{key:t.key||"".concat(e,"-").concat(r),xAxis:a[f],yAxis:u[h],viewBox:{x:c.left,y:c.top,width:c.width,height:c.height},clipPathId:i})},n.renderGraphicChild=function(t,e,r){var i=n.filterFormatItem(t,e,r);if(!i)return null;var o=Object(s.cloneElement)(t,i.props),a=n.state,u=a.isTooltipActive,c=a.tooltipAxis,l=a.activeTooltipIndex,f=a.activeLabel,h=n.props.children,p=K(h,Fr),d=i.props,y=d.points,m=d.isRange,g=d.baseLine,b=i.item.props,x=b.activeDot;if(!b.hide&&u&&p&&x&&l>=0){var w,O;if(c.dataKey&&!c.allowDuplicatedCategory){var _="function"===typeof c.dataKey?function(t){return c.dataKey(t.payload)}:"payload.".concat(c.dataKey);w=B(y,_,f),O=m&&g&&B(g,_,f)}else w=y[l],O=m&&g&&g[l];if(!v()(w))return[o].concat(cy(n.renderActivePoints({item:i,activePoint:w,basePoint:O,childIndex:l,isRange:m})))}return m?[o,null,null]:[o,null]},n.renderCustomized=function(t){return Object(s.cloneElement)(t,ly({},n.props,{},n.state))};var i=n.constructor.createDefaultState(t);return n.state=ly({},i,{updateId:0},n.updateStateOfAxisMapsOffsetAndStackGroups(ly({props:t},i,{updateId:0}))),n.uniqueChartId=v()(t.id)?I("recharts"):t.id,n.clipPathId="".concat(n.uniqueChartId,"-clip"),t.throttleDelay&&(n.triggeredAfterMouseMove=np()(n.triggeredAfterMouseMove,t.throttleDelay)),n}var f,h,p;return function(t,e){if("function"!==typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&yy(t,e)}(r,t),f=r,p=[{key:"getAxisNameByLayout",value:function(t){return"horizontal"===t?{numericAxisName:"yAxis",cateAxisName:"xAxis"}:"vertical"===t?{numericAxisName:"xAxis",cateAxisName:"yAxis"}:"centric"===t?{numericAxisName:"radiusAxis",cateAxisName:"angleAxis"}:{numericAxisName:"angleAxis",cateAxisName:"radiusAxis"}}},{key:"renderActiveDot",value:function(t,e){var n;return n=Object(s.isValidElement)(t)?Object(s.cloneElement)(t,e):a()(t)?t(e):l.a.createElement(Ii,e),l.a.createElement(zi,{className:"recharts-active-dot",key:e.key},n)}}],(h=[{key:"componentDidMount",value:function(){v()(this.props.syncId)||this.addListener()}},{key:"componentWillReceiveProps",value:function(t){var e=this,n=this.props,r=n.data,i=n.children,o=n.width,a=n.height,u=n.layout,c=n.stackOffset,s=n.margin,l=this.state.updateId;if(t.data===r&&t.width===o&&t.height===a&&t.layout===u&&t.stackOffset===c&&z(t.margin,s)){if(!ot(t.children,i)){var f=v()(t.data)?l+1:l;this.setState((function(n){return ly({updateId:f},e.updateStateOfAxisMapsOffsetAndStackGroups(ly({props:t},n,{updateId:f})))}))}}else{var h=this.constructor.createDefaultState(t);this.setState(ly({},h,{updateId:l+1},this.updateStateOfAxisMapsOffsetAndStackGroups(ly({props:t},h,{updateId:l+1}))))}v()(this.props.syncId)&&!v()(t.syncId)&&this.addListener(),!v()(this.props.syncId)&&v()(t.syncId)&&this.removeListener()}},{key:"componentWillUnmount",value:function(){v()(this.props.syncId)||this.removeListener(),"function"===typeof this.triggeredAfterMouseMove.cancel&&this.triggeredAfterMouseMove.cancel()}},{key:"getAxisMap",value:function(t,e){var n=e.axisType,r=void 0===n?"xAxis":n,i=e.AxisComp,o=e.graphicalItems,a=e.stackGroups,u=e.dataStartIndex,c=e.dataEndIndex,s=t.children,l="".concat(r,"Id"),f=Y(s,i),h={};return f&&f.length?h=this.getAxisMapByAxes(t,{axes:f,graphicalItems:o,axisType:r,axisIdKey:l,stackGroups:a,dataStartIndex:u,dataEndIndex:c}):o&&o.length&&(h=this.getAxisMapByItems(t,{Axis:i,graphicalItems:o,axisType:r,axisIdKey:l,stackGroups:a,dataStartIndex:u,dataEndIndex:c})),h}},{key:"getAxisMapByAxes",value:function(t,e){var n=this,r=e.axes,i=e.graphicalItems,o=e.axisType,a=e.axisIdKey,u=e.stackGroups,c=e.dataStartIndex,s=e.dataEndIndex,l=t.layout,f=t.children,h=t.stackOffset,p=kf(l,o);return r.reduce((function(e,r){var d=r.props,y=d.type,m=d.dataKey,g=d.allowDataOverflow,b=d.allowDuplicatedCategory,x=d.scale,w=d.ticks,_=r.props[a],M=n.constructor.getDisplayedData(t,{graphicalItems:i.filter((function(t){return t.props[a]===_})),dataStartIndex:c,dataEndIndex:s}),E=M.length;if(!e[_]){var k,S,j;if(m){if(k=wf(M,m,y),"category"===y&&p){var T=function(t){if(!O()(t))return!1;for(var e=t.length,n={},r=0;r=0?t:[].concat(cy(t),[e])}),[]))}else if("category"===y)k=b?k.filter((function(t){return""!==t&&!v()(t)})):Uf(r.props.domain,k,r).reduce((function(t,e){return t.indexOf(e)>=0||""===e||v()(e)?t:[].concat(cy(t),[e])}),[]);else if("number"===y){var P=function(t,e,n,r){var i=e.map((function(e){return Mf(t,e,n,r)})).filter((function(t){return!v()(t)}));return i&&i.length?i.reduce((function(t,e){return[Math.min(t[0],e[0]),Math.max(t[1],e[1])]}),[1/0,-1/0]):null}(M,i.filter((function(t){return t.props[a]===_&&!t.props.hide})),m,o);P&&(k=P)}!p||"number"!==y&&"auto"===x||(j=wf(M,m,"category"))}else k=p?tp()(0,E):u&&u[_]&&u[_].hasStack&&"number"===y?"expand"===h?[0,1]:Rf(u[_].stackGroups,c,s):Ef(M,i.filter((function(t){return t.props[a]===_&&!t.props.hide})),y,!0);return"number"===y&&(k=ey(f,k,_,o,w),r.props.domain&&(k=zf(r.props.domain,k,g))),ly({},e,fy({},_,ly({},r.props,{axisType:o,domain:k,categoricalDomain:j,duplicateDomain:S,originalDomain:r.props.domain,isCategorial:p,layout:l})))}return e}),{})}},{key:"getAxisMapByItems",value:function(t,e){var n=e.graphicalItems,r=e.Axis,i=e.axisType,o=e.axisIdKey,a=e.stackGroups,u=e.dataStartIndex,c=e.dataEndIndex,s=t.layout,l=t.children,f=this.constructor.getDisplayedData(t,{graphicalItems:n,dataStartIndex:u,dataEndIndex:c}),h=f.length,p=kf(s,i),d=-1;return n.reduce((function(t,e){var y,v=e.props[o];return t[v]?t:(d++,p?y=tp()(0,h):a&&a[v]&&a[v].hasStack?(y=Rf(a[v].stackGroups,u,c),y=ey(l,y,v,i)):(y=zf(r.defaultProps.domain,Ef(f,n.filter((function(t){return t.props[o]===v&&!t.props.hide})),"number"),r.defaultProps.allowDataOverflow),y=ey(l,y,v,i)),ly({},t,fy({},v,ly({axisType:i},r.defaultProps,{hide:!0,orientation:vy[i]&&vy[i][d%2],domain:y,originalDomain:r.defaultProps.domain,isCategorial:p,layout:s}))))}),{})}},{key:"getActiveCoordinate",value:function(t,e,n){var r=this.props.layout,i=t.find((function(t){return t&&t.index===e}));if(i){if("horizontal"===r)return{x:i.coordinate,y:n.y};if("vertical"===r)return{x:n.x,y:i.coordinate};if("centric"===r){var o=i.coordinate,a=n.radius;return ly({},n,{},Vf(n.cx,n.cy,a,o),{angle:o,radius:a})}var u=i.coordinate,c=n.angle;return ly({},n,{},Vf(n.cx,n.cy,u,c),{angle:c,radius:u})}return my}},{key:"getMouseInfo",value:function(t){if(!this.container)return null;var e=function(t,e){return{chartX:Math.round(t.pageX-e.left),chartY:Math.round(t.pageY-e.top)}}(t,function(t){var e=t.ownerDocument.documentElement,n={top:0,left:0};return"undefined"!==typeof t.getBoundingClientRect&&(n=t.getBoundingClientRect()),{top:n.top+window.pageYOffset-e.clientTop,left:n.left+window.pageXOffset-e.clientLeft}}(this.container)),n=this.inRange(e.chartX,e.chartY);if(!n)return null;var r=this.state,o=r.xAxisMap,a=r.yAxisMap;if("axis"!==i&&o&&a){var u=R(o).scale,c=R(a).scale;return ly({},e,{xValue:u&&u.invert?u.invert(e.chartX):null,yValue:c&&c.invert?c.invert(e.chartY):null})}var s=this.state,l=s.orderedTooltipTicks,f=s.tooltipAxis,h=s.tooltipTicks,p=function(t,e,n,r){var i=-1,o=e.length;if(o>1){if(r&&"angleAxis"===r.axisType&&Math.abs(Math.abs(r.range[1]-r.range[0])-360)<=1e-6)for(var a=r.range,u=0;u0?n[u-1].coordinate:n[o-1].coordinate,s=n[u].coordinate,l=u>=o-1?n[0].coordinate:n[u+1].coordinate,f=void 0;if(T(s-c)!==T(l-s)){var h=[];if(T(l-s)===T(a[1]-a[0])){f=l;var p=s+a[1]-a[0];h[0]=Math.min(p,(p+c)/2),h[1]=Math.max(p,(p+c)/2)}else{f=c;var d=l+a[1]-a[0];h[0]=Math.min(s,(d+s)/2),h[1]=Math.max(s,(d+s)/2)}var y=[Math.min(s,(f+s)/2),Math.max(s,(f+s)/2)];if(t>y[0]&&t<=y[1]||t>=h[0]&&t<=h[1]){i=n[u].index;break}}else{var v=Math.min(c,l),m=Math.max(c,l);if(t>(v+s)/2&&t<=(m+s)/2){i=n[u].index;break}}}else for(var g=0;g0&&g(e[g].coordinate+e[g-1].coordinate)/2&&t<=(e[g].coordinate+e[g+1].coordinate)/2||g===o-1&&t>(e[g].coordinate+e[g-1].coordinate)/2){i=e[g].index;break}}else i=0;return i}(this.calculateTooltipPos(n),l,h,f);if(p>=0&&h){var d=h[p]&&h[p].value;return ly({},e,{activeTooltipIndex:p,activeLabel:d,activePayload:this.getTooltipContent(p,d),activeCoordinate:this.getActiveCoordinate(l,p,n)})}return null}},{key:"getTooltipContent",value:function(t,e){var n=this.state,r=n.graphicalItems,i=n.tooltipAxis,o=this.constructor.getDisplayedData(this.props,this.state);return t<0||!r||!r.length||t>=o.length?null:r.reduce((function(n,r){if(r.props.hide)return n;var a,u=r.props,c=u.dataKey,s=u.name,l=u.unit,f=u.formatter,h=u.data,p=u.tooltipType;return(a=i.dataKey&&!i.allowDuplicatedCategory?B(h||o,i.dataKey,e):h&&h[t]||o[t])?[].concat(cy(n),[ly({},$(r),{dataKey:c,unit:l,formatter:f,name:s||c,color:Of(r),value:xf(a,c),type:p,payload:a})]):n}),[])}},{key:"getFormatItems",value:function(t,e){var n=this,r=e.graphicalItems,i=e.stackGroups,a=e.offset,u=e.updateId,c=e.dataStartIndex,s=e.dataEndIndex,l=t.barSize,f=t.layout,h=t.barGap,p=t.barCategoryGap,d=t.maxBarSize,y=this.constructor.getAxisNameByLayout(f),m=y.numericAxisName,g=y.cateAxisName,b=this.constructor.hasBar(r),x=b&&function(t){var e=t.barSize,n=t.stackGroups,r=void 0===n?{}:n;if(!r)return{};for(var i={},o=Object.keys(r),a=0,u=o.length;a=0}));if(y&&y.length){var m=y[0].props.barSize,g=y[0].props[d];i[g]||(i[g]=[]),i[g].push({item:y[0],stackList:y.slice(1),barSize:v()(m)?e:m})}}return i}({barSize:l,stackGroups:i}),w=[];return r.forEach((function(r,l){var y,O=n.constructor.getDisplayedData(t,{dataStartIndex:c,dataEndIndex:s},r),_=r.props,M=_.dataKey,E=_.maxBarSize,k=r.props["".concat(m,"Id")],S=r.props["".concat(g,"Id")],j=o.reduce((function(t,n){var i,o=e["".concat(n.axisType,"Map")],a=r.props["".concat(n.axisType,"Id")],u=o&&o[a];return ly({},t,(fy(i={},n.axisType,u),fy(i,"".concat(n.axisType,"Ticks"),jf(u)),i))}),{}),T=j[g],P=j["".concat(g,"Ticks")],A=i&&i[k]&&i[k].hasStack&&function(t,e){var n=t.props.stackId;if(N(n)){var r=e[n];if(r&&r.items.length){for(var i=-1,o=0,a=r.items.length;o=0?r.stackedData[i]:null}}return null}(r,i[k].stackGroups),C=Ff(T,P),I=v()(E)?d:E,R=b&&function(t){var e=t.barGap,n=t.barCategoryGap,r=t.bandSize,i=t.sizeList,o=void 0===i?[]:i,a=t.maxBarSize,u=o.length;if(u<1)return null;var c,s=D(e,r,0,!0);if(o[0].barSize===+o[0].barSize){var l=!1,f=r/u,h=o.reduce((function(t,e){return t+e.barSize||0}),0);(h+=(u-1)*s)>=r&&(h-=(u-1)*s,s=0),h>=r&&f>0&&(l=!0,h=u*(f*=.9));var p={offset:((r-h)/2>>0)-s,size:0};c=o.reduce((function(t,e){var n=[].concat(vf(t),[{item:e.item,position:{offset:p.offset+p.size+s,size:l?f:e.barSize}}]);return p=n[n.length-1].position,e.stackList&&e.stackList.length&&e.stackList.forEach((function(t){n.push({item:t,position:p})})),n}),[])}else{var d=D(n,r,0,!0);r-2*d-(u-1)*s<=0&&(s=0);var y=(r-2*d-(u-1)*s)/u;y>1&&(y>>=0);var v=a===+a?Math.min(y,a):y;c=o.reduce((function(t,e,n){var r=[].concat(vf(t),[{item:e.item,position:{offset:d+(y+s)*n+(y-v)/2,size:v}}]);return e.stackList&&e.stackList.length&&e.stackList.forEach((function(t){r.push({item:t,position:r[r.length-1].position})})),r}),[])}return c}({barGap:h,barCategoryGap:p,bandSize:C,sizeList:x[S],maxBarSize:I}),L=r&&r.type&&r.type.getComposedData;L&&w.push({props:ly({},L(ly({},j,{displayedData:O,props:t,dataKey:M,item:r,bandSize:C,barPosition:R,offset:a,stackedData:A,layout:f,dataStartIndex:c,dataEndIndex:s,onItemMouseLeave:Tf(n.handleItemMouseLeave,null,r.props.onMouseLeave),onItemMouseEnter:Tf(n.handleItemMouseEnter,null,r.props.onMouseEnter)})),(y={key:r.key||"item-".concat(l)},fy(y,m,j[m]),fy(y,g,j[g]),fy(y,"animationId",u),y)),childIndex:ct(r,t.children),item:r})})),w}},{key:"getCursorRectangle",value:function(){var t=this.props.layout,e=this.state,n=e.activeCoordinate,r=e.offset,i=e.tooltipAxisBandSize,o=i/2;return{stroke:"none",fill:"#ccc",x:"horizontal"===t?n.x-o:r.left+.5,y:"horizontal"===t?r.top+.5:n.y-o,width:"horizontal"===t?i:r.width-1,height:"horizontal"===t?r.height-1:i}}},{key:"getCursorPoints",value:function(){var t,e,n,r,i=this.props.layout,o=this.state,a=o.activeCoordinate,u=o.offset;if("horizontal"===i)n=t=a.x,e=u.top,r=u.top+u.height;else if("vertical"===i)r=e=a.y,t=u.left,n=u.left+u.width;else if(!v()(a.cx)||!v()(a.cy)){if("centric"!==i){var c=a.cx,s=a.cy,l=a.radius,f=a.startAngle,h=a.endAngle;return{points:[Vf(c,s,l,f),Vf(c,s,l,h)],cx:c,cy:s,radius:l,startAngle:f,endAngle:h}}var p=a.cx,d=a.cy,y=a.innerRadius,m=a.outerRadius,g=a.angle,b=Vf(p,d,y,g),x=Vf(p,d,m,g);t=b.x,e=b.y,n=x.x,r=x.y}return[{x:t,y:e},{x:n,y:r}]}},{key:"calculateTooltipPos",value:function(t){var e=this.props.layout;return"horizontal"===e?t.x:"vertical"===e?t.y:"centric"===e?t.angle:t.radius}},{key:"inRange",value:function(t,e){var n=this.props.layout;if("horizontal"===n||"vertical"===n){var r=this.state.offset;return t>=r.left&&t<=r.left+r.width&&e>=r.top&&e<=r.top+r.height?{x:t,y:e}:null}var i=this.state,o=i.angleAxisMap,a=i.radiusAxisMap;if(o&&a){var u=R(o);return $f({x:t,y:e},u)}return null}},{key:"parseEventsOfWrapper",value:function(){var t=this.props.children,e=K(t,Fr)&&"axis"===i?{onMouseEnter:this.handleMouseEnter,onMouseMove:this.handleMouseMove,onMouseLeave:this.handleMouseLeave,onTouchMove:this.handleTouchMove,onTouchStart:this.handleTouchStart,onTouchEnd:this.handleTouchEnd}:{};return ly({},J(this.props,this.handleOuterEvent),{},e)}},{key:"updateStateOfAxisMapsOffsetAndStackGroups",value:function(t){var r=this,i=t.props,a=t.dataStartIndex,u=t.dataEndIndex,s=t.updateId;if(!et({props:i}))return null;var l=i.children,f=i.layout,h=i.stackOffset,p=i.data,d=i.reverseStackOrder,y=this.constructor.getAxisNameByLayout(f),v=y.numericAxisName,m=y.cateAxisName,g=Y(l,n),b=function(t,e,n,r,i,o){if(!t)return null;var a=(o?e.reverse():e).reduce((function(t,e){var i=e.props,o=i.stackId;if(i.hide)return t;var a=e.props[n],u=t[a]||{hasStack:!1,stackGroups:{}};if(N(o)){var c=u.stackGroups[o]||{numericAxisId:n,cateAxisId:r,items:[]};c.items.push(e),u.hasStack=!0,u.stackGroups[o]=c}else u.stackGroups[I("_stackId_")]={numericAxisId:n,cateAxisId:r,items:[e]};return gf({},t,bf({},a,u))}),{});return Object.keys(a).reduce((function(e,o){var u=a[o];return u.hasStack&&(u.stackGroups=Object.keys(u.stackGroups).reduce((function(e,o){var a=u.stackGroups[o];return gf({},e,bf({},o,{numericAxisId:n,cateAxisId:r,items:a.items,stackedData:Cf(t,a.items,i)}))}),{})),gf({},e,bf({},o,u))}),{})}(p,g,"".concat(v,"Id"),"".concat(m,"Id"),h,d),x=o.reduce((function(t,e){return ly({},t,fy({},"".concat(e.axisType,"Map"),r.getAxisMap(i,ly({},e,{graphicalItems:g,stackGroups:e.axisType===v&&b,dataStartIndex:a,dataEndIndex:u}))))}),{}),w=this.calculateOffset(ly({},x,{props:i,graphicalItems:g}));Object.keys(x).forEach((function(t){x[t]=c(i,x[t],w,t.replace("Map",""),e)}));var O=x["".concat(m,"Map")],_=this.tooltipTicksGenerator(O),M=this.getFormatItems(i,ly({},x,{dataStartIndex:a,dataEndIndex:u,updateId:s,graphicalItems:g,stackGroups:b,offset:w}));return ly({formatedGraphicalItems:M,graphicalItems:g,offset:w,stackGroups:b},_,{},x)}},{key:"addListener",value:function(){ry.on(iy,this.handleReceiveSyncEvent),ry.setMaxListeners&&ry._maxListeners&&ry.setMaxListeners(ry._maxListeners+1)}},{key:"removeListener",value:function(){ry.removeListener(iy,this.handleReceiveSyncEvent),ry.setMaxListeners&&ry._maxListeners&&ry.setMaxListeners(ry._maxListeners-1)}},{key:"calculateOffset",value:function(t){var e=t.props,n=t.graphicalItems,r=t.xAxisMap,i=void 0===r?{}:r,o=t.yAxisMap,a=void 0===o?{}:o,u=e.width,c=e.height,s=e.children,l=e.margin||{},f=K(s,ad),h=K(s,rn),p=Object.keys(a).reduce((function(t,e){var n=a[e],r=n.orientation;return n.mirror||n.hide?t:ly({},t,fy({},r,t[r]+n.width))}),{left:l.left||0,right:l.right||0}),d=Object.keys(i).reduce((function(t,e){var n=i[e],r=n.orientation;return n.mirror||n.hide?t:ly({},t,fy({},r,t[r]+n.height))}),{top:l.top||0,bottom:l.bottom||0}),y=ly({},d,{},p),v=y.bottom;return f&&(y.bottom+=f.props.height||ad.defaultProps.height),h&&this.legendInstance&&(y=function(t,e,n,r){var i=n.children,o=n.width,a=n.height,u=n.margin,c=o-(u.left||0)-(u.right||0),s=a-(u.top||0)-(u.bottom||0),l=_f({children:i,items:e,legendWidth:c,legendHeight:s}),f=t;if(l){var h=r||{},p=l.align,d=l.verticalAlign,y=l.layout;("vertical"===y||"horizontal"===y&&"center"===d)&&A(t[p])&&(f=gf({},t,bf({},p,f[p]+(h.width||0)))),("horizontal"===y||"vertical"===y&&"center"===p)&&A(t[d])&&(f=gf({},t,bf({},d,f[d]+(h.height||0))))}return f}(y,n,e,this.legendInstance.getBBox())),ly({brushBottom:v},y,{width:u-y.left-y.right,height:c-y.top-y.bottom})}},{key:"triggerSyncEvent",value:function(t){var e=this.props.syncId;v()(e)||ry.emit(iy,e,this.uniqueChartId,t)}},{key:"filterFormatItem",value:function(t,e,n){for(var r=this.state.formatedGraphicalItems,i=0,o=r.length;i=0}))},y.getDisplayedData=function(t,e,n){var r=e.graphicalItems,i=e.dataStartIndex,o=e.dataEndIndex,a=(r||[]).reduce((function(t,e){var n=e.props.data;return n&&n.length?[].concat(cy(t),cy(n)):t}),[]);if(a&&a.length>0)return a;if(n&&n.props&&n.props.data&&n.props.data.length>0)return n.props.data;var u=t.data;return u&&u.length&&A(i)&&A(o)?u.slice(i,o+1):[]},y}({chartName:"AreaChart",GraphicalChild:Ih,axisComponents:[{axisType:"xAxis",AxisComp:Uh},{axisType:"yAxis",AxisComp:Yh}],formatAxisMap:function(t,e,n,r,i){var o=t.width,a=t.height,u=t.layout,c=Object.keys(e),s={left:n.left,leftMirror:n.left,right:o-n.right,rightMirror:o-n.right,top:n.top,topMirror:n.top,bottom:a-n.bottom,bottomMirror:a-n.bottom};return c.reduce((function(t,o){var a,c,l,f,h=e[o],p=h.orientation,d=h.domain,y=h.padding,v=void 0===y?{}:y,m=h.mirror,g=h.reversed,b="".concat(p).concat(m?"Mirror":"");a="xAxis"===r?[n.left+(v.left||0),n.left+n.width-(v.right||0)]:"yAxis"===r?"horizontal"===u?[n.top+n.height-(v.bottom||0),n.top+(v.top||0)]:[n.top+(v.top||0),n.top+n.height-(v.bottom||0)]:h.range,g&&(a=[a[1],a[0]]);var x=Pf(h,i),w=x.scale,O=x.realScaleType;w.domain(d).range(a),Af(w);var _=If(w,dd({},h,{realScaleType:O}));"xAxis"===r?(f="top"===p&&!m||"bottom"===p&&m,c=n.left,l=s[b]-f*h.height):"yAxis"===r&&(f="left"===p&&!m||"right"===p&&m,c=s[b]-f*h.width,l=n.top);var M=dd({},h,{},_,{realScaleType:O,x:c,y:l,scale:w,width:"xAxis"===r?n.width:h.width,height:"yAxis"===r?n.height:h.height});return M.bandSize=Ff(M,_),h.hide||"xAxis"!==r?h.hide||(s[b]+=(f?-1:1)*M.width):s[b]+=(f?-1:1)*M.height,dd({},t,yd({},o,M))}),{})}});n.d(e,"d",(function(){return rn})),n.d(e,"f",(function(){return Fr})),n.d(e,"e",(function(){return Zr})),n.d(e,"c",(function(){return si})),n.d(e,"a",(function(){return Ih})),n.d(e,"g",(function(){return Uh})),n.d(e,"h",(function(){return Yh})),n.d(e,"b",(function(){return gy}))},806:function(t,e,n){n(807),n(811),n(812),n(813),n(814),n(815),n(816),n(817),n(819),n(820),n(821),n(822),n(823),n(824),n(825),n(826),n(827),t.exports=n(442).Math},807:function(t,e,n){var r=n(403),i=n(559),o=Math.sqrt,a=Math.acosh;r(r.S+r.F*!(a&&710==Math.floor(a(Number.MAX_VALUE))&&a(1/0)==1/0),"Math",{acosh:function(t){return(t=+t)<1?NaN:t>94906265.62425156?Math.log(t)+Math.LN2:i(t-1+o(t-1)*o(t+1))}})},808:function(t,e,n){t.exports=n(557)("native-function-to-string",Function.toString)},809:function(t,e){t.exports=!1},810:function(t,e){t.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}},811:function(t,e,n){var r=n(403),i=Math.asinh;r(r.S+r.F*!(i&&1/i(0)>0),"Math",{asinh:function t(e){return isFinite(e=+e)&&0!=e?e<0?-t(-e):Math.log(e+Math.sqrt(e*e+1)):e}})},812:function(t,e,n){var r=n(403),i=Math.atanh;r(r.S+r.F*!(i&&1/i(-0)<0),"Math",{atanh:function(t){return 0==(t=+t)?t:Math.log((1+t)/(1-t))/2}})},813:function(t,e,n){var r=n(403),i=n(496);r(r.S,"Math",{cbrt:function(t){return i(t=+t)*Math.pow(Math.abs(t),1/3)}})},814:function(t,e,n){var r=n(403);r(r.S,"Math",{clz32:function(t){return(t>>>=0)?31-Math.floor(Math.log(t+.5)*Math.LOG2E):32}})},815:function(t,e,n){var r=n(403),i=Math.exp;r(r.S,"Math",{cosh:function(t){return(i(t=+t)+i(-t))/2}})},816:function(t,e,n){var r=n(403),i=n(497);r(r.S+r.F*(i!=Math.expm1),"Math",{expm1:i})},817:function(t,e,n){var r=n(403);r(r.S,"Math",{fround:n(818)})},818:function(t,e,n){var r=n(496),i=Math.pow,o=i(2,-52),a=i(2,-23),u=i(2,127)*(2-a),c=i(2,-126);t.exports=Math.fround||function(t){var e,n,i=Math.abs(t),s=r(t);return iu||n!=n?s*(1/0):s*n}},819:function(t,e,n){var r=n(403),i=Math.abs;r(r.S,"Math",{hypot:function(t,e){for(var n,r,o=0,a=0,u=arguments.length,c=0;a0?(r=n/c)*r:n;return c===1/0?1/0:c*Math.sqrt(o)}})},820:function(t,e,n){var r=n(403),i=Math.imul;r(r.S+r.F*n(419)((function(){return-5!=i(4294967295,5)||2!=i.length})),"Math",{imul:function(t,e){var n=+t,r=+e,i=65535&n,o=65535&r;return 0|i*o+((65535&n>>>16)*o+i*(65535&r>>>16)<<16>>>0)}})},821:function(t,e,n){var r=n(403);r(r.S,"Math",{log10:function(t){return Math.log(t)*Math.LOG10E}})},822:function(t,e,n){var r=n(403);r(r.S,"Math",{log1p:n(559)})},823:function(t,e,n){var r=n(403);r(r.S,"Math",{log2:function(t){return Math.log(t)/Math.LN2}})},824:function(t,e,n){var r=n(403);r(r.S,"Math",{sign:n(496)})},825:function(t,e,n){var r=n(403),i=n(497),o=Math.exp;r(r.S+r.F*n(419)((function(){return-2e-17!=!Math.sinh(-2e-17)})),"Math",{sinh:function(t){return Math.abs(t=+t)<1?(i(t)-i(-t))/2:(o(t-1)-o(-t-1))*(Math.E/2)}})},826:function(t,e,n){var r=n(403),i=n(497),o=Math.exp;r(r.S,"Math",{tanh:function(t){var e=i(t=+t),n=i(-t);return e==1/0?1:n==1/0?-1:(e-n)/(o(t)+o(-t))}})},827:function(t,e,n){var r=n(403);r(r.S,"Math",{trunc:function(t){return(t>0?Math.floor:Math.ceil)(t)}})},828:function(t,e,n){n(829),n(842),n(844),n(845),n(846),n(847),n(848),n(849),n(850),n(851),n(852),n(854),t.exports=n(442).Number},829:function(t,e,n){"use strict";var r=n(415),i=n(459),o=n(498),a=n(830),u=n(495),c=n(419),s=n(834).f,l=n(560).f,f=n(494).f,h=n(502).trim,p=r.Number,d=p,y=p.prototype,v="Number"==o(n(838)(y)),m="trim"in String.prototype,g=function(t){var e=u(t,!1);if("string"==typeof e&&e.length>2){var n,r,i,o=(e=m?e.trim():h(e,3)).charCodeAt(0);if(43===o||45===o){if(88===(n=e.charCodeAt(2))||120===n)return NaN}else if(48===o){switch(e.charCodeAt(1)){case 66:case 98:r=2,i=49;break;case 79:case 111:r=8,i=55;break;default:return+e}for(var a,c=e.slice(2),s=0,l=c.length;si)return NaN;return parseInt(c,r)}}return+e};if(!p(" 0o1")||!p("0b1")||p("+0x1")){p=function(t){var e=arguments.length<1?0:t,n=this;return n instanceof p&&(v?c((function(){y.valueOf.call(n)})):"Number"!=o(n))?a(new d(g(e)),n,p):g(e)};for(var b,x=n(433)?s(d):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,isFinite,isInteger,isNaN,isSafeInteger,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,parseFloat,parseInt,isInteger".split(","),w=0;x.length>w;w++)i(d,b=x[w])&&!i(p,b)&&f(p,b,l(d,b));p.prototype=y,y.constructor=p,n(555)(r,"Number",p)}},830:function(t,e,n){var r=n(432),i=n(831).set;t.exports=function(t,e,n){var o,a=e.constructor;return a!==n&&"function"==typeof a&&(o=a.prototype)!==n.prototype&&r(o)&&i&&i(t,o),t}},831:function(t,e,n){var r=n(432),i=n(458),o=function(t,e){if(i(t),!r(e)&&null!==e)throw TypeError(e+": can't set as prototype!")};t.exports={set:Object.setPrototypeOf||("__proto__"in{}?function(t,e,r){try{(r=n(558)(Function.call,n(560).f(Object.prototype,"__proto__").set,2))(t,[]),e=!(t instanceof Array)}catch(i){e=!0}return function(t,n){return o(t,n),e?t.__proto__=n:r(t,n),t}}({},!1):void 0),check:o}},832:function(t,e){e.f={}.propertyIsEnumerable},833:function(t,e,n){var r=n(498);t.exports=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==r(t)?t.split(""):Object(t)}},834:function(t,e,n){var r=n(561),i=n(501).concat("length","prototype");e.f=Object.getOwnPropertyNames||function(t){return r(t,i)}},835:function(t,e,n){var r=n(499),i=n(836),o=n(837);t.exports=function(t){return function(e,n,a){var u,c=r(e),s=i(c.length),l=o(a,s);if(t&&n!=n){for(;s>l;)if((u=c[l++])!=u)return!0}else for(;s>l;l++)if((t||l in c)&&c[l]===n)return t||l||0;return!t&&-1}}},836:function(t,e,n){var r=n(460),i=Math.min;t.exports=function(t){return t>0?i(r(t),9007199254740991):0}},837:function(t,e,n){var r=n(460),i=Math.max,o=Math.min;t.exports=function(t,e){return(t=r(t))<0?i(t+e,0):o(t,e)}},838:function(t,e,n){var r=n(458),i=n(839),o=n(501),a=n(562)("IE_PROTO"),u=function(){},c=function(){var t,e=n(553)("iframe"),r=o.length;for(e.style.display="none",n(841).appendChild(e),e.src="javascript:",(t=e.contentWindow.document).open(),t.write("