From a1512079a117e043b15a671d0cce5b1e58a329bb Mon Sep 17 00:00:00 2001 From: Dean Shub Date: Sat, 7 Nov 2020 20:17:32 +0200 Subject: [PATCH] Nissix "prettier" plugin --- client/actions/todos.js | 17 +- client/components/ActionToolbar/index.js | 600 +- .../components/ConfigurationDialog/index.js | 158 +- client/components/GeneralInfo/index.js | 236 +- client/components/GeneralToolbar/index.js | 225 +- client/components/LogDialog/index.js | 154 +- client/components/Navbar/index.js | 85 +- client/components/ProcessTable/index.js | 241 +- client/containers/App/index.js | 113 +- client/containers/HomePage/index.js | 151 +- client/index.js | 64 +- client/middleware/index.js | 9 +- client/middleware/logger.js | 9 +- client/reducers/actions.js | 59 +- client/reducers/index.js | 17 +- client/reducers/initialData.js | 5 +- client/store/index.js | 49 +- client/utils/dateFilter.js | 14 +- client/utils/durationFilter.js | 279 +- common/pm2wrapper.js | 202 +- common/processController.js | 348 +- common/utils.js | 152 +- index.js | 425 +- package.json | 1 + processes/anal.e/index.js | 42 +- processes/iis/index.js | 124 +- processes/mongo/index.js | 36 +- processes/nginx/index.js | 384 +- processes/prismweb/index.js | 94 +- processes/privatenginx/index.js | 348 +- processes/privatevnext/index.js | 42 +- processes/vnext/index.js | 42 +- static/bundle.js | 38800 +-- static/vendor.bundle.js | 208968 ++++++++------- webpack.config.js | 195 +- 35 files changed, 140035 insertions(+), 112653 deletions(-) diff --git a/client/actions/todos.js b/client/actions/todos.js index a87fbb8..5b65c08 100644 --- a/client/actions/todos.js +++ b/client/actions/todos.js @@ -1,9 +1,8 @@ - -import { createAction } from 'redux-actions' - -export const addTodo = createAction('add todo') -export const deleteTodo = createAction('delete todo') -export const editTodo = createAction('edit todo') -export const completeTodo = createAction('complete todo') -export const completeAll = createAction('complete all') -export const clearCompleted = createAction('clear complete') +import { createAction } from 'redux-actions'; + +export const addTodo = createAction('add todo'); +export const deleteTodo = createAction('delete todo'); +export const editTodo = createAction('edit todo'); +export const completeTodo = createAction('complete todo'); +export const completeAll = createAction('complete all'); +export const clearCompleted = createAction('clear complete'); diff --git a/client/components/ActionToolbar/index.js b/client/components/ActionToolbar/index.js index b017b14..b7c9a12 100644 --- a/client/components/ActionToolbar/index.js +++ b/client/components/ActionToolbar/index.js @@ -1,293 +1,307 @@ -import React, { Component, PropTypes } from 'react'; -import {Toolbar, ToolbarGroup, ToolbarSeparator} from 'material-ui/Toolbar'; -import { TextField, RaisedButton, MenuItem } from 'material-ui'; -import { Popover, Menu, IconButton } from 'material-ui'; -import NavigationExpandMoreIcon from 'material-ui/svg-icons/navigation/expand-more'; -import AvStop from 'material-ui/svg-icons/av/stop'; -import AvReplay from 'material-ui/svg-icons/av/replay'; -import ActionsDelete from 'material-ui/svg-icons/action/delete'; -import ActionsBuild from 'material-ui/svg-icons/action/build'; -import InsertDriveFile from 'material-ui/svg-icons/editor/insert-drive-file'; -import request from 'superagent'; -import http from 'stream-http'; -// import classnames from 'classnames'; -import LogDialog from '../LogDialog'; -import ConfigurationDialog from '../ConfigurationDialog'; -// import style from './style.css'; - -const SYSTEM_ACTIONS = { - RESTART_ALL:'Start/Restart All', - STOP_ALL:'Stop All', - DELETE_ALL:'Delete All', - KILL_PM2:'Kill PM2', -}; - -// Chart.defaults.global.responsive = true - -class ActionToolbar extends Component { - static propTypes = { - handleSearch: PropTypes.func, - refreshStats: PropTypes.func, - rowSelected: PropTypes.object, - } - - constructor(props){ - super(props); - this.state = { - openMenu: false, - logDialogOpen: false, - logsDetails: { - procId: null, - logsPaths: [], - }, - logText: [], - }; - } - - handleTouchTap(event){ - event.preventDefault(); - this.setState({ - anchorEl: event.currentTarget, - openMenu: true, - }); - } - - handleRequestClose(){ - this.setState({ - openMenu: false, - }); - } - - handleOpen() { - this.setState({logDialogOpen: true}); - } - - showLog(logpath, id, logname) { - this.setState({ - currentLogName: logname, - logText: [], - }); - - let path = `/api/operations/showlog/${id}/${logname}`; - let options = { - path, - method: 'GET', - }; - let req = http.request(options, (res) => { - this.response = res; - res.on('data', (buf) => { - this.setState({ - logText: this.state.logText.concat([buf.toString()]), - }); - var objDiv = document.getElementById('logContent'); - objDiv.scrollTop = objDiv.scrollHeight; - }); - res.on('end', () => { - this.setState({ - logText: this.state.logText.concat(['--------------------------------------']), - }); - var objDiv = document.getElementById('logContent'); - objDiv.scrollTop = objDiv.scrollHeight; - }); - }); - - req.on('error', (error) => { - console.log('error requesting log file: ', error); - }); - - req.end(); - - this.request = req; - } - - handleLogClose = () => { - this.setState({ - logDialogOpen: false, - logText: [], - }); - - if (this.request) { - this.request.abort(); - this.request = null; - } - }; - - handleConfigurationClose = ()=>{ - this.setState({ - configurationDialogOpen: false, - configurationDetails: undefined, - }); - } - - handleSystemAction(action, id){ - let url; - if (action===SYSTEM_ACTIONS.RESTART_ALL){ - url = `/api/operations/restart/${id}`; - }else if (action===SYSTEM_ACTIONS.STOP_ALL){ - url = `/api/operations/stop/${id}`; - }else if (action===SYSTEM_ACTIONS.DELETE_ALL){ - url = `/api/operations/delete/${id}`; - }else if (action===SYSTEM_ACTIONS.KILL_PM2){ - url = '/api/operations/kill'; - } - - if (url){ - request.get(url) - .end((err)=>{ - console.error(err); - setTimeout(this.props.refreshStats); - }); - } - } - - getLogs(processId){ - const url = `/api/operations/logs/${processId}`; - request.get(url) - .end((err, res)=>{ - this.setState({ - selectedProcess: processId, - currentLogName: '', - logDialogOpen: true, - logsDetails: res.body, - }); - // setTimeout(this.props.refreshStats); - }); - } - - getConfiguration(processId){ - const url = `/api/operations/configuration/${processId}`; - request.get(url) - .end((err, res)=>{ - this.setState({ - selectedProcess: processId, - configurationDialogOpen: true, - configurationDetails: res.body, - }); - // setTimeout(this.props.refreshStats); - }); - } - - setConfiguration(processId, configurations){ - const url = `/api/operations/configuration/${processId}`; - - request.post(url) - .send({configurations}) - .end((err, res)=>{ - // this.setState({ - // }); - console.log('success'); - // setTimeout(this.props.refreshStats); - }); - this.handleConfigurationClose(); - } - - render() { - const { rowSelected, handleSearch } = this.props; - const { openMenu, anchorEl, logsDetails, logText, logDialogOpen, currentLogName, selectedProcess, - configurationDialogOpen, configurationDetails } = this.state; - - // let processId; - // if (rowSelected && rowSelected.pm_id!==undefined){ - // processId = rowSelected.pm_id; - // }else if (rowSelected && rowSelected.name!==undefined) { - // processId = rowSelected.name; - // } - const processId = rowSelected?rowSelected.name:undefined; - - return ( - - - this.handleSystemAction(SYSTEM_ACTIONS.STOP_ALL, processId)} - tooltip="Stop" - > - - - this.handleSystemAction(SYSTEM_ACTIONS.RESTART_ALL, processId)} - tooltip="Restart" - > - - - this.handleSystemAction(SYSTEM_ACTIONS.DELETE_ALL, processId)} - tooltip="Delete" - > - - - this.getConfiguration(processId)} - tooltip="Configuration" - > - - - this.getLogs(processId)} - tooltip="Logs" - > - - - - - - } - label="System Actions" - labelPosition="before" - onTouchTap={::this.handleTouchTap} - /> - - - { - Object.keys(SYSTEM_ACTIONS).map( - (actionName,index)=> - this.handleSystemAction(SYSTEM_ACTIONS[actionName], 'all')} - /> - ) - } - - - - - handleSearch(searchText)} - /> - - - - - - - ); - } -} - -export default ActionToolbar; +import React, { Component, PropTypes } from 'react'; +import { Toolbar, ToolbarGroup, ToolbarSeparator } from 'material-ui/Toolbar'; +import { TextField, RaisedButton, MenuItem } from 'material-ui'; +import { Popover, Menu, IconButton } from 'material-ui'; +import NavigationExpandMoreIcon from 'material-ui/svg-icons/navigation/expand-more'; +import AvStop from 'material-ui/svg-icons/av/stop'; +import AvReplay from 'material-ui/svg-icons/av/replay'; +import ActionsDelete from 'material-ui/svg-icons/action/delete'; +import ActionsBuild from 'material-ui/svg-icons/action/build'; +import InsertDriveFile from 'material-ui/svg-icons/editor/insert-drive-file'; +import request from 'superagent'; +import http from 'stream-http'; +// import classnames from 'classnames'; +import LogDialog from '../LogDialog'; +import ConfigurationDialog from '../ConfigurationDialog'; +// import style from './style.css'; + +const SYSTEM_ACTIONS = { + RESTART_ALL: 'Start/Restart All', + STOP_ALL: 'Stop All', + DELETE_ALL: 'Delete All', + KILL_PM2: 'Kill PM2', +}; + +// Chart.defaults.global.responsive = true + +class ActionToolbar extends Component { + static propTypes = { + handleSearch: PropTypes.func, + refreshStats: PropTypes.func, + rowSelected: PropTypes.object, + }; + + constructor(props) { + super(props); + this.state = { + openMenu: false, + logDialogOpen: false, + logsDetails: { + procId: null, + logsPaths: [], + }, + logText: [], + }; + } + + handleTouchTap(event) { + event.preventDefault(); + this.setState({ + anchorEl: event.currentTarget, + openMenu: true, + }); + } + + handleRequestClose() { + this.setState({ + openMenu: false, + }); + } + + handleOpen() { + this.setState({ logDialogOpen: true }); + } + + showLog(logpath, id, logname) { + this.setState({ + currentLogName: logname, + logText: [], + }); + + let path = `/api/operations/showlog/${id}/${logname}`; + let options = { + path, + method: 'GET', + }; + let req = http.request(options, (res) => { + this.response = res; + res.on('data', (buf) => { + this.setState({ + logText: this.state.logText.concat([buf.toString()]), + }); + var objDiv = document.getElementById('logContent'); + objDiv.scrollTop = objDiv.scrollHeight; + }); + res.on('end', () => { + this.setState({ + logText: this.state.logText.concat([ + '--------------------------------------', + ]), + }); + var objDiv = document.getElementById('logContent'); + objDiv.scrollTop = objDiv.scrollHeight; + }); + }); + + req.on('error', (error) => { + console.log('error requesting log file: ', error); + }); + + req.end(); + + this.request = req; + } + + handleLogClose = () => { + this.setState({ + logDialogOpen: false, + logText: [], + }); + + if (this.request) { + this.request.abort(); + this.request = null; + } + }; + + handleConfigurationClose = () => { + this.setState({ + configurationDialogOpen: false, + configurationDetails: undefined, + }); + }; + + handleSystemAction(action, id) { + let url; + if (action === SYSTEM_ACTIONS.RESTART_ALL) { + url = `/api/operations/restart/${id}`; + } else if (action === SYSTEM_ACTIONS.STOP_ALL) { + url = `/api/operations/stop/${id}`; + } else if (action === SYSTEM_ACTIONS.DELETE_ALL) { + url = `/api/operations/delete/${id}`; + } else if (action === SYSTEM_ACTIONS.KILL_PM2) { + url = '/api/operations/kill'; + } + + if (url) { + request.get(url).end((err) => { + console.error(err); + setTimeout(this.props.refreshStats); + }); + } + } + + getLogs(processId) { + const url = `/api/operations/logs/${processId}`; + request.get(url).end((err, res) => { + this.setState({ + selectedProcess: processId, + currentLogName: '', + logDialogOpen: true, + logsDetails: res.body, + }); + // setTimeout(this.props.refreshStats); + }); + } + + getConfiguration(processId) { + const url = `/api/operations/configuration/${processId}`; + request.get(url).end((err, res) => { + this.setState({ + selectedProcess: processId, + configurationDialogOpen: true, + configurationDetails: res.body, + }); + // setTimeout(this.props.refreshStats); + }); + } + + setConfiguration(processId, configurations) { + const url = `/api/operations/configuration/${processId}`; + + request + .post(url) + .send({ configurations }) + .end((err, res) => { + // this.setState({ + // }); + console.log('success'); + // setTimeout(this.props.refreshStats); + }); + this.handleConfigurationClose(); + } + + render() { + const { rowSelected, handleSearch } = this.props; + const { + openMenu, + anchorEl, + logsDetails, + logText, + logDialogOpen, + currentLogName, + selectedProcess, + configurationDialogOpen, + configurationDetails, + } = this.state; + + // let processId; + // if (rowSelected && rowSelected.pm_id!==undefined){ + // processId = rowSelected.pm_id; + // }else if (rowSelected && rowSelected.name!==undefined) { + // processId = rowSelected.name; + // } + const processId = rowSelected ? rowSelected.name : undefined; + + return ( + + + + this.handleSystemAction(SYSTEM_ACTIONS.STOP_ALL, processId) + } + tooltip="Stop" + > + + + + this.handleSystemAction(SYSTEM_ACTIONS.RESTART_ALL, processId) + } + tooltip="Restart" + > + + + + this.handleSystemAction(SYSTEM_ACTIONS.DELETE_ALL, processId) + } + tooltip="Delete" + > + + + this.getConfiguration(processId)} + tooltip="Configuration" + > + + + this.getLogs(processId)} + tooltip="Logs" + > + + + + + + } + label="System Actions" + labelPosition="before" + onTouchTap={::this.handleTouchTap} + /> + + + {Object.keys(SYSTEM_ACTIONS).map((actionName, index) => ( + + this.handleSystemAction(SYSTEM_ACTIONS[actionName], 'all') + } + /> + ))} + + + + + handleSearch(searchText)} + /> + + + + + + + ); + } +} + +export default ActionToolbar; diff --git a/client/components/ConfigurationDialog/index.js b/client/components/ConfigurationDialog/index.js index 36330a4..065914c 100644 --- a/client/components/ConfigurationDialog/index.js +++ b/client/components/ConfigurationDialog/index.js @@ -1,77 +1,81 @@ -import React, { Component, PropTypes } from 'react'; -import Dialog from 'material-ui/Dialog'; -import TextField from 'material-ui/TextField'; -import FlatButton from 'material-ui/FlatButton'; -import classnames from 'classnames'; -import style from './style.css'; - -export default class LogDialog extends Component { - static propTypes={ - configurationDialogOpen: PropTypes.bool, - handleClose: PropTypes.func, - configurationDetails: PropTypes.object, - processId: PropTypes.string, - setConfiguration: PropTypes.func, - } - static defaultProps={ - configurationDialogOpen: false, - }; - - constructor(props){ - super(props); - this.configurationDetails={}; - } - - prepareForm(configurationDetails){ - let textFileds = []; - if (configurationDetails){ - for (let prop in configurationDetails) { - textFileds.push( - { - this.configurationDetails[prop] = event.target.value; - }} - /> - ); - } - } - return textFileds; - } - - render(){ - const {configurationDialogOpen, handleClose, configurationDetails, processId, setConfiguration} = this.props; - const actions = [ - setConfiguration(processId, this.configurationDetails)} - />, - , - ]; - - return ( - -
- {this.prepareForm(configurationDetails)} -
-
- ); - } -} +import React, { Component, PropTypes } from 'react'; +import Dialog from 'material-ui/Dialog'; +import TextField from 'material-ui/TextField'; +import FlatButton from 'material-ui/FlatButton'; +import classnames from 'classnames'; +import style from './style.css'; + +export default class LogDialog extends Component { + static propTypes = { + configurationDialogOpen: PropTypes.bool, + handleClose: PropTypes.func, + configurationDetails: PropTypes.object, + processId: PropTypes.string, + setConfiguration: PropTypes.func, + }; + static defaultProps = { + configurationDialogOpen: false, + }; + + constructor(props) { + super(props); + this.configurationDetails = {}; + } + + prepareForm(configurationDetails) { + let textFileds = []; + if (configurationDetails) { + for (let prop in configurationDetails) { + textFileds.push( + { + this.configurationDetails[prop] = event.target.value; + }} + />, + ); + } + } + return textFileds; + } + + render() { + const { + configurationDialogOpen, + handleClose, + configurationDetails, + processId, + setConfiguration, + } = this.props; + const actions = [ + + setConfiguration(processId, this.configurationDetails) + } + />, + , + ]; + + return ( + +
+ {this.prepareForm(configurationDetails)} +
+
+ ); + } +} diff --git a/client/components/GeneralInfo/index.js b/client/components/GeneralInfo/index.js index 69f466f..20703a0 100644 --- a/client/components/GeneralInfo/index.js +++ b/client/components/GeneralInfo/index.js @@ -1,111 +1,125 @@ -import React, { Component, PropTypes } from 'react'; -import {List, ListItem} from 'material-ui/List'; -import AccessTime from 'material-ui/svg-icons/device/access-time'; -import Title from 'material-ui/svg-icons/editor/title'; -import classnames from 'classnames'; -import { Line as LineChart } from 'react-chartjs'; -// import { bindActionCreators } from 'redux' -// import { connect } from 'react-redux' - -import style from './style.css'; -import durationFilter from '../../utils/durationFilter'; - -class HistoryGraph extends Component { - static propTypes = { - system_info: PropTypes.object, - monit: PropTypes.object, - } - - static defaultProps={ - system_info:{}, - monit:{}, - } - - constructor(props){ - super(props); - this.state = { - memData:{ - labels:[], - datasets:[{ - label: 'Used Memory', - data: [], - backgroundColor: 'rgba(76, 175, 80, 0.2)', - pointBackgroundColor: 'rgb(67, 160, 71)', - pointHoverBackgroundColor: 'rgb(229, 57, 53)', - pointHoverBorderColor: 'rgb(67, 160, 71)', - pointStrokeColor: 'rgb(229, 57, 53)', - pointBorderColor: 'rgb(67, 160, 71)', - }], - }, - cpuData: { - labels: [], - datasets: [], - }, - }; - } - - render() { - const { system_info, monit } = this.props; - let {memData, cpuData} = this.state; - - memData.labels.push((new Date()).toLocaleString()); - memData.datasets[0].data.push(Math.round((monit.total_mem - monit.free_mem)/1024/1024)); - - cpuData.labels.push((new Date()).toLocaleString()); - if (monit.cpu){ - let totalCpuCapacity = monit.cpu.reduce((total, cpu)=> - total + cpu.times.user + cpu.times.nice + cpu.times.sys + - cpu.times.irq + cpu.times.idle, 0); - monit.cpu.forEach((cpu, index)=>{ - if (!cpuData.datasets[index]){ - cpuData.datasets[index]={data:[], label:`CPU${index+1}`}; - } - - let cpuUsage = cpu.times.idle; - cpuData.datasets[index].data.push(cpuUsage / totalCpuCapacity * 100); - }); - } - - return ( -
- - } - primaryText={`Host Name: ${system_info.hostName}`} - /> - } - primaryText={`Up Time: ${durationFilter(system_info.uptime,'dd \'days\', hh \'hours\', mm \'minutes\'')}`} - /> - -
- -
-
- -
-
- ); - } -} - -// function mapStateToProps(state) { -// return { -// ...state.routing.locationBeforeTransitions.state, -// } -// } -// -// function mapDispatchToProps(dispatch) { -// return { -// actions: bindActionCreators(TodoActions, dispatch), -// } -// } -// -// export default connect( -// mapStateToProps, -// mapDispatchToProps -// )(HistoryGraph) -export default HistoryGraph; +import React, { Component, PropTypes } from 'react'; +import { List, ListItem } from 'material-ui/List'; +import AccessTime from 'material-ui/svg-icons/device/access-time'; +import Title from 'material-ui/svg-icons/editor/title'; +import classnames from 'classnames'; +import { Line as LineChart } from 'react-chartjs'; +// import { bindActionCreators } from 'redux' +// import { connect } from 'react-redux' + +import style from './style.css'; +import durationFilter from '../../utils/durationFilter'; + +class HistoryGraph extends Component { + static propTypes = { + system_info: PropTypes.object, + monit: PropTypes.object, + }; + + static defaultProps = { + system_info: {}, + monit: {}, + }; + + constructor(props) { + super(props); + this.state = { + memData: { + labels: [], + datasets: [ + { + label: 'Used Memory', + data: [], + backgroundColor: 'rgba(76, 175, 80, 0.2)', + pointBackgroundColor: 'rgb(67, 160, 71)', + pointHoverBackgroundColor: 'rgb(229, 57, 53)', + pointHoverBorderColor: 'rgb(67, 160, 71)', + pointStrokeColor: 'rgb(229, 57, 53)', + pointBorderColor: 'rgb(67, 160, 71)', + }, + ], + }, + cpuData: { + labels: [], + datasets: [], + }, + }; + } + + render() { + const { system_info, monit } = this.props; + let { memData, cpuData } = this.state; + + memData.labels.push(new Date().toLocaleString()); + memData.datasets[0].data.push( + Math.round((monit.total_mem - monit.free_mem) / 1024 / 1024), + ); + + cpuData.labels.push(new Date().toLocaleString()); + if (monit.cpu) { + let totalCpuCapacity = monit.cpu.reduce( + (total, cpu) => + total + + cpu.times.user + + cpu.times.nice + + cpu.times.sys + + cpu.times.irq + + cpu.times.idle, + 0, + ); + monit.cpu.forEach((cpu, index) => { + if (!cpuData.datasets[index]) { + cpuData.datasets[index] = { data: [], label: `CPU${index + 1}` }; + } + + let cpuUsage = cpu.times.idle; + cpuData.datasets[index].data.push((cpuUsage / totalCpuCapacity) * 100); + }); + } + + return ( +
+ + } + primaryText={`Host Name: ${system_info.hostName}`} + /> + } + primaryText={`Up Time: ${durationFilter( + system_info.uptime, + "dd 'days', hh 'hours', mm 'minutes'", + )}`} + /> + +
+ +
+
+ +
+
+ ); + } +} + +// function mapStateToProps(state) { +// return { +// ...state.routing.locationBeforeTransitions.state, +// } +// } +// +// function mapDispatchToProps(dispatch) { +// return { +// actions: bindActionCreators(TodoActions, dispatch), +// } +// } +// +// export default connect( +// mapStateToProps, +// mapDispatchToProps +// )(HistoryGraph) +export default HistoryGraph; diff --git a/client/components/GeneralToolbar/index.js b/client/components/GeneralToolbar/index.js index e1b9eeb..70625de 100644 --- a/client/components/GeneralToolbar/index.js +++ b/client/components/GeneralToolbar/index.js @@ -1,116 +1,109 @@ -import React, { Component, PropTypes } from 'react'; -import {Toolbar, ToolbarGroup, ToolbarSeparator, ToolbarTitle} from 'material-ui/Toolbar'; -import { TextField, IconMenu, RaisedButton, MenuItem } from 'material-ui'; -import { IconButton } from 'material-ui'; -import NavigationExpandMoreIcon from 'material-ui/svg-icons/navigation/expand-more'; -import AvStop from 'material-ui/svg-icons/av/stop'; -import AvPlay from 'material-ui/svg-icons/av/play-arrow'; -import AvReplay from 'material-ui/svg-icons/av/replay'; -import ActionsDelete from 'material-ui/svg-icons/action/delete'; -import FormatAlignJustify from 'material-ui/svg-icons/editor/format-align-justify'; - -// import classnames from 'classnames'; -// import {Line as LineChart} from 'react-chartjs'; -// import { bindActionCreators } from 'redux' -// import { connect } from 'react-redux' - -// Chart.defaults.global.responsive = true - -class GeneralToolbar extends Component { - static propTypes = { - rowSelected: PropTypes.bool, - } - - static defaultProps={ - rowSelected: false, - } - - constructor(props){ - super(props); - this.state = { - openMenu: false, - }; - } - - handleOpenMenu = () => { - this.setState({ - openMenu: true, - }); - } - - render() { - const { rowSelected } = this.props; - - return ( - - - - - - - - - - - - - - - - - - - - } - label="Actions" - labelPosition="before" - onTouchTap={this.handleOpenMenu} - primary - /> - } - open={this.state.openMenu} - > - - - - - - - - - ); - } -} - -// function mapStateToProps(state) { -// return { -// ...state.routing.locationBeforeTransitions.state, -// } -// } -// -// function mapDispatchToProps(dispatch) { -// return { -// actions: bindActionCreators(TodoActions, dispatch), -// } -// } -// -// export default connect( -// mapStateToProps, -// mapDispatchToProps -// )(HistoryGraph) -export default GeneralToolbar; +import React, { Component, PropTypes } from 'react'; +import { + Toolbar, + ToolbarGroup, + ToolbarSeparator, + ToolbarTitle, +} from 'material-ui/Toolbar'; +import { TextField, IconMenu, RaisedButton, MenuItem } from 'material-ui'; +import { IconButton } from 'material-ui'; +import NavigationExpandMoreIcon from 'material-ui/svg-icons/navigation/expand-more'; +import AvStop from 'material-ui/svg-icons/av/stop'; +import AvPlay from 'material-ui/svg-icons/av/play-arrow'; +import AvReplay from 'material-ui/svg-icons/av/replay'; +import ActionsDelete from 'material-ui/svg-icons/action/delete'; +import FormatAlignJustify from 'material-ui/svg-icons/editor/format-align-justify'; + +// import classnames from 'classnames'; +// import {Line as LineChart} from 'react-chartjs'; +// import { bindActionCreators } from 'redux' +// import { connect } from 'react-redux' + +// Chart.defaults.global.responsive = true + +class GeneralToolbar extends Component { + static propTypes = { + rowSelected: PropTypes.bool, + }; + + static defaultProps = { + rowSelected: false, + }; + + constructor(props) { + super(props); + this.state = { + openMenu: false, + }; + } + + handleOpenMenu = () => { + this.setState({ + openMenu: true, + }); + }; + + render() { + const { rowSelected } = this.props; + + return ( + + + + + + + + + + + + + + + + + + + + } + label="Actions" + labelPosition="before" + onTouchTap={this.handleOpenMenu} + primary + /> + } + open={this.state.openMenu} + > + + + + + + + + + ); + } +} + +// function mapStateToProps(state) { +// return { +// ...state.routing.locationBeforeTransitions.state, +// } +// } +// +// function mapDispatchToProps(dispatch) { +// return { +// actions: bindActionCreators(TodoActions, dispatch), +// } +// } +// +// export default connect( +// mapStateToProps, +// mapDispatchToProps +// )(HistoryGraph) +export default GeneralToolbar; diff --git a/client/components/LogDialog/index.js b/client/components/LogDialog/index.js index 7a6aa16..cfb5e9e 100644 --- a/client/components/LogDialog/index.js +++ b/client/components/LogDialog/index.js @@ -1,71 +1,83 @@ -import React, { Component, PropTypes } from 'react'; -import Dialog from 'material-ui/Dialog'; -import {List, ListItem} from 'material-ui/List'; -import InsertDriveFile from 'material-ui/svg-icons/editor/insert-drive-file'; -import FlatButton from 'material-ui/FlatButton'; -import classnames from 'classnames'; -import style from './style.css'; - -export default class LogDialog extends Component { - static propTypes={ - logDialogOpen: PropTypes.bool, - handleClose: PropTypes.func, - logName: PropTypes.string, - logText: PropTypes.array, - logsDetails: PropTypes.object, - processId: PropTypes.string, - showLog: PropTypes.func, - } - static defaultProps={ - logText: [], - logName: '', - processId: '', - logsDetails:{ - logsPaths:[], - }, - }; - - render(){ - const {logDialogOpen, handleClose, showLog, logsDetails, logText, logName, processId} = this.props; - const actions = [ - , - ]; - - return ( - -
- - { - logsDetails.logsPaths.map(logFile => - } - onTouchTap={()=>showLog(logFile.path, logsDetails.procId, logFile.name)} - primaryText={logFile.name} - /> - ) - } - -
- {logText.map((text,index)=>
{text}
)} -
-
-
- ); - } -} +import React, { Component, PropTypes } from 'react'; +import Dialog from 'material-ui/Dialog'; +import { List, ListItem } from 'material-ui/List'; +import InsertDriveFile from 'material-ui/svg-icons/editor/insert-drive-file'; +import FlatButton from 'material-ui/FlatButton'; +import classnames from 'classnames'; +import style from './style.css'; + +export default class LogDialog extends Component { + static propTypes = { + logDialogOpen: PropTypes.bool, + handleClose: PropTypes.func, + logName: PropTypes.string, + logText: PropTypes.array, + logsDetails: PropTypes.object, + processId: PropTypes.string, + showLog: PropTypes.func, + }; + static defaultProps = { + logText: [], + logName: '', + processId: '', + logsDetails: { + logsPaths: [], + }, + }; + + render() { + const { + logDialogOpen, + handleClose, + showLog, + logsDetails, + logText, + logName, + processId, + } = this.props; + const actions = [ + , + ]; + + return ( + +
+ + {logsDetails.logsPaths.map((logFile) => ( + } + onTouchTap={() => + showLog(logFile.path, logsDetails.procId, logFile.name) + } + primaryText={logFile.name} + /> + ))} + +
+ {logText.map((text, index) => ( +
{text}
+ ))} +
+
+
+ ); + } +} diff --git a/client/components/Navbar/index.js b/client/components/Navbar/index.js index 313fa92..7cef256 100644 --- a/client/components/Navbar/index.js +++ b/client/components/Navbar/index.js @@ -1,44 +1,41 @@ -import React, { Component, PropTypes } from 'react'; -import { AppBar, IconButton } from 'material-ui'; -import { MuiThemeProvider, getMuiTheme, colors } from 'material-ui/styles'; -import Refresh from 'material-ui/svg-icons/navigation/refresh'; - -const muiTheme = getMuiTheme({ - palette: { - primary1Color: colors.amberA200, - canvasColor: colors.darkBlack, - textColor: colors.white, - alternateTextColor: colors.fullBlack, - }, -}); - -class Navbar extends Component { - static propTypes = { - refreshStats: PropTypes.func, - title: PropTypes.string, - }; - static defaultProps = { - title: 'Sisense Process Activity Monitor', - }; - - render() { - const { title, refreshStats } = this.props; - return ( - - - - - } - title={title} - /> - - ); - } -} - -export default Navbar; +import React, { Component, PropTypes } from 'react'; +import { AppBar, IconButton } from 'material-ui'; +import { MuiThemeProvider, getMuiTheme, colors } from 'material-ui/styles'; +import Refresh from 'material-ui/svg-icons/navigation/refresh'; + +const muiTheme = getMuiTheme({ + palette: { + primary1Color: colors.amberA200, + canvasColor: colors.darkBlack, + textColor: colors.white, + alternateTextColor: colors.fullBlack, + }, +}); + +class Navbar extends Component { + static propTypes = { + refreshStats: PropTypes.func, + title: PropTypes.string, + }; + static defaultProps = { + title: 'Sisense Process Activity Monitor', + }; + + render() { + const { title, refreshStats } = this.props; + return ( + + + + + } + title={title} + /> + + ); + } +} + +export default Navbar; diff --git a/client/components/ProcessTable/index.js b/client/components/ProcessTable/index.js index 749347c..9527830 100644 --- a/client/components/ProcessTable/index.js +++ b/client/components/ProcessTable/index.js @@ -1,109 +1,132 @@ -import React, { Component, PropTypes } from 'react'; -import {Table, TableBody, TableHeader, TableHeaderColumn, TableRow, TableRowColumn} from 'material-ui/Table'; -import classnames from 'classnames'; - -import dateFilter from '../../utils/dateFilter'; -import style from './style.css'; - -class ProcessTable extends Component { - static propTypes = { - onRowSelection: PropTypes.func, - processes: PropTypes.array, - searchText: PropTypes.string, - selectedRow: PropTypes.object, - } - - static defaultProps={ - processes:[], - searchText:'', - } - - constructor(props){ - super(props); - this.state = { - openMenu: false, - }; - } - - handleOpenMenu = () => { - this.setState({ - openMenu: true, - }); - } - - render() { - const { processes, searchText, selectedRow, onRowSelection } = this.props; - - return ( - {onRowSelection(processes[rowIndex]);}}> - - - PM2 ID - App Name - Mode - pid - Status - Uptime - Restarts - Unstable Restarts - Created On - Memory - CPU - - - - { - processes - .filter((process)=>process.name.includes(searchText)||process.pm_id.toString().includes(searchText)) - .map(process=>{ - const statusClass = classnames({ - [style.online]:process.pm2_env.status==='online', - [style.notonline]:process.pm2_env.status!=='online', - [style.capitalize]:true, - }); - return ( - - {process.pm_id} - {process.name} - {process.pm2_env.exec_mode} - {process.pid} - {process.pm2_env.status} - {dateFilter(process.pm2_env.pm_uptime - process.pm2_env.created_at,'HH:mm:ss')} - {process.pm2_env.restart_time} - {process.pm2_env.unstable_restarts} - {dateFilter(process.pm2_env.created_at, 'YYYY-MM-D HH:mm:ss')} - {process.monit.memory} - {process.monit.cpu} - - ); - }) - } - -
- ); - } -} - -// function mapStateToProps(state) { -// return { -// ...state.routing.locationBeforeTransitions.state, -// } -// } -// -// function mapDispatchToProps(dispatch) { -// return { -// actions: bindActionCreators(TodoActions, dispatch), -// } -// } -// -// export default connect( -// mapStateToProps, -// mapDispatchToProps -// )(HistoryGraph) -export default ProcessTable; +import React, { Component, PropTypes } from 'react'; +import { + Table, + TableBody, + TableHeader, + TableHeaderColumn, + TableRow, + TableRowColumn, +} from 'material-ui/Table'; +import classnames from 'classnames'; + +import dateFilter from '../../utils/dateFilter'; +import style from './style.css'; + +class ProcessTable extends Component { + static propTypes = { + onRowSelection: PropTypes.func, + processes: PropTypes.array, + searchText: PropTypes.string, + selectedRow: PropTypes.object, + }; + + static defaultProps = { + processes: [], + searchText: '', + }; + + constructor(props) { + super(props); + this.state = { + openMenu: false, + }; + } + + handleOpenMenu = () => { + this.setState({ + openMenu: true, + }); + }; + + render() { + const { processes, searchText, selectedRow, onRowSelection } = this.props; + + return ( + { + onRowSelection(processes[rowIndex]); + }} + > + + + PM2 ID + App Name + Mode + pid + Status + Uptime + Restarts + Unstable Restarts + Created On + Memory + CPU + + + + {processes + .filter( + (process) => + process.name.includes(searchText) || + process.pm_id.toString().includes(searchText), + ) + .map((process) => { + const statusClass = classnames({ + [style.online]: process.pm2_env.status === 'online', + [style.notonline]: process.pm2_env.status !== 'online', + [style.capitalize]: true, + }); + return ( + + {process.pm_id} + {process.name} + {process.pm2_env.exec_mode} + {process.pid} + + {process.pm2_env.status} + + + {dateFilter( + process.pm2_env.pm_uptime - process.pm2_env.created_at, + 'HH:mm:ss', + )} + + + {process.pm2_env.restart_time} + + + {process.pm2_env.unstable_restarts} + + + {dateFilter( + process.pm2_env.created_at, + 'YYYY-MM-D HH:mm:ss', + )} + + {process.monit.memory} + {process.monit.cpu} + + ); + })} + +
+ ); + } +} + +// function mapStateToProps(state) { +// return { +// ...state.routing.locationBeforeTransitions.state, +// } +// } +// +// function mapDispatchToProps(dispatch) { +// return { +// actions: bindActionCreators(TodoActions, dispatch), +// } +// } +// +// export default connect( +// mapStateToProps, +// mapDispatchToProps +// )(HistoryGraph) +export default ProcessTable; diff --git a/client/containers/App/index.js b/client/containers/App/index.js index 6034468..d25a36b 100644 --- a/client/containers/App/index.js +++ b/client/containers/App/index.js @@ -1,56 +1,57 @@ -import React, { Component, PropTypes } from 'react'; -import classnames from 'classnames'; -import request from 'superagent'; - -import Navbar from '../../components/Navbar'; -import style from './style.css'; - -class App extends Component { - static propTypes = { - children: PropTypes.object, - params: PropTypes.object, - }; - - constructor(props){ - super(props); - this.state = { - stat:{}, - }; - } - - componentDidMount(){ - this.refreshStats(); - } - - refreshStats(){ - request.get('/api/serverStat') - .set('Accept', 'application/json') - .end((err, res)=>{ - console.log(res?res.body:err); - if (!err){ - this.setState({ - stat: res.body, - }); - } - }); - } - render() { - const { children, params } = this.props; - const { stat } = this.state; - // TODO: get user name by params.userId - - return ( -
- -
- {React.cloneElement(children, { refreshStats: ::this.refreshStats, stat })} -
-
- ); - } -} - -export default App; +import React, { Component, PropTypes } from 'react'; +import classnames from 'classnames'; +import request from 'superagent'; + +import Navbar from '../../components/Navbar'; +import style from './style.css'; + +class App extends Component { + static propTypes = { + children: PropTypes.object, + params: PropTypes.object, + }; + + constructor(props) { + super(props); + this.state = { + stat: {}, + }; + } + + componentDidMount() { + this.refreshStats(); + } + + refreshStats() { + request + .get('/api/serverStat') + .set('Accept', 'application/json') + .end((err, res) => { + console.log(res ? res.body : err); + if (!err) { + this.setState({ + stat: res.body, + }); + } + }); + } + render() { + const { children, params } = this.props; + const { stat } = this.state; + // TODO: get user name by params.userId + + return ( +
+ +
+ {React.cloneElement(children, { + refreshStats: ::this.refreshStats, + stat, + })} +
+
+ ); + } +} + +export default App; diff --git a/client/containers/HomePage/index.js b/client/containers/HomePage/index.js index a10584c..7fba546 100644 --- a/client/containers/HomePage/index.js +++ b/client/containers/HomePage/index.js @@ -1,76 +1,75 @@ -import React, { Component, PropTypes } from 'react'; -import { Paper } from 'material-ui'; -import { MuiThemeProvider, getMuiTheme, colors } from 'material-ui/styles'; -import classnames from 'classnames'; - -import GeneralInfo from '../../components/GeneralInfo'; -import ActionToolbar from '../../components/ActionToolbar'; -import ProcessTable from '../../components/ProcessTable'; - -import style from './style.css'; - -const muiTheme = getMuiTheme({ - palette: { - primary1Color: colors.amber500, - canvasColor: colors.white, - textColor: colors.fullBlack, - alternateTextColor: colors.amberA200, - }, -}); - -class HomePage extends Component { - static propTypes = { - refreshStats: PropTypes.func, - stat: PropTypes.object, - } - - constructor(props){ - super(props); - this.state = { - }; - } - - handleRowSelection(selectedRows){ - this.setState({ - rowSelected: selectedRows, - }); - } - - handleSearch(searchText){ - this.setState({ - searchText, - }); - } - - render() { - const { rowSelected, searchText } = this.state; - const { stat, refreshStats } = this.props; - - return ( -
- - - - - - - - - - - -
- ); - } -} - -export default HomePage; +import React, { Component, PropTypes } from 'react'; +import { Paper } from 'material-ui'; +import { MuiThemeProvider, getMuiTheme, colors } from 'material-ui/styles'; +import classnames from 'classnames'; + +import GeneralInfo from '../../components/GeneralInfo'; +import ActionToolbar from '../../components/ActionToolbar'; +import ProcessTable from '../../components/ProcessTable'; + +import style from './style.css'; + +const muiTheme = getMuiTheme({ + palette: { + primary1Color: colors.amber500, + canvasColor: colors.white, + textColor: colors.fullBlack, + alternateTextColor: colors.amberA200, + }, +}); + +class HomePage extends Component { + static propTypes = { + refreshStats: PropTypes.func, + stat: PropTypes.object, + }; + + constructor(props) { + super(props); + this.state = {}; + } + + handleRowSelection(selectedRows) { + this.setState({ + rowSelected: selectedRows, + }); + } + + handleSearch(searchText) { + this.setState({ + searchText, + }); + } + + render() { + const { rowSelected, searchText } = this.state; + const { stat, refreshStats } = this.props; + + return ( +
+ + + + + + + + + + + +
+ ); + } +} + +export default HomePage; diff --git a/client/index.js b/client/index.js index 94e6cbd..2c4766a 100644 --- a/client/index.js +++ b/client/index.js @@ -1,36 +1,28 @@ -import { Router, Route, browserHistory } from 'react-router'; -import { syncHistoryWithStore } from 'react-router-redux'; -import { Provider } from 'react-redux'; -import ReactDOM from 'react-dom'; -// import { whyDidYouUpdate } from 'why-did-you-update'; -import React from 'react'; -import injectTapEventPlugin from 'react-tap-event-plugin'; - -import configure from './store'; -import App from './containers/App'; -import HomePage from './containers/HomePage'; -// whyDidYouUpdate(React); - -const store = configure(); -const history = syncHistoryWithStore(browserHistory, store); -injectTapEventPlugin(); - -ReactDOM.render( - - - - - - - - , - document.getElementById('root') -); +import { Router, Route, browserHistory } from 'react-router'; +import { syncHistoryWithStore } from 'react-router-redux'; +import { Provider } from 'react-redux'; +import ReactDOM from 'react-dom'; +// import { whyDidYouUpdate } from 'why-did-you-update'; +import React from 'react'; +import injectTapEventPlugin from 'react-tap-event-plugin'; + +import configure from './store'; +import App from './containers/App'; +import HomePage from './containers/HomePage'; +// whyDidYouUpdate(React); + +const store = configure(); +const history = syncHistoryWithStore(browserHistory, store); +injectTapEventPlugin(); + +ReactDOM.render( + + + + + + + + , + document.getElementById('root'), +); diff --git a/client/middleware/index.js b/client/middleware/index.js index 97d1622..6b02775 100644 --- a/client/middleware/index.js +++ b/client/middleware/index.js @@ -1,6 +1,3 @@ - -import logger from './logger' - -export { - logger, -} +import logger from './logger'; + +export { logger }; diff --git a/client/middleware/logger.js b/client/middleware/logger.js index e83552b..38f5ad1 100644 --- a/client/middleware/logger.js +++ b/client/middleware/logger.js @@ -1,5 +1,4 @@ - -export default store => next => action => { - console.log(action) - return next(action) -} \ No newline at end of file +export default (store) => (next) => (action) => { + console.log(action); + return next(action); +}; diff --git a/client/reducers/actions.js b/client/reducers/actions.js index b4bcce9..c2b509c 100644 --- a/client/reducers/actions.js +++ b/client/reducers/actions.js @@ -1,27 +1,32 @@ - -import { handleActions } from 'redux-actions' - -// TODO: replace this with actual ajax -const initialState = require('./initialData') - -export default handleActions({ - 'add todo' (state, action) { - return [{ - id: state.reduce((maxId, todo) => Math.max(todo.id, maxId), -1) + 1, - completed: false, - text: action.payload, - }, ...state] - }, - - 'delete todo' (state, action) { - return state.filter(todo => todo.id !== action.payload ) - }, - - 'edit todo' (state, action) { - return state.map(todo => { - return todo.id === action.payload.id - ? { ...todo, text: action.payload.text } - : todo - }) - }, -}, initialState) +import { handleActions } from 'redux-actions'; + +// TODO: replace this with actual ajax +const initialState = require('./initialData'); + +export default handleActions( + { + 'add todo'(state, action) { + return [ + { + id: state.reduce((maxId, todo) => Math.max(todo.id, maxId), -1) + 1, + completed: false, + text: action.payload, + }, + ...state, + ]; + }, + + 'delete todo'(state, action) { + return state.filter((todo) => todo.id !== action.payload); + }, + + 'edit todo'(state, action) { + return state.map((todo) => { + return todo.id === action.payload.id + ? { ...todo, text: action.payload.text } + : todo; + }); + }, + }, + initialState, +); diff --git a/client/reducers/index.js b/client/reducers/index.js index f9dc72a..5bcd6e7 100644 --- a/client/reducers/index.js +++ b/client/reducers/index.js @@ -1,9 +1,8 @@ - -import { routerReducer as routing } from 'react-router-redux' -import { combineReducers } from 'redux' -import actions from './actions' - -export default combineReducers({ - routing, - actions, -}) +import { routerReducer as routing } from 'react-router-redux'; +import { combineReducers } from 'redux'; +import actions from './actions'; + +export default combineReducers({ + routing, + actions, +}); diff --git a/client/reducers/initialData.js b/client/reducers/initialData.js index 16d784e..90942ee 100644 --- a/client/reducers/initialData.js +++ b/client/reducers/initialData.js @@ -1,3 +1,2 @@ -let initialData = [ -] -export default initialData +let initialData = []; +export default initialData; diff --git a/client/store/index.js b/client/store/index.js index 9f5f6f0..54aac7a 100644 --- a/client/store/index.js +++ b/client/store/index.js @@ -1,26 +1,23 @@ - -import { createStore, applyMiddleware } from 'redux' - -import { logger } from '../middleware' -import rootReducer from '../reducers' - -export default function configure(initialState) { - const create = window.devToolsExtension - ? window.devToolsExtension()(createStore) - : createStore - - const createStoreWithMiddleware = applyMiddleware( - logger - )(create) - - const store = createStoreWithMiddleware(rootReducer, initialState) - - if (module.hot) { - module.hot.accept('../reducers', () => { - const nextReducer = require('../reducers') - store.replaceReducer(nextReducer) - }) - } - - return store -} +import { createStore, applyMiddleware } from 'redux'; + +import { logger } from '../middleware'; +import rootReducer from '../reducers'; + +export default function configure(initialState) { + const create = window.devToolsExtension + ? window.devToolsExtension()(createStore) + : createStore; + + const createStoreWithMiddleware = applyMiddleware(logger)(create); + + const store = createStoreWithMiddleware(rootReducer, initialState); + + if (module.hot) { + module.hot.accept('../reducers', () => { + const nextReducer = require('../reducers'); + store.replaceReducer(nextReducer); + }); + } + + return store; +} diff --git a/client/utils/dateFilter.js b/client/utils/dateFilter.js index f9bacc6..05ae6c0 100644 --- a/client/utils/dateFilter.js +++ b/client/utils/dateFilter.js @@ -1,7 +1,7 @@ -import moment from 'moment'; - -export default (number, format) => { - if(!number) return ''; - var date = moment(number); - return date.format(format); -}; +import moment from 'moment'; + +export default (number, format) => { + if (!number) return ''; + var date = moment(number); + return date.format(format); +}; diff --git a/client/utils/durationFilter.js b/client/utils/durationFilter.js index 4e438f8..1a17188 100644 --- a/client/utils/durationFilter.js +++ b/client/utils/durationFilter.js @@ -1,126 +1,153 @@ -var DURATION_FORMATS_SPLIT = /((?:[^ydhms']+)|(?:'(?:[^']|'')*')|(?:y+|d+|h+|m+|s+))(.*)/; -var DURATION_FORMATS = { - y: { // years - // "longer" years are not supported - value: 365 * 24 * 60 * 60 * 1000, - }, - yy: { - value: 'y', - pad: 2, - }, - d: { // days - value: 24 * 60 * 60 * 1000, - }, - dd: { - value: 'd', - pad: 2, - }, - h: { // hours - value: 60 * 60 * 1000, - }, - hh: { // padded hours - value: 'h', - pad: 2, - }, - m: { // minutes - value: 60 * 1000, - }, - mm: { // padded minutes - value: 'm', - pad: 2, - }, - s: { // seconds - value: 1000, - }, - ss: { // padded seconds - value: 's', - pad: 2, - }, - sss: { // milliseconds - value: 1, - }, - ssss: { // padded milliseconds - value: 'sss', - pad: 4, - }, -}; - -function _parseFormat(string) { - // @inspiration AngularJS date filter - var parts = []; - var format = string ? string.toString() : ''; - - while (format) { - var match = DURATION_FORMATS_SPLIT.exec(format); - - if (match) { - parts = parts.concat(match.slice(1)); - - format = parts.pop(); - } else { - parts.push(format); - - format = null; - } - } - - return parts; -} - -function _formatDuration(timestamp, format) { - var text = ''; - var values = { }; - - format.filter(function(format) { // filter only value parts of format - return DURATION_FORMATS.hasOwnProperty(format); - }).map(function(format) { // get formats with values only - var config = DURATION_FORMATS[format]; - - if (config.hasOwnProperty('pad')) { - return config.value; - } else { - return format; - } - }).filter(function(format, index, arr) { // remove duplicates - return (arr.indexOf(format) === index); - }).map(function(format) { // get format configurations with values - return Object.assign({ - name: format, - }, DURATION_FORMATS[format]); - }).sort(function(a, b) { // sort formats descending by value - return b.value - a.value; - }).forEach(function(format) { // create values for format parts - var value = values[format.name] = Math.floor(timestamp / format.value); - - timestamp = timestamp - (value * format.value); - }); - - format.forEach(function(part) { - var format = DURATION_FORMATS[part]; - - if (format) { - var value = values[format.value]; - - text += (format.hasOwnProperty('pad') ? _padNumber(value, Math.max(format.pad, value.toString().length)) : values[part]); - } else { - text += part.replace(/(^'|'$)/g, '').replace(/''/g, '\''); - } - }); - - return text; -} - -function _padNumber(number, len) { - return ((new Array(len + 1)).join('0') + number).slice(-len); -} - -export default (value, format) => { - var parsedValue = parseFloat(value, 10); - var parsedFormat = _parseFormat(format); - - if (isNaN(parsedValue) || (parsedFormat.length === 0)) { - return value; - } else { - return _formatDuration(parsedValue, parsedFormat); - } -}; +var DURATION_FORMATS_SPLIT = /((?:[^ydhms']+)|(?:'(?:[^']|'')*')|(?:y+|d+|h+|m+|s+))(.*)/; +var DURATION_FORMATS = { + y: { + // years + // "longer" years are not supported + value: 365 * 24 * 60 * 60 * 1000, + }, + yy: { + value: 'y', + pad: 2, + }, + d: { + // days + value: 24 * 60 * 60 * 1000, + }, + dd: { + value: 'd', + pad: 2, + }, + h: { + // hours + value: 60 * 60 * 1000, + }, + hh: { + // padded hours + value: 'h', + pad: 2, + }, + m: { + // minutes + value: 60 * 1000, + }, + mm: { + // padded minutes + value: 'm', + pad: 2, + }, + s: { + // seconds + value: 1000, + }, + ss: { + // padded seconds + value: 's', + pad: 2, + }, + sss: { + // milliseconds + value: 1, + }, + ssss: { + // padded milliseconds + value: 'sss', + pad: 4, + }, +}; + +function _parseFormat(string) { + // @inspiration AngularJS date filter + var parts = []; + var format = string ? string.toString() : ''; + + while (format) { + var match = DURATION_FORMATS_SPLIT.exec(format); + + if (match) { + parts = parts.concat(match.slice(1)); + + format = parts.pop(); + } else { + parts.push(format); + + format = null; + } + } + + return parts; +} + +function _formatDuration(timestamp, format) { + var text = ''; + var values = {}; + + format + .filter(function (format) { + // filter only value parts of format + return DURATION_FORMATS.hasOwnProperty(format); + }) + .map(function (format) { + // get formats with values only + var config = DURATION_FORMATS[format]; + + if (config.hasOwnProperty('pad')) { + return config.value; + } else { + return format; + } + }) + .filter(function (format, index, arr) { + // remove duplicates + return arr.indexOf(format) === index; + }) + .map(function (format) { + // get format configurations with values + return Object.assign( + { + name: format, + }, + DURATION_FORMATS[format], + ); + }) + .sort(function (a, b) { + // sort formats descending by value + return b.value - a.value; + }) + .forEach(function (format) { + // create values for format parts + var value = (values[format.name] = Math.floor(timestamp / format.value)); + + timestamp = timestamp - value * format.value; + }); + + format.forEach(function (part) { + var format = DURATION_FORMATS[part]; + + if (format) { + var value = values[format.value]; + + text += format.hasOwnProperty('pad') + ? _padNumber(value, Math.max(format.pad, value.toString().length)) + : values[part]; + } else { + text += part.replace(/(^'|'$)/g, '').replace(/''/g, "'"); + } + }); + + return text; +} + +function _padNumber(number, len) { + return (new Array(len + 1).join('0') + number).slice(-len); +} + +export default (value, format) => { + var parsedValue = parseFloat(value, 10); + var parsedFormat = _parseFormat(format); + + if (isNaN(parsedValue) || parsedFormat.length === 0) { + return value; + } else { + return _formatDuration(parsedValue, parsedFormat); + } +}; diff --git a/common/pm2wrapper.js b/common/pm2wrapper.js index aba70e5..ff80b89 100644 --- a/common/pm2wrapper.js +++ b/common/pm2wrapper.js @@ -1,101 +1,101 @@ -const pm2 = require('pm2'); - -module.exports={ - list:() => { - return new Promise((resolve, reject)=>{ - pm2.connect(true,(err)=>{ - if(err) return reject(err); - pm2.list((err,list)=>{ - pm2.disconnect(); - if(err){ - return reject(err); - } - return resolve(list); - }); - }); - }); - }, - start:(id)=>{ - return new Promise((resolve, reject)=>{ - pm2.connect(true,(err)=>{ - if(err) return reject(err); - pm2.start(id, (err, details)=>{ - pm2.disconnect(); - if(err){ - return reject(err); - } - return resolve(details); - }); - }); - }); - }, - stop:(id) => { - return new Promise((resolve, reject)=>{ - pm2.connect(true,(err)=>{ - if(err) return reject(err); - pm2.stop(id, (err, details)=>{ - pm2.disconnect(); - if(err){ - return reject(err); - } - return resolve(details); - }); - }); - }); - }, - restart:(id) => { - return new Promise((resolve, reject)=>{ - pm2.connect(true,(err)=>{ - if(err) return reject(err); - pm2.gracefulReload(id, (err, details)=>{ - pm2.disconnect(); - if(err){ - return reject(err); - } - return resolve(details); - }); - }); - }); - }, - delete:(id) => { - return new Promise((resolve, reject)=>{ - pm2.connect(true,(err)=>{ - if(err) return reject(err); - pm2.delete(id, (err, details)=>{ - pm2.disconnect(); - if(err){ - return reject(err); - } - return resolve(details); - }); - }); - }); - }, - kill:() => { - return new Promise((resolve, reject)=>{ - pm2.connect(true,(err)=>{ - if(err) return reject(err); - pm2.killDaemon((err,details)=>{ - if(err){ - return reject(err); - } - return resolve(details); - }); - }); - }); - }, - describe:(id) => { - return new Promise((resolve, reject)=>{ - pm2.connect(true,(err)=>{ - if(err) return reject(err); - pm2.describe(id, (err, details)=>{ - pm2.disconnect(); - if(err){ - return reject(err); - } - return resolve(details); - }); - }); - }); - }, -}; +const pm2 = require('pm2'); + +module.exports = { + list: () => { + return new Promise((resolve, reject) => { + pm2.connect(true, (err) => { + if (err) return reject(err); + pm2.list((err, list) => { + pm2.disconnect(); + if (err) { + return reject(err); + } + return resolve(list); + }); + }); + }); + }, + start: (id) => { + return new Promise((resolve, reject) => { + pm2.connect(true, (err) => { + if (err) return reject(err); + pm2.start(id, (err, details) => { + pm2.disconnect(); + if (err) { + return reject(err); + } + return resolve(details); + }); + }); + }); + }, + stop: (id) => { + return new Promise((resolve, reject) => { + pm2.connect(true, (err) => { + if (err) return reject(err); + pm2.stop(id, (err, details) => { + pm2.disconnect(); + if (err) { + return reject(err); + } + return resolve(details); + }); + }); + }); + }, + restart: (id) => { + return new Promise((resolve, reject) => { + pm2.connect(true, (err) => { + if (err) return reject(err); + pm2.gracefulReload(id, (err, details) => { + pm2.disconnect(); + if (err) { + return reject(err); + } + return resolve(details); + }); + }); + }); + }, + delete: (id) => { + return new Promise((resolve, reject) => { + pm2.connect(true, (err) => { + if (err) return reject(err); + pm2.delete(id, (err, details) => { + pm2.disconnect(); + if (err) { + return reject(err); + } + return resolve(details); + }); + }); + }); + }, + kill: () => { + return new Promise((resolve, reject) => { + pm2.connect(true, (err) => { + if (err) return reject(err); + pm2.killDaemon((err, details) => { + if (err) { + return reject(err); + } + return resolve(details); + }); + }); + }); + }, + describe: (id) => { + return new Promise((resolve, reject) => { + pm2.connect(true, (err) => { + if (err) return reject(err); + pm2.describe(id, (err, details) => { + pm2.disconnect(); + if (err) { + return reject(err); + } + return resolve(details); + }); + }); + }); + }, +}; diff --git a/common/processController.js b/common/processController.js index bd7c2a3..f335221 100644 --- a/common/processController.js +++ b/common/processController.js @@ -1,167 +1,181 @@ -const os=require('os'); -const pm2wrapper = require('./pm2wrapper'); -const utils = require('./utils'); - -function getOsStats() { - return { - system_info:{ - hostName:os.hostname(), - uptime:os.uptime(), - }, - monit:{ - loadavg:os.loadavg(), - total_mem:os.totalmem(), - free_mem:os.freemem(), - cpu:os.cpus(), - interfaces:os.networkInterfaces(), - }, - os:{ - type:os.type(), - platform:os.platform(), - release:os.release(), - }, - cpu_arch:os.arch(), - loadAvg:os.loadavg(), - }; -} - -module.exports={ - list:()=>{ - let stats = getOsStats(); - const externalProcesses = utils.getExternalProcesses(); - const statusPromises = Object.keys(externalProcesses).map(name=>{ - if (externalProcesses[name].pm2proc!==false){ - return new Promise(resolve=>{ - return resolve({status:'offline'}); - }); - }else{ - return externalProcesses[name].status().catch(err=>{ - console.error(`error getting status of external process "${name}":`, err); - return {status:'unknown'}; - }); - } - }); - return Promise.all([pm2wrapper.list(), ...statusPromises]).then(([list, ...statuses])=>{ - const pm2ProcesesNames = list.map(proc=>proc.name); - - const outerProcesses = Object.keys(externalProcesses) - .filter(name=>!pm2ProcesesNames.includes(name)) - .map((name, index)=>{ - const procStatus = { - name, - pm2:false, - pm_id: undefined, - pm2_env: { - exec_mode:'External Process', - status:statuses[index].status, - pm_uptime:undefined, - created_at:undefined, - restart_time:undefined, - unstable_restarts:undefined, - }, - pid: undefined, - monit: { - memory:undefined, - cpu: undefined, - }, - }; - - if (externalProcesses[name].pm2proc!==false){ - return Object.assign({}, procStatus, externalProcesses[name]); - }else{ - return procStatus; - } - }); - - stats.processes=list.concat(outerProcesses); - return stats; - }); - }, - start:id=>{ - const externalProcesses = utils.getExternalProcesses(); - if (externalProcesses[id].pm2proc===false){ - return externalProcesses[id].start(); - }else{ - return pm2wrapper.start(externalProcesses[id]); - } - }, - stop:id=>{ - const externalProcesses = utils.getExternalProcesses(); - if (externalProcesses[id].pm2proc===false){ - return externalProcesses[id].stop(); - }else{ - return pm2wrapper.stop(id); - } - }, - restart:id=>{ - const externalProcesses = utils.getExternalProcesses(); - if (externalProcesses[id].pm2proc===false){ - return externalProcesses[id].restart(); - }else{ - return pm2wrapper.restart(id).catch((err)=>{ - if (err.message==='process name not found'){ - return pm2wrapper.start(externalProcesses[id]); - }else{ - throw err; - } - }); - } - }, - delete:id=>{ - const externalProcesses = utils.getExternalProcesses(); - if (externalProcesses[id].pm2proc===false){ - return externalProcesses[id].delete(); - }else{ - return pm2wrapper.delete(id); - } - }, - describe:id=>{ - const externalProcesses = utils.getExternalProcesses(); - if (externalProcesses[id].pm2proc===false){ - return externalProcesses[id].describe().catch(err=>{ - console.error(`error getting described details of external process "${id}":`, err); - return []; - }).then(details=>{ - return { - procId: id, - logsPaths: details, - }; - }); - }else{ - return pm2wrapper.describe(id).then(procDetails => { - let logsPaths = [{ - name: 'error', - path: procDetails[0].pm2_env.pm_err_log_path, - },{ - name: 'out', - path: procDetails[0].pm2_env.pm_out_log_path, - }]; - - let logsDetails = { - procId: id, - logsPaths, - }; - - return logsDetails; - }); - } - }, - getConfigurations:id=>{ - const externalProcesses = utils.getExternalProcesses(); - if (externalProcesses[id] && externalProcesses[id].getConfigurations){ - return externalProcesses[id].getConfigurations(); - } - // else{ - // return pm2wrapper.getConfigurations(id); - // } - }, - setConfigurations:(id, configuration)=>{ - const externalProcesses = utils.getExternalProcesses(); - if (externalProcesses[id] && externalProcesses[id].setConfigurations){ - return externalProcesses[id].setConfigurations(configuration); - } - // else{ - // return pm2wrapper.setConfigurations(id, configuration); - // } - }, -}; +const os = require('os'); +const pm2wrapper = require('./pm2wrapper'); +const utils = require('./utils'); + +function getOsStats() { + return { + system_info: { + hostName: os.hostname(), + uptime: os.uptime(), + }, + monit: { + loadavg: os.loadavg(), + total_mem: os.totalmem(), + free_mem: os.freemem(), + cpu: os.cpus(), + interfaces: os.networkInterfaces(), + }, + os: { + type: os.type(), + platform: os.platform(), + release: os.release(), + }, + cpu_arch: os.arch(), + loadAvg: os.loadavg(), + }; +} + +module.exports = { + list: () => { + let stats = getOsStats(); + const externalProcesses = utils.getExternalProcesses(); + const statusPromises = Object.keys(externalProcesses).map((name) => { + if (externalProcesses[name].pm2proc !== false) { + return new Promise((resolve) => { + return resolve({ status: 'offline' }); + }); + } else { + return externalProcesses[name].status().catch((err) => { + console.error( + `error getting status of external process "${name}":`, + err, + ); + return { status: 'unknown' }; + }); + } + }); + return Promise.all([pm2wrapper.list(), ...statusPromises]).then( + ([list, ...statuses]) => { + const pm2ProcesesNames = list.map((proc) => proc.name); + + const outerProcesses = Object.keys(externalProcesses) + .filter((name) => !pm2ProcesesNames.includes(name)) + .map((name, index) => { + const procStatus = { + name, + pm2: false, + pm_id: undefined, + pm2_env: { + exec_mode: 'External Process', + status: statuses[index].status, + pm_uptime: undefined, + created_at: undefined, + restart_time: undefined, + unstable_restarts: undefined, + }, + pid: undefined, + monit: { + memory: undefined, + cpu: undefined, + }, + }; + + if (externalProcesses[name].pm2proc !== false) { + return Object.assign({}, procStatus, externalProcesses[name]); + } else { + return procStatus; + } + }); + + stats.processes = list.concat(outerProcesses); + return stats; + }, + ); + }, + start: (id) => { + const externalProcesses = utils.getExternalProcesses(); + if (externalProcesses[id].pm2proc === false) { + return externalProcesses[id].start(); + } else { + return pm2wrapper.start(externalProcesses[id]); + } + }, + stop: (id) => { + const externalProcesses = utils.getExternalProcesses(); + if (externalProcesses[id].pm2proc === false) { + return externalProcesses[id].stop(); + } else { + return pm2wrapper.stop(id); + } + }, + restart: (id) => { + const externalProcesses = utils.getExternalProcesses(); + if (externalProcesses[id].pm2proc === false) { + return externalProcesses[id].restart(); + } else { + return pm2wrapper.restart(id).catch((err) => { + if (err.message === 'process name not found') { + return pm2wrapper.start(externalProcesses[id]); + } else { + throw err; + } + }); + } + }, + delete: (id) => { + const externalProcesses = utils.getExternalProcesses(); + if (externalProcesses[id].pm2proc === false) { + return externalProcesses[id].delete(); + } else { + return pm2wrapper.delete(id); + } + }, + describe: (id) => { + const externalProcesses = utils.getExternalProcesses(); + if (externalProcesses[id].pm2proc === false) { + return externalProcesses[id] + .describe() + .catch((err) => { + console.error( + `error getting described details of external process "${id}":`, + err, + ); + return []; + }) + .then((details) => { + return { + procId: id, + logsPaths: details, + }; + }); + } else { + return pm2wrapper.describe(id).then((procDetails) => { + let logsPaths = [ + { + name: 'error', + path: procDetails[0].pm2_env.pm_err_log_path, + }, + { + name: 'out', + path: procDetails[0].pm2_env.pm_out_log_path, + }, + ]; + + let logsDetails = { + procId: id, + logsPaths, + }; + + return logsDetails; + }); + } + }, + getConfigurations: (id) => { + const externalProcesses = utils.getExternalProcesses(); + if (externalProcesses[id] && externalProcesses[id].getConfigurations) { + return externalProcesses[id].getConfigurations(); + } + // else{ + // return pm2wrapper.getConfigurations(id); + // } + }, + setConfigurations: (id, configuration) => { + const externalProcesses = utils.getExternalProcesses(); + if (externalProcesses[id] && externalProcesses[id].setConfigurations) { + return externalProcesses[id].setConfigurations(configuration); + } + // else{ + // return pm2wrapper.setConfigurations(id, configuration); + // } + }, +}; diff --git a/common/utils.js b/common/utils.js index 4a0f9da..31f9258 100644 --- a/common/utils.js +++ b/common/utils.js @@ -1,70 +1,82 @@ -const config = require('config'); -const Q = require('q'); -const path = require('path'); -const fs = require('fs'); - -const processController = require('./processController'); - -const EXTRA_PROCESSES_DIR = 'processes'; -let externalProcesses = {}; -Q.longStackSupport = true; - -const startup = () => { - processController.list().then((stats)=>{ - const existingProcesses = stats.processes.reduce((result, process)=>{ - // console.log(process.name, process.pm2_env.status); - result[process.name] = process; - return result; - },{}); - // console.log(existingProcesses); - - let promises; - if (config.processes!==undefined && Array.isArray(config.processes)){ - promises = config.processes.map((process)=>{ - const processName = typeof(process)==='string'?process:process.name; - - if (existingProcesses[processName]!==undefined) { - if (existingProcesses[processName].pm2_env && existingProcesses[processName].pm2_env.status!=='online'){ - if (existingProcesses[processName].pm2!==false){ - return ()=>{ - console.log(`Reloading ${processName}`); - return processController.start(processName); - }; - }else{ - return ()=>{ - console.log(`Reloading ${processName}`); - return processController.restart(processName); - }; - } - } - }else{ - return ()=>{ - console.log(`Starting ${processName}`); - return processController.start(process); - }; - } - - return ()=>Q(undefined); - }); - }else { - return ()=>Q([]); - } - - return promises.reduce(Q.when, Q(undefined)); - }).catch(console.error); -}; - -const loadExtraProcesses = () => { - return Q.nfcall(fs.readdir, path.join(__dirname, '..', EXTRA_PROCESSES_DIR), {encoding:'utf-8'}) - .then((files) => { - externalProcesses = files.reduce((result, file) => { - result[file] = require(`../${EXTRA_PROCESSES_DIR}/${file}`); - return result; - },{}); - return externalProcesses; - }).catch(console.error); -}; - -module.exports.startup = startup; -module.exports.loadExtraProcesses = loadExtraProcesses; -module.exports.getExternalProcesses=()=>{return externalProcesses;}; +const config = require('config'); +const Q = require('q'); +const path = require('path'); +const fs = require('fs'); + +const processController = require('./processController'); + +const EXTRA_PROCESSES_DIR = 'processes'; +let externalProcesses = {}; +Q.longStackSupport = true; + +const startup = () => { + processController + .list() + .then((stats) => { + const existingProcesses = stats.processes.reduce((result, process) => { + // console.log(process.name, process.pm2_env.status); + result[process.name] = process; + return result; + }, {}); + // console.log(existingProcesses); + + let promises; + if (config.processes !== undefined && Array.isArray(config.processes)) { + promises = config.processes.map((process) => { + const processName = + typeof process === 'string' ? process : process.name; + + if (existingProcesses[processName] !== undefined) { + if ( + existingProcesses[processName].pm2_env && + existingProcesses[processName].pm2_env.status !== 'online' + ) { + if (existingProcesses[processName].pm2 !== false) { + return () => { + console.log(`Reloading ${processName}`); + return processController.start(processName); + }; + } else { + return () => { + console.log(`Reloading ${processName}`); + return processController.restart(processName); + }; + } + } + } else { + return () => { + console.log(`Starting ${processName}`); + return processController.start(process); + }; + } + + return () => Q(undefined); + }); + } else { + return () => Q([]); + } + + return promises.reduce(Q.when, Q(undefined)); + }) + .catch(console.error); +}; + +const loadExtraProcesses = () => { + return Q.nfcall(fs.readdir, path.join(__dirname, '..', EXTRA_PROCESSES_DIR), { + encoding: 'utf-8', + }) + .then((files) => { + externalProcesses = files.reduce((result, file) => { + result[file] = require(`../${EXTRA_PROCESSES_DIR}/${file}`); + return result; + }, {}); + return externalProcesses; + }) + .catch(console.error); +}; + +module.exports.startup = startup; +module.exports.loadExtraProcesses = loadExtraProcesses; +module.exports.getExternalProcesses = () => { + return externalProcesses; +}; diff --git a/index.js b/index.js index 967d90c..e91ea74 100644 --- a/index.js +++ b/index.js @@ -1,202 +1,223 @@ -const express = require('express'); -const path = require('path'); -var fileSystem = require('fs'); -var bodyParser = require('body-parser'); - -const utils = require('./common/utils'); -const processController = require('./common/processController'); -const pm2wrapper = require('./common/pm2wrapper'); - -const app = express(); -const PORT = process.env.port||3666; -app.use( bodyParser.json() ); -app.use(bodyParser.urlencoded({ - extended: true, -})); - -//Information -app.get('/api/serverStat',(req,res)=>{ - processController.list() - .then((stats)=>{ - res.json(stats); - }) - .catch((err)=>{ - console.log(2); - console.error(err); - res.status(400).send(err); - }); -}); - -//Operations -app.get('/api/operations/stop/:id',(req,res)=>{ - if(!req.params.id){ - res.status(400).send({ - error:'Process id not supplied', - }); - return; - } - processController.stop(req.params.id) - .then((stats)=>{ - res.json(stats); - }) - .catch((err)=>{ - console.error(err); - res.status(400).send(err); - }); -}); - -app.get('/api/operations/restart/:id',(req,res)=>{ - if(!req.params.id){ - res.status(400).send({ - error:'Process id not supplied', - }); - return; - } - processController.restart(req.params.id) - .then((stats)=>{ - res.json(stats); - }) - .catch((err)=>{ - console.error(err); - res.status(400).send(err); - }); -}); - -app.get('/api/operations/delete/:id',(req,res)=>{ - if(!req.params.id){ - res.status(400).send({ - error:'Process id not supplied', - }); - return; - } - processController.delete(req.params.id) - .then((stats)=>{ - res.json(stats); - }) - .catch((err)=>{ - console.error(err); - res.status(400).send(err); - }); -}); - -app.get('/api/operations/kill', (req,res)=>{ - pm2wrapper.kill() - .then((stats)=>{ - res.json(stats); - }) - .catch((err)=>{ - console.error(err); - res.status(400).send(err); - }); -}); - -app.get('/api/operations/logs/:id', (req,res) => { - if(!req.params.id){ - res.status(400).send({ - error:'Process id not supplied', - }); - return; - } - - processController.describe(req.params.id).then(logsDetails=>{ - console.log(logsDetails); - res.json(logsDetails); - }).catch((err)=>{ - console.error(err); - res.status(400).send(err); - }); -}); - -app.post('/api/operations/showlog', (req,res)=>{ - try{ - var readStream = fileSystem.createReadStream(req.body.logpath); - readStream.pipe(res); - }catch(e){ - console.error(`log "${req.body.logpath}" not found`); - } -}); - -app.get('/api/operations/showlog/:id/:logname', (req,res)=>{ - let id = req.params.id; - let logname = req.params.logname; - - if(!id){ - res.status(400).send({ - error:'Process id not supplied', - }); - return; - } - - if(!logname){ - res.status(400).send({ - error:'Logname not supplied', - }); - return; - } - - processController.describe(req.params.id).then(procsDetails=>{ - const logs = procsDetails.logsPaths.filter(proc=>proc.name===logname); - if (logs.length>0){ - const readStream = fileSystem.createReadStream(logs[0].path); - readStream.pipe(res); - }else{ - console.error(`No log "${logname}" found on process "${id}"`); - throw `No log "${logname}" found on process "${id}"`; - } - // pm2wrapper.describe(req.params.id).then((procDetails) => { - // let logFilePath = ''; - // - // if (logname === 'out') { - // logFilePath = procDetails[0].pm2_env.pm_out_log_path; - // } else if (logname === 'error') { - // logFilePath = procDetails[0].pm2_env.pm_err_log_path; - // } - // - // var readStream = fileSystem.createReadStream(logFilePath); - // readStream.pipe(res); - }).catch((err)=>{ - console.error(err); - res.status(400).send(err); - }); -}); - -app.get('/api/operations/configuration/:id', (req,res)=>{ - if(!req.params.id){ - res.status(400).send({ - error:'Process id not supplied', - }); - return; - } - - processController.getConfigurations(req.params.id).then(configurationDetails=>{ - res.json(configurationDetails); - }).catch((err)=>{ - console.error(err); - res.status(400).send(err); - }); -}); - -app.post('/api/operations/configuration/:id', (req,res)=>{ - if(!req.params.id || !req.body.configurations){ - res.status(400).send({ - error:'Process id not supplied', - }); - return; - } - - processController.setConfigurations(req.params.id, req.body.configurations).then(configurationDetails=>{ - res.json(configurationDetails); - }).catch((err)=>{ - console.error(err); - res.status(400).send(err); - }); -}); - -app.use('/', express.static(path.join(__dirname,'static'))); - -utils.loadExtraProcesses().then(()=>{ - utils.startup(); -}); - -app.listen(PORT); -console.log(`listening on: http://localhost:${PORT}/`); +const express = require('express'); +const path = require('path'); +var fileSystem = require('fs'); +var bodyParser = require('body-parser'); + +const utils = require('./common/utils'); +const processController = require('./common/processController'); +const pm2wrapper = require('./common/pm2wrapper'); + +const app = express(); +const PORT = process.env.port || 3666; +app.use(bodyParser.json()); +app.use( + bodyParser.urlencoded({ + extended: true, + }), +); + +//Information +app.get('/api/serverStat', (req, res) => { + processController + .list() + .then((stats) => { + res.json(stats); + }) + .catch((err) => { + console.log(2); + console.error(err); + res.status(400).send(err); + }); +}); + +//Operations +app.get('/api/operations/stop/:id', (req, res) => { + if (!req.params.id) { + res.status(400).send({ + error: 'Process id not supplied', + }); + return; + } + processController + .stop(req.params.id) + .then((stats) => { + res.json(stats); + }) + .catch((err) => { + console.error(err); + res.status(400).send(err); + }); +}); + +app.get('/api/operations/restart/:id', (req, res) => { + if (!req.params.id) { + res.status(400).send({ + error: 'Process id not supplied', + }); + return; + } + processController + .restart(req.params.id) + .then((stats) => { + res.json(stats); + }) + .catch((err) => { + console.error(err); + res.status(400).send(err); + }); +}); + +app.get('/api/operations/delete/:id', (req, res) => { + if (!req.params.id) { + res.status(400).send({ + error: 'Process id not supplied', + }); + return; + } + processController + .delete(req.params.id) + .then((stats) => { + res.json(stats); + }) + .catch((err) => { + console.error(err); + res.status(400).send(err); + }); +}); + +app.get('/api/operations/kill', (req, res) => { + pm2wrapper + .kill() + .then((stats) => { + res.json(stats); + }) + .catch((err) => { + console.error(err); + res.status(400).send(err); + }); +}); + +app.get('/api/operations/logs/:id', (req, res) => { + if (!req.params.id) { + res.status(400).send({ + error: 'Process id not supplied', + }); + return; + } + + processController + .describe(req.params.id) + .then((logsDetails) => { + console.log(logsDetails); + res.json(logsDetails); + }) + .catch((err) => { + console.error(err); + res.status(400).send(err); + }); +}); + +app.post('/api/operations/showlog', (req, res) => { + try { + var readStream = fileSystem.createReadStream(req.body.logpath); + readStream.pipe(res); + } catch (e) { + console.error(`log "${req.body.logpath}" not found`); + } +}); + +app.get('/api/operations/showlog/:id/:logname', (req, res) => { + let id = req.params.id; + let logname = req.params.logname; + + if (!id) { + res.status(400).send({ + error: 'Process id not supplied', + }); + return; + } + + if (!logname) { + res.status(400).send({ + error: 'Logname not supplied', + }); + return; + } + + processController + .describe(req.params.id) + .then((procsDetails) => { + const logs = procsDetails.logsPaths.filter( + (proc) => proc.name === logname, + ); + if (logs.length > 0) { + const readStream = fileSystem.createReadStream(logs[0].path); + readStream.pipe(res); + } else { + console.error(`No log "${logname}" found on process "${id}"`); + throw `No log "${logname}" found on process "${id}"`; + } + // pm2wrapper.describe(req.params.id).then((procDetails) => { + // let logFilePath = ''; + // + // if (logname === 'out') { + // logFilePath = procDetails[0].pm2_env.pm_out_log_path; + // } else if (logname === 'error') { + // logFilePath = procDetails[0].pm2_env.pm_err_log_path; + // } + // + // var readStream = fileSystem.createReadStream(logFilePath); + // readStream.pipe(res); + }) + .catch((err) => { + console.error(err); + res.status(400).send(err); + }); +}); + +app.get('/api/operations/configuration/:id', (req, res) => { + if (!req.params.id) { + res.status(400).send({ + error: 'Process id not supplied', + }); + return; + } + + processController + .getConfigurations(req.params.id) + .then((configurationDetails) => { + res.json(configurationDetails); + }) + .catch((err) => { + console.error(err); + res.status(400).send(err); + }); +}); + +app.post('/api/operations/configuration/:id', (req, res) => { + if (!req.params.id || !req.body.configurations) { + res.status(400).send({ + error: 'Process id not supplied', + }); + return; + } + + processController + .setConfigurations(req.params.id, req.body.configurations) + .then((configurationDetails) => { + res.json(configurationDetails); + }) + .catch((err) => { + console.error(err); + res.status(400).send(err); + }); +}); + +app.use('/', express.static(path.join(__dirname, 'static'))); + +utils.loadExtraProcesses().then(() => { + utils.startup(); +}); + +app.listen(PORT); +console.log(`listening on: http://localhost:${PORT}/`); diff --git a/package.json b/package.json index ad1f1d0..b506a3a 100644 --- a/package.json +++ b/package.json @@ -84,6 +84,7 @@ "babel-eslint": "^7.0.0", "eslint": "^3.6.1", "eslint-plugin-react": "^6.4.1", + "prettier": "^2.1.2", "why-did-you-update": "^0.0.8" } } diff --git a/processes/anal.e/index.js b/processes/anal.e/index.js index 370d2c4..895f72c 100644 --- a/processes/anal.e/index.js +++ b/processes/anal.e/index.js @@ -1,21 +1,21 @@ -module.exports = { - pm2proc: true, - name: 'anal.e', - cwd: '../anal.e/dist', - script: 'index.js', - merge_logs: true, - log_date_format: 'YYYY-MM-DD HH:mm Z', - error_file: 'logs/anale.stderr.log', - out_file: 'logs/anale.stdout.log', - pid_file: 'logs/anale.pid', - env:{ - NODE_ENV: 'development', - }, - env_production : { - NODE_ENV: 'production', - }, - max_memory_restart: '500M', - instances: 1, - autorestart : true, - restart_delay: 4000, -}; +module.exports = { + pm2proc: true, + name: 'anal.e', + cwd: '../anal.e/dist', + script: 'index.js', + merge_logs: true, + log_date_format: 'YYYY-MM-DD HH:mm Z', + error_file: 'logs/anale.stderr.log', + out_file: 'logs/anale.stdout.log', + pid_file: 'logs/anale.pid', + env: { + NODE_ENV: 'development', + }, + env_production: { + NODE_ENV: 'production', + }, + max_memory_restart: '500M', + instances: 1, + autorestart: true, + restart_delay: 4000, +}; diff --git a/processes/iis/index.js b/processes/iis/index.js index b3e9ef1..14ef501 100644 --- a/processes/iis/index.js +++ b/processes/iis/index.js @@ -1,61 +1,63 @@ -const child_process = require('child_process'); - -module.exports = { - pm2proc: false, - start: ()=>{ - return new Promise((resolve, reject) => { - child_process.exec('iisreset /start', (err, stdOut, stdErr) => { - if(err) return reject(err); - return resolve({stdOut, stdErr}); - }); - }); - }, - stop: ()=>{ - return new Promise((resolve, reject) => { - child_process.exec('iisreset /stop', (err, stdOut, stdErr) => { - if(err) return reject(err); - return resolve({stdOut, stdErr}); - }); - }); - }, - restart: ()=>{ - return new Promise((resolve, reject) => { - child_process.exec('iisreset', (err, stdOut, stdErr) => { - if(err) return reject(err); - return resolve({stdOut, stdErr}); - }); - }); - }, - status: ()=>{ - return new Promise((resolve, reject) => { - child_process.exec('iisreset /status', (err, stdOut, stdErr) => { - if(err) return reject(err); - if (/World Wide Web Publishing[^:]*: Running/i.test(stdOut)){ - return resolve({status:'online'}); - }else if (/World Wide Web Publishing[^:]*: Stopped/i.test(stdOut)){ - return resolve({status:'stopped'}); - }else{ - return reject({stdOut, stdErr}); - } - }); - }); - }, - describe: ()=>{ - return new Promise(resolve=>{ - return resolve([{ - name: 'PrismWebServer', - path: 'C:/ProgramData/Sisense/PrismWeb/Logs/PrismWebServer.log', - }]); - }); - }, - getConfigurations:()=>{ - return Promise.resolve({ - port: 80, - ssl: false, - }); - }, - setConfigurations:(configuration={})=>{ - console.log(configuration); - return Promise.resolve(configuration); - }, -}; +const child_process = require('child_process'); + +module.exports = { + pm2proc: false, + start: () => { + return new Promise((resolve, reject) => { + child_process.exec('iisreset /start', (err, stdOut, stdErr) => { + if (err) return reject(err); + return resolve({ stdOut, stdErr }); + }); + }); + }, + stop: () => { + return new Promise((resolve, reject) => { + child_process.exec('iisreset /stop', (err, stdOut, stdErr) => { + if (err) return reject(err); + return resolve({ stdOut, stdErr }); + }); + }); + }, + restart: () => { + return new Promise((resolve, reject) => { + child_process.exec('iisreset', (err, stdOut, stdErr) => { + if (err) return reject(err); + return resolve({ stdOut, stdErr }); + }); + }); + }, + status: () => { + return new Promise((resolve, reject) => { + child_process.exec('iisreset /status', (err, stdOut, stdErr) => { + if (err) return reject(err); + if (/World Wide Web Publishing[^:]*: Running/i.test(stdOut)) { + return resolve({ status: 'online' }); + } else if (/World Wide Web Publishing[^:]*: Stopped/i.test(stdOut)) { + return resolve({ status: 'stopped' }); + } else { + return reject({ stdOut, stdErr }); + } + }); + }); + }, + describe: () => { + return new Promise((resolve) => { + return resolve([ + { + name: 'PrismWebServer', + path: 'C:/ProgramData/Sisense/PrismWeb/Logs/PrismWebServer.log', + }, + ]); + }); + }, + getConfigurations: () => { + return Promise.resolve({ + port: 80, + ssl: false, + }); + }, + setConfigurations: (configuration = {}) => { + console.log(configuration); + return Promise.resolve(configuration); + }, +}; diff --git a/processes/mongo/index.js b/processes/mongo/index.js index cc3eb58..e396671 100644 --- a/processes/mongo/index.js +++ b/processes/mongo/index.js @@ -1,18 +1,18 @@ -module.exports = { - pm2proc: true, - name: 'mongo', - cwd: '../prismweb/MaestroWebApp/vnext', - script: 'mongoStarter.js', - merge_logs: true, - log_date_format: 'YYYY-MM-DD HH:mm Z', - error_file: 'logs/mongo.stderr.log', - out_file: 'logs/mongo.stdout.log', - pid_file: 'logs/mongo.pid', - env:{ - NODE_ENV: 'development', - }, - env_production: { - NODE_ENV: 'production', - }, - instances: 1, -}; +module.exports = { + pm2proc: true, + name: 'mongo', + cwd: '../prismweb/MaestroWebApp/vnext', + script: 'mongoStarter.js', + merge_logs: true, + log_date_format: 'YYYY-MM-DD HH:mm Z', + error_file: 'logs/mongo.stderr.log', + out_file: 'logs/mongo.stdout.log', + pid_file: 'logs/mongo.pid', + env: { + NODE_ENV: 'development', + }, + env_production: { + NODE_ENV: 'production', + }, + instances: 1, +}; diff --git a/processes/nginx/index.js b/processes/nginx/index.js index b2404d5..944d509 100644 --- a/processes/nginx/index.js +++ b/processes/nginx/index.js @@ -1,153 +1,231 @@ -const fs = require('fs'); - -module.exports = { - pm2proc: true, - name: 'nginx', - cwd: '../prismWeb/nginx', - script: 'wrapper.js', - args:['nginx.exe'], - merge_logs: true, - log_date_format: 'YYYY-MM-DD HH:mm Z', - error_file: 'logs/nginx.stderr.log', - out_file: 'logs/nginx.stdout.log', - pid_file: 'logs/nginx.pid', - autorestart:false, - env:{ - NODE_ENV: 'development', - }, - 'env_production' : { - NODE_ENV: 'production', - }, - max_memory_restart: '500M', - instances: 1, - getConfigurations:()=>{ - return new Promise((resolve, reject)=>{ - fs.readFile('C:/git/prismweb/nginx/conf/nginx.conf', 'utf-8', (err, data) => { - if (err) return reject(err); - return resolve({'general': data}); - }); - }).then((conf)=>{ - return new Promise((resolve, reject)=>{ - fs.readFile('C:/git/prismweb/nginx/conf/sisense.conf', 'utf-8', (err, data) => { - if (err) return reject(err); - return resolve(Object.assign({},conf,{'sisense': data})); - }); - }); - }).then((conf)=>{ - return new Promise((resolve, reject)=>{ - fs.readFile('C:/git/prismweb/nginx/conf/node.conf', 'utf-8', (err, data) => { - if (err) return reject(err); - return resolve(Object.assign({},conf,{'node': data})); - }); - }); - }).then((conf)=>{ - return new Promise((resolve, reject)=>{ - fs.readFile('C:/git/prismweb/nginx/conf/net.conf', 'utf-8', (err, data) => { - if (err) return reject(err); - return resolve(Object.assign({},conf,{'net': data})); - }); - }); - }).then((conf)=>{ - return new Promise((resolve, reject)=>{ - fs.readFile('C:/git/prismweb/nginx/conf/ssl.conf', 'utf-8', (err, data) => { - if (err) return reject(err); - return resolve(Object.assign({},conf,{'ssl': data})); - }); - }); - }).then((conf)=>{ - return new Promise((resolve, reject)=>{ - fs.readFile('C:/git/prismweb/nginx/conf/cors.conf', 'utf-8', (err, data) => { - if (err) return reject(err); - return resolve(Object.assign({},conf,{'cors': data})); - }); - }); - }).then((conf)=>{ - return new Promise((resolve, reject)=>{ - fs.readFile('C:/git/prismweb/nginx/conf/static.conf', 'utf-8', (err, data) => { - if (err) return reject(err); - return resolve(Object.assign({},conf,{'static': data})); - }); - }); - }).then((conf)=>{ - return new Promise((resolve, reject)=>{ - fs.readFile('C:/git/prismweb/nginx/conf/custom.conf', 'utf-8', (err, data) => { - if (err) return reject(err); - return resolve(Object.assign({},conf,{'custom': data})); - }); - }); - }); - }, - setConfigurations:(config={})=>{ - return new Promise((resolve, reject)=>{ - if(config.hasOwnProperty('general')){ - fs.writeFile('C:/git/prismweb/nginx/conf/nginx.conf', config['general'], (err)=>{ - if (err) return reject(err); - resolve(config); - }); - } - }).then((config)=>{ - return new Promise((resolve, reject)=>{ - if(config.hasOwnProperty('sisense')){ - fs.writeFile('C:/git/prismweb/nginx/conf/sisense.conf', config['sisense'], (err)=>{ - if (err) return reject(err); - resolve(config); - }); - } - }); - }).then((config)=>{ - return new Promise((resolve, reject)=>{ - if(config.hasOwnProperty('node')){ - fs.writeFile('C:/git/prismweb/nginx/conf/node.conf', config['node'], (err)=>{ - if (err) return reject(err); - resolve(config); - }); - } - }); - }).then((config)=>{ - return new Promise((resolve, reject)=>{ - if(config.hasOwnProperty('net')){ - fs.writeFile('C:/git/prismweb/nginx/conf/net.conf', config['net'], (err)=>{ - if (err) return reject(err); - resolve(config); - }); - } - }); - }).then((config)=>{ - return new Promise((resolve, reject)=>{ - if(config.hasOwnProperty('ssl')){ - fs.writeFile('C:/git/prismweb/nginx/conf/ssl.conf', config['ssl'], (err)=>{ - if (err) return reject(err); - resolve(config); - }); - } - }); - }).then((config)=>{ - return new Promise((resolve, reject)=>{ - if(config.hasOwnProperty('cors')){ - fs.writeFile('C:/git/prismweb/nginx/conf/cors.conf', config['cors'], (err)=>{ - if (err) return reject(err); - resolve(config); - }); - } - }); - }).then((config)=>{ - return new Promise((resolve, reject)=>{ - if(config.hasOwnProperty('static')){ - fs.writeFile('C:/git/prismweb/nginx/conf/static.conf', config['static'], (err)=>{ - if (err) return reject(err); - resolve(config); - }); - } - }); - }).then((config)=>{ - return new Promise((resolve, reject)=>{ - if(config.hasOwnProperty('custom')){ - fs.writeFile('C:/git/prismweb/nginx/conf/custom.conf', config['custom'], (err)=>{ - if (err) return reject(err); - resolve(config); - }); - } - }); - }); - }, -}; +const fs = require('fs'); + +module.exports = { + pm2proc: true, + name: 'nginx', + cwd: '../prismWeb/nginx', + script: 'wrapper.js', + args: ['nginx.exe'], + merge_logs: true, + log_date_format: 'YYYY-MM-DD HH:mm Z', + error_file: 'logs/nginx.stderr.log', + out_file: 'logs/nginx.stdout.log', + pid_file: 'logs/nginx.pid', + autorestart: false, + env: { + NODE_ENV: 'development', + }, + env_production: { + NODE_ENV: 'production', + }, + max_memory_restart: '500M', + instances: 1, + getConfigurations: () => { + return new Promise((resolve, reject) => { + fs.readFile( + 'C:/git/prismweb/nginx/conf/nginx.conf', + 'utf-8', + (err, data) => { + if (err) return reject(err); + return resolve({ general: data }); + }, + ); + }) + .then((conf) => { + return new Promise((resolve, reject) => { + fs.readFile( + 'C:/git/prismweb/nginx/conf/sisense.conf', + 'utf-8', + (err, data) => { + if (err) return reject(err); + return resolve(Object.assign({}, conf, { sisense: data })); + }, + ); + }); + }) + .then((conf) => { + return new Promise((resolve, reject) => { + fs.readFile( + 'C:/git/prismweb/nginx/conf/node.conf', + 'utf-8', + (err, data) => { + if (err) return reject(err); + return resolve(Object.assign({}, conf, { node: data })); + }, + ); + }); + }) + .then((conf) => { + return new Promise((resolve, reject) => { + fs.readFile( + 'C:/git/prismweb/nginx/conf/net.conf', + 'utf-8', + (err, data) => { + if (err) return reject(err); + return resolve(Object.assign({}, conf, { net: data })); + }, + ); + }); + }) + .then((conf) => { + return new Promise((resolve, reject) => { + fs.readFile( + 'C:/git/prismweb/nginx/conf/ssl.conf', + 'utf-8', + (err, data) => { + if (err) return reject(err); + return resolve(Object.assign({}, conf, { ssl: data })); + }, + ); + }); + }) + .then((conf) => { + return new Promise((resolve, reject) => { + fs.readFile( + 'C:/git/prismweb/nginx/conf/cors.conf', + 'utf-8', + (err, data) => { + if (err) return reject(err); + return resolve(Object.assign({}, conf, { cors: data })); + }, + ); + }); + }) + .then((conf) => { + return new Promise((resolve, reject) => { + fs.readFile( + 'C:/git/prismweb/nginx/conf/static.conf', + 'utf-8', + (err, data) => { + if (err) return reject(err); + return resolve(Object.assign({}, conf, { static: data })); + }, + ); + }); + }) + .then((conf) => { + return new Promise((resolve, reject) => { + fs.readFile( + 'C:/git/prismweb/nginx/conf/custom.conf', + 'utf-8', + (err, data) => { + if (err) return reject(err); + return resolve(Object.assign({}, conf, { custom: data })); + }, + ); + }); + }); + }, + setConfigurations: (config = {}) => { + return new Promise((resolve, reject) => { + if (config.hasOwnProperty('general')) { + fs.writeFile( + 'C:/git/prismweb/nginx/conf/nginx.conf', + config['general'], + (err) => { + if (err) return reject(err); + resolve(config); + }, + ); + } + }) + .then((config) => { + return new Promise((resolve, reject) => { + if (config.hasOwnProperty('sisense')) { + fs.writeFile( + 'C:/git/prismweb/nginx/conf/sisense.conf', + config['sisense'], + (err) => { + if (err) return reject(err); + resolve(config); + }, + ); + } + }); + }) + .then((config) => { + return new Promise((resolve, reject) => { + if (config.hasOwnProperty('node')) { + fs.writeFile( + 'C:/git/prismweb/nginx/conf/node.conf', + config['node'], + (err) => { + if (err) return reject(err); + resolve(config); + }, + ); + } + }); + }) + .then((config) => { + return new Promise((resolve, reject) => { + if (config.hasOwnProperty('net')) { + fs.writeFile( + 'C:/git/prismweb/nginx/conf/net.conf', + config['net'], + (err) => { + if (err) return reject(err); + resolve(config); + }, + ); + } + }); + }) + .then((config) => { + return new Promise((resolve, reject) => { + if (config.hasOwnProperty('ssl')) { + fs.writeFile( + 'C:/git/prismweb/nginx/conf/ssl.conf', + config['ssl'], + (err) => { + if (err) return reject(err); + resolve(config); + }, + ); + } + }); + }) + .then((config) => { + return new Promise((resolve, reject) => { + if (config.hasOwnProperty('cors')) { + fs.writeFile( + 'C:/git/prismweb/nginx/conf/cors.conf', + config['cors'], + (err) => { + if (err) return reject(err); + resolve(config); + }, + ); + } + }); + }) + .then((config) => { + return new Promise((resolve, reject) => { + if (config.hasOwnProperty('static')) { + fs.writeFile( + 'C:/git/prismweb/nginx/conf/static.conf', + config['static'], + (err) => { + if (err) return reject(err); + resolve(config); + }, + ); + } + }); + }) + .then((config) => { + return new Promise((resolve, reject) => { + if (config.hasOwnProperty('custom')) { + fs.writeFile( + 'C:/git/prismweb/nginx/conf/custom.conf', + config['custom'], + (err) => { + if (err) return reject(err); + resolve(config); + }, + ); + } + }); + }); + }, +}; diff --git a/processes/prismweb/index.js b/processes/prismweb/index.js index 42da6da..799e614 100644 --- a/processes/prismweb/index.js +++ b/processes/prismweb/index.js @@ -1,43 +1,51 @@ -const fs = require('fs'); - -module.exports = { - pm2proc: true, - name: 'prismweb', - cwd: '../prismweb/Prism.Web.Service.Console/bin/Debug', - script: 'wrapper.js', - args:['Prism.Web.Service.Console.exe'], - merge_logs: true, - log_date_format: 'YYYY-MM-DD HH:mm Z', - error_file: 'logs/prismweb.stderr.log', - out_file: 'logs/prismweb.stdout.log', - pid_file: 'logs/prismweb.pid', - autorestart:false, - env:{ - NODE_ENV: 'development', - }, - 'env_production' : { - NODE_ENV: 'production', - }, - max_memory_restart: '500M', - instances: 1, - getConfigurations:()=>{ - return new Promise((resolve, reject)=>{ - fs.readFile('C:/git/prismweb/nginx/conf/nginx.conf', 'utf-8', (err, data) => { - if (err) return reject(err); - return resolve({'Whole Config': data}); - }); - }); - }, - setConfigurations:(configuration={})=>{ - return new Promise((resolve, reject)=>{ - if(configuration.hasOwnProperty('Whole Config')){ - console.log('started'); - fs.writeFile('C:/git/prismweb/nginx/conf/nginx.conf', configuration['Whole Config'], (err)=>{ - console.log('resolved'); - if (err) return reject(err); - resolve(configuration); - }); - } - }); - }, -}; +const fs = require('fs'); + +module.exports = { + pm2proc: true, + name: 'prismweb', + cwd: '../prismweb/Prism.Web.Service.Console/bin/Debug', + script: 'wrapper.js', + args: ['Prism.Web.Service.Console.exe'], + merge_logs: true, + log_date_format: 'YYYY-MM-DD HH:mm Z', + error_file: 'logs/prismweb.stderr.log', + out_file: 'logs/prismweb.stdout.log', + pid_file: 'logs/prismweb.pid', + autorestart: false, + env: { + NODE_ENV: 'development', + }, + env_production: { + NODE_ENV: 'production', + }, + max_memory_restart: '500M', + instances: 1, + getConfigurations: () => { + return new Promise((resolve, reject) => { + fs.readFile( + 'C:/git/prismweb/nginx/conf/nginx.conf', + 'utf-8', + (err, data) => { + if (err) return reject(err); + return resolve({ 'Whole Config': data }); + }, + ); + }); + }, + setConfigurations: (configuration = {}) => { + return new Promise((resolve, reject) => { + if (configuration.hasOwnProperty('Whole Config')) { + console.log('started'); + fs.writeFile( + 'C:/git/prismweb/nginx/conf/nginx.conf', + configuration['Whole Config'], + (err) => { + console.log('resolved'); + if (err) return reject(err); + resolve(configuration); + }, + ); + } + }); + }, +}; diff --git a/processes/privatenginx/index.js b/processes/privatenginx/index.js index 7bc2ea8..a4ddaf0 100644 --- a/processes/privatenginx/index.js +++ b/processes/privatenginx/index.js @@ -1,153 +1,195 @@ -const fs = require('fs'); - -module.exports = { - pm2proc: true, - name: 'privatenginx', - cwd: '../nginx', - script: 'wrapper.js', - args:['nginx.exe'], - merge_logs: true, - log_date_format: 'YYYY-MM-DD HH:mm Z', - error_file: 'logs/nginx.stderr.log', - out_file: 'logs/nginx.stdout.log', - pid_file: 'logs/nginx.pid', - autorestart:false, - env:{ - NODE_ENV: 'development', - }, - 'env_production' : { - NODE_ENV: 'production', - }, - max_memory_restart: '500M', - instances: 1, - getConfigurations:()=>{ - return new Promise((resolve, reject)=>{ - fs.readFile('C:/git/nginx/conf/nginx.conf', 'utf-8', (err, data) => { - if (err) return reject(err); - return resolve({'general': data}); - }); - }).then((conf)=>{ - return new Promise((resolve, reject)=>{ - fs.readFile('C:/git/nginx/conf/sisense.conf', 'utf-8', (err, data) => { - if (err) return reject(err); - return resolve(Object.assign({},conf,{'sisense': data})); - }); - }); - }).then((conf)=>{ - return new Promise((resolve, reject)=>{ - fs.readFile('C:/git/nginx/conf/node.conf', 'utf-8', (err, data) => { - if (err) return reject(err); - return resolve(Object.assign({},conf,{'node': data})); - }); - }); - }).then((conf)=>{ - return new Promise((resolve, reject)=>{ - fs.readFile('C:/git/nginx/conf/net.conf', 'utf-8', (err, data) => { - if (err) return reject(err); - return resolve(Object.assign({},conf,{'net': data})); - }); - }); - }).then((conf)=>{ - return new Promise((resolve, reject)=>{ - fs.readFile('C:/git/nginx/conf/ssl.conf', 'utf-8', (err, data) => { - if (err) return reject(err); - return resolve(Object.assign({},conf,{'ssl': data})); - }); - }); - }).then((conf)=>{ - return new Promise((resolve, reject)=>{ - fs.readFile('C:/git/nginx/conf/cors.conf', 'utf-8', (err, data) => { - if (err) return reject(err); - return resolve(Object.assign({},conf,{'cors': data})); - }); - }); - }).then((conf)=>{ - return new Promise((resolve, reject)=>{ - fs.readFile('C:/git/nginx/conf/static.conf', 'utf-8', (err, data) => { - if (err) return reject(err); - return resolve(Object.assign({},conf,{'static': data})); - }); - }); - }).then((conf)=>{ - return new Promise((resolve, reject)=>{ - fs.readFile('C:/git/nginx/conf/custom.conf', 'utf-8', (err, data) => { - if (err) return reject(err); - return resolve(Object.assign({},conf,{'custom': data})); - }); - }); - }); - }, - setConfigurations:(config={})=>{ - return new Promise((resolve, reject)=>{ - if(config.hasOwnProperty('general')){ - fs.writeFile('C:/git/nginx/conf/nginx.conf', config['general'], (err)=>{ - if (err) return reject(err); - resolve(config); - }); - } - }).then((config)=>{ - return new Promise((resolve, reject)=>{ - if(config.hasOwnProperty('sisense')){ - fs.writeFile('C:/git/nginx/conf/sisense.conf', config['sisense'], (err)=>{ - if (err) return reject(err); - resolve(config); - }); - } - }); - }).then((config)=>{ - return new Promise((resolve, reject)=>{ - if(config.hasOwnProperty('node')){ - fs.writeFile('C:/git/nginx/conf/node.conf', config['node'], (err)=>{ - if (err) return reject(err); - resolve(config); - }); - } - }); - }).then((config)=>{ - return new Promise((resolve, reject)=>{ - if(config.hasOwnProperty('net')){ - fs.writeFile('C:/git/nginx/conf/net.conf', config['net'], (err)=>{ - if (err) return reject(err); - resolve(config); - }); - } - }); - }).then((config)=>{ - return new Promise((resolve, reject)=>{ - if(config.hasOwnProperty('ssl')){ - fs.writeFile('C:/git/nginx/conf/ssl.conf', config['ssl'], (err)=>{ - if (err) return reject(err); - resolve(config); - }); - } - }); - }).then((config)=>{ - return new Promise((resolve, reject)=>{ - if(config.hasOwnProperty('cors')){ - fs.writeFile('C:/git/nginx/conf/cors.conf', config['cors'], (err)=>{ - if (err) return reject(err); - resolve(config); - }); - } - }); - }).then((config)=>{ - return new Promise((resolve, reject)=>{ - if(config.hasOwnProperty('static')){ - fs.writeFile('C:/git/nginx/conf/static.conf', config['static'], (err)=>{ - if (err) return reject(err); - resolve(config); - }); - } - }); - }).then((config)=>{ - return new Promise((resolve, reject)=>{ - if(config.hasOwnProperty('custom')){ - fs.writeFile('C:/git/nginx/conf/custom.conf', config['custom'], (err)=>{ - if (err) return reject(err); - resolve(config); - }); - } - }); - }); - }, -}; +const fs = require('fs'); + +module.exports = { + pm2proc: true, + name: 'privatenginx', + cwd: '../nginx', + script: 'wrapper.js', + args: ['nginx.exe'], + merge_logs: true, + log_date_format: 'YYYY-MM-DD HH:mm Z', + error_file: 'logs/nginx.stderr.log', + out_file: 'logs/nginx.stdout.log', + pid_file: 'logs/nginx.pid', + autorestart: false, + env: { + NODE_ENV: 'development', + }, + env_production: { + NODE_ENV: 'production', + }, + max_memory_restart: '500M', + instances: 1, + getConfigurations: () => { + return new Promise((resolve, reject) => { + fs.readFile('C:/git/nginx/conf/nginx.conf', 'utf-8', (err, data) => { + if (err) return reject(err); + return resolve({ general: data }); + }); + }) + .then((conf) => { + return new Promise((resolve, reject) => { + fs.readFile( + 'C:/git/nginx/conf/sisense.conf', + 'utf-8', + (err, data) => { + if (err) return reject(err); + return resolve(Object.assign({}, conf, { sisense: data })); + }, + ); + }); + }) + .then((conf) => { + return new Promise((resolve, reject) => { + fs.readFile('C:/git/nginx/conf/node.conf', 'utf-8', (err, data) => { + if (err) return reject(err); + return resolve(Object.assign({}, conf, { node: data })); + }); + }); + }) + .then((conf) => { + return new Promise((resolve, reject) => { + fs.readFile('C:/git/nginx/conf/net.conf', 'utf-8', (err, data) => { + if (err) return reject(err); + return resolve(Object.assign({}, conf, { net: data })); + }); + }); + }) + .then((conf) => { + return new Promise((resolve, reject) => { + fs.readFile('C:/git/nginx/conf/ssl.conf', 'utf-8', (err, data) => { + if (err) return reject(err); + return resolve(Object.assign({}, conf, { ssl: data })); + }); + }); + }) + .then((conf) => { + return new Promise((resolve, reject) => { + fs.readFile('C:/git/nginx/conf/cors.conf', 'utf-8', (err, data) => { + if (err) return reject(err); + return resolve(Object.assign({}, conf, { cors: data })); + }); + }); + }) + .then((conf) => { + return new Promise((resolve, reject) => { + fs.readFile('C:/git/nginx/conf/static.conf', 'utf-8', (err, data) => { + if (err) return reject(err); + return resolve(Object.assign({}, conf, { static: data })); + }); + }); + }) + .then((conf) => { + return new Promise((resolve, reject) => { + fs.readFile('C:/git/nginx/conf/custom.conf', 'utf-8', (err, data) => { + if (err) return reject(err); + return resolve(Object.assign({}, conf, { custom: data })); + }); + }); + }); + }, + setConfigurations: (config = {}) => { + return new Promise((resolve, reject) => { + if (config.hasOwnProperty('general')) { + fs.writeFile( + 'C:/git/nginx/conf/nginx.conf', + config['general'], + (err) => { + if (err) return reject(err); + resolve(config); + }, + ); + } + }) + .then((config) => { + return new Promise((resolve, reject) => { + if (config.hasOwnProperty('sisense')) { + fs.writeFile( + 'C:/git/nginx/conf/sisense.conf', + config['sisense'], + (err) => { + if (err) return reject(err); + resolve(config); + }, + ); + } + }); + }) + .then((config) => { + return new Promise((resolve, reject) => { + if (config.hasOwnProperty('node')) { + fs.writeFile( + 'C:/git/nginx/conf/node.conf', + config['node'], + (err) => { + if (err) return reject(err); + resolve(config); + }, + ); + } + }); + }) + .then((config) => { + return new Promise((resolve, reject) => { + if (config.hasOwnProperty('net')) { + fs.writeFile('C:/git/nginx/conf/net.conf', config['net'], (err) => { + if (err) return reject(err); + resolve(config); + }); + } + }); + }) + .then((config) => { + return new Promise((resolve, reject) => { + if (config.hasOwnProperty('ssl')) { + fs.writeFile('C:/git/nginx/conf/ssl.conf', config['ssl'], (err) => { + if (err) return reject(err); + resolve(config); + }); + } + }); + }) + .then((config) => { + return new Promise((resolve, reject) => { + if (config.hasOwnProperty('cors')) { + fs.writeFile( + 'C:/git/nginx/conf/cors.conf', + config['cors'], + (err) => { + if (err) return reject(err); + resolve(config); + }, + ); + } + }); + }) + .then((config) => { + return new Promise((resolve, reject) => { + if (config.hasOwnProperty('static')) { + fs.writeFile( + 'C:/git/nginx/conf/static.conf', + config['static'], + (err) => { + if (err) return reject(err); + resolve(config); + }, + ); + } + }); + }) + .then((config) => { + return new Promise((resolve, reject) => { + if (config.hasOwnProperty('custom')) { + fs.writeFile( + 'C:/git/nginx/conf/custom.conf', + config['custom'], + (err) => { + if (err) return reject(err); + resolve(config); + }, + ); + } + }); + }); + }, +}; diff --git a/processes/privatevnext/index.js b/processes/privatevnext/index.js index 4c3da39..ff65087 100644 --- a/processes/privatevnext/index.js +++ b/processes/privatevnext/index.js @@ -1,21 +1,21 @@ -module.exports = { - pm2proc: true, - name: 'privatevnext', - cwd: '../vnext', - script: 'app.js', - merge_logs: true, - log_date_format: 'YYYY-MM-DD HH:mm Z', - error_file: 'logs/vnext.stderr.log', - out_file: 'logs/vnext.stdout.log', - pid_file: 'logs/vnext.pid', - env:{ - NODE_ENV: 'development', - }, - env_production : { - NODE_ENV: 'production', - }, - max_memory_restart: '500M', - instances: 1, - autorestart : true, - restart_delay: 4000, -}; +module.exports = { + pm2proc: true, + name: 'privatevnext', + cwd: '../vnext', + script: 'app.js', + merge_logs: true, + log_date_format: 'YYYY-MM-DD HH:mm Z', + error_file: 'logs/vnext.stderr.log', + out_file: 'logs/vnext.stdout.log', + pid_file: 'logs/vnext.pid', + env: { + NODE_ENV: 'development', + }, + env_production: { + NODE_ENV: 'production', + }, + max_memory_restart: '500M', + instances: 1, + autorestart: true, + restart_delay: 4000, +}; diff --git a/processes/vnext/index.js b/processes/vnext/index.js index 678dd94..6ed0c0e 100644 --- a/processes/vnext/index.js +++ b/processes/vnext/index.js @@ -1,21 +1,21 @@ -module.exports = { - pm2proc: true, - name: 'vnext', - cwd: '../prismweb/MaestroWebApp/vnext', - script: 'app.js', - merge_logs: true, - log_date_format: 'YYYY-MM-DD HH:mm Z', - error_file: 'logs/vnext.stderr.log', - out_file: 'logs/vnext.stdout.log', - pid_file: 'logs/vnext.pid', - env:{ - NODE_ENV: 'development', - }, - env_production : { - NODE_ENV: 'production', - }, - max_memory_restart: '500M', - instances: 1, - autorestart : true, - restart_delay: 4000, -}; +module.exports = { + pm2proc: true, + name: 'vnext', + cwd: '../prismweb/MaestroWebApp/vnext', + script: 'app.js', + merge_logs: true, + log_date_format: 'YYYY-MM-DD HH:mm Z', + error_file: 'logs/vnext.stderr.log', + out_file: 'logs/vnext.stdout.log', + pid_file: 'logs/vnext.pid', + env: { + NODE_ENV: 'development', + }, + env_production: { + NODE_ENV: 'production', + }, + max_memory_restart: '500M', + instances: 1, + autorestart: true, + restart_delay: 4000, +}; diff --git a/static/bundle.js b/static/bundle.js index 747392a..59251ea 100644 --- a/static/bundle.js +++ b/static/bundle.js @@ -1,18342 +1,20458 @@ -webpackJsonp([1],[ -/* 0 */ -/***/ function(module, exports, __webpack_require__) { - - 'use strict'; - - var _reactRouter = __webpack_require__(1); - - var _reactRouterRedux = __webpack_require__(97); - - var _reactRedux = __webpack_require__(102); - - var _reactDom = __webpack_require__(130); - - var _reactDom2 = _interopRequireDefault(_reactDom); - - var _react = __webpack_require__(3); - - var _react2 = _interopRequireDefault(_react); - - var _reactTapEventPlugin = __webpack_require__(268); - - var _reactTapEventPlugin2 = _interopRequireDefault(_reactTapEventPlugin); - - var _store = __webpack_require__(274); - - var _store2 = _interopRequireDefault(_store); - - var _App = __webpack_require__(488); - - var _App2 = _interopRequireDefault(_App); - - var _HomePage = __webpack_require__(812); - - var _HomePage2 = _interopRequireDefault(_HomePage); - - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - - // whyDidYouUpdate(React); - - var store = (0, _store2.default)(); - // import { whyDidYouUpdate } from 'why-did-you-update'; - - var history = (0, _reactRouterRedux.syncHistoryWithStore)(_reactRouter.browserHistory, store); - (0, _reactTapEventPlugin2.default)(); - - _reactDom2.default.render(_react2.default.createElement( - _reactRedux.Provider, - { store: store }, - _react2.default.createElement( - _reactRouter.Router, - { history: history }, - _react2.default.createElement( - _reactRouter.Route, - { - component: _App2.default - }, - _react2.default.createElement(_reactRouter.Route, { - component: _HomePage2.default, - path: '/' - }), - _react2.default.createElement(_reactRouter.Route, { - component: _HomePage2.default, - path: '/app/:pm2Id' - }) - ) - ) - ), document.getElementById('root')); - -/***/ }, -/* 1 */, -/* 2 */, -/* 3 */, -/* 4 */, -/* 5 */, -/* 6 */, -/* 7 */, -/* 8 */, -/* 9 */, -/* 10 */, -/* 11 */, -/* 12 */, -/* 13 */, -/* 14 */, -/* 15 */, -/* 16 */, -/* 17 */, -/* 18 */, -/* 19 */, -/* 20 */, -/* 21 */, -/* 22 */, -/* 23 */, -/* 24 */, -/* 25 */, -/* 26 */, -/* 27 */, -/* 28 */, -/* 29 */, -/* 30 */, -/* 31 */, -/* 32 */, -/* 33 */, -/* 34 */, -/* 35 */, -/* 36 */, -/* 37 */, -/* 38 */, -/* 39 */, -/* 40 */, -/* 41 */, -/* 42 */, -/* 43 */, -/* 44 */, -/* 45 */, -/* 46 */, -/* 47 */, -/* 48 */, -/* 49 */, -/* 50 */, -/* 51 */, -/* 52 */, -/* 53 */, -/* 54 */, -/* 55 */, -/* 56 */, -/* 57 */, -/* 58 */, -/* 59 */, -/* 60 */, -/* 61 */, -/* 62 */, -/* 63 */, -/* 64 */, -/* 65 */, -/* 66 */, -/* 67 */, -/* 68 */, -/* 69 */, -/* 70 */, -/* 71 */, -/* 72 */, -/* 73 */, -/* 74 */, -/* 75 */, -/* 76 */, -/* 77 */, -/* 78 */, -/* 79 */, -/* 80 */, -/* 81 */, -/* 82 */, -/* 83 */, -/* 84 */, -/* 85 */, -/* 86 */, -/* 87 */, -/* 88 */, -/* 89 */, -/* 90 */, -/* 91 */, -/* 92 */, -/* 93 */, -/* 94 */, -/* 95 */, -/* 96 */, -/* 97 */, -/* 98 */, -/* 99 */, -/* 100 */, -/* 101 */, -/* 102 */, -/* 103 */, -/* 104 */, -/* 105 */, -/* 106 */, -/* 107 */, -/* 108 */, -/* 109 */, -/* 110 */, -/* 111 */, -/* 112 */, -/* 113 */, -/* 114 */, -/* 115 */, -/* 116 */, -/* 117 */, -/* 118 */, -/* 119 */, -/* 120 */, -/* 121 */, -/* 122 */, -/* 123 */, -/* 124 */, -/* 125 */, -/* 126 */, -/* 127 */, -/* 128 */, -/* 129 */, -/* 130 */, -/* 131 */, -/* 132 */, -/* 133 */, -/* 134 */, -/* 135 */, -/* 136 */, -/* 137 */, -/* 138 */, -/* 139 */, -/* 140 */, -/* 141 */, -/* 142 */, -/* 143 */, -/* 144 */, -/* 145 */, -/* 146 */, -/* 147 */, -/* 148 */, -/* 149 */, -/* 150 */, -/* 151 */, -/* 152 */, -/* 153 */, -/* 154 */, -/* 155 */, -/* 156 */, -/* 157 */, -/* 158 */, -/* 159 */, -/* 160 */, -/* 161 */, -/* 162 */, -/* 163 */, -/* 164 */, -/* 165 */, -/* 166 */, -/* 167 */, -/* 168 */, -/* 169 */, -/* 170 */, -/* 171 */, -/* 172 */, -/* 173 */, -/* 174 */, -/* 175 */, -/* 176 */, -/* 177 */, -/* 178 */, -/* 179 */, -/* 180 */, -/* 181 */, -/* 182 */, -/* 183 */, -/* 184 */, -/* 185 */, -/* 186 */, -/* 187 */, -/* 188 */, -/* 189 */, -/* 190 */, -/* 191 */, -/* 192 */, -/* 193 */, -/* 194 */, -/* 195 */, -/* 196 */, -/* 197 */, -/* 198 */, -/* 199 */, -/* 200 */, -/* 201 */, -/* 202 */, -/* 203 */, -/* 204 */, -/* 205 */, -/* 206 */, -/* 207 */, -/* 208 */, -/* 209 */, -/* 210 */, -/* 211 */, -/* 212 */, -/* 213 */, -/* 214 */, -/* 215 */, -/* 216 */, -/* 217 */, -/* 218 */, -/* 219 */, -/* 220 */, -/* 221 */, -/* 222 */, -/* 223 */, -/* 224 */, -/* 225 */, -/* 226 */, -/* 227 */, -/* 228 */, -/* 229 */, -/* 230 */, -/* 231 */, -/* 232 */, -/* 233 */, -/* 234 */, -/* 235 */, -/* 236 */, -/* 237 */, -/* 238 */, -/* 239 */, -/* 240 */, -/* 241 */, -/* 242 */, -/* 243 */, -/* 244 */, -/* 245 */, -/* 246 */, -/* 247 */, -/* 248 */, -/* 249 */, -/* 250 */, -/* 251 */, -/* 252 */, -/* 253 */, -/* 254 */, -/* 255 */, -/* 256 */, -/* 257 */, -/* 258 */, -/* 259 */, -/* 260 */, -/* 261 */, -/* 262 */, -/* 263 */, -/* 264 */, -/* 265 */, -/* 266 */, -/* 267 */, -/* 268 */ -/***/ function(module, exports, __webpack_require__) { - - var invariant = __webpack_require__(269); - var defaultClickRejectionStrategy = __webpack_require__(270); - - var alreadyInjected = false; - - module.exports = function injectTapEventPlugin (strategyOverrides) { - strategyOverrides = strategyOverrides || {} - var shouldRejectClick = strategyOverrides.shouldRejectClick || defaultClickRejectionStrategy; - - if (true) { - invariant( - !alreadyInjected, - 'injectTapEventPlugin(): Can only be called once per application lifecycle.\n\n\ - It is recommended to call injectTapEventPlugin() just before you call \ - ReactDOM.render(). If you are using an external library which calls injectTapEventPlugin() \ - itself, please contact the maintainer as it shouldn\'t be called in library code and \ - should be injected by the application.' - ) - } - - alreadyInjected = true; - - __webpack_require__(139).injection.injectEventPluginsByName({ - 'TapEventPlugin': __webpack_require__(271)(shouldRejectClick) - }); - }; - - -/***/ }, -/* 269 */ -/***/ function(module, exports, __webpack_require__) { - - /** - * Copyright 2013-2015, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - * @providesModule invariant - */ - - "use strict"; - - /** - * Use invariant() to assert state which your program assumes to be true. - * - * Provide sprintf-style format (only %s is supported) and arguments - * to provide information about what broke and what you were - * expecting. - * - * The invariant message will be stripped in production, but the invariant - * will remain to ensure logic does not differ in production. - */ - - var invariant = function (condition, format, a, b, c, d, e, f) { - if (true) { - if (format === undefined) { - throw new Error('invariant requires an error message argument'); - } - } - - if (!condition) { - var error; - if (format === undefined) { - error = new Error('Minified exception occurred; use the non-minified dev environment ' + 'for the full error message and additional helpful warnings.'); - } else { - var args = [a, b, c, d, e, f]; - var argIndex = 0; - error = new Error('Invariant Violation: ' + format.replace(/%s/g, function () { - return args[argIndex++]; - })); - } - - error.framesToPop = 1; // we don't care about invariant's own frame - throw error; - } - }; - - module.exports = invariant; - -/***/ }, -/* 270 */ -/***/ function(module, exports) { - - module.exports = function(lastTouchEvent, clickTimestamp) { - if (lastTouchEvent && (clickTimestamp - lastTouchEvent) < 750) { - return true; - } - }; - - -/***/ }, -/* 271 */ -/***/ function(module, exports, __webpack_require__) { - - /** - * Copyright 2013-2014 Facebook, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * @providesModule TapEventPlugin - * @typechecks static-only - */ - - "use strict"; - - var EventConstants = __webpack_require__(137); - var EventPluginUtils = __webpack_require__(141); - var EventPropagators = __webpack_require__(138); - var SyntheticUIEvent = __webpack_require__(172); - var TouchEventUtils = __webpack_require__(272); - var ViewportMetrics = __webpack_require__(173); - - var keyOf = __webpack_require__(273); - var topLevelTypes = EventConstants.topLevelTypes; - - var isStartish = EventPluginUtils.isStartish; - var isEndish = EventPluginUtils.isEndish; - - var isTouch = function(topLevelType) { - var touchTypes = [ - topLevelTypes.topTouchCancel, - topLevelTypes.topTouchEnd, - topLevelTypes.topTouchStart, - topLevelTypes.topTouchMove - ]; - return touchTypes.indexOf(topLevelType) >= 0; - } - - /** - * Number of pixels that are tolerated in between a `touchStart` and `touchEnd` - * in order to still be considered a 'tap' event. - */ - var tapMoveThreshold = 10; - var ignoreMouseThreshold = 750; - var startCoords = {x: null, y: null}; - var lastTouchEvent = null; - - var Axis = { - x: {page: 'pageX', client: 'clientX', envScroll: 'currentPageScrollLeft'}, - y: {page: 'pageY', client: 'clientY', envScroll: 'currentPageScrollTop'} - }; - - function getAxisCoordOfEvent(axis, nativeEvent) { - var singleTouch = TouchEventUtils.extractSingleTouch(nativeEvent); - if (singleTouch) { - return singleTouch[axis.page]; - } - return axis.page in nativeEvent ? - nativeEvent[axis.page] : - nativeEvent[axis.client] + ViewportMetrics[axis.envScroll]; - } - - function getDistance(coords, nativeEvent) { - var pageX = getAxisCoordOfEvent(Axis.x, nativeEvent); - var pageY = getAxisCoordOfEvent(Axis.y, nativeEvent); - return Math.pow( - Math.pow(pageX - coords.x, 2) + Math.pow(pageY - coords.y, 2), - 0.5 - ); - } - - var touchEvents = [ - topLevelTypes.topTouchStart, - topLevelTypes.topTouchCancel, - topLevelTypes.topTouchEnd, - topLevelTypes.topTouchMove, - ]; - - var dependencies = [ - topLevelTypes.topMouseDown, - topLevelTypes.topMouseMove, - topLevelTypes.topMouseUp, - ].concat(touchEvents); - - var eventTypes = { - touchTap: { - phasedRegistrationNames: { - bubbled: keyOf({onTouchTap: null}), - captured: keyOf({onTouchTapCapture: null}) - }, - dependencies: dependencies - } - }; - - var now = (function() { - if (Date.now) { - return Date.now; - } else { - // IE8 support: http://stackoverflow.com/questions/9430357/please-explain-why-and-how-new-date-works-as-workaround-for-date-now-in - return function () { - return +new Date; - } - } - })(); - - function createTapEventPlugin(shouldRejectClick) { - return { - - tapMoveThreshold: tapMoveThreshold, - - ignoreMouseThreshold: ignoreMouseThreshold, - - eventTypes: eventTypes, - - /** - * @param {string} topLevelType Record from `EventConstants`. - * @param {DOMEventTarget} targetInst The listening component root node. - * @param {object} nativeEvent Native browser event. - * @return {*} An accumulation of synthetic events. - * @see {EventPluginHub.extractEvents} - */ - extractEvents: function( - topLevelType, - targetInst, - nativeEvent, - nativeEventTarget - ) { - - if (isTouch(topLevelType)) { - lastTouchEvent = now(); - } else { - if (shouldRejectClick(lastTouchEvent, now())) { - return null; - } - } - - if (!isStartish(topLevelType) && !isEndish(topLevelType)) { - return null; - } - var event = null; - var distance = getDistance(startCoords, nativeEvent); - if (isEndish(topLevelType) && distance < tapMoveThreshold) { - event = SyntheticUIEvent.getPooled( - eventTypes.touchTap, - targetInst, - nativeEvent, - nativeEventTarget - ); - } - if (isStartish(topLevelType)) { - startCoords.x = getAxisCoordOfEvent(Axis.x, nativeEvent); - startCoords.y = getAxisCoordOfEvent(Axis.y, nativeEvent); - } else if (isEndish(topLevelType)) { - startCoords.x = 0; - startCoords.y = 0; - } - EventPropagators.accumulateTwoPhaseDispatches(event); - return event; - } - - }; - } - - module.exports = createTapEventPlugin; - - -/***/ }, -/* 272 */ -/***/ function(module, exports) { - - /** - * Copyright 2013-2014 Facebook, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * @providesModule TouchEventUtils - */ - - var TouchEventUtils = { - /** - * Utility function for common case of extracting out the primary touch from a - * touch event. - * - `touchEnd` events usually do not have the `touches` property. - * http://stackoverflow.com/questions/3666929/ - * mobile-sarai-touchend-event-not-firing-when-last-touch-is-removed - * - * @param {Event} nativeEvent Native event that may or may not be a touch. - * @return {TouchesObject?} an object with pageX and pageY or null. - */ - extractSingleTouch: function(nativeEvent) { - var touches = nativeEvent.touches; - var changedTouches = nativeEvent.changedTouches; - var hasTouches = touches && touches.length > 0; - var hasChangedTouches = changedTouches && changedTouches.length > 0; - - return !hasTouches && hasChangedTouches ? changedTouches[0] : - hasTouches ? touches[0] : - nativeEvent; - } - }; - - module.exports = TouchEventUtils; - - -/***/ }, -/* 273 */ -/***/ function(module, exports) { - - /** - * Copyright 2013-2015, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - * @providesModule keyOf - */ - - /** - * Allows extraction of a minified key. Let's the build system minify keys - * without losing the ability to dynamically use key strings as values - * themselves. Pass in an object with a single key/val pair and it will return - * you the string key of that single record. Suppose you want to grab the - * value for a key 'className' inside of an object. Key/val minification may - * have aliased that key to be 'xa12'. keyOf({className: null}) will return - * 'xa12' in that case. Resolve keys you want to use once at startup time, then - * reuse those resolutions. - */ - "use strict"; - - var keyOf = function (oneKeyObj) { - var key; - for (key in oneKeyObj) { - if (!oneKeyObj.hasOwnProperty(key)) { - continue; - } - return key; - } - return null; - }; - - module.exports = keyOf; - -/***/ }, -/* 274 */ -/***/ function(module, exports, __webpack_require__) { - - 'use strict'; - - Object.defineProperty(exports, "__esModule", { - value: true - }); - exports.default = configure; - - var _redux = __webpack_require__(109); - - var _middleware = __webpack_require__(275); - - var _reducers = __webpack_require__(277); - - var _reducers2 = _interopRequireDefault(_reducers); - - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - - function configure(initialState) { - var create = window.devToolsExtension ? window.devToolsExtension()(_redux.createStore) : _redux.createStore; - - var createStoreWithMiddleware = (0, _redux.applyMiddleware)(_middleware.logger)(create); - - var store = createStoreWithMiddleware(_reducers2.default, initialState); - - if (false) { - module.hot.accept('../reducers', function () { - var nextReducer = require('../reducers'); - store.replaceReducer(nextReducer); - }); - } - - return store; - } - -/***/ }, -/* 275 */ -/***/ function(module, exports, __webpack_require__) { - - 'use strict'; - - Object.defineProperty(exports, "__esModule", { - value: true - }); - exports.logger = undefined; - - var _logger = __webpack_require__(276); - - var _logger2 = _interopRequireDefault(_logger); - - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - - exports.logger = _logger2.default; - -/***/ }, -/* 276 */ -/***/ function(module, exports) { - - "use strict"; - - Object.defineProperty(exports, "__esModule", { - value: true - }); - - exports.default = function (store) { - return function (next) { - return function (action) { - console.log(action); - return next(action); - }; - }; - }; - -/***/ }, -/* 277 */ -/***/ function(module, exports, __webpack_require__) { - - 'use strict'; - - Object.defineProperty(exports, "__esModule", { - value: true - }); - - var _reactRouterRedux = __webpack_require__(97); - - var _redux = __webpack_require__(109); - - var _actions = __webpack_require__(278); - - var _actions2 = _interopRequireDefault(_actions); - - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - - exports.default = (0, _redux.combineReducers)({ - routing: _reactRouterRedux.routerReducer, - actions: _actions2.default - }); - -/***/ }, -/* 278 */ -/***/ function(module, exports, __webpack_require__) { - - 'use strict'; - - Object.defineProperty(exports, "__esModule", { - value: true - }); - - var _extends2 = __webpack_require__(279); - - var _extends3 = _interopRequireDefault(_extends2); - - var _toConsumableArray2 = __webpack_require__(317); - - var _toConsumableArray3 = _interopRequireDefault(_toConsumableArray2); - - var _reduxActions = __webpack_require__(340); - - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - - // TODO: replace this with actual ajax - var initialState = __webpack_require__(487); - - exports.default = (0, _reduxActions.handleActions)({ - 'add todo': function addTodo(state, action) { - return [{ - id: state.reduce(function (maxId, todo) { - return Math.max(todo.id, maxId); - }, -1) + 1, - completed: false, - text: action.payload - }].concat((0, _toConsumableArray3.default)(state)); - }, - 'delete todo': function deleteTodo(state, action) { - return state.filter(function (todo) { - return todo.id !== action.payload; - }); - }, - 'edit todo': function editTodo(state, action) { - return state.map(function (todo) { - return todo.id === action.payload.id ? (0, _extends3.default)({}, todo, { text: action.payload.text }) : todo; - }); - } - }, initialState); - -/***/ }, -/* 279 */ -/***/ function(module, exports, __webpack_require__) { - - "use strict"; - - exports.__esModule = true; - - var _assign = __webpack_require__(280); - - var _assign2 = _interopRequireDefault(_assign); - - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - - exports.default = _assign2.default || function (target) { - for (var i = 1; i < arguments.length; i++) { - var source = arguments[i]; - - for (var key in source) { - if (Object.prototype.hasOwnProperty.call(source, key)) { - target[key] = source[key]; - } - } - } - - return target; - }; - -/***/ }, -/* 280 */ -/***/ function(module, exports, __webpack_require__) { - - module.exports = { "default": __webpack_require__(281), __esModule: true }; - -/***/ }, -/* 281 */ -/***/ function(module, exports, __webpack_require__) { - - __webpack_require__(282); - module.exports = __webpack_require__(285).Object.assign; - -/***/ }, -/* 282 */ -/***/ function(module, exports, __webpack_require__) { - - // 19.1.3.1 Object.assign(target, source) - var $export = __webpack_require__(283); - - $export($export.S + $export.F, 'Object', {assign: __webpack_require__(298)}); - -/***/ }, -/* 283 */ -/***/ function(module, exports, __webpack_require__) { - - var global = __webpack_require__(284) - , core = __webpack_require__(285) - , ctx = __webpack_require__(286) - , hide = __webpack_require__(288) - , PROTOTYPE = 'prototype'; - - var $export = function(type, name, source){ - var IS_FORCED = type & $export.F - , IS_GLOBAL = type & $export.G - , IS_STATIC = type & $export.S - , IS_PROTO = type & $export.P - , IS_BIND = type & $export.B - , IS_WRAP = type & $export.W - , exports = IS_GLOBAL ? core : core[name] || (core[name] = {}) - , expProto = exports[PROTOTYPE] - , target = IS_GLOBAL ? global : IS_STATIC ? global[name] : (global[name] || {})[PROTOTYPE] - , key, own, out; - if(IS_GLOBAL)source = name; - for(key in source){ - // contains in native - own = !IS_FORCED && target && target[key] !== undefined; - if(own && key in exports)continue; - // export native or passed - out = own ? target[key] : source[key]; - // prevent global pollution for namespaces - exports[key] = IS_GLOBAL && typeof target[key] != 'function' ? source[key] - // bind timers to global for call from export context - : IS_BIND && own ? ctx(out, global) - // wrap global constructors for prevent change them in library - : IS_WRAP && target[key] == out ? (function(C){ - var F = function(a, b, c){ - if(this instanceof C){ - switch(arguments.length){ - case 0: return new C; - case 1: return new C(a); - case 2: return new C(a, b); - } return new C(a, b, c); - } return C.apply(this, arguments); - }; - F[PROTOTYPE] = C[PROTOTYPE]; - return F; - // make static versions for prototype methods - })(out) : IS_PROTO && typeof out == 'function' ? ctx(Function.call, out) : out; - // export proto methods to core.%CONSTRUCTOR%.methods.%NAME% - if(IS_PROTO){ - (exports.virtual || (exports.virtual = {}))[key] = out; - // export proto methods to core.%CONSTRUCTOR%.prototype.%NAME% - if(type & $export.R && expProto && !expProto[key])hide(expProto, key, out); - } - } - }; - // type bitmap - $export.F = 1; // forced - $export.G = 2; // global - $export.S = 4; // static - $export.P = 8; // proto - $export.B = 16; // bind - $export.W = 32; // wrap - $export.U = 64; // safe - $export.R = 128; // real proto method for `library` - module.exports = $export; - -/***/ }, -/* 284 */ -/***/ function(module, exports) { - - // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028 - var global = module.exports = typeof window != 'undefined' && window.Math == Math - ? window : typeof self != 'undefined' && self.Math == Math ? self : Function('return this')(); - if(typeof __g == 'number')__g = global; // eslint-disable-line no-undef - -/***/ }, -/* 285 */ -/***/ function(module, exports) { - - var core = module.exports = {version: '2.4.0'}; - if(typeof __e == 'number')__e = core; // eslint-disable-line no-undef - -/***/ }, -/* 286 */ -/***/ function(module, exports, __webpack_require__) { - - // optional / simple context binding - var aFunction = __webpack_require__(287); - module.exports = function(fn, that, length){ - aFunction(fn); - if(that === undefined)return fn; - switch(length){ - case 1: return function(a){ - return fn.call(that, a); - }; - case 2: return function(a, b){ - return fn.call(that, a, b); - }; - case 3: return function(a, b, c){ - return fn.call(that, a, b, c); - }; - } - return function(/* ...args */){ - return fn.apply(that, arguments); - }; - }; - -/***/ }, -/* 287 */ -/***/ function(module, exports) { - - module.exports = function(it){ - if(typeof it != 'function')throw TypeError(it + ' is not a function!'); - return it; - }; - -/***/ }, -/* 288 */ -/***/ function(module, exports, __webpack_require__) { - - var dP = __webpack_require__(289) - , createDesc = __webpack_require__(297); - module.exports = __webpack_require__(293) ? function(object, key, value){ - return dP.f(object, key, createDesc(1, value)); - } : function(object, key, value){ - object[key] = value; - return object; - }; - -/***/ }, -/* 289 */ -/***/ function(module, exports, __webpack_require__) { - - var anObject = __webpack_require__(290) - , IE8_DOM_DEFINE = __webpack_require__(292) - , toPrimitive = __webpack_require__(296) - , dP = Object.defineProperty; - - exports.f = __webpack_require__(293) ? Object.defineProperty : function defineProperty(O, P, Attributes){ - anObject(O); - P = toPrimitive(P, true); - anObject(Attributes); - if(IE8_DOM_DEFINE)try { - return dP(O, P, Attributes); - } catch(e){ /* empty */ } - if('get' in Attributes || 'set' in Attributes)throw TypeError('Accessors not supported!'); - if('value' in Attributes)O[P] = Attributes.value; - return O; - }; - -/***/ }, -/* 290 */ -/***/ function(module, exports, __webpack_require__) { - - var isObject = __webpack_require__(291); - module.exports = function(it){ - if(!isObject(it))throw TypeError(it + ' is not an object!'); - return it; - }; - -/***/ }, -/* 291 */ -/***/ function(module, exports) { - - module.exports = function(it){ - return typeof it === 'object' ? it !== null : typeof it === 'function'; - }; - -/***/ }, -/* 292 */ -/***/ function(module, exports, __webpack_require__) { - - module.exports = !__webpack_require__(293) && !__webpack_require__(294)(function(){ - return Object.defineProperty(__webpack_require__(295)('div'), 'a', {get: function(){ return 7; }}).a != 7; - }); - -/***/ }, -/* 293 */ -/***/ function(module, exports, __webpack_require__) { - - // Thank's IE8 for his funny defineProperty - module.exports = !__webpack_require__(294)(function(){ - return Object.defineProperty({}, 'a', {get: function(){ return 7; }}).a != 7; - }); - -/***/ }, -/* 294 */ -/***/ function(module, exports) { - - module.exports = function(exec){ - try { - return !!exec(); - } catch(e){ - return true; - } - }; - -/***/ }, -/* 295 */ -/***/ function(module, exports, __webpack_require__) { - - var isObject = __webpack_require__(291) - , document = __webpack_require__(284).document - // in old IE typeof document.createElement is 'object' - , is = isObject(document) && isObject(document.createElement); - module.exports = function(it){ - return is ? document.createElement(it) : {}; - }; - -/***/ }, -/* 296 */ -/***/ function(module, exports, __webpack_require__) { - - // 7.1.1 ToPrimitive(input [, PreferredType]) - var isObject = __webpack_require__(291); - // instead of the ES6 spec version, we didn't implement @@toPrimitive case - // and the second argument - flag - preferred type is a string - module.exports = function(it, S){ - if(!isObject(it))return it; - var fn, val; - if(S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it)))return val; - if(typeof (fn = it.valueOf) == 'function' && !isObject(val = fn.call(it)))return val; - if(!S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it)))return val; - throw TypeError("Can't convert object to primitive value"); - }; - -/***/ }, -/* 297 */ -/***/ function(module, exports) { - - module.exports = function(bitmap, value){ - return { - enumerable : !(bitmap & 1), - configurable: !(bitmap & 2), - writable : !(bitmap & 4), - value : value - }; - }; - -/***/ }, -/* 298 */ -/***/ function(module, exports, __webpack_require__) { - - 'use strict'; - // 19.1.2.1 Object.assign(target, source, ...) - var getKeys = __webpack_require__(299) - , gOPS = __webpack_require__(314) - , pIE = __webpack_require__(315) - , toObject = __webpack_require__(316) - , IObject = __webpack_require__(303) - , $assign = Object.assign; - - // should work with symbols and should have deterministic property order (V8 bug) - module.exports = !$assign || __webpack_require__(294)(function(){ - var A = {} - , B = {} - , S = Symbol() - , K = 'abcdefghijklmnopqrst'; - A[S] = 7; - K.split('').forEach(function(k){ B[k] = k; }); - return $assign({}, A)[S] != 7 || Object.keys($assign({}, B)).join('') != K; - }) ? function assign(target, source){ // eslint-disable-line no-unused-vars - var T = toObject(target) - , aLen = arguments.length - , index = 1 - , getSymbols = gOPS.f - , isEnum = pIE.f; - while(aLen > index){ - var S = IObject(arguments[index++]) - , keys = getSymbols ? getKeys(S).concat(getSymbols(S)) : getKeys(S) - , length = keys.length - , j = 0 - , key; - while(length > j)if(isEnum.call(S, key = keys[j++]))T[key] = S[key]; - } return T; - } : $assign; - -/***/ }, -/* 299 */ -/***/ function(module, exports, __webpack_require__) { - - // 19.1.2.14 / 15.2.3.14 Object.keys(O) - var $keys = __webpack_require__(300) - , enumBugKeys = __webpack_require__(313); - - module.exports = Object.keys || function keys(O){ - return $keys(O, enumBugKeys); - }; - -/***/ }, -/* 300 */ -/***/ function(module, exports, __webpack_require__) { - - var has = __webpack_require__(301) - , toIObject = __webpack_require__(302) - , arrayIndexOf = __webpack_require__(306)(false) - , IE_PROTO = __webpack_require__(310)('IE_PROTO'); - - module.exports = function(object, names){ - var O = toIObject(object) - , i = 0 - , result = [] - , key; - for(key in O)if(key != IE_PROTO)has(O, key) && result.push(key); - // Don't enum bug & hidden keys - while(names.length > i)if(has(O, key = names[i++])){ - ~arrayIndexOf(result, key) || result.push(key); - } - return result; - }; - -/***/ }, -/* 301 */ -/***/ function(module, exports) { - - var hasOwnProperty = {}.hasOwnProperty; - module.exports = function(it, key){ - return hasOwnProperty.call(it, key); - }; - -/***/ }, -/* 302 */ -/***/ function(module, exports, __webpack_require__) { - - // to indexed object, toObject with fallback for non-array-like ES3 strings - var IObject = __webpack_require__(303) - , defined = __webpack_require__(305); - module.exports = function(it){ - return IObject(defined(it)); - }; - -/***/ }, -/* 303 */ -/***/ function(module, exports, __webpack_require__) { - - // fallback for non-array-like ES3 and non-enumerable old V8 strings - var cof = __webpack_require__(304); - module.exports = Object('z').propertyIsEnumerable(0) ? Object : function(it){ - return cof(it) == 'String' ? it.split('') : Object(it); - }; - -/***/ }, -/* 304 */ -/***/ function(module, exports) { - - var toString = {}.toString; - - module.exports = function(it){ - return toString.call(it).slice(8, -1); - }; - -/***/ }, -/* 305 */ -/***/ function(module, exports) { - - // 7.2.1 RequireObjectCoercible(argument) - module.exports = function(it){ - if(it == undefined)throw TypeError("Can't call method on " + it); - return it; - }; - -/***/ }, -/* 306 */ -/***/ function(module, exports, __webpack_require__) { - - // false -> Array#indexOf - // true -> Array#includes - var toIObject = __webpack_require__(302) - , toLength = __webpack_require__(307) - , toIndex = __webpack_require__(309); - module.exports = function(IS_INCLUDES){ - return function($this, el, fromIndex){ - var O = toIObject($this) - , length = toLength(O.length) - , index = toIndex(fromIndex, length) - , value; - // Array#includes uses SameValueZero equality algorithm - if(IS_INCLUDES && el != el)while(length > index){ - value = O[index++]; - if(value != value)return true; - // Array#toIndex ignores holes, Array#includes - not - } else for(;length > index; index++)if(IS_INCLUDES || index in O){ - if(O[index] === el)return IS_INCLUDES || index || 0; - } return !IS_INCLUDES && -1; - }; - }; - -/***/ }, -/* 307 */ -/***/ function(module, exports, __webpack_require__) { - - // 7.1.15 ToLength - var toInteger = __webpack_require__(308) - , min = Math.min; - module.exports = function(it){ - return it > 0 ? min(toInteger(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991 - }; - -/***/ }, -/* 308 */ -/***/ function(module, exports) { - - // 7.1.4 ToInteger - var ceil = Math.ceil - , floor = Math.floor; - module.exports = function(it){ - return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it); - }; - -/***/ }, -/* 309 */ -/***/ function(module, exports, __webpack_require__) { - - var toInteger = __webpack_require__(308) - , max = Math.max - , min = Math.min; - module.exports = function(index, length){ - index = toInteger(index); - return index < 0 ? max(index + length, 0) : min(index, length); - }; - -/***/ }, -/* 310 */ -/***/ function(module, exports, __webpack_require__) { - - var shared = __webpack_require__(311)('keys') - , uid = __webpack_require__(312); - module.exports = function(key){ - return shared[key] || (shared[key] = uid(key)); - }; - -/***/ }, -/* 311 */ -/***/ function(module, exports, __webpack_require__) { - - var global = __webpack_require__(284) - , SHARED = '__core-js_shared__' - , store = global[SHARED] || (global[SHARED] = {}); - module.exports = function(key){ - return store[key] || (store[key] = {}); - }; - -/***/ }, -/* 312 */ -/***/ function(module, exports) { - - var id = 0 - , px = Math.random(); - module.exports = function(key){ - return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36)); - }; - -/***/ }, -/* 313 */ -/***/ function(module, exports) { - - // IE 8- don't enum bug keys - module.exports = ( - 'constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf' - ).split(','); - -/***/ }, -/* 314 */ -/***/ function(module, exports) { - - exports.f = Object.getOwnPropertySymbols; - -/***/ }, -/* 315 */ -/***/ function(module, exports) { - - exports.f = {}.propertyIsEnumerable; - -/***/ }, -/* 316 */ -/***/ function(module, exports, __webpack_require__) { - - // 7.1.13 ToObject(argument) - var defined = __webpack_require__(305); - module.exports = function(it){ - return Object(defined(it)); - }; - -/***/ }, -/* 317 */ -/***/ function(module, exports, __webpack_require__) { - - "use strict"; - - exports.__esModule = true; - - var _from = __webpack_require__(318); - - var _from2 = _interopRequireDefault(_from); - - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - - exports.default = function (arr) { - if (Array.isArray(arr)) { - for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { - arr2[i] = arr[i]; - } - - return arr2; - } else { - return (0, _from2.default)(arr); - } - }; - -/***/ }, -/* 318 */ -/***/ function(module, exports, __webpack_require__) { - - module.exports = { "default": __webpack_require__(319), __esModule: true }; - -/***/ }, -/* 319 */ -/***/ function(module, exports, __webpack_require__) { - - __webpack_require__(320); - __webpack_require__(333); - module.exports = __webpack_require__(285).Array.from; - -/***/ }, -/* 320 */ -/***/ function(module, exports, __webpack_require__) { - - 'use strict'; - var $at = __webpack_require__(321)(true); - - // 21.1.3.27 String.prototype[@@iterator]() - __webpack_require__(322)(String, 'String', function(iterated){ - this._t = String(iterated); // target - this._i = 0; // next index - // 21.1.5.2.1 %StringIteratorPrototype%.next() - }, function(){ - var O = this._t - , index = this._i - , point; - if(index >= O.length)return {value: undefined, done: true}; - point = $at(O, index); - this._i += point.length; - return {value: point, done: false}; - }); - -/***/ }, -/* 321 */ -/***/ function(module, exports, __webpack_require__) { - - var toInteger = __webpack_require__(308) - , defined = __webpack_require__(305); - // true -> String#at - // false -> String#codePointAt - module.exports = function(TO_STRING){ - return function(that, pos){ - var s = String(defined(that)) - , i = toInteger(pos) - , l = s.length - , a, b; - if(i < 0 || i >= l)return TO_STRING ? '' : undefined; - a = s.charCodeAt(i); - return a < 0xd800 || a > 0xdbff || i + 1 === l || (b = s.charCodeAt(i + 1)) < 0xdc00 || b > 0xdfff - ? TO_STRING ? s.charAt(i) : a - : TO_STRING ? s.slice(i, i + 2) : (a - 0xd800 << 10) + (b - 0xdc00) + 0x10000; - }; - }; - -/***/ }, -/* 322 */ -/***/ function(module, exports, __webpack_require__) { - - 'use strict'; - var LIBRARY = __webpack_require__(323) - , $export = __webpack_require__(283) - , redefine = __webpack_require__(324) - , hide = __webpack_require__(288) - , has = __webpack_require__(301) - , Iterators = __webpack_require__(325) - , $iterCreate = __webpack_require__(326) - , setToStringTag = __webpack_require__(330) - , getPrototypeOf = __webpack_require__(332) - , ITERATOR = __webpack_require__(331)('iterator') - , BUGGY = !([].keys && 'next' in [].keys()) // Safari has buggy iterators w/o `next` - , FF_ITERATOR = '@@iterator' - , KEYS = 'keys' - , VALUES = 'values'; - - var returnThis = function(){ return this; }; - - module.exports = function(Base, NAME, Constructor, next, DEFAULT, IS_SET, FORCED){ - $iterCreate(Constructor, NAME, next); - var getMethod = function(kind){ - if(!BUGGY && kind in proto)return proto[kind]; - switch(kind){ - case KEYS: return function keys(){ return new Constructor(this, kind); }; - case VALUES: return function values(){ return new Constructor(this, kind); }; - } return function entries(){ return new Constructor(this, kind); }; - }; - var TAG = NAME + ' Iterator' - , DEF_VALUES = DEFAULT == VALUES - , VALUES_BUG = false - , proto = Base.prototype - , $native = proto[ITERATOR] || proto[FF_ITERATOR] || DEFAULT && proto[DEFAULT] - , $default = $native || getMethod(DEFAULT) - , $entries = DEFAULT ? !DEF_VALUES ? $default : getMethod('entries') : undefined - , $anyNative = NAME == 'Array' ? proto.entries || $native : $native - , methods, key, IteratorPrototype; - // Fix native - if($anyNative){ - IteratorPrototype = getPrototypeOf($anyNative.call(new Base)); - if(IteratorPrototype !== Object.prototype){ - // Set @@toStringTag to native iterators - setToStringTag(IteratorPrototype, TAG, true); - // fix for some old engines - if(!LIBRARY && !has(IteratorPrototype, ITERATOR))hide(IteratorPrototype, ITERATOR, returnThis); - } - } - // fix Array#{values, @@iterator}.name in V8 / FF - if(DEF_VALUES && $native && $native.name !== VALUES){ - VALUES_BUG = true; - $default = function values(){ return $native.call(this); }; - } - // Define iterator - if((!LIBRARY || FORCED) && (BUGGY || VALUES_BUG || !proto[ITERATOR])){ - hide(proto, ITERATOR, $default); - } - // Plug for library - Iterators[NAME] = $default; - Iterators[TAG] = returnThis; - if(DEFAULT){ - methods = { - values: DEF_VALUES ? $default : getMethod(VALUES), - keys: IS_SET ? $default : getMethod(KEYS), - entries: $entries - }; - if(FORCED)for(key in methods){ - if(!(key in proto))redefine(proto, key, methods[key]); - } else $export($export.P + $export.F * (BUGGY || VALUES_BUG), NAME, methods); - } - return methods; - }; - -/***/ }, -/* 323 */ -/***/ function(module, exports) { - - module.exports = true; - -/***/ }, -/* 324 */ -/***/ function(module, exports, __webpack_require__) { - - module.exports = __webpack_require__(288); - -/***/ }, -/* 325 */ -/***/ function(module, exports) { - - module.exports = {}; - -/***/ }, -/* 326 */ -/***/ function(module, exports, __webpack_require__) { - - 'use strict'; - var create = __webpack_require__(327) - , descriptor = __webpack_require__(297) - , setToStringTag = __webpack_require__(330) - , IteratorPrototype = {}; - - // 25.1.2.1.1 %IteratorPrototype%[@@iterator]() - __webpack_require__(288)(IteratorPrototype, __webpack_require__(331)('iterator'), function(){ return this; }); - - module.exports = function(Constructor, NAME, next){ - Constructor.prototype = create(IteratorPrototype, {next: descriptor(1, next)}); - setToStringTag(Constructor, NAME + ' Iterator'); - }; - -/***/ }, -/* 327 */ -/***/ function(module, exports, __webpack_require__) { - - // 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties]) - var anObject = __webpack_require__(290) - , dPs = __webpack_require__(328) - , enumBugKeys = __webpack_require__(313) - , IE_PROTO = __webpack_require__(310)('IE_PROTO') - , Empty = function(){ /* empty */ } - , PROTOTYPE = 'prototype'; - - // Create object with fake `null` prototype: use iframe Object with cleared prototype - var createDict = function(){ - // Thrash, waste and sodomy: IE GC bug - var iframe = __webpack_require__(295)('iframe') - , i = enumBugKeys.length - , lt = '<' - , gt = '>' - , iframeDocument; - iframe.style.display = 'none'; - __webpack_require__(329).appendChild(iframe); - iframe.src = 'javascript:'; // eslint-disable-line no-script-url - // createDict = iframe.contentWindow.Object; - // html.removeChild(iframe); - iframeDocument = iframe.contentWindow.document; - iframeDocument.open(); - iframeDocument.write(lt + 'script' + gt + 'document.F=Object' + lt + '/script' + gt); - iframeDocument.close(); - createDict = iframeDocument.F; - while(i--)delete createDict[PROTOTYPE][enumBugKeys[i]]; - return createDict(); - }; - - module.exports = Object.create || function create(O, Properties){ - var result; - if(O !== null){ - Empty[PROTOTYPE] = anObject(O); - result = new Empty; - Empty[PROTOTYPE] = null; - // add "__proto__" for Object.getPrototypeOf polyfill - result[IE_PROTO] = O; - } else result = createDict(); - return Properties === undefined ? result : dPs(result, Properties); - }; - - -/***/ }, -/* 328 */ -/***/ function(module, exports, __webpack_require__) { - - var dP = __webpack_require__(289) - , anObject = __webpack_require__(290) - , getKeys = __webpack_require__(299); - - module.exports = __webpack_require__(293) ? Object.defineProperties : function defineProperties(O, Properties){ - anObject(O); - var keys = getKeys(Properties) - , length = keys.length - , i = 0 - , P; - while(length > i)dP.f(O, P = keys[i++], Properties[P]); - return O; - }; - -/***/ }, -/* 329 */ -/***/ function(module, exports, __webpack_require__) { - - module.exports = __webpack_require__(284).document && document.documentElement; - -/***/ }, -/* 330 */ -/***/ function(module, exports, __webpack_require__) { - - var def = __webpack_require__(289).f - , has = __webpack_require__(301) - , TAG = __webpack_require__(331)('toStringTag'); - - module.exports = function(it, tag, stat){ - if(it && !has(it = stat ? it : it.prototype, TAG))def(it, TAG, {configurable: true, value: tag}); - }; - -/***/ }, -/* 331 */ -/***/ function(module, exports, __webpack_require__) { - - var store = __webpack_require__(311)('wks') - , uid = __webpack_require__(312) - , Symbol = __webpack_require__(284).Symbol - , USE_SYMBOL = typeof Symbol == 'function'; - - var $exports = module.exports = function(name){ - return store[name] || (store[name] = - USE_SYMBOL && Symbol[name] || (USE_SYMBOL ? Symbol : uid)('Symbol.' + name)); - }; - - $exports.store = store; - -/***/ }, -/* 332 */ -/***/ function(module, exports, __webpack_require__) { - - // 19.1.2.9 / 15.2.3.2 Object.getPrototypeOf(O) - var has = __webpack_require__(301) - , toObject = __webpack_require__(316) - , IE_PROTO = __webpack_require__(310)('IE_PROTO') - , ObjectProto = Object.prototype; - - module.exports = Object.getPrototypeOf || function(O){ - O = toObject(O); - if(has(O, IE_PROTO))return O[IE_PROTO]; - if(typeof O.constructor == 'function' && O instanceof O.constructor){ - return O.constructor.prototype; - } return O instanceof Object ? ObjectProto : null; - }; - -/***/ }, -/* 333 */ -/***/ function(module, exports, __webpack_require__) { - - 'use strict'; - var ctx = __webpack_require__(286) - , $export = __webpack_require__(283) - , toObject = __webpack_require__(316) - , call = __webpack_require__(334) - , isArrayIter = __webpack_require__(335) - , toLength = __webpack_require__(307) - , createProperty = __webpack_require__(336) - , getIterFn = __webpack_require__(337); - - $export($export.S + $export.F * !__webpack_require__(339)(function(iter){ Array.from(iter); }), 'Array', { - // 22.1.2.1 Array.from(arrayLike, mapfn = undefined, thisArg = undefined) - from: function from(arrayLike/*, mapfn = undefined, thisArg = undefined*/){ - var O = toObject(arrayLike) - , C = typeof this == 'function' ? this : Array - , aLen = arguments.length - , mapfn = aLen > 1 ? arguments[1] : undefined - , mapping = mapfn !== undefined - , index = 0 - , iterFn = getIterFn(O) - , length, result, step, iterator; - if(mapping)mapfn = ctx(mapfn, aLen > 2 ? arguments[2] : undefined, 2); - // if object isn't iterable or it's array with default iterator - use simple case - if(iterFn != undefined && !(C == Array && isArrayIter(iterFn))){ - for(iterator = iterFn.call(O), result = new C; !(step = iterator.next()).done; index++){ - createProperty(result, index, mapping ? call(iterator, mapfn, [step.value, index], true) : step.value); - } - } else { - length = toLength(O.length); - for(result = new C(length); length > index; index++){ - createProperty(result, index, mapping ? mapfn(O[index], index) : O[index]); - } - } - result.length = index; - return result; - } - }); - - -/***/ }, -/* 334 */ -/***/ function(module, exports, __webpack_require__) { - - // call something on iterator step with safe closing on error - var anObject = __webpack_require__(290); - module.exports = function(iterator, fn, value, entries){ - try { - return entries ? fn(anObject(value)[0], value[1]) : fn(value); - // 7.4.6 IteratorClose(iterator, completion) - } catch(e){ - var ret = iterator['return']; - if(ret !== undefined)anObject(ret.call(iterator)); - throw e; - } - }; - -/***/ }, -/* 335 */ -/***/ function(module, exports, __webpack_require__) { - - // check on default Array iterator - var Iterators = __webpack_require__(325) - , ITERATOR = __webpack_require__(331)('iterator') - , ArrayProto = Array.prototype; - - module.exports = function(it){ - return it !== undefined && (Iterators.Array === it || ArrayProto[ITERATOR] === it); - }; - -/***/ }, -/* 336 */ -/***/ function(module, exports, __webpack_require__) { - - 'use strict'; - var $defineProperty = __webpack_require__(289) - , createDesc = __webpack_require__(297); - - module.exports = function(object, index, value){ - if(index in object)$defineProperty.f(object, index, createDesc(0, value)); - else object[index] = value; - }; - -/***/ }, -/* 337 */ -/***/ function(module, exports, __webpack_require__) { - - var classof = __webpack_require__(338) - , ITERATOR = __webpack_require__(331)('iterator') - , Iterators = __webpack_require__(325); - module.exports = __webpack_require__(285).getIteratorMethod = function(it){ - if(it != undefined)return it[ITERATOR] - || it['@@iterator'] - || Iterators[classof(it)]; - }; - -/***/ }, -/* 338 */ -/***/ function(module, exports, __webpack_require__) { - - // getting tag from 19.1.3.6 Object.prototype.toString() - var cof = __webpack_require__(304) - , TAG = __webpack_require__(331)('toStringTag') - // ES3 wrong here - , ARG = cof(function(){ return arguments; }()) == 'Arguments'; - - // fallback for IE11 Script Access Denied error - var tryGet = function(it, key){ - try { - return it[key]; - } catch(e){ /* empty */ } - }; - - module.exports = function(it){ - var O, T, B; - return it === undefined ? 'Undefined' : it === null ? 'Null' - // @@toStringTag case - : typeof (T = tryGet(O = Object(it), TAG)) == 'string' ? T - // builtinTag case - : ARG ? cof(O) - // ES3 arguments fallback - : (B = cof(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : B; - }; - -/***/ }, -/* 339 */ -/***/ function(module, exports, __webpack_require__) { - - var ITERATOR = __webpack_require__(331)('iterator') - , SAFE_CLOSING = false; - - try { - var riter = [7][ITERATOR](); - riter['return'] = function(){ SAFE_CLOSING = true; }; - Array.from(riter, function(){ throw 2; }); - } catch(e){ /* empty */ } - - module.exports = function(exec, skipClosing){ - if(!skipClosing && !SAFE_CLOSING)return false; - var safe = false; - try { - var arr = [7] - , iter = arr[ITERATOR](); - iter.next = function(){ return {done: safe = true}; }; - arr[ITERATOR] = function(){ return iter; }; - exec(arr); - } catch(e){ /* empty */ } - return safe; - }; - -/***/ }, -/* 340 */ -/***/ function(module, exports, __webpack_require__) { - - 'use strict'; - - Object.defineProperty(exports, "__esModule", { - value: true - }); - exports.combineActions = exports.handleActions = exports.handleAction = exports.createActions = exports.createAction = undefined; - - var _createAction = __webpack_require__(341); - - var _createAction2 = _interopRequireDefault(_createAction); - - var _handleAction = __webpack_require__(343); - - var _handleAction2 = _interopRequireDefault(_handleAction); - - var _handleActions = __webpack_require__(394); - - var _handleActions2 = _interopRequireDefault(_handleActions); - - var _combineActions = __webpack_require__(378); - - var _combineActions2 = _interopRequireDefault(_combineActions); - - var _createActions = __webpack_require__(397); - - var _createActions2 = _interopRequireDefault(_createActions); - - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - - exports.createAction = _createAction2.default; - exports.createActions = _createActions2.default; - exports.handleAction = _handleAction2.default; - exports.handleActions = _handleActions2.default; - exports.combineActions = _combineActions2.default; - -/***/ }, -/* 341 */ -/***/ function(module, exports, __webpack_require__) { - - 'use strict'; - - Object.defineProperty(exports, "__esModule", { - value: true - }); - exports.default = createAction; - - var _identity = __webpack_require__(342); - - var _identity2 = _interopRequireDefault(_identity); - - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - - function createAction(type, payloadCreator, metaCreator) { - var finalPayloadCreator = typeof payloadCreator === 'function' ? payloadCreator : _identity2.default; - - var actionHandler = function actionHandler() { - var hasError = (arguments.length <= 0 ? undefined : arguments[0]) instanceof Error; - - var action = { - type: type - }; - - var payload = hasError ? arguments.length <= 0 ? undefined : arguments[0] : finalPayloadCreator.apply(undefined, arguments); - if (!(payload === null || payload === undefined)) { - action.payload = payload; - } - - if (hasError) { - // Handle FSA errors where the payload is an Error object. Set error. - action.error = true; - } - - if (typeof metaCreator === 'function') { - action.meta = metaCreator.apply(undefined, arguments); - } - - return action; - }; - - actionHandler.toString = function () { - return type.toString(); - }; - - return actionHandler; - } - -/***/ }, -/* 342 */, -/* 343 */ -/***/ function(module, exports, __webpack_require__) { - - 'use strict'; - - Object.defineProperty(exports, "__esModule", { - value: true - }); - - var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); - - exports.default = handleAction; - - var _isFunction = __webpack_require__(344); - - var _isFunction2 = _interopRequireDefault(_isFunction); - - var _identity = __webpack_require__(342); - - var _identity2 = _interopRequireDefault(_identity); - - var _isNil = __webpack_require__(346); - - var _isNil2 = _interopRequireDefault(_isNil); - - var _includes = __webpack_require__(347); - - var _includes2 = _interopRequireDefault(_includes); - - var _combineActions = __webpack_require__(378); - - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - - function handleAction(actionType, reducers, defaultState) { - var actionTypes = actionType.toString().split(_combineActions.ACTION_TYPE_DELIMITER); - - var _ref = (0, _isFunction2.default)(reducers) ? [reducers, reducers] : [reducers.next, reducers.throw].map(function (reducer) { - return (0, _isNil2.default)(reducer) ? _identity2.default : reducer; - }); - - var _ref2 = _slicedToArray(_ref, 2); - - var nextReducer = _ref2[0]; - var throwReducer = _ref2[1]; - - - return function () { - var state = arguments.length <= 0 || arguments[0] === undefined ? defaultState : arguments[0]; - var action = arguments[1]; - - if (!(0, _includes2.default)(actionTypes, action.type.toString())) { - return state; - } - - return (action.error === true ? throwReducer : nextReducer)(state, action); - }; - } - -/***/ }, -/* 344 */, -/* 345 */, -/* 346 */ -/***/ function(module, exports) { - - /** - * Checks if `value` is `null` or `undefined`. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is nullish, else `false`. - * @example - * - * _.isNil(null); - * // => true - * - * _.isNil(void 0); - * // => true - * - * _.isNil(NaN); - * // => false - */ - function isNil(value) { - return value == null; - } - - module.exports = isNil; - - -/***/ }, -/* 347 */ -/***/ function(module, exports, __webpack_require__) { - - var baseIndexOf = __webpack_require__(348), - isArrayLike = __webpack_require__(352), - isString = __webpack_require__(354), - toInteger = __webpack_require__(356), - values = __webpack_require__(360); - - /* Built-in method references for those with the same name as other `lodash` methods. */ - var nativeMax = Math.max; - - /** - * Checks if `value` is in `collection`. If `collection` is a string, it's - * checked for a substring of `value`, otherwise - * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) - * is used for equality comparisons. If `fromIndex` is negative, it's used as - * the offset from the end of `collection`. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Collection - * @param {Array|Object|string} collection The collection to inspect. - * @param {*} value The value to search for. - * @param {number} [fromIndex=0] The index to search from. - * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`. - * @returns {boolean} Returns `true` if `value` is found, else `false`. - * @example - * - * _.includes([1, 2, 3], 1); - * // => true - * - * _.includes([1, 2, 3], 1, 2); - * // => false - * - * _.includes({ 'a': 1, 'b': 2 }, 1); - * // => true - * - * _.includes('abcd', 'bc'); - * // => true - */ - function includes(collection, value, fromIndex, guard) { - collection = isArrayLike(collection) ? collection : values(collection); - fromIndex = (fromIndex && !guard) ? toInteger(fromIndex) : 0; - - var length = collection.length; - if (fromIndex < 0) { - fromIndex = nativeMax(length + fromIndex, 0); - } - return isString(collection) - ? (fromIndex <= length && collection.indexOf(value, fromIndex) > -1) - : (!!length && baseIndexOf(collection, value, fromIndex) > -1); - } - - module.exports = includes; - - -/***/ }, -/* 348 */ -/***/ function(module, exports, __webpack_require__) { - - var baseFindIndex = __webpack_require__(349), - baseIsNaN = __webpack_require__(350), - strictIndexOf = __webpack_require__(351); - - /** - * The base implementation of `_.indexOf` without `fromIndex` bounds checks. - * - * @private - * @param {Array} array The array to inspect. - * @param {*} value The value to search for. - * @param {number} fromIndex The index to search from. - * @returns {number} Returns the index of the matched value, else `-1`. - */ - function baseIndexOf(array, value, fromIndex) { - return value === value - ? strictIndexOf(array, value, fromIndex) - : baseFindIndex(array, baseIsNaN, fromIndex); - } - - module.exports = baseIndexOf; - - -/***/ }, -/* 349 */ -/***/ function(module, exports) { - - /** - * The base implementation of `_.findIndex` and `_.findLastIndex` without - * support for iteratee shorthands. - * - * @private - * @param {Array} array The array to inspect. - * @param {Function} predicate The function invoked per iteration. - * @param {number} fromIndex The index to search from. - * @param {boolean} [fromRight] Specify iterating from right to left. - * @returns {number} Returns the index of the matched value, else `-1`. - */ - function baseFindIndex(array, predicate, fromIndex, fromRight) { - var length = array.length, - index = fromIndex + (fromRight ? 1 : -1); - - while ((fromRight ? index-- : ++index < length)) { - if (predicate(array[index], index, array)) { - return index; - } - } - return -1; - } - - module.exports = baseFindIndex; - - -/***/ }, -/* 350 */ -/***/ function(module, exports) { - - /** - * The base implementation of `_.isNaN` without support for number objects. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`. - */ - function baseIsNaN(value) { - return value !== value; - } - - module.exports = baseIsNaN; - - -/***/ }, -/* 351 */ -/***/ function(module, exports) { - - /** - * A specialized version of `_.indexOf` which performs strict equality - * comparisons of values, i.e. `===`. - * - * @private - * @param {Array} array The array to inspect. - * @param {*} value The value to search for. - * @param {number} fromIndex The index to search from. - * @returns {number} Returns the index of the matched value, else `-1`. - */ - function strictIndexOf(array, value, fromIndex) { - var index = fromIndex - 1, - length = array.length; - - while (++index < length) { - if (array[index] === value) { - return index; - } - } - return -1; - } - - module.exports = strictIndexOf; - - -/***/ }, -/* 352 */, -/* 353 */, -/* 354 */ -/***/ function(module, exports, __webpack_require__) { - - var baseGetTag = __webpack_require__(112), - isArray = __webpack_require__(355), - isObjectLike = __webpack_require__(120); - - /** `Object#toString` result references. */ - var stringTag = '[object String]'; - - /** - * Checks if `value` is classified as a `String` primitive or object. - * - * @static - * @since 0.1.0 - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a string, else `false`. - * @example - * - * _.isString('abc'); - * // => true - * - * _.isString(1); - * // => false - */ - function isString(value) { - return typeof value == 'string' || - (!isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag); - } - - module.exports = isString; - - -/***/ }, -/* 355 */, -/* 356 */ -/***/ function(module, exports, __webpack_require__) { - - var toFinite = __webpack_require__(357); - - /** - * Converts `value` to an integer. - * - * **Note:** This method is loosely based on - * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger). - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to convert. - * @returns {number} Returns the converted integer. - * @example - * - * _.toInteger(3.2); - * // => 3 - * - * _.toInteger(Number.MIN_VALUE); - * // => 0 - * - * _.toInteger(Infinity); - * // => 1.7976931348623157e+308 - * - * _.toInteger('3.2'); - * // => 3 - */ - function toInteger(value) { - var result = toFinite(value), - remainder = result % 1; - - return result === result ? (remainder ? result - remainder : result) : 0; - } - - module.exports = toInteger; - - -/***/ }, -/* 357 */ -/***/ function(module, exports, __webpack_require__) { - - var toNumber = __webpack_require__(358); - - /** Used as references for various `Number` constants. */ - var INFINITY = 1 / 0, - MAX_INTEGER = 1.7976931348623157e+308; - - /** - * Converts `value` to a finite number. - * - * @static - * @memberOf _ - * @since 4.12.0 - * @category Lang - * @param {*} value The value to convert. - * @returns {number} Returns the converted number. - * @example - * - * _.toFinite(3.2); - * // => 3.2 - * - * _.toFinite(Number.MIN_VALUE); - * // => 5e-324 - * - * _.toFinite(Infinity); - * // => 1.7976931348623157e+308 - * - * _.toFinite('3.2'); - * // => 3.2 - */ - function toFinite(value) { - if (!value) { - return value === 0 ? value : 0; - } - value = toNumber(value); - if (value === INFINITY || value === -INFINITY) { - var sign = (value < 0 ? -1 : 1); - return sign * MAX_INTEGER; - } - return value === value ? value : 0; - } - - module.exports = toFinite; - - -/***/ }, -/* 358 */, -/* 359 */, -/* 360 */ -/***/ function(module, exports, __webpack_require__) { - - var baseValues = __webpack_require__(361), - keys = __webpack_require__(363); - - /** - * Creates an array of the own enumerable string keyed property values of `object`. - * - * **Note:** Non-object values are coerced to objects. - * - * @static - * @since 0.1.0 - * @memberOf _ - * @category Object - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property values. - * @example - * - * function Foo() { - * this.a = 1; - * this.b = 2; - * } - * - * Foo.prototype.c = 3; - * - * _.values(new Foo); - * // => [1, 2] (iteration order is not guaranteed) - * - * _.values('hi'); - * // => ['h', 'i'] - */ - function values(object) { - return object == null ? [] : baseValues(object, keys(object)); - } - - module.exports = values; - - -/***/ }, -/* 361 */ -/***/ function(module, exports, __webpack_require__) { - - var arrayMap = __webpack_require__(362); - - /** - * The base implementation of `_.values` and `_.valuesIn` which creates an - * array of `object` property values corresponding to the property names - * of `props`. - * - * @private - * @param {Object} object The object to query. - * @param {Array} props The property names to get values for. - * @returns {Object} Returns the array of property values. - */ - function baseValues(object, props) { - return arrayMap(props, function(key) { - return object[key]; - }); - } - - module.exports = baseValues; - - -/***/ }, -/* 362 */ -/***/ function(module, exports) { - - /** - * A specialized version of `_.map` for arrays without support for iteratee - * shorthands. - * - * @private - * @param {Array} [array] The array to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Array} Returns the new mapped array. - */ - function arrayMap(array, iteratee) { - var index = -1, - length = array == null ? 0 : array.length, - result = Array(length); - - while (++index < length) { - result[index] = iteratee(array[index], index, array); - } - return result; - } - - module.exports = arrayMap; - - -/***/ }, -/* 363 */ -/***/ function(module, exports, __webpack_require__) { - - var arrayLikeKeys = __webpack_require__(364), - baseKeys = __webpack_require__(375), - isArrayLike = __webpack_require__(352); - - /** - * Creates an array of the own enumerable property names of `object`. - * - * **Note:** Non-object values are coerced to objects. See the - * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) - * for more details. - * - * @static - * @since 0.1.0 - * @memberOf _ - * @category Object - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property names. - * @example - * - * function Foo() { - * this.a = 1; - * this.b = 2; - * } - * - * Foo.prototype.c = 3; - * - * _.keys(new Foo); - * // => ['a', 'b'] (iteration order is not guaranteed) - * - * _.keys('hi'); - * // => ['0', '1'] - */ - function keys(object) { - return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object); - } - - module.exports = keys; - - -/***/ }, -/* 364 */, -/* 365 */, -/* 366 */, -/* 367 */, -/* 368 */, -/* 369 */, -/* 370 */, -/* 371 */, -/* 372 */, -/* 373 */, -/* 374 */, -/* 375 */ -/***/ function(module, exports, __webpack_require__) { - - var isPrototype = __webpack_require__(376), - nativeKeys = __webpack_require__(377); - - /** Used for built-in method references. */ - var objectProto = Object.prototype; - - /** Used to check objects for own properties. */ - var hasOwnProperty = objectProto.hasOwnProperty; - - /** - * The base implementation of `_.keys` which doesn't treat sparse arrays as dense. - * - * @private - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property names. - */ - function baseKeys(object) { - if (!isPrototype(object)) { - return nativeKeys(object); - } - var result = []; - for (var key in Object(object)) { - if (hasOwnProperty.call(object, key) && key != 'constructor') { - result.push(key); - } - } - return result; - } - - module.exports = baseKeys; - - -/***/ }, -/* 376 */, -/* 377 */ -/***/ function(module, exports, __webpack_require__) { - - var overArg = __webpack_require__(119); - - /* Built-in method references for those with the same name as other `lodash` methods. */ - var nativeKeys = overArg(Object.keys, Object); - - module.exports = nativeKeys; - - -/***/ }, -/* 378 */ -/***/ function(module, exports, __webpack_require__) { - - 'use strict'; - - Object.defineProperty(exports, "__esModule", { - value: true - }); - exports.ACTION_TYPE_DELIMITER = undefined; - exports.default = combineActions; - - var _isString = __webpack_require__(354); - - var _isString2 = _interopRequireDefault(_isString); - - var _isFunction = __webpack_require__(344); - - var _isFunction2 = _interopRequireDefault(_isFunction); - - var _isEmpty = __webpack_require__(379); - - var _isEmpty2 = _interopRequireDefault(_isEmpty); - - var _toString = __webpack_require__(392); - - var _toString2 = _interopRequireDefault(_toString); - - var _isSymbol = __webpack_require__(359); - - var _isSymbol2 = _interopRequireDefault(_isSymbol); - - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - - var ACTION_TYPE_DELIMITER = exports.ACTION_TYPE_DELIMITER = '||'; - - function isValidActionType(actionType) { - return (0, _isString2.default)(actionType) || (0, _isFunction2.default)(actionType) || (0, _isSymbol2.default)(actionType); - } - - function isValidActionTypes(actionTypes) { - if ((0, _isEmpty2.default)(actionTypes)) { - return false; - } - return actionTypes.every(isValidActionType); - } - - function combineActions() { - for (var _len = arguments.length, actionsTypes = Array(_len), _key = 0; _key < _len; _key++) { - actionsTypes[_key] = arguments[_key]; - } - - if (!isValidActionTypes(actionsTypes)) { - throw new TypeError('Expected action types to be strings, symbols, or action creators'); - } - - var combinedActionType = actionsTypes.map(_toString2.default).join(ACTION_TYPE_DELIMITER); - - return { toString: function toString() { - return combinedActionType; - } }; - } - -/***/ }, -/* 379 */ -/***/ function(module, exports, __webpack_require__) { - - var baseKeys = __webpack_require__(375), - getTag = __webpack_require__(380), - isArguments = __webpack_require__(366), - isArray = __webpack_require__(355), - isArrayLike = __webpack_require__(352), - isBuffer = __webpack_require__(368), - isPrototype = __webpack_require__(376), - isTypedArray = __webpack_require__(371); - - /** `Object#toString` result references. */ - var mapTag = '[object Map]', - setTag = '[object Set]'; - - /** Used for built-in method references. */ - var objectProto = Object.prototype; - - /** Used to check objects for own properties. */ - var hasOwnProperty = objectProto.hasOwnProperty; - - /** - * Checks if `value` is an empty object, collection, map, or set. - * - * Objects are considered empty if they have no own enumerable string keyed - * properties. - * - * Array-like values such as `arguments` objects, arrays, buffers, strings, or - * jQuery-like collections are considered empty if they have a `length` of `0`. - * Similarly, maps and sets are considered empty if they have a `size` of `0`. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is empty, else `false`. - * @example - * - * _.isEmpty(null); - * // => true - * - * _.isEmpty(true); - * // => true - * - * _.isEmpty(1); - * // => true - * - * _.isEmpty([1, 2, 3]); - * // => false - * - * _.isEmpty({ 'a': 1 }); - * // => false - */ - function isEmpty(value) { - if (value == null) { - return true; - } - if (isArrayLike(value) && - (isArray(value) || typeof value == 'string' || typeof value.splice == 'function' || - isBuffer(value) || isTypedArray(value) || isArguments(value))) { - return !value.length; - } - var tag = getTag(value); - if (tag == mapTag || tag == setTag) { - return !value.size; - } - if (isPrototype(value)) { - return !baseKeys(value).length; - } - for (var key in value) { - if (hasOwnProperty.call(value, key)) { - return false; - } - } - return true; - } - - module.exports = isEmpty; - - -/***/ }, -/* 380 */ -/***/ function(module, exports, __webpack_require__) { - - var DataView = __webpack_require__(381), - Map = __webpack_require__(388), - Promise = __webpack_require__(389), - Set = __webpack_require__(390), - WeakMap = __webpack_require__(391), - baseGetTag = __webpack_require__(112), - toSource = __webpack_require__(386); - - /** `Object#toString` result references. */ - var mapTag = '[object Map]', - objectTag = '[object Object]', - promiseTag = '[object Promise]', - setTag = '[object Set]', - weakMapTag = '[object WeakMap]'; - - var dataViewTag = '[object DataView]'; - - /** Used to detect maps, sets, and weakmaps. */ - var dataViewCtorString = toSource(DataView), - mapCtorString = toSource(Map), - promiseCtorString = toSource(Promise), - setCtorString = toSource(Set), - weakMapCtorString = toSource(WeakMap); - - /** - * Gets the `toStringTag` of `value`. - * - * @private - * @param {*} value The value to query. - * @returns {string} Returns the `toStringTag`. - */ - var getTag = baseGetTag; - - // Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6. - if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) || - (Map && getTag(new Map) != mapTag) || - (Promise && getTag(Promise.resolve()) != promiseTag) || - (Set && getTag(new Set) != setTag) || - (WeakMap && getTag(new WeakMap) != weakMapTag)) { - getTag = function(value) { - var result = baseGetTag(value), - Ctor = result == objectTag ? value.constructor : undefined, - ctorString = Ctor ? toSource(Ctor) : ''; - - if (ctorString) { - switch (ctorString) { - case dataViewCtorString: return dataViewTag; - case mapCtorString: return mapTag; - case promiseCtorString: return promiseTag; - case setCtorString: return setTag; - case weakMapCtorString: return weakMapTag; - } - } - return result; - }; - } - - module.exports = getTag; - - -/***/ }, -/* 381 */ -/***/ function(module, exports, __webpack_require__) { - - var getNative = __webpack_require__(382), - root = __webpack_require__(114); - - /* Built-in method references that are verified to be native. */ - var DataView = getNative(root, 'DataView'); - - module.exports = DataView; - - -/***/ }, -/* 382 */, -/* 383 */, -/* 384 */, -/* 385 */, -/* 386 */, -/* 387 */, -/* 388 */, -/* 389 */ -/***/ function(module, exports, __webpack_require__) { - - var getNative = __webpack_require__(382), - root = __webpack_require__(114); - - /* Built-in method references that are verified to be native. */ - var Promise = getNative(root, 'Promise'); - - module.exports = Promise; - - -/***/ }, -/* 390 */ -/***/ function(module, exports, __webpack_require__) { - - var getNative = __webpack_require__(382), - root = __webpack_require__(114); - - /* Built-in method references that are verified to be native. */ - var Set = getNative(root, 'Set'); - - module.exports = Set; - - -/***/ }, -/* 391 */ -/***/ function(module, exports, __webpack_require__) { - - var getNative = __webpack_require__(382), - root = __webpack_require__(114); - - /* Built-in method references that are verified to be native. */ - var WeakMap = getNative(root, 'WeakMap'); - - module.exports = WeakMap; - - -/***/ }, -/* 392 */ -/***/ function(module, exports, __webpack_require__) { - - var baseToString = __webpack_require__(393); - - /** - * Converts `value` to a string. An empty string is returned for `null` - * and `undefined` values. The sign of `-0` is preserved. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to convert. - * @returns {string} Returns the converted string. - * @example - * - * _.toString(null); - * // => '' - * - * _.toString(-0); - * // => '-0' - * - * _.toString([1, 2, 3]); - * // => '1,2,3' - */ - function toString(value) { - return value == null ? '' : baseToString(value); - } - - module.exports = toString; - - -/***/ }, -/* 393 */ -/***/ function(module, exports, __webpack_require__) { - - var Symbol = __webpack_require__(113), - arrayMap = __webpack_require__(362), - isArray = __webpack_require__(355), - isSymbol = __webpack_require__(359); - - /** Used as references for various `Number` constants. */ - var INFINITY = 1 / 0; - - /** Used to convert symbols to primitives and strings. */ - var symbolProto = Symbol ? Symbol.prototype : undefined, - symbolToString = symbolProto ? symbolProto.toString : undefined; - - /** - * The base implementation of `_.toString` which doesn't convert nullish - * values to empty strings. - * - * @private - * @param {*} value The value to process. - * @returns {string} Returns the string. - */ - function baseToString(value) { - // Exit early for strings to avoid a performance hit in some environments. - if (typeof value == 'string') { - return value; - } - if (isArray(value)) { - // Recursively convert values (susceptible to call stack limits). - return arrayMap(value, baseToString) + ''; - } - if (isSymbol(value)) { - return symbolToString ? symbolToString.call(value) : ''; - } - var result = (value + ''); - return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; - } - - module.exports = baseToString; - - -/***/ }, -/* 394 */ -/***/ function(module, exports, __webpack_require__) { - - 'use strict'; - - Object.defineProperty(exports, "__esModule", { - value: true - }); - exports.default = handleActions; - - var _handleAction = __webpack_require__(343); - - var _handleAction2 = _interopRequireDefault(_handleAction); - - var _ownKeys = __webpack_require__(395); - - var _ownKeys2 = _interopRequireDefault(_ownKeys); - - var _reduceReducers = __webpack_require__(396); - - var _reduceReducers2 = _interopRequireDefault(_reduceReducers); - - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - - function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } - - function handleActions(handlers, defaultState) { - var reducers = (0, _ownKeys2.default)(handlers).map(function (type) { - return (0, _handleAction2.default)(type, handlers[type]); - }); - var reducer = _reduceReducers2.default.apply(undefined, _toConsumableArray(reducers)); - - return function () { - var state = arguments.length <= 0 || arguments[0] === undefined ? defaultState : arguments[0]; - var action = arguments[1]; - return reducer(state, action); - }; - } - -/***/ }, -/* 395 */ -/***/ function(module, exports) { - - 'use strict'; - - Object.defineProperty(exports, "__esModule", { - value: true - }); - exports.default = ownKeys; - function ownKeys(object) { - if (typeof Reflect !== 'undefined' && typeof Reflect.ownKeys === 'function') { - return Reflect.ownKeys(object); - } - - var keys = Object.getOwnPropertyNames(object); - - if (typeof Object.getOwnPropertySymbols === 'function') { - keys = keys.concat(Object.getOwnPropertySymbols(object)); - } - - return keys; - } - -/***/ }, -/* 396 */ -/***/ function(module, exports) { - - "use strict"; - - exports.__esModule = true; - exports["default"] = reduceReducers; - - function reduceReducers() { - for (var _len = arguments.length, reducers = Array(_len), _key = 0; _key < _len; _key++) { - reducers[_key] = arguments[_key]; - } - - return function (previous, current) { - return reducers.reduce(function (p, r) { - return r(p, current); - }, previous); - }; - } - - module.exports = exports["default"]; - -/***/ }, -/* 397 */ -/***/ function(module, exports, __webpack_require__) { - - 'use strict'; - - Object.defineProperty(exports, "__esModule", { - value: true - }); - - var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); - - var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; - - exports.default = createActions; - - var _identity = __webpack_require__(342); - - var _identity2 = _interopRequireDefault(_identity); - - var _camelCase = __webpack_require__(398); - - var _camelCase2 = _interopRequireDefault(_camelCase); - - var _isPlainObject = __webpack_require__(111); - - var _isPlainObject2 = _interopRequireDefault(_isPlainObject); - - var _isArray = __webpack_require__(355); - - var _isArray2 = _interopRequireDefault(_isArray); - - var _reduce = __webpack_require__(417); - - var _reduce2 = _interopRequireDefault(_reduce); - - var _isString = __webpack_require__(354); - - var _isString2 = _interopRequireDefault(_isString); - - var _isFunction = __webpack_require__(344); - - var _isFunction2 = _interopRequireDefault(_isFunction); - - var _createAction = __webpack_require__(341); - - var _createAction2 = _interopRequireDefault(_createAction); - - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - - function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } - - function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } - - function createActions(actionsMap) { - for (var _len = arguments.length, identityActions = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { - identityActions[_key - 1] = arguments[_key]; - } - - if (identityActions.every(_isString2.default)) { - if ((0, _isString2.default)(actionsMap)) { - return fromIdentityActions([actionsMap].concat(identityActions)); - } else if ((0, _isPlainObject2.default)(actionsMap)) { - return _extends({}, fromActionsMap(actionsMap), fromIdentityActions(identityActions)); - } - } - - throw new TypeError('Expected optional object followed by string action types'); - } - - function isValidActionsMapValue(actionsMapValue) { - if ((0, _isFunction2.default)(actionsMapValue)) { - return true; - } else if ((0, _isArray2.default)(actionsMapValue)) { - var _actionsMapValue = _slicedToArray(actionsMapValue, 2); - - var _actionsMapValue$ = _actionsMapValue[0]; - var payload = _actionsMapValue$ === undefined ? _identity2.default : _actionsMapValue$; - var meta = _actionsMapValue[1]; - - - return (0, _isFunction2.default)(payload) && (0, _isFunction2.default)(meta); - } - return false; - } - - function fromActionsMap(actionsMap) { - return (0, _reduce2.default)(actionsMap, function (actionCreatorsMap, actionsMapValue, type) { - if (!isValidActionsMapValue(actionsMapValue)) { - throw new TypeError('Expected function, undefined, or array with payload and meta ' + ('functions for ' + type)); - } - - var actionCreator = (0, _isArray2.default)(actionsMapValue) ? _createAction2.default.apply(undefined, [type].concat(_toConsumableArray(actionsMapValue))) : (0, _createAction2.default)(type, actionsMapValue); - - return _extends({}, actionCreatorsMap, _defineProperty({}, (0, _camelCase2.default)(type), actionCreator)); - }, {}); - } - - function fromIdentityActions(identityActions) { - return fromActionsMap(identityActions.reduce(function (actionsMap, actionType) { - return _extends({}, actionsMap, _defineProperty({}, actionType, _identity2.default)); - }, {})); - } - -/***/ }, -/* 398 */ -/***/ function(module, exports, __webpack_require__) { - - var capitalize = __webpack_require__(399), - createCompounder = __webpack_require__(408); - - /** - * Converts `string` to [camel case](https://en.wikipedia.org/wiki/CamelCase). - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category String - * @param {string} [string=''] The string to convert. - * @returns {string} Returns the camel cased string. - * @example - * - * _.camelCase('Foo Bar'); - * // => 'fooBar' - * - * _.camelCase('--foo-bar--'); - * // => 'fooBar' - * - * _.camelCase('__FOO_BAR__'); - * // => 'fooBar' - */ - var camelCase = createCompounder(function(result, word, index) { - word = word.toLowerCase(); - return result + (index ? capitalize(word) : word); - }); - - module.exports = camelCase; - - -/***/ }, -/* 399 */ -/***/ function(module, exports, __webpack_require__) { - - var toString = __webpack_require__(392), - upperFirst = __webpack_require__(400); - - /** - * Converts the first character of `string` to upper case and the remaining - * to lower case. - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category String - * @param {string} [string=''] The string to capitalize. - * @returns {string} Returns the capitalized string. - * @example - * - * _.capitalize('FRED'); - * // => 'Fred' - */ - function capitalize(string) { - return upperFirst(toString(string).toLowerCase()); - } - - module.exports = capitalize; - - -/***/ }, -/* 400 */ -/***/ function(module, exports, __webpack_require__) { - - var createCaseFirst = __webpack_require__(401); - - /** - * Converts the first character of `string` to upper case. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category String - * @param {string} [string=''] The string to convert. - * @returns {string} Returns the converted string. - * @example - * - * _.upperFirst('fred'); - * // => 'Fred' - * - * _.upperFirst('FRED'); - * // => 'FRED' - */ - var upperFirst = createCaseFirst('toUpperCase'); - - module.exports = upperFirst; - - -/***/ }, -/* 401 */ -/***/ function(module, exports, __webpack_require__) { - - var castSlice = __webpack_require__(402), - hasUnicode = __webpack_require__(404), - stringToArray = __webpack_require__(405), - toString = __webpack_require__(392); - - /** - * Creates a function like `_.lowerFirst`. - * - * @private - * @param {string} methodName The name of the `String` case method to use. - * @returns {Function} Returns the new case function. - */ - function createCaseFirst(methodName) { - return function(string) { - string = toString(string); - - var strSymbols = hasUnicode(string) - ? stringToArray(string) - : undefined; - - var chr = strSymbols - ? strSymbols[0] - : string.charAt(0); - - var trailing = strSymbols - ? castSlice(strSymbols, 1).join('') - : string.slice(1); - - return chr[methodName]() + trailing; - }; - } - - module.exports = createCaseFirst; - - -/***/ }, -/* 402 */ -/***/ function(module, exports, __webpack_require__) { - - var baseSlice = __webpack_require__(403); - - /** - * Casts `array` to a slice if it's needed. - * - * @private - * @param {Array} array The array to inspect. - * @param {number} start The start position. - * @param {number} [end=array.length] The end position. - * @returns {Array} Returns the cast slice. - */ - function castSlice(array, start, end) { - var length = array.length; - end = end === undefined ? length : end; - return (!start && end >= length) ? array : baseSlice(array, start, end); - } - - module.exports = castSlice; - - -/***/ }, -/* 403 */ -/***/ function(module, exports) { - - /** - * The base implementation of `_.slice` without an iteratee call guard. - * - * @private - * @param {Array} array The array to slice. - * @param {number} [start=0] The start position. - * @param {number} [end=array.length] The end position. - * @returns {Array} Returns the slice of `array`. - */ - function baseSlice(array, start, end) { - var index = -1, - length = array.length; - - if (start < 0) { - start = -start > length ? 0 : (length + start); - } - end = end > length ? length : end; - if (end < 0) { - end += length; - } - length = start > end ? 0 : ((end - start) >>> 0); - start >>>= 0; - - var result = Array(length); - while (++index < length) { - result[index] = array[index + start]; - } - return result; - } - - module.exports = baseSlice; - - -/***/ }, -/* 404 */ -/***/ function(module, exports) { - - /** Used to compose unicode character classes. */ - var rsAstralRange = '\\ud800-\\udfff', - rsComboMarksRange = '\\u0300-\\u036f\\ufe20-\\ufe23', - rsComboSymbolsRange = '\\u20d0-\\u20f0', - rsVarRange = '\\ufe0e\\ufe0f'; - - /** Used to compose unicode capture groups. */ - var rsZWJ = '\\u200d'; - - /** Used to detect strings with [zero-width joiners or code points from the astral planes](http://eev.ee/blog/2015/09/12/dark-corners-of-unicode/). */ - var reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboMarksRange + rsComboSymbolsRange + rsVarRange + ']'); - - /** - * Checks if `string` contains Unicode symbols. - * - * @private - * @param {string} string The string to inspect. - * @returns {boolean} Returns `true` if a symbol is found, else `false`. - */ - function hasUnicode(string) { - return reHasUnicode.test(string); - } - - module.exports = hasUnicode; - - -/***/ }, -/* 405 */ -/***/ function(module, exports, __webpack_require__) { - - var asciiToArray = __webpack_require__(406), - hasUnicode = __webpack_require__(404), - unicodeToArray = __webpack_require__(407); - - /** - * Converts `string` to an array. - * - * @private - * @param {string} string The string to convert. - * @returns {Array} Returns the converted array. - */ - function stringToArray(string) { - return hasUnicode(string) - ? unicodeToArray(string) - : asciiToArray(string); - } - - module.exports = stringToArray; - - -/***/ }, -/* 406 */ -/***/ function(module, exports) { - - /** - * Converts an ASCII `string` to an array. - * - * @private - * @param {string} string The string to convert. - * @returns {Array} Returns the converted array. - */ - function asciiToArray(string) { - return string.split(''); - } - - module.exports = asciiToArray; - - -/***/ }, -/* 407 */ -/***/ function(module, exports) { - - /** Used to compose unicode character classes. */ - var rsAstralRange = '\\ud800-\\udfff', - rsComboMarksRange = '\\u0300-\\u036f\\ufe20-\\ufe23', - rsComboSymbolsRange = '\\u20d0-\\u20f0', - rsVarRange = '\\ufe0e\\ufe0f'; - - /** Used to compose unicode capture groups. */ - var rsAstral = '[' + rsAstralRange + ']', - rsCombo = '[' + rsComboMarksRange + rsComboSymbolsRange + ']', - rsFitz = '\\ud83c[\\udffb-\\udfff]', - rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')', - rsNonAstral = '[^' + rsAstralRange + ']', - rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}', - rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]', - rsZWJ = '\\u200d'; - - /** Used to compose unicode regexes. */ - var reOptMod = rsModifier + '?', - rsOptVar = '[' + rsVarRange + ']?', - rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*', - rsSeq = rsOptVar + reOptMod + rsOptJoin, - rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')'; - - /** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */ - var reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g'); - - /** - * Converts a Unicode `string` to an array. - * - * @private - * @param {string} string The string to convert. - * @returns {Array} Returns the converted array. - */ - function unicodeToArray(string) { - return string.match(reUnicode) || []; - } - - module.exports = unicodeToArray; - - -/***/ }, -/* 408 */ -/***/ function(module, exports, __webpack_require__) { - - var arrayReduce = __webpack_require__(409), - deburr = __webpack_require__(410), - words = __webpack_require__(413); - - /** Used to compose unicode capture groups. */ - var rsApos = "['\u2019]"; - - /** Used to match apostrophes. */ - var reApos = RegExp(rsApos, 'g'); - - /** - * Creates a function like `_.camelCase`. - * - * @private - * @param {Function} callback The function to combine each word. - * @returns {Function} Returns the new compounder function. - */ - function createCompounder(callback) { - return function(string) { - return arrayReduce(words(deburr(string).replace(reApos, '')), callback, ''); - }; - } - - module.exports = createCompounder; - - -/***/ }, -/* 409 */ -/***/ function(module, exports) { - - /** - * A specialized version of `_.reduce` for arrays without support for - * iteratee shorthands. - * - * @private - * @param {Array} [array] The array to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @param {*} [accumulator] The initial value. - * @param {boolean} [initAccum] Specify using the first element of `array` as - * the initial value. - * @returns {*} Returns the accumulated value. - */ - function arrayReduce(array, iteratee, accumulator, initAccum) { - var index = -1, - length = array == null ? 0 : array.length; - - if (initAccum && length) { - accumulator = array[++index]; - } - while (++index < length) { - accumulator = iteratee(accumulator, array[index], index, array); - } - return accumulator; - } - - module.exports = arrayReduce; - - -/***/ }, -/* 410 */ -/***/ function(module, exports, __webpack_require__) { - - var deburrLetter = __webpack_require__(411), - toString = __webpack_require__(392); - - /** Used to match Latin Unicode letters (excluding mathematical operators). */ - var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g; - - /** Used to compose unicode character classes. */ - var rsComboMarksRange = '\\u0300-\\u036f\\ufe20-\\ufe23', - rsComboSymbolsRange = '\\u20d0-\\u20f0'; - - /** Used to compose unicode capture groups. */ - var rsCombo = '[' + rsComboMarksRange + rsComboSymbolsRange + ']'; - - /** - * Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks) and - * [combining diacritical marks for symbols](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks_for_Symbols). - */ - var reComboMark = RegExp(rsCombo, 'g'); - - /** - * Deburrs `string` by converting - * [Latin-1 Supplement](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table) - * and [Latin Extended-A](https://en.wikipedia.org/wiki/Latin_Extended-A) - * letters to basic Latin letters and removing - * [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks). - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category String - * @param {string} [string=''] The string to deburr. - * @returns {string} Returns the deburred string. - * @example - * - * _.deburr('déjà vu'); - * // => 'deja vu' - */ - function deburr(string) { - string = toString(string); - return string && string.replace(reLatin, deburrLetter).replace(reComboMark, ''); - } - - module.exports = deburr; - - -/***/ }, -/* 411 */ -/***/ function(module, exports, __webpack_require__) { - - var basePropertyOf = __webpack_require__(412); - - /** Used to map Latin Unicode letters to basic Latin letters. */ - var deburredLetters = { - // Latin-1 Supplement block. - '\xc0': 'A', '\xc1': 'A', '\xc2': 'A', '\xc3': 'A', '\xc4': 'A', '\xc5': 'A', - '\xe0': 'a', '\xe1': 'a', '\xe2': 'a', '\xe3': 'a', '\xe4': 'a', '\xe5': 'a', - '\xc7': 'C', '\xe7': 'c', - '\xd0': 'D', '\xf0': 'd', - '\xc8': 'E', '\xc9': 'E', '\xca': 'E', '\xcb': 'E', - '\xe8': 'e', '\xe9': 'e', '\xea': 'e', '\xeb': 'e', - '\xcc': 'I', '\xcd': 'I', '\xce': 'I', '\xcf': 'I', - '\xec': 'i', '\xed': 'i', '\xee': 'i', '\xef': 'i', - '\xd1': 'N', '\xf1': 'n', - '\xd2': 'O', '\xd3': 'O', '\xd4': 'O', '\xd5': 'O', '\xd6': 'O', '\xd8': 'O', - '\xf2': 'o', '\xf3': 'o', '\xf4': 'o', '\xf5': 'o', '\xf6': 'o', '\xf8': 'o', - '\xd9': 'U', '\xda': 'U', '\xdb': 'U', '\xdc': 'U', - '\xf9': 'u', '\xfa': 'u', '\xfb': 'u', '\xfc': 'u', - '\xdd': 'Y', '\xfd': 'y', '\xff': 'y', - '\xc6': 'Ae', '\xe6': 'ae', - '\xde': 'Th', '\xfe': 'th', - '\xdf': 'ss', - // Latin Extended-A block. - '\u0100': 'A', '\u0102': 'A', '\u0104': 'A', - '\u0101': 'a', '\u0103': 'a', '\u0105': 'a', - '\u0106': 'C', '\u0108': 'C', '\u010a': 'C', '\u010c': 'C', - '\u0107': 'c', '\u0109': 'c', '\u010b': 'c', '\u010d': 'c', - '\u010e': 'D', '\u0110': 'D', '\u010f': 'd', '\u0111': 'd', - '\u0112': 'E', '\u0114': 'E', '\u0116': 'E', '\u0118': 'E', '\u011a': 'E', - '\u0113': 'e', '\u0115': 'e', '\u0117': 'e', '\u0119': 'e', '\u011b': 'e', - '\u011c': 'G', '\u011e': 'G', '\u0120': 'G', '\u0122': 'G', - '\u011d': 'g', '\u011f': 'g', '\u0121': 'g', '\u0123': 'g', - '\u0124': 'H', '\u0126': 'H', '\u0125': 'h', '\u0127': 'h', - '\u0128': 'I', '\u012a': 'I', '\u012c': 'I', '\u012e': 'I', '\u0130': 'I', - '\u0129': 'i', '\u012b': 'i', '\u012d': 'i', '\u012f': 'i', '\u0131': 'i', - '\u0134': 'J', '\u0135': 'j', - '\u0136': 'K', '\u0137': 'k', '\u0138': 'k', - '\u0139': 'L', '\u013b': 'L', '\u013d': 'L', '\u013f': 'L', '\u0141': 'L', - '\u013a': 'l', '\u013c': 'l', '\u013e': 'l', '\u0140': 'l', '\u0142': 'l', - '\u0143': 'N', '\u0145': 'N', '\u0147': 'N', '\u014a': 'N', - '\u0144': 'n', '\u0146': 'n', '\u0148': 'n', '\u014b': 'n', - '\u014c': 'O', '\u014e': 'O', '\u0150': 'O', - '\u014d': 'o', '\u014f': 'o', '\u0151': 'o', - '\u0154': 'R', '\u0156': 'R', '\u0158': 'R', - '\u0155': 'r', '\u0157': 'r', '\u0159': 'r', - '\u015a': 'S', '\u015c': 'S', '\u015e': 'S', '\u0160': 'S', - '\u015b': 's', '\u015d': 's', '\u015f': 's', '\u0161': 's', - '\u0162': 'T', '\u0164': 'T', '\u0166': 'T', - '\u0163': 't', '\u0165': 't', '\u0167': 't', - '\u0168': 'U', '\u016a': 'U', '\u016c': 'U', '\u016e': 'U', '\u0170': 'U', '\u0172': 'U', - '\u0169': 'u', '\u016b': 'u', '\u016d': 'u', '\u016f': 'u', '\u0171': 'u', '\u0173': 'u', - '\u0174': 'W', '\u0175': 'w', - '\u0176': 'Y', '\u0177': 'y', '\u0178': 'Y', - '\u0179': 'Z', '\u017b': 'Z', '\u017d': 'Z', - '\u017a': 'z', '\u017c': 'z', '\u017e': 'z', - '\u0132': 'IJ', '\u0133': 'ij', - '\u0152': 'Oe', '\u0153': 'oe', - '\u0149': "'n", '\u017f': 's' - }; - - /** - * Used by `_.deburr` to convert Latin-1 Supplement and Latin Extended-A - * letters to basic Latin letters. - * - * @private - * @param {string} letter The matched letter to deburr. - * @returns {string} Returns the deburred letter. - */ - var deburrLetter = basePropertyOf(deburredLetters); - - module.exports = deburrLetter; - - -/***/ }, -/* 412 */ -/***/ function(module, exports) { - - /** - * The base implementation of `_.propertyOf` without support for deep paths. - * - * @private - * @param {Object} object The object to query. - * @returns {Function} Returns the new accessor function. - */ - function basePropertyOf(object) { - return function(key) { - return object == null ? undefined : object[key]; - }; - } - - module.exports = basePropertyOf; - - -/***/ }, -/* 413 */ -/***/ function(module, exports, __webpack_require__) { - - var asciiWords = __webpack_require__(414), - hasUnicodeWord = __webpack_require__(415), - toString = __webpack_require__(392), - unicodeWords = __webpack_require__(416); - - /** - * Splits `string` into an array of its words. - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category String - * @param {string} [string=''] The string to inspect. - * @param {RegExp|string} [pattern] The pattern to match words. - * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. - * @returns {Array} Returns the words of `string`. - * @example - * - * _.words('fred, barney, & pebbles'); - * // => ['fred', 'barney', 'pebbles'] - * - * _.words('fred, barney, & pebbles', /[^, ]+/g); - * // => ['fred', 'barney', '&', 'pebbles'] - */ - function words(string, pattern, guard) { - string = toString(string); - pattern = guard ? undefined : pattern; - - if (pattern === undefined) { - return hasUnicodeWord(string) ? unicodeWords(string) : asciiWords(string); - } - return string.match(pattern) || []; - } - - module.exports = words; - - -/***/ }, -/* 414 */ -/***/ function(module, exports) { - - /** Used to match words composed of alphanumeric characters. */ - var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g; - - /** - * Splits an ASCII `string` into an array of its words. - * - * @private - * @param {string} The string to inspect. - * @returns {Array} Returns the words of `string`. - */ - function asciiWords(string) { - return string.match(reAsciiWord) || []; - } - - module.exports = asciiWords; - - -/***/ }, -/* 415 */ -/***/ function(module, exports) { - - /** Used to detect strings that need a more robust regexp to match words. */ - var reHasUnicodeWord = /[a-z][A-Z]|[A-Z]{2,}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/; - - /** - * Checks if `string` contains a word composed of Unicode symbols. - * - * @private - * @param {string} string The string to inspect. - * @returns {boolean} Returns `true` if a word is found, else `false`. - */ - function hasUnicodeWord(string) { - return reHasUnicodeWord.test(string); - } - - module.exports = hasUnicodeWord; - - -/***/ }, -/* 416 */ -/***/ function(module, exports) { - - /** Used to compose unicode character classes. */ - var rsAstralRange = '\\ud800-\\udfff', - rsComboMarksRange = '\\u0300-\\u036f\\ufe20-\\ufe23', - rsComboSymbolsRange = '\\u20d0-\\u20f0', - rsDingbatRange = '\\u2700-\\u27bf', - rsLowerRange = 'a-z\\xdf-\\xf6\\xf8-\\xff', - rsMathOpRange = '\\xac\\xb1\\xd7\\xf7', - rsNonCharRange = '\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf', - rsPunctuationRange = '\\u2000-\\u206f', - rsSpaceRange = ' \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000', - rsUpperRange = 'A-Z\\xc0-\\xd6\\xd8-\\xde', - rsVarRange = '\\ufe0e\\ufe0f', - rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange; - - /** Used to compose unicode capture groups. */ - var rsApos = "['\u2019]", - rsBreak = '[' + rsBreakRange + ']', - rsCombo = '[' + rsComboMarksRange + rsComboSymbolsRange + ']', - rsDigits = '\\d+', - rsDingbat = '[' + rsDingbatRange + ']', - rsLower = '[' + rsLowerRange + ']', - rsMisc = '[^' + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + ']', - rsFitz = '\\ud83c[\\udffb-\\udfff]', - rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')', - rsNonAstral = '[^' + rsAstralRange + ']', - rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}', - rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]', - rsUpper = '[' + rsUpperRange + ']', - rsZWJ = '\\u200d'; - - /** Used to compose unicode regexes. */ - var rsMiscLower = '(?:' + rsLower + '|' + rsMisc + ')', - rsMiscUpper = '(?:' + rsUpper + '|' + rsMisc + ')', - rsOptContrLower = '(?:' + rsApos + '(?:d|ll|m|re|s|t|ve))?', - rsOptContrUpper = '(?:' + rsApos + '(?:D|LL|M|RE|S|T|VE))?', - reOptMod = rsModifier + '?', - rsOptVar = '[' + rsVarRange + ']?', - rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*', - rsOrdLower = '\\d*(?:(?:1st|2nd|3rd|(?![123])\\dth)\\b)', - rsOrdUpper = '\\d*(?:(?:1ST|2ND|3RD|(?![123])\\dTH)\\b)', - rsSeq = rsOptVar + reOptMod + rsOptJoin, - rsEmoji = '(?:' + [rsDingbat, rsRegional, rsSurrPair].join('|') + ')' + rsSeq; - - /** Used to match complex or compound words. */ - var reUnicodeWord = RegExp([ - rsUpper + '?' + rsLower + '+' + rsOptContrLower + '(?=' + [rsBreak, rsUpper, '$'].join('|') + ')', - rsMiscUpper + '+' + rsOptContrUpper + '(?=' + [rsBreak, rsUpper + rsMiscLower, '$'].join('|') + ')', - rsUpper + '?' + rsMiscLower + '+' + rsOptContrLower, - rsUpper + '+' + rsOptContrUpper, - rsOrdUpper, - rsOrdLower, - rsDigits, - rsEmoji - ].join('|'), 'g'); - - /** - * Splits a Unicode `string` into an array of its words. - * - * @private - * @param {string} The string to inspect. - * @returns {Array} Returns the words of `string`. - */ - function unicodeWords(string) { - return string.match(reUnicodeWord) || []; - } - - module.exports = unicodeWords; - - -/***/ }, -/* 417 */ -/***/ function(module, exports, __webpack_require__) { - - var arrayReduce = __webpack_require__(409), - baseEach = __webpack_require__(418), - baseIteratee = __webpack_require__(423), - baseReduce = __webpack_require__(486), - isArray = __webpack_require__(355); - - /** - * Reduces `collection` to a value which is the accumulated result of running - * each element in `collection` thru `iteratee`, where each successive - * invocation is supplied the return value of the previous. If `accumulator` - * is not given, the first element of `collection` is used as the initial - * value. The iteratee is invoked with four arguments: - * (accumulator, value, index|key, collection). - * - * Many lodash methods are guarded to work as iteratees for methods like - * `_.reduce`, `_.reduceRight`, and `_.transform`. - * - * The guarded methods are: - * `assign`, `defaults`, `defaultsDeep`, `includes`, `merge`, `orderBy`, - * and `sortBy` - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Collection - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} [iteratee=_.identity] The function invoked per iteration. - * @param {*} [accumulator] The initial value. - * @returns {*} Returns the accumulated value. - * @see _.reduceRight - * @example - * - * _.reduce([1, 2], function(sum, n) { - * return sum + n; - * }, 0); - * // => 3 - * - * _.reduce({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) { - * (result[value] || (result[value] = [])).push(key); - * return result; - * }, {}); - * // => { '1': ['a', 'c'], '2': ['b'] } (iteration order is not guaranteed) - */ - function reduce(collection, iteratee, accumulator) { - var func = isArray(collection) ? arrayReduce : baseReduce, - initAccum = arguments.length < 3; - - return func(collection, baseIteratee(iteratee, 4), accumulator, initAccum, baseEach); - } - - module.exports = reduce; - - -/***/ }, -/* 418 */ -/***/ function(module, exports, __webpack_require__) { - - var baseForOwn = __webpack_require__(419), - createBaseEach = __webpack_require__(422); - - /** - * The base implementation of `_.forEach` without support for iteratee shorthands. - * - * @private - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Array|Object} Returns `collection`. - */ - var baseEach = createBaseEach(baseForOwn); - - module.exports = baseEach; - - -/***/ }, -/* 419 */ -/***/ function(module, exports, __webpack_require__) { - - var baseFor = __webpack_require__(420), - keys = __webpack_require__(363); - - /** - * The base implementation of `_.forOwn` without support for iteratee shorthands. - * - * @private - * @param {Object} object The object to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Object} Returns `object`. - */ - function baseForOwn(object, iteratee) { - return object && baseFor(object, iteratee, keys); - } - - module.exports = baseForOwn; - - -/***/ }, -/* 420 */, -/* 421 */, -/* 422 */ -/***/ function(module, exports, __webpack_require__) { - - var isArrayLike = __webpack_require__(352); - - /** - * Creates a `baseEach` or `baseEachRight` function. - * - * @private - * @param {Function} eachFunc The function to iterate over a collection. - * @param {boolean} [fromRight] Specify iterating from right to left. - * @returns {Function} Returns the new base function. - */ - function createBaseEach(eachFunc, fromRight) { - return function(collection, iteratee) { - if (collection == null) { - return collection; - } - if (!isArrayLike(collection)) { - return eachFunc(collection, iteratee); - } - var length = collection.length, - index = fromRight ? length : -1, - iterable = Object(collection); - - while ((fromRight ? index-- : ++index < length)) { - if (iteratee(iterable[index], index, iterable) === false) { - break; - } - } - return collection; - }; - } - - module.exports = createBaseEach; - - -/***/ }, -/* 423 */ -/***/ function(module, exports, __webpack_require__) { - - var baseMatches = __webpack_require__(424), - baseMatchesProperty = __webpack_require__(471), - identity = __webpack_require__(342), - isArray = __webpack_require__(355), - property = __webpack_require__(483); - - /** - * The base implementation of `_.iteratee`. - * - * @private - * @param {*} [value=_.identity] The value to convert to an iteratee. - * @returns {Function} Returns the iteratee. - */ - function baseIteratee(value) { - // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9. - // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details. - if (typeof value == 'function') { - return value; - } - if (value == null) { - return identity; - } - if (typeof value == 'object') { - return isArray(value) - ? baseMatchesProperty(value[0], value[1]) - : baseMatches(value); - } - return property(value); - } - - module.exports = baseIteratee; - - -/***/ }, -/* 424 */ -/***/ function(module, exports, __webpack_require__) { - - var baseIsMatch = __webpack_require__(425), - getMatchData = __webpack_require__(468), - matchesStrictComparable = __webpack_require__(470); - - /** - * The base implementation of `_.matches` which doesn't clone `source`. - * - * @private - * @param {Object} source The object of property values to match. - * @returns {Function} Returns the new spec function. - */ - function baseMatches(source) { - var matchData = getMatchData(source); - if (matchData.length == 1 && matchData[0][2]) { - return matchesStrictComparable(matchData[0][0], matchData[0][1]); - } - return function(object) { - return object === source || baseIsMatch(object, source, matchData); - }; - } - - module.exports = baseMatches; - - -/***/ }, -/* 425 */ -/***/ function(module, exports, __webpack_require__) { - - var Stack = __webpack_require__(426), - baseIsEqual = __webpack_require__(455); - - /** Used to compose bitmasks for comparison styles. */ - var UNORDERED_COMPARE_FLAG = 1, - PARTIAL_COMPARE_FLAG = 2; - - /** - * The base implementation of `_.isMatch` without support for iteratee shorthands. - * - * @private - * @param {Object} object The object to inspect. - * @param {Object} source The object of property values to match. - * @param {Array} matchData The property names, values, and compare flags to match. - * @param {Function} [customizer] The function to customize comparisons. - * @returns {boolean} Returns `true` if `object` is a match, else `false`. - */ - function baseIsMatch(object, source, matchData, customizer) { - var index = matchData.length, - length = index, - noCustomizer = !customizer; - - if (object == null) { - return !length; - } - object = Object(object); - while (index--) { - var data = matchData[index]; - if ((noCustomizer && data[2]) - ? data[1] !== object[data[0]] - : !(data[0] in object) - ) { - return false; - } - } - while (++index < length) { - data = matchData[index]; - var key = data[0], - objValue = object[key], - srcValue = data[1]; - - if (noCustomizer && data[2]) { - if (objValue === undefined && !(key in object)) { - return false; - } - } else { - var stack = new Stack; - if (customizer) { - var result = customizer(objValue, srcValue, key, object, source, stack); - } - if (!(result === undefined - ? baseIsEqual(srcValue, objValue, customizer, UNORDERED_COMPARE_FLAG | PARTIAL_COMPARE_FLAG, stack) - : result - )) { - return false; - } - } - } - return true; - } - - module.exports = baseIsMatch; - - -/***/ }, -/* 426 */, -/* 427 */, -/* 428 */, -/* 429 */, -/* 430 */, -/* 431 */, -/* 432 */, -/* 433 */, -/* 434 */, -/* 435 */, -/* 436 */, -/* 437 */, -/* 438 */, -/* 439 */, -/* 440 */, -/* 441 */, -/* 442 */, -/* 443 */, -/* 444 */, -/* 445 */, -/* 446 */, -/* 447 */, -/* 448 */, -/* 449 */, -/* 450 */, -/* 451 */, -/* 452 */, -/* 453 */, -/* 454 */, -/* 455 */ -/***/ function(module, exports, __webpack_require__) { - - var baseIsEqualDeep = __webpack_require__(456), - isObject = __webpack_require__(345), - isObjectLike = __webpack_require__(120); - - /** - * The base implementation of `_.isEqual` which supports partial comparisons - * and tracks traversed objects. - * - * @private - * @param {*} value The value to compare. - * @param {*} other The other value to compare. - * @param {Function} [customizer] The function to customize comparisons. - * @param {boolean} [bitmask] The bitmask of comparison flags. - * The bitmask may be composed of the following flags: - * 1 - Unordered comparison - * 2 - Partial comparison - * @param {Object} [stack] Tracks traversed `value` and `other` objects. - * @returns {boolean} Returns `true` if the values are equivalent, else `false`. - */ - function baseIsEqual(value, other, customizer, bitmask, stack) { - if (value === other) { - return true; - } - if (value == null || other == null || (!isObject(value) && !isObjectLike(other))) { - return value !== value && other !== other; - } - return baseIsEqualDeep(value, other, baseIsEqual, customizer, bitmask, stack); - } - - module.exports = baseIsEqual; - - -/***/ }, -/* 456 */ -/***/ function(module, exports, __webpack_require__) { - - var Stack = __webpack_require__(426), - equalArrays = __webpack_require__(457), - equalByTag = __webpack_require__(463), - equalObjects = __webpack_require__(467), - getTag = __webpack_require__(380), - isArray = __webpack_require__(355), - isBuffer = __webpack_require__(368), - isTypedArray = __webpack_require__(371); - - /** Used to compose bitmasks for comparison styles. */ - var PARTIAL_COMPARE_FLAG = 2; - - /** `Object#toString` result references. */ - var argsTag = '[object Arguments]', - arrayTag = '[object Array]', - objectTag = '[object Object]'; - - /** Used for built-in method references. */ - var objectProto = Object.prototype; - - /** Used to check objects for own properties. */ - var hasOwnProperty = objectProto.hasOwnProperty; - - /** - * A specialized version of `baseIsEqual` for arrays and objects which performs - * deep comparisons and tracks traversed objects enabling objects with circular - * references to be compared. - * - * @private - * @param {Object} object The object to compare. - * @param {Object} other The other object to compare. - * @param {Function} equalFunc The function to determine equivalents of values. - * @param {Function} [customizer] The function to customize comparisons. - * @param {number} [bitmask] The bitmask of comparison flags. See `baseIsEqual` - * for more details. - * @param {Object} [stack] Tracks traversed `object` and `other` objects. - * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. - */ - function baseIsEqualDeep(object, other, equalFunc, customizer, bitmask, stack) { - var objIsArr = isArray(object), - othIsArr = isArray(other), - objTag = arrayTag, - othTag = arrayTag; - - if (!objIsArr) { - objTag = getTag(object); - objTag = objTag == argsTag ? objectTag : objTag; - } - if (!othIsArr) { - othTag = getTag(other); - othTag = othTag == argsTag ? objectTag : othTag; - } - var objIsObj = objTag == objectTag, - othIsObj = othTag == objectTag, - isSameTag = objTag == othTag; - - if (isSameTag && isBuffer(object)) { - if (!isBuffer(other)) { - return false; - } - objIsArr = true; - objIsObj = false; - } - if (isSameTag && !objIsObj) { - stack || (stack = new Stack); - return (objIsArr || isTypedArray(object)) - ? equalArrays(object, other, equalFunc, customizer, bitmask, stack) - : equalByTag(object, other, objTag, equalFunc, customizer, bitmask, stack); - } - if (!(bitmask & PARTIAL_COMPARE_FLAG)) { - var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'), - othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__'); - - if (objIsWrapped || othIsWrapped) { - var objUnwrapped = objIsWrapped ? object.value() : object, - othUnwrapped = othIsWrapped ? other.value() : other; - - stack || (stack = new Stack); - return equalFunc(objUnwrapped, othUnwrapped, customizer, bitmask, stack); - } - } - if (!isSameTag) { - return false; - } - stack || (stack = new Stack); - return equalObjects(object, other, equalFunc, customizer, bitmask, stack); - } - - module.exports = baseIsEqualDeep; - - -/***/ }, -/* 457 */ -/***/ function(module, exports, __webpack_require__) { - - var SetCache = __webpack_require__(458), - arraySome = __webpack_require__(461), - cacheHas = __webpack_require__(462); - - /** Used to compose bitmasks for comparison styles. */ - var UNORDERED_COMPARE_FLAG = 1, - PARTIAL_COMPARE_FLAG = 2; - - /** - * A specialized version of `baseIsEqualDeep` for arrays with support for - * partial deep comparisons. - * - * @private - * @param {Array} array The array to compare. - * @param {Array} other The other array to compare. - * @param {Function} equalFunc The function to determine equivalents of values. - * @param {Function} customizer The function to customize comparisons. - * @param {number} bitmask The bitmask of comparison flags. See `baseIsEqual` - * for more details. - * @param {Object} stack Tracks traversed `array` and `other` objects. - * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`. - */ - function equalArrays(array, other, equalFunc, customizer, bitmask, stack) { - var isPartial = bitmask & PARTIAL_COMPARE_FLAG, - arrLength = array.length, - othLength = other.length; - - if (arrLength != othLength && !(isPartial && othLength > arrLength)) { - return false; - } - // Assume cyclic values are equal. - var stacked = stack.get(array); - if (stacked && stack.get(other)) { - return stacked == other; - } - var index = -1, - result = true, - seen = (bitmask & UNORDERED_COMPARE_FLAG) ? new SetCache : undefined; - - stack.set(array, other); - stack.set(other, array); - - // Ignore non-index properties. - while (++index < arrLength) { - var arrValue = array[index], - othValue = other[index]; - - if (customizer) { - var compared = isPartial - ? customizer(othValue, arrValue, index, other, array, stack) - : customizer(arrValue, othValue, index, array, other, stack); - } - if (compared !== undefined) { - if (compared) { - continue; - } - result = false; - break; - } - // Recursively compare arrays (susceptible to call stack limits). - if (seen) { - if (!arraySome(other, function(othValue, othIndex) { - if (!cacheHas(seen, othIndex) && - (arrValue === othValue || equalFunc(arrValue, othValue, customizer, bitmask, stack))) { - return seen.push(othIndex); - } - })) { - result = false; - break; - } - } else if (!( - arrValue === othValue || - equalFunc(arrValue, othValue, customizer, bitmask, stack) - )) { - result = false; - break; - } - } - stack['delete'](array); - stack['delete'](other); - return result; - } - - module.exports = equalArrays; - - -/***/ }, -/* 458 */ -/***/ function(module, exports, __webpack_require__) { - - var MapCache = __webpack_require__(440), - setCacheAdd = __webpack_require__(459), - setCacheHas = __webpack_require__(460); - - /** - * - * Creates an array cache object to store unique values. - * - * @private - * @constructor - * @param {Array} [values] The values to cache. - */ - function SetCache(values) { - var index = -1, - length = values == null ? 0 : values.length; - - this.__data__ = new MapCache; - while (++index < length) { - this.add(values[index]); - } - } - - // Add methods to `SetCache`. - SetCache.prototype.add = SetCache.prototype.push = setCacheAdd; - SetCache.prototype.has = setCacheHas; - - module.exports = SetCache; - - -/***/ }, -/* 459 */ -/***/ function(module, exports) { - - /** Used to stand-in for `undefined` hash values. */ - var HASH_UNDEFINED = '__lodash_hash_undefined__'; - - /** - * Adds `value` to the array cache. - * - * @private - * @name add - * @memberOf SetCache - * @alias push - * @param {*} value The value to cache. - * @returns {Object} Returns the cache instance. - */ - function setCacheAdd(value) { - this.__data__.set(value, HASH_UNDEFINED); - return this; - } - - module.exports = setCacheAdd; - - -/***/ }, -/* 460 */ -/***/ function(module, exports) { - - /** - * Checks if `value` is in the array cache. - * - * @private - * @name has - * @memberOf SetCache - * @param {*} value The value to search for. - * @returns {number} Returns `true` if `value` is found, else `false`. - */ - function setCacheHas(value) { - return this.__data__.has(value); - } - - module.exports = setCacheHas; - - -/***/ }, -/* 461 */ -/***/ function(module, exports) { - - /** - * A specialized version of `_.some` for arrays without support for iteratee - * shorthands. - * - * @private - * @param {Array} [array] The array to iterate over. - * @param {Function} predicate The function invoked per iteration. - * @returns {boolean} Returns `true` if any element passes the predicate check, - * else `false`. - */ - function arraySome(array, predicate) { - var index = -1, - length = array == null ? 0 : array.length; - - while (++index < length) { - if (predicate(array[index], index, array)) { - return true; - } - } - return false; - } - - module.exports = arraySome; - - -/***/ }, -/* 462 */ -/***/ function(module, exports) { - - /** - * Checks if a `cache` value for `key` exists. - * - * @private - * @param {Object} cache The cache to query. - * @param {string} key The key of the entry to check. - * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. - */ - function cacheHas(cache, key) { - return cache.has(key); - } - - module.exports = cacheHas; - - -/***/ }, -/* 463 */ -/***/ function(module, exports, __webpack_require__) { - - var Symbol = __webpack_require__(113), - Uint8Array = __webpack_require__(464), - eq = __webpack_require__(431), - equalArrays = __webpack_require__(457), - mapToArray = __webpack_require__(465), - setToArray = __webpack_require__(466); - - /** Used to compose bitmasks for comparison styles. */ - var UNORDERED_COMPARE_FLAG = 1, - PARTIAL_COMPARE_FLAG = 2; - - /** `Object#toString` result references. */ - var boolTag = '[object Boolean]', - dateTag = '[object Date]', - errorTag = '[object Error]', - mapTag = '[object Map]', - numberTag = '[object Number]', - regexpTag = '[object RegExp]', - setTag = '[object Set]', - stringTag = '[object String]', - symbolTag = '[object Symbol]'; - - var arrayBufferTag = '[object ArrayBuffer]', - dataViewTag = '[object DataView]'; - - /** Used to convert symbols to primitives and strings. */ - var symbolProto = Symbol ? Symbol.prototype : undefined, - symbolValueOf = symbolProto ? symbolProto.valueOf : undefined; - - /** - * A specialized version of `baseIsEqualDeep` for comparing objects of - * the same `toStringTag`. - * - * **Note:** This function only supports comparing values with tags of - * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`. - * - * @private - * @param {Object} object The object to compare. - * @param {Object} other The other object to compare. - * @param {string} tag The `toStringTag` of the objects to compare. - * @param {Function} equalFunc The function to determine equivalents of values. - * @param {Function} customizer The function to customize comparisons. - * @param {number} bitmask The bitmask of comparison flags. See `baseIsEqual` - * for more details. - * @param {Object} stack Tracks traversed `object` and `other` objects. - * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. - */ - function equalByTag(object, other, tag, equalFunc, customizer, bitmask, stack) { - switch (tag) { - case dataViewTag: - if ((object.byteLength != other.byteLength) || - (object.byteOffset != other.byteOffset)) { - return false; - } - object = object.buffer; - other = other.buffer; - - case arrayBufferTag: - if ((object.byteLength != other.byteLength) || - !equalFunc(new Uint8Array(object), new Uint8Array(other))) { - return false; - } - return true; - - case boolTag: - case dateTag: - case numberTag: - // Coerce booleans to `1` or `0` and dates to milliseconds. - // Invalid dates are coerced to `NaN`. - return eq(+object, +other); - - case errorTag: - return object.name == other.name && object.message == other.message; - - case regexpTag: - case stringTag: - // Coerce regexes to strings and treat strings, primitives and objects, - // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring - // for more details. - return object == (other + ''); - - case mapTag: - var convert = mapToArray; - - case setTag: - var isPartial = bitmask & PARTIAL_COMPARE_FLAG; - convert || (convert = setToArray); - - if (object.size != other.size && !isPartial) { - return false; - } - // Assume cyclic values are equal. - var stacked = stack.get(object); - if (stacked) { - return stacked == other; - } - bitmask |= UNORDERED_COMPARE_FLAG; - - // Recursively compare objects (susceptible to call stack limits). - stack.set(object, other); - var result = equalArrays(convert(object), convert(other), equalFunc, customizer, bitmask, stack); - stack['delete'](object); - return result; - - case symbolTag: - if (symbolValueOf) { - return symbolValueOf.call(object) == symbolValueOf.call(other); - } - } - return false; - } - - module.exports = equalByTag; - - -/***/ }, -/* 464 */, -/* 465 */ -/***/ function(module, exports) { - - /** - * Converts `map` to its key-value pairs. - * - * @private - * @param {Object} map The map to convert. - * @returns {Array} Returns the key-value pairs. - */ - function mapToArray(map) { - var index = -1, - result = Array(map.size); - - map.forEach(function(value, key) { - result[++index] = [key, value]; - }); - return result; - } - - module.exports = mapToArray; - - -/***/ }, -/* 466 */ -/***/ function(module, exports) { - - /** - * Converts `set` to an array of its values. - * - * @private - * @param {Object} set The set to convert. - * @returns {Array} Returns the values. - */ - function setToArray(set) { - var index = -1, - result = Array(set.size); - - set.forEach(function(value) { - result[++index] = value; - }); - return result; - } - - module.exports = setToArray; - - -/***/ }, -/* 467 */ -/***/ function(module, exports, __webpack_require__) { - - var keys = __webpack_require__(363); - - /** Used to compose bitmasks for comparison styles. */ - var PARTIAL_COMPARE_FLAG = 2; - - /** Used for built-in method references. */ - var objectProto = Object.prototype; - - /** Used to check objects for own properties. */ - var hasOwnProperty = objectProto.hasOwnProperty; - - /** - * A specialized version of `baseIsEqualDeep` for objects with support for - * partial deep comparisons. - * - * @private - * @param {Object} object The object to compare. - * @param {Object} other The other object to compare. - * @param {Function} equalFunc The function to determine equivalents of values. - * @param {Function} customizer The function to customize comparisons. - * @param {number} bitmask The bitmask of comparison flags. See `baseIsEqual` - * for more details. - * @param {Object} stack Tracks traversed `object` and `other` objects. - * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. - */ - function equalObjects(object, other, equalFunc, customizer, bitmask, stack) { - var isPartial = bitmask & PARTIAL_COMPARE_FLAG, - objProps = keys(object), - objLength = objProps.length, - othProps = keys(other), - othLength = othProps.length; - - if (objLength != othLength && !isPartial) { - return false; - } - var index = objLength; - while (index--) { - var key = objProps[index]; - if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) { - return false; - } - } - // Assume cyclic values are equal. - var stacked = stack.get(object); - if (stacked && stack.get(other)) { - return stacked == other; - } - var result = true; - stack.set(object, other); - stack.set(other, object); - - var skipCtor = isPartial; - while (++index < objLength) { - key = objProps[index]; - var objValue = object[key], - othValue = other[key]; - - if (customizer) { - var compared = isPartial - ? customizer(othValue, objValue, key, other, object, stack) - : customizer(objValue, othValue, key, object, other, stack); - } - // Recursively compare objects (susceptible to call stack limits). - if (!(compared === undefined - ? (objValue === othValue || equalFunc(objValue, othValue, customizer, bitmask, stack)) - : compared - )) { - result = false; - break; - } - skipCtor || (skipCtor = key == 'constructor'); - } - if (result && !skipCtor) { - var objCtor = object.constructor, - othCtor = other.constructor; - - // Non `Object` object instances with different constructors are not equal. - if (objCtor != othCtor && - ('constructor' in object && 'constructor' in other) && - !(typeof objCtor == 'function' && objCtor instanceof objCtor && - typeof othCtor == 'function' && othCtor instanceof othCtor)) { - result = false; - } - } - stack['delete'](object); - stack['delete'](other); - return result; - } - - module.exports = equalObjects; - - -/***/ }, -/* 468 */ -/***/ function(module, exports, __webpack_require__) { - - var isStrictComparable = __webpack_require__(469), - keys = __webpack_require__(363); - - /** - * Gets the property names, values, and compare flags of `object`. - * - * @private - * @param {Object} object The object to query. - * @returns {Array} Returns the match data of `object`. - */ - function getMatchData(object) { - var result = keys(object), - length = result.length; - - while (length--) { - var key = result[length], - value = object[key]; - - result[length] = [key, value, isStrictComparable(value)]; - } - return result; - } - - module.exports = getMatchData; - - -/***/ }, -/* 469 */ -/***/ function(module, exports, __webpack_require__) { - - var isObject = __webpack_require__(345); - - /** - * Checks if `value` is suitable for strict equality comparisons, i.e. `===`. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` if suitable for strict - * equality comparisons, else `false`. - */ - function isStrictComparable(value) { - return value === value && !isObject(value); - } - - module.exports = isStrictComparable; - - -/***/ }, -/* 470 */ -/***/ function(module, exports) { - - /** - * A specialized version of `matchesProperty` for source values suitable - * for strict equality comparisons, i.e. `===`. - * - * @private - * @param {string} key The key of the property to get. - * @param {*} srcValue The value to match. - * @returns {Function} Returns the new spec function. - */ - function matchesStrictComparable(key, srcValue) { - return function(object) { - if (object == null) { - return false; - } - return object[key] === srcValue && - (srcValue !== undefined || (key in Object(object))); - }; - } - - module.exports = matchesStrictComparable; - - -/***/ }, -/* 471 */ -/***/ function(module, exports, __webpack_require__) { - - var baseIsEqual = __webpack_require__(455), - get = __webpack_require__(472), - hasIn = __webpack_require__(480), - isKey = __webpack_require__(478), - isStrictComparable = __webpack_require__(469), - matchesStrictComparable = __webpack_require__(470), - toKey = __webpack_require__(479); - - /** Used to compose bitmasks for comparison styles. */ - var UNORDERED_COMPARE_FLAG = 1, - PARTIAL_COMPARE_FLAG = 2; - - /** - * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`. - * - * @private - * @param {string} path The path of the property to get. - * @param {*} srcValue The value to match. - * @returns {Function} Returns the new spec function. - */ - function baseMatchesProperty(path, srcValue) { - if (isKey(path) && isStrictComparable(srcValue)) { - return matchesStrictComparable(toKey(path), srcValue); - } - return function(object) { - var objValue = get(object, path); - return (objValue === undefined && objValue === srcValue) - ? hasIn(object, path) - : baseIsEqual(srcValue, objValue, undefined, UNORDERED_COMPARE_FLAG | PARTIAL_COMPARE_FLAG); - }; - } - - module.exports = baseMatchesProperty; - - -/***/ }, -/* 472 */ -/***/ function(module, exports, __webpack_require__) { - - var baseGet = __webpack_require__(473); - - /** - * Gets the value at `path` of `object`. If the resolved value is - * `undefined`, the `defaultValue` is returned in its place. - * - * @static - * @memberOf _ - * @since 3.7.0 - * @category Object - * @param {Object} object The object to query. - * @param {Array|string} path The path of the property to get. - * @param {*} [defaultValue] The value returned for `undefined` resolved values. - * @returns {*} Returns the resolved value. - * @example - * - * var object = { 'a': [{ 'b': { 'c': 3 } }] }; - * - * _.get(object, 'a[0].b.c'); - * // => 3 - * - * _.get(object, ['a', '0', 'b', 'c']); - * // => 3 - * - * _.get(object, 'a.b.c', 'default'); - * // => 'default' - */ - function get(object, path, defaultValue) { - var result = object == null ? undefined : baseGet(object, path); - return result === undefined ? defaultValue : result; - } - - module.exports = get; - - -/***/ }, -/* 473 */ -/***/ function(module, exports, __webpack_require__) { - - var castPath = __webpack_require__(474), - isKey = __webpack_require__(478), - toKey = __webpack_require__(479); - - /** - * The base implementation of `_.get` without support for default values. - * - * @private - * @param {Object} object The object to query. - * @param {Array|string} path The path of the property to get. - * @returns {*} Returns the resolved value. - */ - function baseGet(object, path) { - path = isKey(path, object) ? [path] : castPath(path); - - var index = 0, - length = path.length; - - while (object != null && index < length) { - object = object[toKey(path[index++])]; - } - return (index && index == length) ? object : undefined; - } - - module.exports = baseGet; - - -/***/ }, -/* 474 */ -/***/ function(module, exports, __webpack_require__) { - - var isArray = __webpack_require__(355), - stringToPath = __webpack_require__(475); - - /** - * Casts `value` to a path array if it's not one. - * - * @private - * @param {*} value The value to inspect. - * @returns {Array} Returns the cast property path array. - */ - function castPath(value) { - return isArray(value) ? value : stringToPath(value); - } - - module.exports = castPath; - - -/***/ }, -/* 475 */ -/***/ function(module, exports, __webpack_require__) { - - var memoizeCapped = __webpack_require__(476), - toString = __webpack_require__(392); - - /** Used to match property names within property paths. */ - var reLeadingDot = /^\./, - rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g; - - /** Used to match backslashes in property paths. */ - var reEscapeChar = /\\(\\)?/g; - - /** - * Converts `string` to a property path array. - * - * @private - * @param {string} string The string to convert. - * @returns {Array} Returns the property path array. - */ - var stringToPath = memoizeCapped(function(string) { - string = toString(string); - - var result = []; - if (reLeadingDot.test(string)) { - result.push(''); - } - string.replace(rePropName, function(match, number, quote, string) { - result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match)); - }); - return result; - }); - - module.exports = stringToPath; - - -/***/ }, -/* 476 */ -/***/ function(module, exports, __webpack_require__) { - - var memoize = __webpack_require__(477); - - /** Used as the maximum memoize cache size. */ - var MAX_MEMOIZE_SIZE = 500; - - /** - * A specialized version of `_.memoize` which clears the memoized function's - * cache when it exceeds `MAX_MEMOIZE_SIZE`. - * - * @private - * @param {Function} func The function to have its output memoized. - * @returns {Function} Returns the new memoized function. - */ - function memoizeCapped(func) { - var result = memoize(func, function(key) { - if (cache.size === MAX_MEMOIZE_SIZE) { - cache.clear(); - } - return key; - }); - - var cache = result.cache; - return result; - } - - module.exports = memoizeCapped; - - -/***/ }, -/* 477 */ -/***/ function(module, exports, __webpack_require__) { - - var MapCache = __webpack_require__(440); - - /** Error message constants. */ - var FUNC_ERROR_TEXT = 'Expected a function'; - - /** - * Creates a function that memoizes the result of `func`. If `resolver` is - * provided, it determines the cache key for storing the result based on the - * arguments provided to the memoized function. By default, the first argument - * provided to the memoized function is used as the map cache key. The `func` - * is invoked with the `this` binding of the memoized function. - * - * **Note:** The cache is exposed as the `cache` property on the memoized - * function. Its creation may be customized by replacing the `_.memoize.Cache` - * constructor with one whose instances implement the - * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object) - * method interface of `clear`, `delete`, `get`, `has`, and `set`. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Function - * @param {Function} func The function to have its output memoized. - * @param {Function} [resolver] The function to resolve the cache key. - * @returns {Function} Returns the new memoized function. - * @example - * - * var object = { 'a': 1, 'b': 2 }; - * var other = { 'c': 3, 'd': 4 }; - * - * var values = _.memoize(_.values); - * values(object); - * // => [1, 2] - * - * values(other); - * // => [3, 4] - * - * object.a = 2; - * values(object); - * // => [1, 2] - * - * // Modify the result cache. - * values.cache.set(object, ['a', 'b']); - * values(object); - * // => ['a', 'b'] - * - * // Replace `_.memoize.Cache`. - * _.memoize.Cache = WeakMap; - */ - function memoize(func, resolver) { - if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) { - throw new TypeError(FUNC_ERROR_TEXT); - } - var memoized = function() { - var args = arguments, - key = resolver ? resolver.apply(this, args) : args[0], - cache = memoized.cache; - - if (cache.has(key)) { - return cache.get(key); - } - var result = func.apply(this, args); - memoized.cache = cache.set(key, result) || cache; - return result; - }; - memoized.cache = new (memoize.Cache || MapCache); - return memoized; - } - - // Expose `MapCache`. - memoize.Cache = MapCache; - - module.exports = memoize; - - -/***/ }, -/* 478 */ -/***/ function(module, exports, __webpack_require__) { - - var isArray = __webpack_require__(355), - isSymbol = __webpack_require__(359); - - /** Used to match property names within property paths. */ - var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, - reIsPlainProp = /^\w*$/; - - /** - * Checks if `value` is a property name and not a property path. - * - * @private - * @param {*} value The value to check. - * @param {Object} [object] The object to query keys on. - * @returns {boolean} Returns `true` if `value` is a property name, else `false`. - */ - function isKey(value, object) { - if (isArray(value)) { - return false; - } - var type = typeof value; - if (type == 'number' || type == 'symbol' || type == 'boolean' || - value == null || isSymbol(value)) { - return true; - } - return reIsPlainProp.test(value) || !reIsDeepProp.test(value) || - (object != null && value in Object(object)); - } - - module.exports = isKey; - - -/***/ }, -/* 479 */ -/***/ function(module, exports, __webpack_require__) { - - var isSymbol = __webpack_require__(359); - - /** Used as references for various `Number` constants. */ - var INFINITY = 1 / 0; - - /** - * Converts `value` to a string key if it's not a string or symbol. - * - * @private - * @param {*} value The value to inspect. - * @returns {string|symbol} Returns the key. - */ - function toKey(value) { - if (typeof value == 'string' || isSymbol(value)) { - return value; - } - var result = (value + ''); - return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; - } - - module.exports = toKey; - - -/***/ }, -/* 480 */ -/***/ function(module, exports, __webpack_require__) { - - var baseHasIn = __webpack_require__(481), - hasPath = __webpack_require__(482); - - /** - * Checks if `path` is a direct or inherited property of `object`. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Object - * @param {Object} object The object to query. - * @param {Array|string} path The path to check. - * @returns {boolean} Returns `true` if `path` exists, else `false`. - * @example - * - * var object = _.create({ 'a': _.create({ 'b': 2 }) }); - * - * _.hasIn(object, 'a'); - * // => true - * - * _.hasIn(object, 'a.b'); - * // => true - * - * _.hasIn(object, ['a', 'b']); - * // => true - * - * _.hasIn(object, 'b'); - * // => false - */ - function hasIn(object, path) { - return object != null && hasPath(object, path, baseHasIn); - } - - module.exports = hasIn; - - -/***/ }, -/* 481 */ -/***/ function(module, exports) { - - /** - * The base implementation of `_.hasIn` without support for deep paths. - * - * @private - * @param {Object} [object] The object to query. - * @param {Array|string} key The key to check. - * @returns {boolean} Returns `true` if `key` exists, else `false`. - */ - function baseHasIn(object, key) { - return object != null && key in Object(object); - } - - module.exports = baseHasIn; - - -/***/ }, -/* 482 */ -/***/ function(module, exports, __webpack_require__) { - - var castPath = __webpack_require__(474), - isArguments = __webpack_require__(366), - isArray = __webpack_require__(355), - isIndex = __webpack_require__(370), - isKey = __webpack_require__(478), - isLength = __webpack_require__(353), - toKey = __webpack_require__(479); - - /** - * Checks if `path` exists on `object`. - * - * @private - * @param {Object} object The object to query. - * @param {Array|string} path The path to check. - * @param {Function} hasFunc The function to check properties. - * @returns {boolean} Returns `true` if `path` exists, else `false`. - */ - function hasPath(object, path, hasFunc) { - path = isKey(path, object) ? [path] : castPath(path); - - var index = -1, - length = path.length, - result = false; - - while (++index < length) { - var key = toKey(path[index]); - if (!(result = object != null && hasFunc(object, key))) { - break; - } - object = object[key]; - } - if (result || ++index != length) { - return result; - } - length = object == null ? 0 : object.length; - return !!length && isLength(length) && isIndex(key, length) && - (isArray(object) || isArguments(object)); - } - - module.exports = hasPath; - - -/***/ }, -/* 483 */ -/***/ function(module, exports, __webpack_require__) { - - var baseProperty = __webpack_require__(484), - basePropertyDeep = __webpack_require__(485), - isKey = __webpack_require__(478), - toKey = __webpack_require__(479); - - /** - * Creates a function that returns the value at `path` of a given object. - * - * @static - * @memberOf _ - * @since 2.4.0 - * @category Util - * @param {Array|string} path The path of the property to get. - * @returns {Function} Returns the new accessor function. - * @example - * - * var objects = [ - * { 'a': { 'b': 2 } }, - * { 'a': { 'b': 1 } } - * ]; - * - * _.map(objects, _.property('a.b')); - * // => [2, 1] - * - * _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b'); - * // => [1, 2] - */ - function property(path) { - return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path); - } - - module.exports = property; - - -/***/ }, -/* 484 */ -/***/ function(module, exports) { - - /** - * The base implementation of `_.property` without support for deep paths. - * - * @private - * @param {string} key The key of the property to get. - * @returns {Function} Returns the new accessor function. - */ - function baseProperty(key) { - return function(object) { - return object == null ? undefined : object[key]; - }; - } - - module.exports = baseProperty; - - -/***/ }, -/* 485 */ -/***/ function(module, exports, __webpack_require__) { - - var baseGet = __webpack_require__(473); - - /** - * A specialized version of `baseProperty` which supports deep paths. - * - * @private - * @param {Array|string} path The path of the property to get. - * @returns {Function} Returns the new accessor function. - */ - function basePropertyDeep(path) { - return function(object) { - return baseGet(object, path); - }; - } - - module.exports = basePropertyDeep; - - -/***/ }, -/* 486 */ -/***/ function(module, exports) { - - /** - * The base implementation of `_.reduce` and `_.reduceRight`, without support - * for iteratee shorthands, which iterates over `collection` using `eachFunc`. - * - * @private - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @param {*} accumulator The initial value. - * @param {boolean} initAccum Specify using the first or last element of - * `collection` as the initial value. - * @param {Function} eachFunc The function to iterate over `collection`. - * @returns {*} Returns the accumulated value. - */ - function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) { - eachFunc(collection, function(value, index, collection) { - accumulator = initAccum - ? (initAccum = false, value) - : iteratee(accumulator, value, index, collection); - }); - return accumulator; - } - - module.exports = baseReduce; - - -/***/ }, -/* 487 */ -/***/ function(module, exports) { - - "use strict"; - - Object.defineProperty(exports, "__esModule", { - value: true - }); - var initialData = []; - exports.default = initialData; - -/***/ }, -/* 488 */ -/***/ function(module, exports, __webpack_require__) { - - 'use strict'; - - Object.defineProperty(exports, "__esModule", { - value: true - }); - - var _getPrototypeOf = __webpack_require__(489); - - var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf); - - var _classCallCheck2 = __webpack_require__(493); - - var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); - - var _createClass2 = __webpack_require__(494); - - var _createClass3 = _interopRequireDefault(_createClass2); - - var _possibleConstructorReturn2 = __webpack_require__(498); - - var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2); - - var _inherits2 = __webpack_require__(521); - - var _inherits3 = _interopRequireDefault(_inherits2); - - var _react = __webpack_require__(3); - - var _react2 = _interopRequireDefault(_react); - - var _classnames = __webpack_require__(529); - - var _classnames2 = _interopRequireDefault(_classnames); - - var _superagent = __webpack_require__(530); - - var _superagent2 = _interopRequireDefault(_superagent); - - var _Navbar = __webpack_require__(535); - - var _Navbar2 = _interopRequireDefault(_Navbar); - - var _style = __webpack_require__(808); - - var _style2 = _interopRequireDefault(_style); - - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - - var App = function (_Component) { - (0, _inherits3.default)(App, _Component); - - function App(props) { - (0, _classCallCheck3.default)(this, App); - - var _this = (0, _possibleConstructorReturn3.default)(this, (App.__proto__ || (0, _getPrototypeOf2.default)(App)).call(this, props)); - - _this.state = { - stat: {} - }; - return _this; - } - - (0, _createClass3.default)(App, [{ - key: 'componentDidMount', - value: function componentDidMount() { - this.refreshStats(); - } - }, { - key: 'refreshStats', - value: function refreshStats() { - var _this2 = this; - - _superagent2.default.get('/api/serverStat').set('Accept', 'application/json').end(function (err, res) { - console.log(res ? res.body : err); - if (!err) { - _this2.setState({ - stat: res.body - }); - } - }); - } - }, { - key: 'render', - value: function render() { - var _props = this.props, - children = _props.children, - params = _props.params; - var stat = this.state.stat; - // TODO: get user name by params.userId - - return _react2.default.createElement( - 'div', - null, - _react2.default.createElement(_Navbar2.default, { - refreshStats: this.refreshStats.bind(this), - title: params.userId - }), - _react2.default.createElement( - 'div', - { className: (0, _classnames2.default)([_style2.default.mainsection]) }, - _react2.default.cloneElement(children, { refreshStats: this.refreshStats.bind(this), stat: stat }) - ) - ); - } - }]); - return App; - }(_react.Component); - - App.propTypes = { - children: _react.PropTypes.object, - params: _react.PropTypes.object - }; - exports.default = App; - -/***/ }, -/* 489 */ -/***/ function(module, exports, __webpack_require__) { - - module.exports = { "default": __webpack_require__(490), __esModule: true }; - -/***/ }, -/* 490 */ -/***/ function(module, exports, __webpack_require__) { - - __webpack_require__(491); - module.exports = __webpack_require__(285).Object.getPrototypeOf; - -/***/ }, -/* 491 */ -/***/ function(module, exports, __webpack_require__) { - - // 19.1.2.9 Object.getPrototypeOf(O) - var toObject = __webpack_require__(316) - , $getPrototypeOf = __webpack_require__(332); - - __webpack_require__(492)('getPrototypeOf', function(){ - return function getPrototypeOf(it){ - return $getPrototypeOf(toObject(it)); - }; - }); - -/***/ }, -/* 492 */ -/***/ function(module, exports, __webpack_require__) { - - // most Object methods by ES6 should accept primitives - var $export = __webpack_require__(283) - , core = __webpack_require__(285) - , fails = __webpack_require__(294); - module.exports = function(KEY, exec){ - var fn = (core.Object || {})[KEY] || Object[KEY] - , exp = {}; - exp[KEY] = exec(fn); - $export($export.S + $export.F * fails(function(){ fn(1); }), 'Object', exp); - }; - -/***/ }, -/* 493 */ -/***/ function(module, exports) { - - "use strict"; - - exports.__esModule = true; - - exports.default = function (instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError("Cannot call a class as a function"); - } - }; - -/***/ }, -/* 494 */ -/***/ function(module, exports, __webpack_require__) { - - "use strict"; - - exports.__esModule = true; - - var _defineProperty = __webpack_require__(495); - - var _defineProperty2 = _interopRequireDefault(_defineProperty); - - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - - exports.default = function () { - function defineProperties(target, props) { - for (var i = 0; i < props.length; i++) { - var descriptor = props[i]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ("value" in descriptor) descriptor.writable = true; - (0, _defineProperty2.default)(target, descriptor.key, descriptor); - } - } - - return function (Constructor, protoProps, staticProps) { - if (protoProps) defineProperties(Constructor.prototype, protoProps); - if (staticProps) defineProperties(Constructor, staticProps); - return Constructor; - }; - }(); - -/***/ }, -/* 495 */ -/***/ function(module, exports, __webpack_require__) { - - module.exports = { "default": __webpack_require__(496), __esModule: true }; - -/***/ }, -/* 496 */ -/***/ function(module, exports, __webpack_require__) { - - __webpack_require__(497); - var $Object = __webpack_require__(285).Object; - module.exports = function defineProperty(it, key, desc){ - return $Object.defineProperty(it, key, desc); - }; - -/***/ }, -/* 497 */ -/***/ function(module, exports, __webpack_require__) { - - var $export = __webpack_require__(283); - // 19.1.2.4 / 15.2.3.6 Object.defineProperty(O, P, Attributes) - $export($export.S + $export.F * !__webpack_require__(293), 'Object', {defineProperty: __webpack_require__(289).f}); - -/***/ }, -/* 498 */ -/***/ function(module, exports, __webpack_require__) { - - "use strict"; - - exports.__esModule = true; - - var _typeof2 = __webpack_require__(499); - - var _typeof3 = _interopRequireDefault(_typeof2); - - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - - exports.default = function (self, call) { - if (!self) { - throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); - } - - return call && ((typeof call === "undefined" ? "undefined" : (0, _typeof3.default)(call)) === "object" || typeof call === "function") ? call : self; - }; - -/***/ }, -/* 499 */ -/***/ function(module, exports, __webpack_require__) { - - "use strict"; - - exports.__esModule = true; - - var _iterator = __webpack_require__(500); - - var _iterator2 = _interopRequireDefault(_iterator); - - var _symbol = __webpack_require__(507); - - var _symbol2 = _interopRequireDefault(_symbol); - - var _typeof = typeof _symbol2.default === "function" && typeof _iterator2.default === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof _symbol2.default === "function" && obj.constructor === _symbol2.default && obj !== _symbol2.default.prototype ? "symbol" : typeof obj; }; - - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - - exports.default = typeof _symbol2.default === "function" && _typeof(_iterator2.default) === "symbol" ? function (obj) { - return typeof obj === "undefined" ? "undefined" : _typeof(obj); - } : function (obj) { - return obj && typeof _symbol2.default === "function" && obj.constructor === _symbol2.default && obj !== _symbol2.default.prototype ? "symbol" : typeof obj === "undefined" ? "undefined" : _typeof(obj); - }; - -/***/ }, -/* 500 */ -/***/ function(module, exports, __webpack_require__) { - - module.exports = { "default": __webpack_require__(501), __esModule: true }; - -/***/ }, -/* 501 */ -/***/ function(module, exports, __webpack_require__) { - - __webpack_require__(320); - __webpack_require__(502); - module.exports = __webpack_require__(506).f('iterator'); - -/***/ }, -/* 502 */ -/***/ function(module, exports, __webpack_require__) { - - __webpack_require__(503); - var global = __webpack_require__(284) - , hide = __webpack_require__(288) - , Iterators = __webpack_require__(325) - , TO_STRING_TAG = __webpack_require__(331)('toStringTag'); - - for(var collections = ['NodeList', 'DOMTokenList', 'MediaList', 'StyleSheetList', 'CSSRuleList'], i = 0; i < 5; i++){ - var NAME = collections[i] - , Collection = global[NAME] - , proto = Collection && Collection.prototype; - if(proto && !proto[TO_STRING_TAG])hide(proto, TO_STRING_TAG, NAME); - Iterators[NAME] = Iterators.Array; - } - -/***/ }, -/* 503 */ -/***/ function(module, exports, __webpack_require__) { - - 'use strict'; - var addToUnscopables = __webpack_require__(504) - , step = __webpack_require__(505) - , Iterators = __webpack_require__(325) - , toIObject = __webpack_require__(302); - - // 22.1.3.4 Array.prototype.entries() - // 22.1.3.13 Array.prototype.keys() - // 22.1.3.29 Array.prototype.values() - // 22.1.3.30 Array.prototype[@@iterator]() - module.exports = __webpack_require__(322)(Array, 'Array', function(iterated, kind){ - this._t = toIObject(iterated); // target - this._i = 0; // next index - this._k = kind; // kind - // 22.1.5.2.1 %ArrayIteratorPrototype%.next() - }, function(){ - var O = this._t - , kind = this._k - , index = this._i++; - if(!O || index >= O.length){ - this._t = undefined; - return step(1); - } - if(kind == 'keys' )return step(0, index); - if(kind == 'values')return step(0, O[index]); - return step(0, [index, O[index]]); - }, 'values'); - - // argumentsList[@@iterator] is %ArrayProto_values% (9.4.4.6, 9.4.4.7) - Iterators.Arguments = Iterators.Array; - - addToUnscopables('keys'); - addToUnscopables('values'); - addToUnscopables('entries'); - -/***/ }, -/* 504 */ -/***/ function(module, exports) { - - module.exports = function(){ /* empty */ }; - -/***/ }, -/* 505 */ -/***/ function(module, exports) { - - module.exports = function(done, value){ - return {value: value, done: !!done}; - }; - -/***/ }, -/* 506 */ -/***/ function(module, exports, __webpack_require__) { - - exports.f = __webpack_require__(331); - -/***/ }, -/* 507 */ -/***/ function(module, exports, __webpack_require__) { - - module.exports = { "default": __webpack_require__(508), __esModule: true }; - -/***/ }, -/* 508 */ -/***/ function(module, exports, __webpack_require__) { - - __webpack_require__(509); - __webpack_require__(518); - __webpack_require__(519); - __webpack_require__(520); - module.exports = __webpack_require__(285).Symbol; - -/***/ }, -/* 509 */ -/***/ function(module, exports, __webpack_require__) { - - 'use strict'; - // ECMAScript 6 symbols shim - var global = __webpack_require__(284) - , has = __webpack_require__(301) - , DESCRIPTORS = __webpack_require__(293) - , $export = __webpack_require__(283) - , redefine = __webpack_require__(324) - , META = __webpack_require__(510).KEY - , $fails = __webpack_require__(294) - , shared = __webpack_require__(311) - , setToStringTag = __webpack_require__(330) - , uid = __webpack_require__(312) - , wks = __webpack_require__(331) - , wksExt = __webpack_require__(506) - , wksDefine = __webpack_require__(511) - , keyOf = __webpack_require__(512) - , enumKeys = __webpack_require__(513) - , isArray = __webpack_require__(514) - , anObject = __webpack_require__(290) - , toIObject = __webpack_require__(302) - , toPrimitive = __webpack_require__(296) - , createDesc = __webpack_require__(297) - , _create = __webpack_require__(327) - , gOPNExt = __webpack_require__(515) - , $GOPD = __webpack_require__(517) - , $DP = __webpack_require__(289) - , $keys = __webpack_require__(299) - , gOPD = $GOPD.f - , dP = $DP.f - , gOPN = gOPNExt.f - , $Symbol = global.Symbol - , $JSON = global.JSON - , _stringify = $JSON && $JSON.stringify - , PROTOTYPE = 'prototype' - , HIDDEN = wks('_hidden') - , TO_PRIMITIVE = wks('toPrimitive') - , isEnum = {}.propertyIsEnumerable - , SymbolRegistry = shared('symbol-registry') - , AllSymbols = shared('symbols') - , OPSymbols = shared('op-symbols') - , ObjectProto = Object[PROTOTYPE] - , USE_NATIVE = typeof $Symbol == 'function' - , QObject = global.QObject; - // Don't use setters in Qt Script, https://github.com/zloirock/core-js/issues/173 - var setter = !QObject || !QObject[PROTOTYPE] || !QObject[PROTOTYPE].findChild; - - // fallback for old Android, https://code.google.com/p/v8/issues/detail?id=687 - var setSymbolDesc = DESCRIPTORS && $fails(function(){ - return _create(dP({}, 'a', { - get: function(){ return dP(this, 'a', {value: 7}).a; } - })).a != 7; - }) ? function(it, key, D){ - var protoDesc = gOPD(ObjectProto, key); - if(protoDesc)delete ObjectProto[key]; - dP(it, key, D); - if(protoDesc && it !== ObjectProto)dP(ObjectProto, key, protoDesc); - } : dP; - - var wrap = function(tag){ - var sym = AllSymbols[tag] = _create($Symbol[PROTOTYPE]); - sym._k = tag; - return sym; - }; - - var isSymbol = USE_NATIVE && typeof $Symbol.iterator == 'symbol' ? function(it){ - return typeof it == 'symbol'; - } : function(it){ - return it instanceof $Symbol; - }; - - var $defineProperty = function defineProperty(it, key, D){ - if(it === ObjectProto)$defineProperty(OPSymbols, key, D); - anObject(it); - key = toPrimitive(key, true); - anObject(D); - if(has(AllSymbols, key)){ - if(!D.enumerable){ - if(!has(it, HIDDEN))dP(it, HIDDEN, createDesc(1, {})); - it[HIDDEN][key] = true; - } else { - if(has(it, HIDDEN) && it[HIDDEN][key])it[HIDDEN][key] = false; - D = _create(D, {enumerable: createDesc(0, false)}); - } return setSymbolDesc(it, key, D); - } return dP(it, key, D); - }; - var $defineProperties = function defineProperties(it, P){ - anObject(it); - var keys = enumKeys(P = toIObject(P)) - , i = 0 - , l = keys.length - , key; - while(l > i)$defineProperty(it, key = keys[i++], P[key]); - return it; - }; - var $create = function create(it, P){ - return P === undefined ? _create(it) : $defineProperties(_create(it), P); - }; - var $propertyIsEnumerable = function propertyIsEnumerable(key){ - var E = isEnum.call(this, key = toPrimitive(key, true)); - if(this === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key))return false; - return E || !has(this, key) || !has(AllSymbols, key) || has(this, HIDDEN) && this[HIDDEN][key] ? E : true; - }; - var $getOwnPropertyDescriptor = function getOwnPropertyDescriptor(it, key){ - it = toIObject(it); - key = toPrimitive(key, true); - if(it === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key))return; - var D = gOPD(it, key); - if(D && has(AllSymbols, key) && !(has(it, HIDDEN) && it[HIDDEN][key]))D.enumerable = true; - return D; - }; - var $getOwnPropertyNames = function getOwnPropertyNames(it){ - var names = gOPN(toIObject(it)) - , result = [] - , i = 0 - , key; - while(names.length > i){ - if(!has(AllSymbols, key = names[i++]) && key != HIDDEN && key != META)result.push(key); - } return result; - }; - var $getOwnPropertySymbols = function getOwnPropertySymbols(it){ - var IS_OP = it === ObjectProto - , names = gOPN(IS_OP ? OPSymbols : toIObject(it)) - , result = [] - , i = 0 - , key; - while(names.length > i){ - if(has(AllSymbols, key = names[i++]) && (IS_OP ? has(ObjectProto, key) : true))result.push(AllSymbols[key]); - } return result; - }; - - // 19.4.1.1 Symbol([description]) - if(!USE_NATIVE){ - $Symbol = function Symbol(){ - if(this instanceof $Symbol)throw TypeError('Symbol is not a constructor!'); - var tag = uid(arguments.length > 0 ? arguments[0] : undefined); - var $set = function(value){ - if(this === ObjectProto)$set.call(OPSymbols, value); - if(has(this, HIDDEN) && has(this[HIDDEN], tag))this[HIDDEN][tag] = false; - setSymbolDesc(this, tag, createDesc(1, value)); - }; - if(DESCRIPTORS && setter)setSymbolDesc(ObjectProto, tag, {configurable: true, set: $set}); - return wrap(tag); - }; - redefine($Symbol[PROTOTYPE], 'toString', function toString(){ - return this._k; - }); - - $GOPD.f = $getOwnPropertyDescriptor; - $DP.f = $defineProperty; - __webpack_require__(516).f = gOPNExt.f = $getOwnPropertyNames; - __webpack_require__(315).f = $propertyIsEnumerable; - __webpack_require__(314).f = $getOwnPropertySymbols; - - if(DESCRIPTORS && !__webpack_require__(323)){ - redefine(ObjectProto, 'propertyIsEnumerable', $propertyIsEnumerable, true); - } - - wksExt.f = function(name){ - return wrap(wks(name)); - } - } - - $export($export.G + $export.W + $export.F * !USE_NATIVE, {Symbol: $Symbol}); - - for(var symbols = ( - // 19.4.2.2, 19.4.2.3, 19.4.2.4, 19.4.2.6, 19.4.2.8, 19.4.2.9, 19.4.2.10, 19.4.2.11, 19.4.2.12, 19.4.2.13, 19.4.2.14 - 'hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables' - ).split(','), i = 0; symbols.length > i; )wks(symbols[i++]); - - for(var symbols = $keys(wks.store), i = 0; symbols.length > i; )wksDefine(symbols[i++]); - - $export($export.S + $export.F * !USE_NATIVE, 'Symbol', { - // 19.4.2.1 Symbol.for(key) - 'for': function(key){ - return has(SymbolRegistry, key += '') - ? SymbolRegistry[key] - : SymbolRegistry[key] = $Symbol(key); - }, - // 19.4.2.5 Symbol.keyFor(sym) - keyFor: function keyFor(key){ - if(isSymbol(key))return keyOf(SymbolRegistry, key); - throw TypeError(key + ' is not a symbol!'); - }, - useSetter: function(){ setter = true; }, - useSimple: function(){ setter = false; } - }); - - $export($export.S + $export.F * !USE_NATIVE, 'Object', { - // 19.1.2.2 Object.create(O [, Properties]) - create: $create, - // 19.1.2.4 Object.defineProperty(O, P, Attributes) - defineProperty: $defineProperty, - // 19.1.2.3 Object.defineProperties(O, Properties) - defineProperties: $defineProperties, - // 19.1.2.6 Object.getOwnPropertyDescriptor(O, P) - getOwnPropertyDescriptor: $getOwnPropertyDescriptor, - // 19.1.2.7 Object.getOwnPropertyNames(O) - getOwnPropertyNames: $getOwnPropertyNames, - // 19.1.2.8 Object.getOwnPropertySymbols(O) - getOwnPropertySymbols: $getOwnPropertySymbols - }); - - // 24.3.2 JSON.stringify(value [, replacer [, space]]) - $JSON && $export($export.S + $export.F * (!USE_NATIVE || $fails(function(){ - var S = $Symbol(); - // MS Edge converts symbol values to JSON as {} - // WebKit converts symbol values to JSON as null - // V8 throws on boxed symbols - return _stringify([S]) != '[null]' || _stringify({a: S}) != '{}' || _stringify(Object(S)) != '{}'; - })), 'JSON', { - stringify: function stringify(it){ - if(it === undefined || isSymbol(it))return; // IE8 returns string on undefined - var args = [it] - , i = 1 - , replacer, $replacer; - while(arguments.length > i)args.push(arguments[i++]); - replacer = args[1]; - if(typeof replacer == 'function')$replacer = replacer; - if($replacer || !isArray(replacer))replacer = function(key, value){ - if($replacer)value = $replacer.call(this, key, value); - if(!isSymbol(value))return value; - }; - args[1] = replacer; - return _stringify.apply($JSON, args); - } - }); - - // 19.4.3.4 Symbol.prototype[@@toPrimitive](hint) - $Symbol[PROTOTYPE][TO_PRIMITIVE] || __webpack_require__(288)($Symbol[PROTOTYPE], TO_PRIMITIVE, $Symbol[PROTOTYPE].valueOf); - // 19.4.3.5 Symbol.prototype[@@toStringTag] - setToStringTag($Symbol, 'Symbol'); - // 20.2.1.9 Math[@@toStringTag] - setToStringTag(Math, 'Math', true); - // 24.3.3 JSON[@@toStringTag] - setToStringTag(global.JSON, 'JSON', true); - -/***/ }, -/* 510 */ -/***/ function(module, exports, __webpack_require__) { - - var META = __webpack_require__(312)('meta') - , isObject = __webpack_require__(291) - , has = __webpack_require__(301) - , setDesc = __webpack_require__(289).f - , id = 0; - var isExtensible = Object.isExtensible || function(){ - return true; - }; - var FREEZE = !__webpack_require__(294)(function(){ - return isExtensible(Object.preventExtensions({})); - }); - var setMeta = function(it){ - setDesc(it, META, {value: { - i: 'O' + ++id, // object ID - w: {} // weak collections IDs - }}); - }; - var fastKey = function(it, create){ - // return primitive with prefix - if(!isObject(it))return typeof it == 'symbol' ? it : (typeof it == 'string' ? 'S' : 'P') + it; - if(!has(it, META)){ - // can't set metadata to uncaught frozen object - if(!isExtensible(it))return 'F'; - // not necessary to add metadata - if(!create)return 'E'; - // add missing metadata - setMeta(it); - // return object ID - } return it[META].i; - }; - var getWeak = function(it, create){ - if(!has(it, META)){ - // can't set metadata to uncaught frozen object - if(!isExtensible(it))return true; - // not necessary to add metadata - if(!create)return false; - // add missing metadata - setMeta(it); - // return hash weak collections IDs - } return it[META].w; - }; - // add metadata on freeze-family methods calling - var onFreeze = function(it){ - if(FREEZE && meta.NEED && isExtensible(it) && !has(it, META))setMeta(it); - return it; - }; - var meta = module.exports = { - KEY: META, - NEED: false, - fastKey: fastKey, - getWeak: getWeak, - onFreeze: onFreeze - }; - -/***/ }, -/* 511 */ -/***/ function(module, exports, __webpack_require__) { - - var global = __webpack_require__(284) - , core = __webpack_require__(285) - , LIBRARY = __webpack_require__(323) - , wksExt = __webpack_require__(506) - , defineProperty = __webpack_require__(289).f; - module.exports = function(name){ - var $Symbol = core.Symbol || (core.Symbol = LIBRARY ? {} : global.Symbol || {}); - if(name.charAt(0) != '_' && !(name in $Symbol))defineProperty($Symbol, name, {value: wksExt.f(name)}); - }; - -/***/ }, -/* 512 */ -/***/ function(module, exports, __webpack_require__) { - - var getKeys = __webpack_require__(299) - , toIObject = __webpack_require__(302); - module.exports = function(object, el){ - var O = toIObject(object) - , keys = getKeys(O) - , length = keys.length - , index = 0 - , key; - while(length > index)if(O[key = keys[index++]] === el)return key; - }; - -/***/ }, -/* 513 */ -/***/ function(module, exports, __webpack_require__) { - - // all enumerable object keys, includes symbols - var getKeys = __webpack_require__(299) - , gOPS = __webpack_require__(314) - , pIE = __webpack_require__(315); - module.exports = function(it){ - var result = getKeys(it) - , getSymbols = gOPS.f; - if(getSymbols){ - var symbols = getSymbols(it) - , isEnum = pIE.f - , i = 0 - , key; - while(symbols.length > i)if(isEnum.call(it, key = symbols[i++]))result.push(key); - } return result; - }; - -/***/ }, -/* 514 */ -/***/ function(module, exports, __webpack_require__) { - - // 7.2.2 IsArray(argument) - var cof = __webpack_require__(304); - module.exports = Array.isArray || function isArray(arg){ - return cof(arg) == 'Array'; - }; - -/***/ }, -/* 515 */ -/***/ function(module, exports, __webpack_require__) { - - // fallback for IE11 buggy Object.getOwnPropertyNames with iframe and window - var toIObject = __webpack_require__(302) - , gOPN = __webpack_require__(516).f - , toString = {}.toString; - - var windowNames = typeof window == 'object' && window && Object.getOwnPropertyNames - ? Object.getOwnPropertyNames(window) : []; - - var getWindowNames = function(it){ - try { - return gOPN(it); - } catch(e){ - return windowNames.slice(); - } - }; - - module.exports.f = function getOwnPropertyNames(it){ - return windowNames && toString.call(it) == '[object Window]' ? getWindowNames(it) : gOPN(toIObject(it)); - }; - - -/***/ }, -/* 516 */ -/***/ function(module, exports, __webpack_require__) { - - // 19.1.2.7 / 15.2.3.4 Object.getOwnPropertyNames(O) - var $keys = __webpack_require__(300) - , hiddenKeys = __webpack_require__(313).concat('length', 'prototype'); - - exports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O){ - return $keys(O, hiddenKeys); - }; - -/***/ }, -/* 517 */ -/***/ function(module, exports, __webpack_require__) { - - var pIE = __webpack_require__(315) - , createDesc = __webpack_require__(297) - , toIObject = __webpack_require__(302) - , toPrimitive = __webpack_require__(296) - , has = __webpack_require__(301) - , IE8_DOM_DEFINE = __webpack_require__(292) - , gOPD = Object.getOwnPropertyDescriptor; - - exports.f = __webpack_require__(293) ? gOPD : function getOwnPropertyDescriptor(O, P){ - O = toIObject(O); - P = toPrimitive(P, true); - if(IE8_DOM_DEFINE)try { - return gOPD(O, P); - } catch(e){ /* empty */ } - if(has(O, P))return createDesc(!pIE.f.call(O, P), O[P]); - }; - -/***/ }, -/* 518 */ -/***/ function(module, exports) { - - - -/***/ }, -/* 519 */ -/***/ function(module, exports, __webpack_require__) { - - __webpack_require__(511)('asyncIterator'); - -/***/ }, -/* 520 */ -/***/ function(module, exports, __webpack_require__) { - - __webpack_require__(511)('observable'); - -/***/ }, -/* 521 */ -/***/ function(module, exports, __webpack_require__) { - - "use strict"; - - exports.__esModule = true; - - var _setPrototypeOf = __webpack_require__(522); - - var _setPrototypeOf2 = _interopRequireDefault(_setPrototypeOf); - - var _create = __webpack_require__(526); - - var _create2 = _interopRequireDefault(_create); - - var _typeof2 = __webpack_require__(499); - - var _typeof3 = _interopRequireDefault(_typeof2); - - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - - exports.default = function (subClass, superClass) { - if (typeof superClass !== "function" && superClass !== null) { - throw new TypeError("Super expression must either be null or a function, not " + (typeof superClass === "undefined" ? "undefined" : (0, _typeof3.default)(superClass))); - } - - subClass.prototype = (0, _create2.default)(superClass && superClass.prototype, { - constructor: { - value: subClass, - enumerable: false, - writable: true, - configurable: true - } - }); - if (superClass) _setPrototypeOf2.default ? (0, _setPrototypeOf2.default)(subClass, superClass) : subClass.__proto__ = superClass; - }; - -/***/ }, -/* 522 */ -/***/ function(module, exports, __webpack_require__) { - - module.exports = { "default": __webpack_require__(523), __esModule: true }; - -/***/ }, -/* 523 */ -/***/ function(module, exports, __webpack_require__) { - - __webpack_require__(524); - module.exports = __webpack_require__(285).Object.setPrototypeOf; - -/***/ }, -/* 524 */ -/***/ function(module, exports, __webpack_require__) { - - // 19.1.3.19 Object.setPrototypeOf(O, proto) - var $export = __webpack_require__(283); - $export($export.S, 'Object', {setPrototypeOf: __webpack_require__(525).set}); - -/***/ }, -/* 525 */ -/***/ function(module, exports, __webpack_require__) { - - // Works with __proto__ only. Old v8 can't work with null proto objects. - /* eslint-disable no-proto */ - var isObject = __webpack_require__(291) - , anObject = __webpack_require__(290); - var check = function(O, proto){ - anObject(O); - if(!isObject(proto) && proto !== null)throw TypeError(proto + ": can't set as prototype!"); - }; - module.exports = { - set: Object.setPrototypeOf || ('__proto__' in {} ? // eslint-disable-line - function(test, buggy, set){ - try { - set = __webpack_require__(286)(Function.call, __webpack_require__(517).f(Object.prototype, '__proto__').set, 2); - set(test, []); - buggy = !(test instanceof Array); - } catch(e){ buggy = true; } - return function setPrototypeOf(O, proto){ - check(O, proto); - if(buggy)O.__proto__ = proto; - else set(O, proto); - return O; - }; - }({}, false) : undefined), - check: check - }; - -/***/ }, -/* 526 */ -/***/ function(module, exports, __webpack_require__) { - - module.exports = { "default": __webpack_require__(527), __esModule: true }; - -/***/ }, -/* 527 */ -/***/ function(module, exports, __webpack_require__) { - - __webpack_require__(528); - var $Object = __webpack_require__(285).Object; - module.exports = function create(P, D){ - return $Object.create(P, D); - }; - -/***/ }, -/* 528 */ -/***/ function(module, exports, __webpack_require__) { - - var $export = __webpack_require__(283) - // 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties]) - $export($export.S, 'Object', {create: __webpack_require__(327)}); - -/***/ }, -/* 529 */, -/* 530 */, -/* 531 */, -/* 532 */, -/* 533 */, -/* 534 */, -/* 535 */ -/***/ function(module, exports, __webpack_require__) { - - 'use strict'; - - Object.defineProperty(exports, "__esModule", { - value: true - }); - - var _getPrototypeOf = __webpack_require__(489); - - var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf); - - var _classCallCheck2 = __webpack_require__(493); - - var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); - - var _createClass2 = __webpack_require__(494); - - var _createClass3 = _interopRequireDefault(_createClass2); - - var _possibleConstructorReturn2 = __webpack_require__(498); - - var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2); - - var _inherits2 = __webpack_require__(521); - - var _inherits3 = _interopRequireDefault(_inherits2); - - var _react = __webpack_require__(3); - - var _react2 = _interopRequireDefault(_react); - - var _materialUi = __webpack_require__(536); - - var _styles = __webpack_require__(804); - - var _refresh = __webpack_require__(807); - - var _refresh2 = _interopRequireDefault(_refresh); - - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - - var muiTheme = (0, _styles.getMuiTheme)({ - palette: { - primary1Color: _styles.colors.amberA200, - canvasColor: _styles.colors.darkBlack, - textColor: _styles.colors.white, - alternateTextColor: _styles.colors.fullBlack - } - }); - - var Navbar = function (_Component) { - (0, _inherits3.default)(Navbar, _Component); - - function Navbar() { - (0, _classCallCheck3.default)(this, Navbar); - return (0, _possibleConstructorReturn3.default)(this, (Navbar.__proto__ || (0, _getPrototypeOf2.default)(Navbar)).apply(this, arguments)); - } - - (0, _createClass3.default)(Navbar, [{ - key: 'render', - value: function render() { - var _props = this.props, - title = _props.title, - refreshStats = _props.refreshStats; - - return _react2.default.createElement( - _styles.MuiThemeProvider, - { muiTheme: muiTheme }, - _react2.default.createElement(_materialUi.AppBar, { - iconElementRight: _react2.default.createElement( - _materialUi.IconButton, - { - onTouchTap: refreshStats, - tooltip: 'Refresh' - }, - _react2.default.createElement(_refresh2.default, null) - ), - title: title - }) - ); - } - }]); - return Navbar; - }(_react.Component); - - Navbar.propTypes = { - refreshStats: _react.PropTypes.func, - title: _react.PropTypes.string - }; - Navbar.defaultProps = { - title: 'Sisense Process Activity Monitor' - }; - exports.default = Navbar; - -/***/ }, -/* 536 */, -/* 537 */, -/* 538 */, -/* 539 */, -/* 540 */, -/* 541 */, -/* 542 */, -/* 543 */, -/* 544 */, -/* 545 */, -/* 546 */, -/* 547 */, -/* 548 */, -/* 549 */, -/* 550 */, -/* 551 */, -/* 552 */, -/* 553 */, -/* 554 */, -/* 555 */, -/* 556 */, -/* 557 */, -/* 558 */, -/* 559 */, -/* 560 */, -/* 561 */, -/* 562 */, -/* 563 */, -/* 564 */, -/* 565 */, -/* 566 */, -/* 567 */, -/* 568 */, -/* 569 */, -/* 570 */, -/* 571 */, -/* 572 */, -/* 573 */, -/* 574 */, -/* 575 */, -/* 576 */, -/* 577 */, -/* 578 */, -/* 579 */, -/* 580 */, -/* 581 */, -/* 582 */, -/* 583 */, -/* 584 */, -/* 585 */, -/* 586 */, -/* 587 */, -/* 588 */, -/* 589 */, -/* 590 */, -/* 591 */, -/* 592 */, -/* 593 */, -/* 594 */, -/* 595 */, -/* 596 */, -/* 597 */, -/* 598 */, -/* 599 */, -/* 600 */, -/* 601 */, -/* 602 */, -/* 603 */, -/* 604 */, -/* 605 */, -/* 606 */, -/* 607 */, -/* 608 */, -/* 609 */, -/* 610 */, -/* 611 */, -/* 612 */, -/* 613 */, -/* 614 */, -/* 615 */, -/* 616 */, -/* 617 */, -/* 618 */, -/* 619 */, -/* 620 */, -/* 621 */, -/* 622 */, -/* 623 */, -/* 624 */, -/* 625 */, -/* 626 */, -/* 627 */, -/* 628 */, -/* 629 */, -/* 630 */, -/* 631 */, -/* 632 */, -/* 633 */, -/* 634 */, -/* 635 */, -/* 636 */, -/* 637 */, -/* 638 */, -/* 639 */, -/* 640 */, -/* 641 */, -/* 642 */, -/* 643 */, -/* 644 */, -/* 645 */, -/* 646 */, -/* 647 */, -/* 648 */, -/* 649 */, -/* 650 */, -/* 651 */, -/* 652 */, -/* 653 */, -/* 654 */, -/* 655 */, -/* 656 */, -/* 657 */, -/* 658 */, -/* 659 */, -/* 660 */, -/* 661 */, -/* 662 */, -/* 663 */, -/* 664 */, -/* 665 */, -/* 666 */, -/* 667 */, -/* 668 */, -/* 669 */, -/* 670 */, -/* 671 */, -/* 672 */, -/* 673 */, -/* 674 */, -/* 675 */, -/* 676 */, -/* 677 */, -/* 678 */, -/* 679 */, -/* 680 */, -/* 681 */, -/* 682 */, -/* 683 */, -/* 684 */, -/* 685 */, -/* 686 */, -/* 687 */, -/* 688 */, -/* 689 */, -/* 690 */, -/* 691 */, -/* 692 */, -/* 693 */, -/* 694 */, -/* 695 */, -/* 696 */, -/* 697 */, -/* 698 */, -/* 699 */, -/* 700 */, -/* 701 */, -/* 702 */, -/* 703 */, -/* 704 */, -/* 705 */, -/* 706 */, -/* 707 */, -/* 708 */, -/* 709 */, -/* 710 */, -/* 711 */, -/* 712 */, -/* 713 */, -/* 714 */, -/* 715 */, -/* 716 */, -/* 717 */, -/* 718 */, -/* 719 */, -/* 720 */, -/* 721 */, -/* 722 */, -/* 723 */, -/* 724 */, -/* 725 */, -/* 726 */, -/* 727 */, -/* 728 */, -/* 729 */, -/* 730 */, -/* 731 */, -/* 732 */, -/* 733 */, -/* 734 */, -/* 735 */, -/* 736 */, -/* 737 */, -/* 738 */, -/* 739 */, -/* 740 */, -/* 741 */, -/* 742 */, -/* 743 */, -/* 744 */, -/* 745 */, -/* 746 */, -/* 747 */, -/* 748 */, -/* 749 */, -/* 750 */, -/* 751 */, -/* 752 */, -/* 753 */, -/* 754 */, -/* 755 */, -/* 756 */, -/* 757 */, -/* 758 */, -/* 759 */, -/* 760 */, -/* 761 */, -/* 762 */, -/* 763 */, -/* 764 */, -/* 765 */, -/* 766 */, -/* 767 */, -/* 768 */, -/* 769 */, -/* 770 */, -/* 771 */, -/* 772 */, -/* 773 */, -/* 774 */, -/* 775 */, -/* 776 */, -/* 777 */, -/* 778 */, -/* 779 */, -/* 780 */, -/* 781 */, -/* 782 */, -/* 783 */, -/* 784 */, -/* 785 */, -/* 786 */, -/* 787 */, -/* 788 */, -/* 789 */, -/* 790 */, -/* 791 */, -/* 792 */, -/* 793 */, -/* 794 */, -/* 795 */, -/* 796 */, -/* 797 */, -/* 798 */, -/* 799 */, -/* 800 */, -/* 801 */, -/* 802 */, -/* 803 */, -/* 804 */ -/***/ function(module, exports, __webpack_require__) { - - 'use strict'; - - Object.defineProperty(exports, "__esModule", { - value: true - }); - exports.zIndex = exports.typography = exports.transitions = exports.themeManager = exports.spacing = exports.getMuiTheme = exports.LightRawTheme = exports.lightBaseTheme = exports.DarkRawTheme = exports.darkBaseTheme = exports.colors = exports.MuiThemeProvider = undefined; - - var _MuiThemeProvider2 = __webpack_require__(677); - - var _MuiThemeProvider3 = _interopRequireDefault(_MuiThemeProvider2); - - var _colors2 = __webpack_require__(708); - - var _colors = _interopRequireWildcard(_colors2); - - var _darkBaseTheme2 = __webpack_require__(805); - - var _darkBaseTheme3 = _interopRequireDefault(_darkBaseTheme2); - - var _lightBaseTheme2 = __webpack_require__(707); - - var _lightBaseTheme3 = _interopRequireDefault(_lightBaseTheme2); - - var _getMuiTheme2 = __webpack_require__(678); - - var _getMuiTheme3 = _interopRequireDefault(_getMuiTheme2); - - var _spacing2 = __webpack_require__(709); - - var _spacing3 = _interopRequireDefault(_spacing2); - - var _themeManager2 = __webpack_require__(806); - - var _themeManager3 = _interopRequireDefault(_themeManager2); - - var _transitions2 = __webpack_require__(542); - - var _transitions3 = _interopRequireDefault(_transitions2); - - var _typography2 = __webpack_require__(746); - - var _typography3 = _interopRequireDefault(_typography2); - - var _zIndex2 = __webpack_require__(710); - - var _zIndex3 = _interopRequireDefault(_zIndex2); - - function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } - - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - - exports.MuiThemeProvider = _MuiThemeProvider3.default; - exports.colors = _colors; - exports.darkBaseTheme = _darkBaseTheme3.default; - exports.DarkRawTheme = _darkBaseTheme3.default; - exports.lightBaseTheme = _lightBaseTheme3.default; - exports.LightRawTheme = _lightBaseTheme3.default; - exports.getMuiTheme = _getMuiTheme3.default; - exports.spacing = _spacing3.default; - exports.themeManager = _themeManager3.default; - exports.transitions = _transitions3.default; - exports.typography = _typography3.default; - exports.zIndex = _zIndex3.default; - -/***/ }, -/* 805 */ -/***/ function(module, exports, __webpack_require__) { - - 'use strict'; - - Object.defineProperty(exports, "__esModule", { - value: true - }); - - var _colors = __webpack_require__(708); - - var _colorManipulator = __webpack_require__(583); - - var _spacing = __webpack_require__(709); - - var _spacing2 = _interopRequireDefault(_spacing); - - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - - exports.default = { - spacing: _spacing2.default, - fontFamily: 'Roboto, sans-serif', - palette: { - primary1Color: _colors.cyan700, - primary2Color: _colors.cyan700, - primary3Color: _colors.grey600, - accent1Color: _colors.pinkA200, - accent2Color: _colors.pinkA400, - accent3Color: _colors.pinkA100, - textColor: _colors.fullWhite, - secondaryTextColor: (0, _colorManipulator.fade)(_colors.fullWhite, 0.7), - alternateTextColor: '#303030', - canvasColor: '#303030', - borderColor: (0, _colorManipulator.fade)(_colors.fullWhite, 0.3), - disabledColor: (0, _colorManipulator.fade)(_colors.fullWhite, 0.3), - pickerHeaderColor: (0, _colorManipulator.fade)(_colors.fullWhite, 0.12), - clockCircleColor: (0, _colorManipulator.fade)(_colors.fullWhite, 0.12) - } - }; - -/***/ }, -/* 806 */ -/***/ function(module, exports, __webpack_require__) { - - 'use strict'; - - Object.defineProperty(exports, "__esModule", { - value: true - }); - - var _merge = __webpack_require__(679); - - var _merge2 = _interopRequireDefault(_merge); - - var _getMuiTheme2 = __webpack_require__(678); - - var _getMuiTheme3 = _interopRequireDefault(_getMuiTheme2); - - var _warning = __webpack_require__(39); - - var _warning2 = _interopRequireDefault(_warning); - - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - - exports.default = { - getMuiTheme: function getMuiTheme(baseTheme, muiTheme) { - true ? (0, _warning2.default)(false, 'ThemeManager is deprecated. please import getMuiTheme\n directly from "material-ui/styles/getMuiTheme".\n It will be removed with v0.16.0.') : void 0; - return (0, _getMuiTheme3.default)(baseTheme, muiTheme); - }, - modifyRawThemeSpacing: function modifyRawThemeSpacing(muiTheme, spacing) { - true ? (0, _warning2.default)(false, 'modifyRawThemeSpacing is deprecated. please use getMuiTheme\n to modify your theme directly. http://www.material-ui.com/#/customization/themes.\n It will be removed with v0.16.0.') : void 0; - return (0, _getMuiTheme3.default)((0, _merge2.default)({}, muiTheme.baseTheme, { spacing: spacing })); - }, - modifyRawThemePalette: function modifyRawThemePalette(muiTheme, palette) { - true ? (0, _warning2.default)(false, 'modifyRawThemePalette is deprecated. please use getMuiTheme\n to modify your theme directly. http://www.material-ui.com/#/customization/themes.\n It will be removed with v0.16.0.') : void 0; - return (0, _getMuiTheme3.default)((0, _merge2.default)({}, muiTheme.baseTheme, { baseTheme: { palette: palette } })); - }, - modifyRawThemeFontFamily: function modifyRawThemeFontFamily(muiTheme, fontFamily) { - true ? (0, _warning2.default)(false, 'modifyRawThemeFontFamily is deprecated. please use getMuiTheme\n to modify your theme directly. http://www.material-ui.com/#/customization/themes.\n It will be removed with v0.16.0.') : void 0; - return (0, _getMuiTheme3.default)((0, _merge2.default)({}, muiTheme.baseTheme, { fontFamily: fontFamily })); - } - }; - -/***/ }, -/* 807 */ -/***/ function(module, exports, __webpack_require__) { - - 'use strict'; - - Object.defineProperty(exports, "__esModule", { - value: true - }); - - var _react = __webpack_require__(3); - - var _react2 = _interopRequireDefault(_react); - - var _pure = __webpack_require__(566); - - var _pure2 = _interopRequireDefault(_pure); - - var _SvgIcon = __webpack_require__(575); - - var _SvgIcon2 = _interopRequireDefault(_SvgIcon); - - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - - var NavigationRefresh = function NavigationRefresh(props) { - return _react2.default.createElement( - _SvgIcon2.default, - props, - _react2.default.createElement('path', { d: 'M17.65 6.35C16.2 4.9 14.21 4 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08c-.82 2.33-3.04 4-5.65 4-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4l-2.35 2.35z' }) - ); - }; - NavigationRefresh = (0, _pure2.default)(NavigationRefresh); - NavigationRefresh.displayName = 'NavigationRefresh'; - NavigationRefresh.muiName = 'SvgIcon'; - - exports.default = NavigationRefresh; - -/***/ }, -/* 808 */ -/***/ function(module, exports, __webpack_require__) { - - // style-loader: Adds some css to the DOM by adding a