diff --git a/.babelrc b/.babelrc
new file mode 100644
index 0000000..2b7bafa
--- /dev/null
+++ b/.babelrc
@@ -0,0 +1,3 @@
+{
+ "presets": ["@babel/preset-env", "@babel/preset-react"]
+}
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..7f42fad
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,14 @@
+.DS_Store
+node_modules
+/src/assets/scenario-builder/dist
+/build
+
+# local env files
+.env.local
+.env.*.local
+/src/env.js
+
+# Log files
+npm-debug.log*
+yarn-debug.log*
+yarn-error.log*
diff --git a/.jshintrc b/.jshintrc
new file mode 100644
index 0000000..8ab3485
--- /dev/null
+++ b/.jshintrc
@@ -0,0 +1,3 @@
+{
+ "esversion": 6
+}
\ No newline at end of file
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..a7f81a1
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,3 @@
+js:
+ yarn install
+ yarn build-prod
diff --git a/README.md b/README.md
index 139e909..ce36567 100644
--- a/README.md
+++ b/README.md
@@ -130,6 +130,27 @@ php bin/command.php api:generate_access
php bin/command.php application:seed
```
+### Building assets
+
+Install dependencies inside module folder `yarn install`
+Be sure to have scenario config filled in a global scope. It should look like this:
+
+```js
+window.Scenario = {
+ config: {
+ AUTH_TOKEN: '',
+ CRM_HOST: '',
+ CANCEL_PATH: '',
+ SEGMENT_ID: null
+ }
+};
+```
+
+Run `yarn build-prod` if you want to build whole application for the deployment. Then, at the root of the project, copy assets using:
+```shell
+php bin/command.php application:install_assets
+```
+
### Engine
Scenarios module requires Scenario engine worker to run separately in a background to process graph execution flows.
diff --git a/package.json b/package.json
new file mode 100644
index 0000000..a35ca7c
--- /dev/null
+++ b/package.json
@@ -0,0 +1,57 @@
+{
+ "name": "remp-scenario-builder",
+ "version": "0.3.0",
+ "private": true,
+ "dependencies": {
+ "@material-ui/core": "^4.11.0",
+ "@material-ui/icons": "^4.9.1",
+ "@material-ui/lab": "^4.0.0-alpha.56",
+ "@projectstorm/react-diagrams": "^5.3.2",
+ "axios": "^0.18.0",
+ "eslint-plugin-react-hooks": "^2.3.0",
+ "less": "^4.1.3",
+ "less-loader": "^11.1.3",
+ "lodash": "^4.17.11",
+ "react": "^16.6.0",
+ "react-dom": "^16.6.0",
+ "react-redux": "^7.1.3",
+ "react-scripts": "^3.4.3",
+ "react-select": "^2.1.2",
+ "recompose": "^0.30.0",
+ "redux": "^4.0.1",
+ "redux-logger": "^3.0.6",
+ "redux-thunk": "^2.3.0",
+ "storm-react-diagrams": "^5.2.1"
+ },
+ "scripts": {
+ "serve": "webpack serve --mode development",
+ "build-dev": "webpack --mode development",
+ "build-prod": "webpack --mode production"
+ },
+ "eslintConfig": {
+ "extends": "react-app"
+ },
+ "browserslist": [
+ ">0.2%",
+ "not dead",
+ "not ie <= 11",
+ "not op_mini all"
+ ],
+ "devDependencies": {
+ "@babel/core": "^7.24.7",
+ "@babel/preset-env": "^7.24.7",
+ "@babel/preset-react": "^7.24.7",
+ "babel-loader": "^9.1.3",
+ "cpx": "^1.5.0",
+ "css-loader": "^7.1.2",
+ "eslint-config-rallycoding": "^3.2.0",
+ "html-webpack-plugin": "^5.6.0",
+ "sass": "^1.77.6",
+ "sass-loader": "^14.2.1",
+ "style-loader": "^4.0.0",
+ "url-loader": "^4.1.1",
+ "webpack": "^5.92.1",
+ "webpack-cli": "^5.1.4",
+ "webpack-dev-server": "^5.0.4"
+ }
+}
diff --git a/src/ScenariosModule.php b/src/ScenariosModule.php
index 45c3a82..8ed18f1 100644
--- a/src/ScenariosModule.php
+++ b/src/ScenariosModule.php
@@ -164,7 +164,7 @@ public function registerLazyEventHandlers(LazyEventEmitter $emitter)
public function registerAssets(AssetsManager $assetsManager)
{
- $assetsManager->copyAssets(__DIR__ . '/assets/scenariobuilder', 'layouts/admin/scenariobuilder');
+ $assetsManager->copyAssets(__DIR__ . '/assets/scenario-builder/dist', 'layouts/admin/scenario-builder');
}
public function registerScenariosCriteria(ScenariosCriteriaStorage $scenariosCriteriaStorage)
diff --git a/src/assets/scenario-builder/App.js b/src/assets/scenario-builder/App.js
new file mode 100644
index 0000000..57ecafe
--- /dev/null
+++ b/src/assets/scenario-builder/App.js
@@ -0,0 +1,63 @@
+import React, { Component } from 'react';
+import { connect } from 'react-redux';
+
+import BodyWidget from './components/widgets/BodyWidget';
+import { Application } from './components/Application';
+import * as config from './config';
+import {
+ fetchSegments,
+ fetchGoals,
+ fetchBanners,
+ fetchTriggers,
+ fetchBeforeTriggers,
+ fetchCriteria,
+ fetchScenario,
+ setScenarioName,
+ fetchMails,
+ fetchGenerics,
+ fetchPushNotifications,
+ fetchStatistics
+} from './actions';
+
+class App extends Component {
+ componentDidMount() {
+ const { dispatch } = this.props;
+
+ dispatch(fetchSegments());
+ dispatch(fetchCriteria());
+ dispatch(fetchGoals());
+ dispatch(fetchTriggers());
+ dispatch(fetchBeforeTriggers());
+ dispatch(fetchMails());
+ dispatch(fetchGenerics());
+
+ if (config.BANNER_ENABLED) {
+ dispatch(fetchBanners());
+ }
+
+ if (config.PUSH_NOTIFICATION_ENABLED) {
+ dispatch(fetchPushNotifications());
+ }
+
+ if (config.SCENARIO_ID) {
+ dispatch(fetchScenario(config.SCENARIO_ID));
+ dispatch(fetchStatistics(config.SCENARIO_ID));
+ } else {
+ dispatch(setScenarioName('Unnamed scenario'));
+ }
+ }
+
+ render() {
+ var app = new Application(this.props.scenarioPayload);
+
+ return ;
+ }
+}
+
+function mapStateToProps(state) {
+ return {
+ scenarioPayload: state.scenario.payload
+ };
+}
+
+export default connect(mapStateToProps)(App);
diff --git a/src/assets/scenario-builder/actions/BannersActions.js b/src/assets/scenario-builder/actions/BannersActions.js
new file mode 100644
index 0000000..eb2d958
--- /dev/null
+++ b/src/assets/scenario-builder/actions/BannersActions.js
@@ -0,0 +1,35 @@
+import axios from 'axios';
+import * as config from '../config';
+import { setScenarioLoading } from './ScenarioActions';
+import { setCanvasNotification } from './CanvasActions';
+import { BANNERS_CHANGED } from './types';
+
+export function updateBanners(banners) {
+ return {
+ type: BANNERS_CHANGED,
+ payload: banners
+ };
+}
+
+export function fetchBanners() {
+ return dispatch => {
+ dispatch(setScenarioLoading(true));
+ return axios
+ .get(config.URL_BANNERS_INDEX)
+ .then(response => {
+ dispatch(updateBanners(response.data.banners));
+ dispatch(setScenarioLoading(false));
+ })
+ .catch(error => {
+ dispatch(setScenarioLoading(false));
+ console.log(error);
+ dispatch(
+ setCanvasNotification({
+ open: true,
+ variant: 'error',
+ text: 'Banners fetching failed.'
+ })
+ );
+ });
+ };
+}
diff --git a/src/assets/scenario-builder/actions/BeforeTriggersActions.js b/src/assets/scenario-builder/actions/BeforeTriggersActions.js
new file mode 100644
index 0000000..6b4f805
--- /dev/null
+++ b/src/assets/scenario-builder/actions/BeforeTriggersActions.js
@@ -0,0 +1,36 @@
+import axios from 'axios';
+import * as config from './../config';
+import { setScenarioLoading } from './ScenarioActions';
+import { setCanvasNotification } from './CanvasActions';
+
+import { BEFORE_TRIGGERS_CHANGED } from './types';
+
+export function updateBeforeTriggers(beforeTriggers) {
+ return {
+ type: BEFORE_TRIGGERS_CHANGED,
+ payload: beforeTriggers
+ };
+}
+
+export function fetchBeforeTriggers() {
+ return dispatch => {
+ dispatch(setScenarioLoading(true));
+ return axios
+ .get(`${config.URL_BEFORE_TRIGGERS_INDEX}`)
+ .then(response => {
+ dispatch(updateBeforeTriggers(response.data.events));
+ dispatch(setScenarioLoading(false));
+ })
+ .catch(error => {
+ dispatch(setScenarioLoading(false));
+ console.log(error);
+ dispatch(
+ setCanvasNotification({
+ open: true,
+ variant: 'error',
+ text: 'Triggers fetching failed.'
+ })
+ );
+ });
+ };
+}
diff --git a/src/assets/scenario-builder/actions/CanvasActions.js b/src/assets/scenario-builder/actions/CanvasActions.js
new file mode 100644
index 0000000..1de6e77
--- /dev/null
+++ b/src/assets/scenario-builder/actions/CanvasActions.js
@@ -0,0 +1,34 @@
+import {
+ CANVAS_PANNABLE,
+ CANVAS_ZOOMABLE,
+ CANVAS_ZOOMABLE_PANNABLE,
+ CANVAS_NOTIFICATION
+} from './types';
+
+export function setCanvasZoomable(zoomable) {
+ return {
+ type: CANVAS_ZOOMABLE,
+ payload: zoomable
+ };
+}
+
+export function setCanvasPannable(pannable) {
+ return {
+ type: CANVAS_PANNABLE,
+ payload: pannable
+ };
+}
+
+export function setCanvasZoomingAndPanning(zoomingAndPanning) {
+ return {
+ type: CANVAS_ZOOMABLE_PANNABLE,
+ payload: zoomingAndPanning
+ };
+}
+
+export function setCanvasNotification(notificationOptions) {
+ return {
+ type: CANVAS_NOTIFICATION,
+ payload: notificationOptions
+ };
+}
diff --git a/src/assets/scenario-builder/actions/CriteriaActions.js b/src/assets/scenario-builder/actions/CriteriaActions.js
new file mode 100644
index 0000000..2cbea23
--- /dev/null
+++ b/src/assets/scenario-builder/actions/CriteriaActions.js
@@ -0,0 +1,35 @@
+import axios from 'axios';
+import * as config from '../config';
+import { setScenarioLoading } from './ScenarioActions';
+import { setCanvasNotification } from './CanvasActions';
+import { CRITERIA_CHANGED } from './types';
+
+export function updateCriteria(criteria) {
+ return {
+ type: CRITERIA_CHANGED,
+ payload: criteria
+ };
+}
+
+export function fetchCriteria() {
+ return dispatch => {
+ dispatch(setScenarioLoading(true));
+ return axios
+ .get(config.URL_SCENARIO_CRITERIA)
+ .then(response => {
+ dispatch(updateCriteria(response.data.blueprint));
+ dispatch(setScenarioLoading(false));
+ })
+ .catch(error => {
+ console.log(error);
+ dispatch(setScenarioLoading(false));
+ dispatch(
+ setCanvasNotification({
+ open: true,
+ variant: 'error',
+ text: 'Criteria fetching failed.'
+ })
+ );
+ });
+ };
+}
diff --git a/src/assets/scenario-builder/actions/GenericsActions.js b/src/assets/scenario-builder/actions/GenericsActions.js
new file mode 100644
index 0000000..3f49fef
--- /dev/null
+++ b/src/assets/scenario-builder/actions/GenericsActions.js
@@ -0,0 +1,36 @@
+import axios from 'axios';
+import * as config from './../config';
+import { setScenarioLoading } from './ScenarioActions';
+import { setCanvasNotification } from './CanvasActions';
+
+import { GENERICS_CHANGED } from './types';
+
+export function updateGenerics(generics) {
+ return {
+ type: GENERICS_CHANGED,
+ payload: generics
+ };
+}
+
+export function fetchGenerics() {
+ return dispatch => {
+ dispatch(setScenarioLoading(true));
+ return axios
+ .get(`${config.URL_GENERICS_INDEX}`)
+ .then(response => {
+ dispatch(updateGenerics(response.data));
+ dispatch(setScenarioLoading(false));
+ })
+ .catch(error => {
+ dispatch(setScenarioLoading(false));
+ console.log(error);
+ dispatch(
+ setCanvasNotification({
+ open: true,
+ variant: 'error',
+ text: 'Generics fetching failed.'
+ })
+ );
+ });
+ };
+}
diff --git a/src/assets/scenario-builder/actions/GoalsActions.js b/src/assets/scenario-builder/actions/GoalsActions.js
new file mode 100644
index 0000000..7f68603
--- /dev/null
+++ b/src/assets/scenario-builder/actions/GoalsActions.js
@@ -0,0 +1,35 @@
+import axios from 'axios';
+import * as config from './../config';
+import { setScenarioLoading } from './ScenarioActions';
+import { setCanvasNotification } from './CanvasActions';
+import { GOALS_CHANGED } from './types';
+
+export function updateGoals(goals) {
+ return {
+ type: GOALS_CHANGED,
+ payload: goals
+ };
+}
+
+export function fetchGoals() {
+ return dispatch => {
+ dispatch(setScenarioLoading(true));
+ return axios
+ .get(config.URL_GOALS_INDEX)
+ .then(response => {
+ dispatch(updateGoals(response.data.goals));
+ dispatch(setScenarioLoading(false));
+ })
+ .catch(error => {
+ dispatch(setScenarioLoading(false));
+ console.log(error);
+ dispatch(
+ setCanvasNotification({
+ open: true,
+ variant: 'error',
+ text: 'Goals fetching failed.'
+ })
+ );
+ });
+ };
+}
diff --git a/src/assets/scenario-builder/actions/MailsActions.js b/src/assets/scenario-builder/actions/MailsActions.js
new file mode 100644
index 0000000..9f934df
--- /dev/null
+++ b/src/assets/scenario-builder/actions/MailsActions.js
@@ -0,0 +1,36 @@
+import axios from 'axios';
+import * as config from './../config';
+import { setScenarioLoading } from './ScenarioActions';
+import { setCanvasNotification } from './CanvasActions';
+
+import { MAILS_CHANGED } from './types';
+
+export function updateMails(mails) {
+ return {
+ type: MAILS_CHANGED,
+ payload: mails
+ };
+}
+
+export function fetchMails() {
+ return dispatch => {
+ dispatch(setScenarioLoading(true));
+ return axios
+ .get(`${config.URL_MAILS_INDEX}`)
+ .then(response => {
+ dispatch(updateMails(response.data.mail_templates));
+ dispatch(setScenarioLoading(false));
+ })
+ .catch(error => {
+ dispatch(setScenarioLoading(false));
+ console.log(error);
+ dispatch(
+ setCanvasNotification({
+ open: true,
+ variant: 'error',
+ text: 'Mails fetching failed.'
+ })
+ );
+ });
+ };
+}
diff --git a/src/assets/scenario-builder/actions/PushNotificationActions.js b/src/assets/scenario-builder/actions/PushNotificationActions.js
new file mode 100644
index 0000000..97621b3
--- /dev/null
+++ b/src/assets/scenario-builder/actions/PushNotificationActions.js
@@ -0,0 +1,43 @@
+import axios from 'axios';
+import * as config from './../config';
+import { setScenarioLoading } from './ScenarioActions';
+import { setCanvasNotification } from './CanvasActions';
+
+import {PUSH_NOTIFICATIONS_CHANGED} from './types';
+
+export function updateNotifications(templates, applications) {
+ return {
+ type: PUSH_NOTIFICATIONS_CHANGED,
+ payload: {
+ templates: templates,
+ applications: applications,
+ }
+ };
+}
+
+export function fetchPushNotifications() {
+ return dispatch => {
+
+ dispatch(setScenarioLoading(true));
+
+ let requestTemplates = axios.get(`${config.URL_PUSH_NOTIFICATION_TEMPLATES}`);
+ let requestApplications = axios.get(`${config.URL_PUSH_NOTIFICATION_APPLICATIONS}`);
+
+ return axios.all([requestTemplates, requestApplications])
+ .then(responses => {
+ dispatch(updateNotifications(responses[0].data.templates, responses[1].data.applications));
+ dispatch(setScenarioLoading(false));
+ })
+ .catch(error => {
+ dispatch(setScenarioLoading(false));
+ console.log(error);
+ dispatch(
+ setCanvasNotification({
+ open: true,
+ variant: 'error',
+ text: 'Notifications fetching failed.'
+ })
+ );
+ });
+ };
+}
diff --git a/src/assets/scenario-builder/actions/ScenarioActions.js b/src/assets/scenario-builder/actions/ScenarioActions.js
new file mode 100644
index 0000000..d1d71ee
--- /dev/null
+++ b/src/assets/scenario-builder/actions/ScenarioActions.js
@@ -0,0 +1,62 @@
+import axios from 'axios';
+import {
+ SET_SCENARIO_ID,
+ SET_SCENARIO_NAME,
+ SET_SCENARIO_LOADING,
+ SET_SCENARIO_PAYLOAD
+} from './types';
+import * as config from '../config';
+import { setCanvasNotification } from './CanvasActions';
+
+export function setScenarioId(id) {
+ return {
+ type: SET_SCENARIO_ID,
+ payload: id
+ };
+}
+
+export function setScenarioName(name) {
+ return {
+ type: SET_SCENARIO_NAME,
+ payload: name
+ };
+}
+
+export function setScenarioPayload(payload) {
+ return {
+ type: SET_SCENARIO_PAYLOAD,
+ payload
+ };
+}
+
+export function setScenarioLoading(loading) {
+ return {
+ type: SET_SCENARIO_LOADING,
+ payload: loading
+ };
+}
+
+export function fetchScenario(scenarioId) {
+ return dispatch => {
+ dispatch(setScenarioLoading(true));
+ return axios
+ .get(config.URL_SCENARIO_DETAIL + scenarioId)
+ .then(response => {
+ dispatch(setScenarioPayload(response.data));
+ dispatch(setScenarioName(response.data.name));
+ dispatch(setScenarioId(response.data.id));
+ dispatch(setScenarioLoading(false));
+ })
+ .catch(error => {
+ dispatch(setScenarioLoading(false));
+ dispatch(
+ setCanvasNotification({
+ open: true,
+ variant: 'error',
+ text: 'Scenario fetching failed.'
+ })
+ );
+ console.log(error);
+ });
+ };
+}
diff --git a/src/assets/scenario-builder/actions/SegmentsActions.js b/src/assets/scenario-builder/actions/SegmentsActions.js
new file mode 100644
index 0000000..ccc0ffe
--- /dev/null
+++ b/src/assets/scenario-builder/actions/SegmentsActions.js
@@ -0,0 +1,36 @@
+import axios from 'axios';
+import * as config from './../config';
+import { setScenarioLoading } from './ScenarioActions';
+import { setCanvasNotification } from './CanvasActions';
+
+import { SEGMENTS_CHANGED } from './types';
+
+export function updateSegments(segments) {
+ return {
+ type: SEGMENTS_CHANGED,
+ payload: segments
+ };
+}
+
+export function fetchSegments() {
+ return dispatch => {
+ dispatch(setScenarioLoading(true));
+ return axios
+ .get(`${config.URL_SEGMENTS_INDEX}`)
+ .then(response => {
+ dispatch(updateSegments(response.data.result));
+ dispatch(setScenarioLoading(false));
+ })
+ .catch(error => {
+ console.log(error);
+ dispatch(setScenarioLoading(false));
+ dispatch(
+ setCanvasNotification({
+ open: true,
+ variant: 'error',
+ text: 'Segments fetching failed.'
+ })
+ );
+ });
+ };
+}
diff --git a/src/assets/scenario-builder/actions/StatisticActions.js b/src/assets/scenario-builder/actions/StatisticActions.js
new file mode 100644
index 0000000..bac2165
--- /dev/null
+++ b/src/assets/scenario-builder/actions/StatisticActions.js
@@ -0,0 +1,19 @@
+import {STATISTICS_CHANGED} from "./types";
+import axios from "axios";
+import * as config from "../config";
+
+export function fetchStatistics(scenarioId) {
+ return dispatch => {
+ return axios
+ .get(config.URL_SCENARIO_STATISTIC + scenarioId)
+ .then(response => {
+ dispatch({
+ type: STATISTICS_CHANGED,
+ payload: response.data
+ });
+ })
+ .catch(error => {
+ console.log(error);
+ });
+ };
+}
\ No newline at end of file
diff --git a/src/assets/scenario-builder/actions/TriggersActions.js b/src/assets/scenario-builder/actions/TriggersActions.js
new file mode 100644
index 0000000..9a08df0
--- /dev/null
+++ b/src/assets/scenario-builder/actions/TriggersActions.js
@@ -0,0 +1,36 @@
+import axios from 'axios';
+import * as config from './../config';
+import { setScenarioLoading } from './ScenarioActions';
+import { setCanvasNotification } from './CanvasActions';
+
+import { TRIGGERS_CHANGED } from './types';
+
+export function updateTriggers(triggers) {
+ return {
+ type: TRIGGERS_CHANGED,
+ payload: triggers
+ };
+}
+
+export function fetchTriggers() {
+ return dispatch => {
+ dispatch(setScenarioLoading(true));
+ return axios
+ .get(`${config.URL_TRIGGERS_INDEX}`)
+ .then(response => {
+ dispatch(updateTriggers(response.data.events));
+ dispatch(setScenarioLoading(false));
+ })
+ .catch(error => {
+ dispatch(setScenarioLoading(false));
+ console.log(error);
+ dispatch(
+ setCanvasNotification({
+ open: true,
+ variant: 'error',
+ text: 'Triggers fetching failed.'
+ })
+ );
+ });
+ };
+}
diff --git a/src/assets/scenario-builder/actions/index.js b/src/assets/scenario-builder/actions/index.js
new file mode 100644
index 0000000..75d6278
--- /dev/null
+++ b/src/assets/scenario-builder/actions/index.js
@@ -0,0 +1,12 @@
+export * from './SegmentsActions';
+export * from './TriggersActions';
+export * from './CanvasActions';
+export * from './ScenarioActions';
+export * from './MailsActions';
+export * from './GenericsActions';
+export * from './GoalsActions';
+export * from './BannersActions';
+export * from './CriteriaActions';
+export * from './BeforeTriggersActions';
+export * from './PushNotificationActions';
+export * from './StatisticActions';
\ No newline at end of file
diff --git a/src/assets/scenario-builder/actions/types.js b/src/assets/scenario-builder/actions/types.js
new file mode 100644
index 0000000..c689ba1
--- /dev/null
+++ b/src/assets/scenario-builder/actions/types.js
@@ -0,0 +1,24 @@
+export const SEGMENTS_CHANGED = 'segments_changed';
+
+export const CRITERIA_CHANGED = 'criteria_changed';
+
+export const TRIGGERS_CHANGED = 'triggers_changed';
+export const BEFORE_TRIGGERS_CHANGED = 'before_triggers_changed';
+
+export const MAILS_CHANGED = 'mails_changed';
+export const GOALS_CHANGED = 'goals_changed';
+export const BANNERS_CHANGED = 'banners_changed';
+export const GENERICS_CHANGED = 'generics_changed';
+export const PUSH_NOTIFICATIONS_CHANGED = 'push_notifications_changed';
+
+export const CANVAS_ZOOMABLE = 'canvas_zoomable';
+export const CANVAS_PANNABLE = 'canvas_pannable';
+export const CANVAS_ZOOMABLE_PANNABLE = 'canvas_zoomable_pannable';
+export const CANVAS_NOTIFICATION = 'canvas_notification';
+
+export const SET_SCENARIO_ID = 'set_scenario_id';
+export const SET_SCENARIO_NAME = 'set_scenario_name';
+export const SET_SCENARIO_PAYLOAD = 'set_scenario_payload';
+export const SET_SCENARIO_LOADING = 'set_scenario_loading';
+
+export const STATISTICS_CHANGED = 'statistics_changed';
\ No newline at end of file
diff --git a/src/assets/scenario-builder/components/Application.js b/src/assets/scenario-builder/components/Application.js
new file mode 100755
index 0000000..55ec3fa
--- /dev/null
+++ b/src/assets/scenario-builder/components/Application.js
@@ -0,0 +1,131 @@
+import { DiagramEngine, DiagramModel } from '@projectstorm/react-diagrams';
+
+// import the custom models
+import {
+ SimplePortFactory,
+ Banner,
+ Email,
+ Generic,
+ Segment,
+ Trigger,
+ BeforeTrigger,
+ Wait,
+ Goal,
+ Condition,
+ PushNotification,
+ ABTest
+} from './elements';
+
+import './sass/main.scss';
+import { LinkFactory } from './elements/Link';
+import { RenderService } from './../services/RenderService';
+
+export class Application {
+ activeModel;
+ diagramEngine;
+
+ constructor(payload) {
+ this.diagramEngine = new DiagramEngine();
+ this.diagramEngine.installDefaultFactories();
+ this.activeModel = new DiagramModel();
+ this.renderService = new RenderService(this.activeModel);
+ this.payload = payload;
+ this.corruptedPayload = false;
+
+ if (payload) {
+ this.renderPayload();
+ } else {
+ this.registerCustomModels();
+ }
+ }
+
+ renderPayload() {
+ this.registerCustomModels();
+ try {
+ this.renderService.renderPayload(this.payload);
+ } catch(ex) {
+ // In case of rendering error, dump loaded model, log and flag as corrupted scenario
+ console.log(ex.message);
+ this.corruptedPayload = true;
+ this.activeModel = new DiagramModel();
+ }
+
+ this.diagramEngine.setDiagramModel(this.activeModel);
+ this.diagramEngine.repaintCanvas();
+ }
+
+ registerCustomModels() {
+ this.diagramEngine.registerLinkFactory(new LinkFactory());
+ this.diagramEngine.registerPortFactory(
+ new SimplePortFactory('email', config => new Email.PortModel())
+ );
+ this.diagramEngine.registerNodeFactory(new Email.NodeFactory());
+
+ this.diagramEngine.registerPortFactory(
+ new SimplePortFactory('generic', config => new Generic.PortModel())
+ );
+ this.diagramEngine.registerNodeFactory(new Generic.NodeFactory());
+
+ this.diagramEngine.registerPortFactory(
+ new SimplePortFactory('segment', config => new Segment.PortModel())
+ );
+ this.diagramEngine.registerNodeFactory(new Segment.NodeFactory());
+
+ this.diagramEngine.registerPortFactory(
+ new SimplePortFactory('trigger', config => new Trigger.PortModel())
+ );
+ this.diagramEngine.registerNodeFactory(new Trigger.NodeFactory());
+
+ this.diagramEngine.registerPortFactory(
+ new SimplePortFactory('before_trigger', config => new BeforeTrigger.PortModel())
+ );
+ this.diagramEngine.registerNodeFactory(new BeforeTrigger.NodeFactory());
+
+ this.diagramEngine.registerPortFactory(
+ new SimplePortFactory('wait', config => new Wait.PortModel())
+ );
+ this.diagramEngine.registerNodeFactory(new Wait.NodeFactory());
+
+ // Goal
+ this.diagramEngine.registerPortFactory(
+ new SimplePortFactory('goal', config => new Goal.PortModel())
+ );
+ this.diagramEngine.registerNodeFactory(new Goal.NodeFactory());
+
+ // Banner
+ this.diagramEngine.registerPortFactory(
+ new SimplePortFactory('banner', config => new Banner.PortModel())
+ );
+ this.diagramEngine.registerNodeFactory(new Banner.NodeFactory());
+
+ // Condition
+ this.diagramEngine.registerPortFactory(
+ new SimplePortFactory('condition', config => new Condition.PortModel())
+ );
+ this.diagramEngine.registerNodeFactory(new Condition.NodeFactory());
+
+ // Notification
+ this.diagramEngine.registerPortFactory(
+ new SimplePortFactory('push_notification', config => new PushNotification.PortModel())
+ );
+ this.diagramEngine.registerNodeFactory(new PushNotification.NodeFactory());
+
+ // AB Test
+ this.diagramEngine.registerPortFactory(
+ new SimplePortFactory('ab_test', config => new ABTest.PortModel())
+ );
+ this.diagramEngine.registerNodeFactory(new ABTest.NodeFactory());
+ }
+
+ getActiveDiagram() {
+ return this.activeModel;
+ }
+
+ getDiagramEngine() {
+ return this.diagramEngine;
+ }
+
+ isCorruptedPayload() {
+ return this.corruptedPayload;
+ }
+}
diff --git a/src/assets/scenario-builder/components/Notification.js b/src/assets/scenario-builder/components/Notification.js
new file mode 100644
index 0000000..c1d3cea
--- /dev/null
+++ b/src/assets/scenario-builder/components/Notification.js
@@ -0,0 +1,52 @@
+import React from 'react';
+import PropTypes from 'prop-types';
+import Snackbar from '@material-ui/core/Snackbar';
+import SnackbarContent from '@material-ui/core/SnackbarContent';
+import CheckCircleIcon from '@material-ui/icons/CheckCircle';
+import ErrorIcon from '@material-ui/icons/Error';
+import InfoIcon from '@material-ui/icons/Info';
+import WarningIcon from '@material-ui/icons/Warning';
+
+const variantIcon = {
+ success: CheckCircleIcon,
+ warning: WarningIcon,
+ error: ErrorIcon,
+ info: InfoIcon
+};
+
+class Notification extends React.Component {
+ render() {
+ const Icon = variantIcon[this.props.variant];
+
+ return (
+
+
+
+ {this.props.text}
+
+ }
+ />
+
+ );
+ }
+}
+
+Notification.propTypes = {
+ variant: PropTypes.oneOf(['success', 'warning', 'info', 'error']).isRequired,
+ text: PropTypes.string.isRequired,
+ handleClose: PropTypes.func,
+ open: PropTypes.bool.isRequired
+};
+
+export default Notification;
diff --git a/src/assets/scenario-builder/components/StatisticBadge.js b/src/assets/scenario-builder/components/StatisticBadge.js
new file mode 100644
index 0000000..529c639
--- /dev/null
+++ b/src/assets/scenario-builder/components/StatisticBadge.js
@@ -0,0 +1,78 @@
+import React from "react";
+import {useSelector} from 'react-redux';
+import Chip from "@material-ui/core/Chip";
+import {CircularProgress} from "@material-ui/core";
+
+function StatisticBadge(props) {
+
+ const formatLabelNumbers = number => {
+ if (number < 1000) {
+ return number;
+ }
+ if (number < 1000000) {
+ return Number(number / 1000).toFixed((number > 100000 ? 0 : 1)) + 'K';
+ }
+
+ return Number(number / 1000000).toFixed(1) + 'M';
+ };
+
+ const defaultTimePeriod = '24h';
+ const statistics = useSelector(state => state.statistics.statistics);
+ const data = statistics[props.elementId] ?? null;
+
+ let label = null;
+ if (statistics.length === 0) {
+ label =
;
+ } else {
+ if (data) {
+ if (data.hasOwnProperty('finished')) {
+ label = data.finished[defaultTimePeriod];
+ }
+
+ if (props.position === 'right' && data.hasOwnProperty('matched')) {
+ label = data.matched[defaultTimePeriod];
+ }
+
+ if (props.position === 'right' && data.hasOwnProperty('completed')) {
+ label = data.completed[defaultTimePeriod];
+ }
+
+ if (props.position === 'bottom' && data.hasOwnProperty('notMatched')) {
+ label = data.notMatched[defaultTimePeriod];
+ }
+
+ if (props.position === 'bottom' && data.hasOwnProperty('timeout')) {
+ label = data.timeout[defaultTimePeriod];
+ }
+
+ if (props.hasOwnProperty('index')) {
+ if (!data[props.index]) {
+ label = 0;
+ } else {
+ label = data[props.index][defaultTimePeriod];
+ }
+ }
+ }
+
+ if (label !== null) {
+ label=formatLabelNumbers(label);
+ } else {
+ return null;
+ }
+ }
+
+ return (
+
+
+
+ );
+}
+
+
+export default StatisticBadge;
\ No newline at end of file
diff --git a/src/assets/scenario-builder/components/StatisticTooltip.js b/src/assets/scenario-builder/components/StatisticTooltip.js
new file mode 100644
index 0000000..9787d25
--- /dev/null
+++ b/src/assets/scenario-builder/components/StatisticTooltip.js
@@ -0,0 +1,141 @@
+import React from 'react';
+import PropTypes from 'prop-types';
+import Popover from '@material-ui/core/Popover';
+import { connect } from 'react-redux';
+
+class StatisticsTooltip extends React.Component {
+ static propTypes = {
+ id: PropTypes.string.isRequired,
+ anchorElement: PropTypes.instanceOf(Element)
+ };
+
+ render() {
+ const { anchorElement } = this.props;
+ const data = this.props.statistics[this.props.id] ?? null;
+ const variants = this.props.variants ?? [];
+
+ if (data === null) {
+ return null;
+ }
+
+ return (
+
+
+ {data ?
+
+
Statistics
+
+
+ {data.hasOwnProperty('waiting') ?
+
+ Waiting: {data.waiting}
+
: null
+ }
+
+ {data.hasOwnProperty('recheck') ?
+
+ Waiting to re-check: {data.recheck}
+
: null
+ }
+
+
Last 24 hours
+
+
+ {data.hasOwnProperty('finished') ?
+
+ Finished: |
+ {data.finished["24h"]} |
+
: null}
+ {data.hasOwnProperty('matched') ?
+
+ Matched: |
+ {data.matched["24h"]} |
+
: null}
+ {data.hasOwnProperty('notMatched') ?
+
+ Not matched: |
+ {data.notMatched["24h"]} |
+
: null}
+ {data.hasOwnProperty('completed') ?
+
+ Completed: |
+ {data.completed["24h"]} |
+
: null}
+ {data.hasOwnProperty('timeout') ?
+
+ Timed out: |
+ {data.timeout["24h"]} |
+
: null}
+ {variants.flatMap((variant) => (
+
+ {variant.name}: |
+ {data[variant.code] ? data[variant.code]["24h"] : 0} |
+
+ ))}
+
+
+
+
Last 30 days
+
+
+
+ {data.hasOwnProperty('finished') ?
+
+ Finished: |
+ {data.finished["30d"]} |
+
: null}
+ {data.hasOwnProperty('matched') ?
+
+ Matched: |
+ {data.matched["30d"]} |
+
: null}
+ {data.hasOwnProperty('notMatched') ?
+
+ Not matched: |
+ {data.notMatched["30d"]} |
+
: null}
+ {data.hasOwnProperty('completed') ?
+
+ Completed: |
+ {data.completed["30d"]} |
+
: null}
+ {data.hasOwnProperty('timeout') ?
+
+ Timed out: |
+ {data.timeout["30d"]} |
+
: null}
+ {variants.flatMap((variant) => (
+
+ {variant.name}: |
+ {data[variant.code] ? data[variant.code]["30d"] : 0} |
+
+ ))}
+
+
+
+ : ''}
+
+
+ );
+ }
+}
+
+function mapStateToProps(state) {
+ return {
+ statistics: state.statistics.statistics
+ };
+}
+
+export default connect(mapStateToProps)(StatisticsTooltip);
diff --git a/src/assets/scenario-builder/components/elements/ABTest/NodeFactory.js b/src/assets/scenario-builder/components/elements/ABTest/NodeFactory.js
new file mode 100755
index 0000000..f0d9dd0
--- /dev/null
+++ b/src/assets/scenario-builder/components/elements/ABTest/NodeFactory.js
@@ -0,0 +1,26 @@
+import * as React from 'react';
+import { AbstractNodeFactory } from '@projectstorm/react-diagrams';
+
+import NodeWidget from './NodeWidget';
+import { NodeModel } from './NodeModel';
+
+export class NodeFactory extends AbstractNodeFactory {
+ constructor() {
+ super('ab_test');
+ }
+
+ generateReactWidget(diagramEngine, node) {
+ return (
+
+ );
+ }
+
+ getNewInstance() {
+ return new NodeModel();
+ }
+}
diff --git a/src/assets/scenario-builder/components/elements/ABTest/NodeModel.js b/src/assets/scenario-builder/components/elements/ABTest/NodeModel.js
new file mode 100755
index 0000000..a1f65b3
--- /dev/null
+++ b/src/assets/scenario-builder/components/elements/ABTest/NodeModel.js
@@ -0,0 +1,46 @@
+import { NodeModel as BaseNodeModel } from '@projectstorm/react-diagrams';
+import * as _ from 'lodash';
+import { PortModel } from './PortModel';
+import uuidv4 from 'uuid/v4';
+
+export class NodeModel extends BaseNodeModel {
+ constructor(element) {
+ super('ab_test', element.id);
+
+ this.name = element.name;
+ this.scenarioName = element.scenarioName;
+
+ if (element.variants) {
+ this.variants = element.variants;
+ } else {
+ this.variants = [{
+ code: uuidv4().slice(0, 6),
+ name: 'Variant A',
+ distribution: 50,
+ }, {
+ code: uuidv4().slice(0, 6),
+ name: 'Variant B',
+ distribution: 50,
+ }];
+ }
+
+ this.addPort(new PortModel('left'));
+
+ this.variants.forEach((item, index) =>
+ this.addPort(new PortModel('right.' + index))
+ );
+ }
+
+ deSerialize(ob, engine) {
+ super.deSerialize(ob, engine);
+ this.name = ob.name;
+ this.variants = ob.variants;
+ }
+
+ serialize() {
+ return _.merge(super.serialize(), {
+ name: this.name,
+ variants: this.variants,
+ });
+ }
+}
diff --git a/src/assets/scenario-builder/components/elements/ABTest/NodeWidget.js b/src/assets/scenario-builder/components/elements/ABTest/NodeWidget.js
new file mode 100755
index 0000000..8315ec3
--- /dev/null
+++ b/src/assets/scenario-builder/components/elements/ABTest/NodeWidget.js
@@ -0,0 +1,247 @@
+import * as React from 'react';
+import { connect } from 'react-redux';
+import SwapVertIcon from '@material-ui/icons/SwapVert';
+import Grid from '@material-ui/core/Grid';
+import TextField from '@material-ui/core/TextField';
+import Button from '@material-ui/core/Button';
+import Dialog from '@material-ui/core/Dialog';
+import DialogActions from '@material-ui/core/DialogActions';
+import DialogContent from '@material-ui/core/DialogContent';
+import DialogTitle from '@material-ui/core/DialogTitle';
+import { PortWidget } from './../../widgets/PortWidget';
+import { setCanvasZoomingAndPanning } from '../../../actions';
+import DialogContentText from "@material-ui/core/DialogContentText";
+import VariantBuilder from "./VariantBuilder";
+import {Typography} from "@material-ui/core";
+import {PortModel} from './PortModel';
+import StatisticBadge from "../../StatisticBadge";
+import StatisticsTooltip from "../../StatisticTooltip";
+
+class NodeWidget extends React.Component {
+
+ constructor(props) {
+ super(props);
+
+ // Use it to access VariantBuilder state
+ this.builderRef = React.createRef();
+
+ this.state = {
+ nodeFormName: this.props.node.name,
+ enabledSave: true,
+ dialogOpened: false,
+ anchorElementForTooltip: null,
+ };
+ }
+
+ bem(selector) {
+ return (
+ this.props.classBaseName +
+ selector +
+ ' ' +
+ this.props.className +
+ selector +
+ ' '
+ );
+ }
+
+ getClassName() {
+ return this.props.classBaseName + ' ' + this.props.className;
+ }
+
+ openDialog = () => {
+ this.setState({
+ dialogOpened: true,
+ nodeFormName: this.props.node.name,
+ anchorElementForTooltip: null
+ });
+ this.props.dispatch(setCanvasZoomingAndPanning(false));
+ };
+
+ closeDialog = () => {
+ this.setState({ dialogOpened: false });
+ this.props.dispatch(setCanvasZoomingAndPanning(true));
+ };
+
+ handleNodeMouseEnter = event => {
+ if (!this.state.dialogOpened) {
+ this.setState({ anchorElementForTooltip: event.currentTarget });
+ }
+ };
+
+ handleNodeMouseLeave = () => {
+ this.setState({ anchorElementForTooltip: null });
+ };
+
+ enableSave = enable => {
+ // prevents re-rendering, setState only if value differs
+ if (this.state.enabledSave !== enable) {
+ this.setState( {enabledSave: enable });
+ }
+ };
+
+ syncNodeModel = () => {
+
+ // Add ports if is not in variants
+ this.props.node.variants.forEach((variant, index) => {
+ if (!this.props.node.getPort('right.' + index)) {
+ this.props.node.addPort(new PortModel('right.' + index));
+ }
+ });
+
+ // Remove ports if is not in variants
+ for (const portName in this.props.node.getPorts()) {
+ if (portName.startsWith('right.')) {
+ let index = portName.split('.')[1];
+ if (!this.props.node.variants[index]) {
+ let port = this.props.node.getPort(portName);
+
+ for (const [link] of Object.entries(port.getLinks())) {
+ this.props.diagramEngine.diagramModel.removeLink(link);
+ }
+ this.props.node.removePort(port);
+ }
+ }
+ }
+ };
+
+ render() {
+ return (
+ {
+ this.openDialog();
+ }}
+ onMouseEnter={this.handleNodeMouseEnter}
+ onMouseLeave={this.handleNodeMouseLeave}
+ >
+
+
+ {this.props.node.name
+ ? this.props.node.name
+ : 'AB Test'}
+
+
+
+
+
+
+
+
+
+
+
+ {this.props.node.variants.flatMap((variant, index) => (
+
+
+
+
+
+ {variant.name} ({variant.distribution}%)
+
+
+
+ ))}
+
+
+
+
+
+
+
+ );
+ }
+}
+
+function mapStateToProps(state) {
+ const { dispatch } = state;
+ return { dispatch };
+}
+
+export default connect(mapStateToProps)(NodeWidget);
\ No newline at end of file
diff --git a/src/assets/scenario-builder/components/elements/ABTest/PortModel.js b/src/assets/scenario-builder/components/elements/ABTest/PortModel.js
new file mode 100755
index 0000000..83f6a94
--- /dev/null
+++ b/src/assets/scenario-builder/components/elements/ABTest/PortModel.js
@@ -0,0 +1,7 @@
+import { LeftRightBottomPort } from './../Ports';
+
+export class PortModel extends LeftRightBottomPort {
+ constructor(position = 'right') {
+ super(position, 'ab_test');
+ }
+}
diff --git a/src/assets/scenario-builder/components/elements/ABTest/VariantBuilder.js b/src/assets/scenario-builder/components/elements/ABTest/VariantBuilder.js
new file mode 100644
index 0000000..a0a082a
--- /dev/null
+++ b/src/assets/scenario-builder/components/elements/ABTest/VariantBuilder.js
@@ -0,0 +1,294 @@
+import React, {forwardRef, useImperativeHandle, useReducer} from "react";
+import Grid from "@material-ui/core/Grid";
+import {
+ Dialog, DialogActions, DialogContent, DialogTitle,
+ FormControl,
+ IconButton,
+ Input,
+ InputAdornment,
+ InputLabel,
+ TextField
+} from "@material-ui/core";
+import AddCircle from '@material-ui/icons/AddCircleOutline';
+import DeleteIcon from "@material-ui/icons/Delete";
+import Button from "@material-ui/core/Button";
+import AddIcon from "@material-ui/icons/AddCircleOutline";
+import EditIcon from '@material-ui/icons/Edit';
+import ShowIcon from '@material-ui/icons/Visibility';
+import uuidv4 from 'uuid/v4';
+import DialogContentText from "@material-ui/core/DialogContentText";
+import * as config from '../../../config';
+
+function reducer(state, action) {
+
+ let isError = false;
+
+ switch (action.type) {
+ case 'ADD_VARIANT':
+ return {
+ ...state,
+ variants: [
+ ...state.variants, {
+ "code": uuidv4().slice(0, 6),
+ "name": "Variant " + String.fromCharCode(65 + state.variants.length),
+ "distribution": 0
+ }
+ ]
+ };
+
+ case 'DELETE_VARIANT':
+ let variants = state.variants.filter((element, index) => index !== action.payload.index);
+ if (variants.reduce((sum, item) => sum + parseInt(item.distribution), 0) !== 100) {
+ isError = true;
+ }
+
+ return {
+ ...state,
+ variants: variants,
+ isError: isError
+ };
+
+ case 'UPDATE_VARIANT_DISTRIBUTION':
+ let filteredVariants = state.variants.filter((element, index) => index !== action.payload.index);
+ isError = (filteredVariants.reduce((sum, item) => sum + parseInt(item.distribution), 0) + parseInt(action.payload.value)) !== 100;
+
+ return {
+ ...state,
+ variants: state.variants.map((element, index) => {
+ if (index === action.payload.index) {
+ return {
+ ...element,
+ distribution: action.payload.value
+ }
+ }
+ return element;
+ }),
+ isError: isError,
+ };
+
+ case 'UPDATE_VARIANT_NAME':
+ return {
+ ...state,
+ variants: state.variants.map((element, index) => {
+ if (index === action.payload.index) {
+ return {
+ ...element,
+ name: action.payload.value
+ }
+ }
+ return element;
+ })
+ };
+
+ case 'UPDATE_SEGMENT_NAME':
+ return {
+ ...state,
+ variants: state.variants.map((element, index) => {
+ if (index === action.payload.index) {
+ return {
+ ...element,
+ segment: {
+ name: action.payload.name
+ }
+ }
+ }
+ return element;
+ })
+ };
+
+ default:
+ throw new Error("unsupported action type " + action.type);
+ }
+}
+
+function VariantBuilder(props, ref) {
+ const [state, dispatch] = useReducer(reducer, {
+ ...props
+ });
+
+ if (state.isError !== undefined) {
+ props.onEnableSave(!state.isError);
+ }
+
+ // expose state to outer node
+ useImperativeHandle(ref, () => ({
+ state: state
+ }));
+
+ return (
+
+);
+}
+
+function SegmentForm(props) {
+
+ const defaultSegmentName = "Scenario variant: " + props.scenarioName + " - " + props.nodeName + " - " + props.variantName + " (" + props.variantCode + ")";
+
+ const [open, setOpen] = React.useState(false);
+ const [name, setName] = React.useState(props.segment.name ?? defaultSegmentName);
+
+ const handleClickOpen = () => {
+ setOpen(true);
+ };
+
+ const handleCancel = () => {
+ setName(props.segment.name ?? defaultSegmentName);
+ setOpen(false);
+ };
+
+ const handleSave = () => {
+ props.dispatch({
+ type: 'UPDATE_SEGMENT_NAME',
+ payload: {
+ index: props.index,
+ name: name
+ }
+ });
+
+ setOpen(false);
+ };
+
+ return (
+
+
+
+ :
+ }>
+ {props.segment.name ? 'Edit segment' : 'Create segment'}
+
+
+
+
+ );
+}
+
+// // forwardRef is here used to access local state from parent node
+export default forwardRef(VariantBuilder)
\ No newline at end of file
diff --git a/src/assets/scenario-builder/components/elements/ABTest/index.js b/src/assets/scenario-builder/components/elements/ABTest/index.js
new file mode 100755
index 0000000..af068d7
--- /dev/null
+++ b/src/assets/scenario-builder/components/elements/ABTest/index.js
@@ -0,0 +1,9 @@
+import { NodeModel } from "./NodeModel";
+import { NodeFactory } from "./NodeFactory";
+import { PortModel } from "./PortModel";
+
+export {
+ NodeModel,
+ NodeFactory,
+ PortModel
+};
diff --git a/src/assets/scenario-builder/components/elements/ABTest/sass/style.scss b/src/assets/scenario-builder/components/elements/ABTest/sass/style.scss
new file mode 100644
index 0000000..f41aa46
--- /dev/null
+++ b/src/assets/scenario-builder/components/elements/ABTest/sass/style.scss
@@ -0,0 +1,43 @@
+$nodeColor: $grey;
+
+.srd-node--selected {
+ .diamond-node .abtest-node .node-container {
+ box-shadow: 0 0 10px $nodeColor;
+ }
+}
+
+.abtest-node {
+ .node-container {
+ border: solid 2px $nodeColor;
+ color: $nodeColor;
+ height: auto;
+ }
+
+ &__title {
+ color: $nodeColor;
+ }
+
+ &__ports {
+ width: 50%;
+ height: 100%;
+ flex-direction: column;
+ }
+
+ &__right {
+ margin-top: 10px;
+ height: 20px;
+ }
+
+ &__description {
+ display: flex;
+ position: absolute;
+ left: 40px;
+ top: -2px;
+ font-size: 0.8rem;
+ color: $black;
+ }
+
+ .port {
+ box-shadow: 0 0 10px $nodeColor;
+ }
+}
diff --git a/src/assets/scenario-builder/components/elements/Banner/NodeFactory.js b/src/assets/scenario-builder/components/elements/Banner/NodeFactory.js
new file mode 100755
index 0000000..203ebdd
--- /dev/null
+++ b/src/assets/scenario-builder/components/elements/Banner/NodeFactory.js
@@ -0,0 +1,26 @@
+import * as React from 'react';
+import { AbstractNodeFactory } from '@projectstorm/react-diagrams';
+
+import NodeWidget from './NodeWidget';
+import { NodeModel } from './NodeModel';
+
+export class NodeFactory extends AbstractNodeFactory {
+ constructor() {
+ super('banner');
+ }
+
+ generateReactWidget(diagramEngine, node) {
+ return (
+
+ );
+ }
+
+ getNewInstance() {
+ return new NodeModel();
+ }
+}
diff --git a/src/assets/scenario-builder/components/elements/Banner/NodeModel.js b/src/assets/scenario-builder/components/elements/Banner/NodeModel.js
new file mode 100755
index 0000000..85f6fa6
--- /dev/null
+++ b/src/assets/scenario-builder/components/elements/Banner/NodeModel.js
@@ -0,0 +1,36 @@
+import { NodeModel as BaseNodeModel } from '@projectstorm/react-diagrams';
+import * as _ from 'lodash';
+import { PortModel } from './PortModel';
+
+export class NodeModel extends BaseNodeModel {
+ constructor(element) {
+ super('banner', element.id);
+
+ this.name = element.name;
+ this.selectedBanner = element.selectedBanner;
+
+ this.expiresInTime = element.expiresInTime;
+ this.expiresInUnit = element.expiresInUnit;
+
+ this.addPort(new PortModel('left'));
+ this.addPort(new PortModel('right'));
+ }
+
+ deSerialize(ob, engine) {
+ super.deSerialize(ob, engine);
+ this.name = ob.name;
+ this.selectedBanner = ob.selectedBanner;
+
+ this.expiresInTime = ob.expiresInTime || '1';
+ this.expiresInUnit = ob.expiresInUnit || 'days';
+ }
+
+ serialize() {
+ return _.merge(super.serialize(), {
+ name: this.name,
+ selectedBanner: this.selectedBanner,
+ expiresInTime: this.expiresInTime,
+ expiresInUnit: this.expiresInUnit,
+ });
+ }
+}
diff --git a/src/assets/scenario-builder/components/elements/Banner/NodeWidget.js b/src/assets/scenario-builder/components/elements/Banner/NodeWidget.js
new file mode 100755
index 0000000..b460dcb
--- /dev/null
+++ b/src/assets/scenario-builder/components/elements/Banner/NodeWidget.js
@@ -0,0 +1,265 @@
+import * as React from 'react';
+import { connect } from 'react-redux';
+import ActionIcon from '@material-ui/icons/Adjust';
+import Grid from '@material-ui/core/Grid';
+import TextField from '@material-ui/core/TextField';
+import Button from '@material-ui/core/Button';
+import Dialog from '@material-ui/core/Dialog';
+import DialogActions from '@material-ui/core/DialogActions';
+import DialogContent from '@material-ui/core/DialogContent';
+import DialogContentText from '@material-ui/core/DialogContentText';
+import DialogTitle from '@material-ui/core/DialogTitle';
+import FormControl from '@material-ui/core/FormControl';
+import InputLabel from '@material-ui/core/InputLabel';
+import Select from '@material-ui/core/Select';
+import MenuItem from '@material-ui/core/MenuItem';
+
+import { PortWidget } from '../../widgets/PortWidget';
+import StatisticsTooltip from '../../StatisticTooltip';
+import { setCanvasZoomingAndPanning } from '../../../actions';
+import StatisticBadge from "../../StatisticBadge";
+import {Autocomplete} from "@material-ui/lab";
+
+class NodeWidget extends React.Component {
+ constructor(props) {
+ super(props);
+ this.state = {
+ nodeFormName: this.props.node.name,
+ selectedBanner: this.props.node.selectedBanner,
+ dialogOpened: false,
+ anchorElementForTooltip: null,
+ expiresInTime: this.props.node.expiresInTime,
+ expiresInUnit: this.props.node.expiresInUnit,
+ };
+ }
+
+ bem(selector) {
+ return (
+ this.props.classBaseName +
+ selector +
+ ' ' +
+ this.props.className +
+ selector +
+ ' '
+ );
+ }
+
+ getClassName() {
+ return this.props.classBaseName + ' ' + this.props.className;
+ }
+
+ openDialog = () => {
+ this.setState({
+ dialogOpened: true,
+ nodeFormName: this.props.node.name,
+ anchorElementForTooltip: null
+ });
+ this.props.dispatch(setCanvasZoomingAndPanning(false));
+ };
+
+ closeDialog = () => {
+ this.setState({ dialogOpened: false });
+ this.props.dispatch(setCanvasZoomingAndPanning(true));
+ };
+
+ handleNodeMouseEnter = event => {
+ if (!this.state.dialogOpened) {
+ this.setState({ anchorElementForTooltip: event.currentTarget });
+ }
+ };
+
+ handleNodeMouseLeave = () => {
+ this.setState({ anchorElementForTooltip: null });
+ };
+
+ getSelectedBanner = () => {
+ const selected = this.props.banners.find(
+ banner => banner.id === this.state.selectedBanner
+ );
+
+ return selected ? selected : null;
+ };
+
+ getSelectedBannerValue = () => {
+ const selected = this.props.banners.find(
+ banner => banner.id === this.props.node.selectedBanner
+ );
+
+ return selected ? ` - ${selected.name}` : '';
+ };
+
+ render() {
+ return (
+ {
+ this.openDialog();
+ }}
+ onMouseEnter={this.handleNodeMouseEnter}
+ onMouseLeave={this.handleNodeMouseLeave}
+ >
+
+
+
+ {this.props.node.name
+ ? this.props.node.name
+ : `Banner ${this.getSelectedBannerValue()}`}
+
+
+
+
+
+
+
+ );
+ }
+}
+
+function mapStateToProps(state) {
+ return {
+ banners: state.banners.availableBanners
+ };
+}
+
+export default connect(mapStateToProps)(NodeWidget);
diff --git a/src/assets/scenario-builder/components/elements/Banner/PortModel.js b/src/assets/scenario-builder/components/elements/Banner/PortModel.js
new file mode 100755
index 0000000..e9526a8
--- /dev/null
+++ b/src/assets/scenario-builder/components/elements/Banner/PortModel.js
@@ -0,0 +1,7 @@
+import { LeftRightPort } from '../Ports';
+
+export class PortModel extends LeftRightPort {
+ constructor(position = 'left') {
+ super(position, 'banner');
+ }
+}
diff --git a/src/assets/scenario-builder/components/elements/Banner/index.js b/src/assets/scenario-builder/components/elements/Banner/index.js
new file mode 100755
index 0000000..af068d7
--- /dev/null
+++ b/src/assets/scenario-builder/components/elements/Banner/index.js
@@ -0,0 +1,9 @@
+import { NodeModel } from "./NodeModel";
+import { NodeFactory } from "./NodeFactory";
+import { PortModel } from "./PortModel";
+
+export {
+ NodeModel,
+ NodeFactory,
+ PortModel
+};
diff --git a/src/assets/scenario-builder/components/elements/Banner/sass/style.scss b/src/assets/scenario-builder/components/elements/Banner/sass/style.scss
new file mode 100644
index 0000000..b6ccd50
--- /dev/null
+++ b/src/assets/scenario-builder/components/elements/Banner/sass/style.scss
@@ -0,0 +1,30 @@
+$nodeColor: $violet;
+
+.srd-node--selected {
+ .square-node.banner-node .node-container {
+ box-shadow: 0 0 10px $nodeColor;
+ }
+}
+
+.banner-node {
+ .node-container {
+ border: solid 2px $nodeColor;
+ color: $nodeColor;
+ }
+
+ &__title {
+ color: $nodeColor;
+ }
+
+ &__left,
+ &__right {
+ .port {
+ box-shadow: 0 0 10px $nodeColor;
+
+ &:hover,
+ &.selected {
+ background: $nodeColor;
+ }
+ }
+ }
+}
diff --git a/src/assets/scenario-builder/components/elements/BeforeTrigger/NodeFactory.js b/src/assets/scenario-builder/components/elements/BeforeTrigger/NodeFactory.js
new file mode 100755
index 0000000..2ec72b1
--- /dev/null
+++ b/src/assets/scenario-builder/components/elements/BeforeTrigger/NodeFactory.js
@@ -0,0 +1,26 @@
+import * as React from 'react';
+import { AbstractNodeFactory } from '@projectstorm/react-diagrams';
+
+import NodeWidget from './NodeWidget';
+import { NodeModel } from './NodeModel';
+
+export class NodeFactory extends AbstractNodeFactory {
+ constructor() {
+ super('before_trigger');
+ }
+
+ generateReactWidget(diagramEngine, node) {
+ return (
+
+ );
+ }
+
+ getNewInstance() {
+ return new NodeModel();
+ }
+}
diff --git a/src/assets/scenario-builder/components/elements/BeforeTrigger/NodeModel.js b/src/assets/scenario-builder/components/elements/BeforeTrigger/NodeModel.js
new file mode 100755
index 0000000..009499f
--- /dev/null
+++ b/src/assets/scenario-builder/components/elements/BeforeTrigger/NodeModel.js
@@ -0,0 +1,33 @@
+import * as _ from 'lodash';
+import { NodeModel as BaseNodeModel } from '@projectstorm/react-diagrams';
+import { PortModel } from './PortModel';
+
+export class NodeModel extends BaseNodeModel {
+ constructor(element) {
+ super('before_trigger', element.id);
+
+ this.name = element.name;
+ this.selectedTrigger = element.selectedTrigger;
+ this.time = element.time !== undefined ? element.time : 10;
+ this.timeUnit = element.timeUnit !== undefined ? element.timeUnit : 'hours';
+
+ this.addPort(new PortModel('right'));
+ }
+
+ deSerialize(ob, engine) {
+ super.deSerialize(ob, engine);
+ this.name = ob.name;
+ this.selectedTrigger = ob.selectedTrigger;
+ this.time = ob.time;
+ this.timeUnit = ob.timeUnit;
+ }
+
+ serialize() {
+ return _.merge(super.serialize(), {
+ name: this.name,
+ selectedTrigger: this.selectedTrigger,
+ time: this.time,
+ timeUnit: this.timeUnit
+ });
+ }
+}
diff --git a/src/assets/scenario-builder/components/elements/BeforeTrigger/NodeWidget.js b/src/assets/scenario-builder/components/elements/BeforeTrigger/NodeWidget.js
new file mode 100755
index 0000000..7e6f74d
--- /dev/null
+++ b/src/assets/scenario-builder/components/elements/BeforeTrigger/NodeWidget.js
@@ -0,0 +1,271 @@
+import * as React from 'react';
+import { connect } from 'react-redux';
+import NotificationsActiveIcon from '@material-ui/icons/NotificationsActive';
+import Grid from '@material-ui/core/Grid';
+import TextField from '@material-ui/core/TextField';
+import Button from '@material-ui/core/Button';
+import Dialog from '@material-ui/core/Dialog';
+import DialogActions from '@material-ui/core/DialogActions';
+import DialogContent from '@material-ui/core/DialogContent';
+import DialogContentText from '@material-ui/core/DialogContentText';
+import DialogTitle from '@material-ui/core/DialogTitle';
+import { PortWidget } from '../../widgets/PortWidget';
+import Autocomplete from '@material-ui/lab/Autocomplete';
+import StatisticsTooltip from '../../StatisticTooltip';
+import { setCanvasZoomingAndPanning } from '../../../actions';
+import FormControl from "@material-ui/core/FormControl";
+import InputLabel from "@material-ui/core/InputLabel";
+import Select from "@material-ui/core/Select";
+import MenuItem from "@material-ui/core/MenuItem";
+import StatisticBadge from "../../StatisticBadge";
+
+class NodeWidget extends React.Component {
+ constructor(props) {
+ super(props);
+
+ this.state = {
+ nodeFormName: this.props.node.name,
+ selectedTrigger: this.props.node.selectedTrigger,
+ nodeFormBeforeTime: this.props.node.time,
+ timeUnit: this.props.node.timeUnit,
+ dialogOpened: false,
+ anchorElementForTooltip: null
+ };
+ }
+
+ bem(selector) {
+ return (
+ this.props.classBaseName +
+ selector +
+ ' ' +
+ this.props.className +
+ selector +
+ ' '
+ );
+ }
+
+ getClassName() {
+ return this.props.classBaseName + ' ' + this.props.className;
+ }
+
+ openDialog = () => {
+ this.setState({
+ dialogOpened: true,
+ nodeFormName: this.props.node.name,
+ nodeFormBeforeTime: this.props.node.time,
+ timeUnit: this.props.node.timeUnit,
+ anchorElementForTooltip: null
+ });
+ this.props.dispatch(setCanvasZoomingAndPanning(false));
+ };
+
+ closeDialog = () => {
+ this.setState({ dialogOpened: false });
+ this.props.dispatch(setCanvasZoomingAndPanning(true));
+ };
+
+ handleNodeMouseEnter = event => {
+ if (!this.state.dialogOpened) {
+ this.setState({ anchorElementForTooltip: event.currentTarget });
+ }
+ };
+
+ handleNodeMouseLeave = () => {
+ this.setState({ anchorElementForTooltip: null });
+ };
+
+ getTriggersInSelectableFormat = () => {
+ return this.props.beforeTriggers.map(trigger => {
+ return {
+ value: trigger.code,
+ label: trigger.name
+ };
+ });
+ };
+
+ getSelectedTriggerValue = () => {
+ const selected = this.getTriggersInSelectableFormat().find(
+ trigger => trigger.value === this.props.node.selectedTrigger
+ );
+
+ return selected ? `${this.props.node.time} ${this.props.node.timeUnit} before - ${selected.label} event` : 'Before Event';
+ };
+
+ render() {
+ return (
+ {
+ this.openDialog();
+ }}
+ onMouseEnter={this.handleNodeMouseEnter}
+ onMouseLeave={this.handleNodeMouseLeave}
+ >
+
+
+
+
+ {this.props.node.name
+ ? this.props.node.name
+ : this.getSelectedTriggerValue()}
+
+
+
+
+
+
+
+ );
+ }
+}
+
+function mapStateToProps(state) {
+ const { beforeTriggers } = state;
+
+ return {
+ beforeTriggers: beforeTriggers.availableBeforeTriggers
+ };
+}
+
+export default connect(mapStateToProps)(NodeWidget);
diff --git a/src/assets/scenario-builder/components/elements/BeforeTrigger/PortModel.js b/src/assets/scenario-builder/components/elements/BeforeTrigger/PortModel.js
new file mode 100755
index 0000000..23d7f82
--- /dev/null
+++ b/src/assets/scenario-builder/components/elements/BeforeTrigger/PortModel.js
@@ -0,0 +1,7 @@
+import { LeftRightPort } from '../Ports';
+
+export class PortModel extends LeftRightPort {
+ constructor(position = 'left') {
+ super(position, 'trigger_before');
+ }
+}
diff --git a/src/assets/scenario-builder/components/elements/BeforeTrigger/index.js b/src/assets/scenario-builder/components/elements/BeforeTrigger/index.js
new file mode 100755
index 0000000..af068d7
--- /dev/null
+++ b/src/assets/scenario-builder/components/elements/BeforeTrigger/index.js
@@ -0,0 +1,9 @@
+import { NodeModel } from "./NodeModel";
+import { NodeFactory } from "./NodeFactory";
+import { PortModel } from "./PortModel";
+
+export {
+ NodeModel,
+ NodeFactory,
+ PortModel
+};
diff --git a/src/assets/scenario-builder/components/elements/BeforeTrigger/sass/style.scss b/src/assets/scenario-builder/components/elements/BeforeTrigger/sass/style.scss
new file mode 100644
index 0000000..575ecfb
--- /dev/null
+++ b/src/assets/scenario-builder/components/elements/BeforeTrigger/sass/style.scss
@@ -0,0 +1,30 @@
+$nodeColor: $teal;
+
+.srd-node--selected {
+ .square-node.before-trigger-node .node-container {
+ box-shadow: 0 0 10px $nodeColor;
+ }
+}
+
+.before-trigger-node {
+ .node-container {
+ border: solid 2px $nodeColor;
+ color: $nodeColor;
+ }
+
+ &__title {
+ color: $nodeColor;
+ }
+
+ &__left,
+ &__right {
+ .port {
+ box-shadow: 0 0 10px $nodeColor;
+
+ &:hover,
+ &.selected {
+ background: $nodeColor;
+ }
+ }
+ }
+}
diff --git a/src/assets/scenario-builder/components/elements/Condition/CriteriaBuilder.js b/src/assets/scenario-builder/components/elements/Condition/CriteriaBuilder.js
new file mode 100755
index 0000000..8530e32
--- /dev/null
+++ b/src/assets/scenario-builder/components/elements/Condition/CriteriaBuilder.js
@@ -0,0 +1,223 @@
+import React, { useImperativeHandle, useReducer, useContext, forwardRef } from 'react';
+import { useSelector } from 'react-redux';
+import Button from '@material-ui/core/Button';
+import Grid from '@material-ui/core/Grid';
+import ButtonGroup from '@material-ui/core/ButtonGroup';
+import DeleteIcon from '@material-ui/icons/Delete';
+import AddIcon from '@material-ui/icons/AddCircleOutline';
+import { Card, CardContent, FormControl, InputLabel, Select, MenuItem, IconButton } from '@material-ui/core';
+import { makeStyles } from '@material-ui/core/styles';
+import StringLabeledArrayParam from '../params/StringLabeledArrayParam';
+import BooleanParam from '../params/BooleanParam';
+import NumberParam from '../params/NumberParam';
+import TimeframeParam from '../params/TimeframeParam';
+import { emptyNode, reducer, actionSetEvent, actionSetKeyForNode, actionAddCriterion, actionDeleteNode } from './criteriaReducer';
+
+const BuilderDispatch = React.createContext(null);
+
+////////////////////
+// CriterionParam
+////////////////////
+
+// Props - node, blueprint
+function CriterionParam(props) {
+ const dispatch = useContext(BuilderDispatch);
+
+ let param = props.node.params.filter(param => param.key === props.blueprint.key)[0];
+ // input name identifying both criterion (using artifically generated ID) and its param (using param's key)
+ let name = [props.node.id, param.key];
+
+ switch (props.blueprint.type) {
+ case 'string_labeled_array':
+ return ();
+ case 'boolean':
+ return ();
+ case 'number':
+ return ();
+ case 'timeframe':
+ return ();
+ default:
+ throw new Error("unsupported node type " + props.blueprint.type);
+ }
+}
+
+// Props - node, blueprint
+function CriterionParams(props) {
+ return (
+ <>
+ {props.blueprint.map(paramBlueprint => (
+ // key is required by React here (not used in CriterionParam)
+
+ ))}
+ >
+ )
+}
+
+////////////////////
+// CriteriaForm
+////////////////////
+
+const useCriteriaFormStyles = makeStyles({
+ cardContent: {
+ display: 'flex',
+ justifyContent: 'space-between',
+ alignItems: 'flex-end',
+ backgroundColor: '#F2F2F2',
+ },
+ formControl: {
+ minWidth: '180px',
+ },
+});
+
+
+// Props - node, criteriaBlueprint
+function CriteriaForm(props) {
+ const classes = useCriteriaFormStyles();
+ const dispatch = useContext(BuilderDispatch);
+
+ return (
+
+
+
+ Criterion
+
+
+ dispatch(actionDeleteNode(props.node.id))}
+ size="small"
+ className={classes.icon}
+ aria-label="delete">
+
+
+
+
+ { props.node.key &&
+
+ cr.key === props.node.key)[0].params}>
+
+
+ }
+
+ );
+}
+
+////////////////////
+// CriteriaTable
+////////////////////
+
+const useCriteriaTableStyles = makeStyles({
+ andContainer: {
+ display: 'flex',
+ justifyContent: 'center',
+ flexGrow: 0,
+ maxWidth: '100%',
+ flexBasis: '100%'
+ }
+});
+
+// Props - criteriaBlueprint, nodes
+function CriteriaTable(props) {
+ const classes = useCriteriaTableStyles();
+ const dispatch = useContext(BuilderDispatch);
+
+ return (
+ <>
+ {props.nodes.map((node, index) => (
+
+ { index >= 1 &&
+ AND
+ }
+
+
+
+
+
+ ))}
+
+
+
+
+ >
+ )
+}
+
+////////////////////
+// CriteriaBuilder
+////////////////////
+
+const useCriteriaBuilderStyles = makeStyles({
+ selectedButton: {
+ backgroundColor: "#E4E4E4"
+ },
+ deselectedButton: {
+ color: "#A6A6A6"
+ }
+});
+
+function CriteriaBuilder(props, ref) {
+ const classes = useCriteriaBuilderStyles();
+ const criteria = useSelector(state => state.criteria.criteria);
+
+ const [state, dispatch] = useReducer(reducer, {
+ version: 1,
+ event: criteria[0].event,
+ nodes: [emptyNode()] // by default, one empty node
+ , ...props.conditions});
+
+ // expose state to outer node
+ useImperativeHandle(ref, () => ({
+ state: state
+ }));
+
+ return (
+
+
+
+
+ {criteria.map(criteriaBlueprint => (
+
+ ))}
+
+
+
+ {criteria.filter(cb => cb.event === state.event).map(criteriaBlueprint => (
+
+ )
+ )}
+
+
+ )
+}
+
+// forwardRef is here used to access local state from parent node
+export default forwardRef(CriteriaBuilder)
diff --git a/src/assets/scenario-builder/components/elements/Condition/NodeFactory.js b/src/assets/scenario-builder/components/elements/Condition/NodeFactory.js
new file mode 100755
index 0000000..8d7d7aa
--- /dev/null
+++ b/src/assets/scenario-builder/components/elements/Condition/NodeFactory.js
@@ -0,0 +1,26 @@
+import * as React from 'react';
+import { AbstractNodeFactory } from '@projectstorm/react-diagrams';
+
+import NodeWidget from './NodeWidget';
+import { NodeModel } from './NodeModel';
+
+export class NodeFactory extends AbstractNodeFactory {
+ constructor() {
+ super('condition');
+ }
+
+ generateReactWidget(diagramEngine, node) {
+ return (
+
+ );
+ }
+
+ getNewInstance() {
+ return new NodeModel();
+ }
+}
diff --git a/src/assets/scenario-builder/components/elements/Condition/NodeModel.js b/src/assets/scenario-builder/components/elements/Condition/NodeModel.js
new file mode 100755
index 0000000..2361c79
--- /dev/null
+++ b/src/assets/scenario-builder/components/elements/Condition/NodeModel.js
@@ -0,0 +1,29 @@
+import { NodeModel as BaseNodeModel } from '@projectstorm/react-diagrams';
+import * as _ from 'lodash';
+import { PortModel } from './PortModel';
+
+export class NodeModel extends BaseNodeModel {
+ constructor(element) {
+ super('condition', element.id);
+
+ this.name = element.name;
+ this.conditions = element.conditions;
+
+ this.addPort(new PortModel('left'));
+ this.addPort(new PortModel('bottom'));
+ this.addPort(new PortModel('right'));
+ }
+
+ deSerialize(ob, engine) {
+ super.deSerialize(ob, engine);
+ this.name = ob.name;
+ this.conditions = ob.conditions;
+ }
+
+ serialize() {
+ return _.merge(super.serialize(), {
+ name: this.name,
+ conditions: this.conditions,
+ });
+ }
+}
diff --git a/src/assets/scenario-builder/components/elements/Condition/NodeWidget.js b/src/assets/scenario-builder/components/elements/Condition/NodeWidget.js
new file mode 100755
index 0000000..0108e26
--- /dev/null
+++ b/src/assets/scenario-builder/components/elements/Condition/NodeWidget.js
@@ -0,0 +1,210 @@
+import * as React from 'react';
+import { connect } from 'react-redux';
+import ConditionIcon from '@material-ui/icons/CallSplit';
+import OkIcon from '@material-ui/icons/Check';
+import Grid from '@material-ui/core/Grid';
+import NopeIcon from '@material-ui/icons/Close';
+import TextField from '@material-ui/core/TextField';
+import Button from '@material-ui/core/Button';
+import Dialog from '@material-ui/core/Dialog';
+import DialogActions from '@material-ui/core/DialogActions';
+import DialogContent from '@material-ui/core/DialogContent';
+import DialogTitle from '@material-ui/core/DialogTitle';
+import CriteriaBuilder from './CriteriaBuilder';
+import { PortWidget } from '../../widgets/PortWidget';
+import { setCanvasZoomingAndPanning } from '../../../actions';
+import StatisticBadge from "../../StatisticBadge";
+import StatisticsTooltip from "../../StatisticTooltip";
+
+class NodeWidget extends React.Component {
+ constructor(props) {
+ super(props);
+
+ // Use it to access CriteriaBuilder state
+ this.builderRef = React.createRef();
+
+ this.state = {
+ nodeFormName: this.props.node.name,
+ dialogOpened: false,
+ anchorElementForTooltip: null
+ };
+ }
+
+ bem(selector) {
+ return (
+ this.props.classBaseName +
+ selector +
+ ' ' +
+ this.props.className +
+ selector +
+ ' '
+ );
+ }
+
+ getClassName() {
+ return this.props.classBaseName + ' ' + this.props.className;
+ }
+
+ openDialog = () => {
+ this.setState({
+ dialogOpened: true,
+ nodeFormName: this.props.node.name,
+ anchorElementForTooltip: null
+ });
+ this.props.dispatch(setCanvasZoomingAndPanning(false));
+ };
+
+ closeDialog = () => {
+ this.setState({ dialogOpened: false });
+ this.props.dispatch(setCanvasZoomingAndPanning(true));
+ };
+
+ handleNodeMouseEnter = event => {
+ if (!this.state.dialogOpened) {
+ this.setState({ anchorElementForTooltip: event.currentTarget });
+ }
+ };
+
+ handleNodeMouseLeave = () => {
+ this.setState({ anchorElementForTooltip: null });
+ };
+
+
+ render() {
+ let displayStatisticBadge = false;
+ if (this.props.statistics.length === 0 || this.props.statistics[this.props.node.id]) {
+ displayStatisticBadge = true;
+ }
+ return (
+ {
+ this.openDialog();
+ }}
+ onMouseEnter={this.handleNodeMouseEnter}
+ onMouseLeave={this.handleNodeMouseLeave}
+ >
+
+
+ {this.props.node.name
+ ? this.props.node.name
+ : 'Condition'}
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {displayStatisticBadge ?
+
:
+
+ }
+
+
+
+
+ {displayStatisticBadge ?
+
:
+
+ }
+
+
+
+
+
+
+
+
+ );
+ }
+}
+
+function mapStateToProps(state) {
+ const { dispatch } = state;
+ return {
+ dispatch,
+ statistics: state.statistics.statistics
+ };
+}
+
+export default connect(mapStateToProps)(NodeWidget);
\ No newline at end of file
diff --git a/src/assets/scenario-builder/components/elements/Condition/PortModel.js b/src/assets/scenario-builder/components/elements/Condition/PortModel.js
new file mode 100755
index 0000000..67656db
--- /dev/null
+++ b/src/assets/scenario-builder/components/elements/Condition/PortModel.js
@@ -0,0 +1,7 @@
+import { LeftRightBottomPort } from './../Ports';
+
+export class PortModel extends LeftRightBottomPort {
+ constructor(position = 'top') {
+ super(position, 'condition');
+ }
+}
diff --git a/src/assets/scenario-builder/components/elements/Condition/criteriaReducer.js b/src/assets/scenario-builder/components/elements/Condition/criteriaReducer.js
new file mode 100644
index 0000000..42e6a52
--- /dev/null
+++ b/src/assets/scenario-builder/components/elements/Condition/criteriaReducer.js
@@ -0,0 +1,122 @@
+import uuidv4 from 'uuid/v4';
+
+///////////////////////////
+// local reducer and state for criteria builder
+///////////////////////////
+
+export function emptyNode() {
+ return {
+ id: uuidv4(),
+ key: '',
+ params: [],
+ };
+}
+
+export function actionSetKeyForNode(nodeId, criterionKey, criterionParams) {
+ return {
+ type: 'SET_KEY_FOR_NODE',
+ payload: {
+ key: criterionKey,
+ nodeId: nodeId,
+ // Criterion params are associated with key,
+ // but since we do not have access to blueprint here, request criterionParams as additional parameter
+ params: criterionParams
+ }
+ };
+}
+
+export function actionDeleteNode(nodeId) {
+ return {
+ type: 'DELETE_NODE',
+ payload: {
+ nodeId: nodeId,
+ }
+ };
+}
+
+export function actionAddCriterion() {
+ return {
+ type: 'ADD_CRITERION'
+ };
+}
+
+export function actionSetEvent(event) {
+ return {
+ type: 'SET_EVENT',
+ payload: event
+ };
+}
+
+export function reducer(state, action) {
+ switch (action.type) {
+ // params actions
+ case 'UPDATE_PARAM_VALUES': {
+ let [nodeId, paramKey] = action.payload.name;
+ return {
+ ...state, nodes: state.nodes.map(node => {
+ if (node.id === nodeId) {
+ return {
+ ...node, params: node.params.map(param => {
+ if (param.key === paramKey) {
+ return {...param, values: Object.assign(param.values, action.payload.values)};
+ }
+ return param;
+ })
+ };
+ }
+ return node;
+ })
+ };
+ }
+ case 'SET_PARAM_VALUES': {
+ let [nodeId, paramKey] = action.payload.name;
+ return {
+ ...state, nodes: state.nodes.map(node => {
+ if (node.id === nodeId) {
+ return {
+ ...node, params: node.params.map(param => {
+ if (param.key === paramKey) {
+ return {...param, values: action.payload.values};
+ }
+ return param;
+ })
+ };
+ }
+ return node;
+ })
+ };
+ }
+
+ // internal criteriaReducer actions
+ case 'SET_EVENT':
+ // this also resets nodes state
+ return {
+ ...state, nodes: [emptyNode()], event: action.payload
+ };
+ case 'ADD_CRITERION':
+ return {
+ ...state, nodes: [...state.nodes, emptyNode()]
+ };
+ case 'DELETE_NODE':
+ return {
+ ...state, nodes: state.nodes.filter(n => n.id !== action.payload.nodeId)
+ };
+ case 'SET_KEY_FOR_NODE': {
+ let newNodes = state.nodes.map(node => {
+ if (action.payload.nodeId === node.id) return {
+ id: node.id,
+ key: action.payload.key,
+ // TODO: load params from blueprint without needing them in a payload (since they are associated with a criteria key)
+ params: action.payload.params,
+ };
+ return node;
+ });
+ return {
+ ...state, nodes: newNodes
+ };
+ }
+
+ default:
+ throw new Error("unsupported action type " + action.type);
+ }
+}
diff --git a/src/assets/scenario-builder/components/elements/Condition/index.js b/src/assets/scenario-builder/components/elements/Condition/index.js
new file mode 100755
index 0000000..af068d7
--- /dev/null
+++ b/src/assets/scenario-builder/components/elements/Condition/index.js
@@ -0,0 +1,9 @@
+import { NodeModel } from "./NodeModel";
+import { NodeFactory } from "./NodeFactory";
+import { PortModel } from "./PortModel";
+
+export {
+ NodeModel,
+ NodeFactory,
+ PortModel
+};
diff --git a/src/assets/scenario-builder/components/elements/Condition/sass/style.scss b/src/assets/scenario-builder/components/elements/Condition/sass/style.scss
new file mode 100644
index 0000000..0f9b40a
--- /dev/null
+++ b/src/assets/scenario-builder/components/elements/Condition/sass/style.scss
@@ -0,0 +1,31 @@
+$nodeColor: $orange;
+
+.srd-node--selected {
+ .diamond-node.condition-node .node-container {
+ box-shadow: 0 0 10px $nodeColor;
+ }
+}
+
+.condition-node {
+ .node-container {
+ border: solid 2px $nodeColor;
+ color: $nodeColor;
+ }
+
+ &__title {
+ color: $nodeColor;
+ }
+
+ &__left,
+ &__right,
+ &__bottom {
+ .port {
+ box-shadow: 0 0 10px $nodeColor;
+
+ &:hover,
+ &.selected {
+ background: $nodeColor;
+ }
+ }
+ }
+}
diff --git a/src/assets/scenario-builder/components/elements/Email/NodeFactory.js b/src/assets/scenario-builder/components/elements/Email/NodeFactory.js
new file mode 100755
index 0000000..e0c9d71
--- /dev/null
+++ b/src/assets/scenario-builder/components/elements/Email/NodeFactory.js
@@ -0,0 +1,26 @@
+import * as React from 'react';
+import { AbstractNodeFactory } from '@projectstorm/react-diagrams';
+
+import NodeWidget from './NodeWidget';
+import { NodeModel } from './NodeModel';
+
+export class NodeFactory extends AbstractNodeFactory {
+ constructor() {
+ super('email');
+ }
+
+ generateReactWidget(diagramEngine, node) {
+ return (
+
+ );
+ }
+
+ getNewInstance() {
+ return new NodeModel();
+ }
+}
diff --git a/src/assets/scenario-builder/components/elements/Email/NodeModel.js b/src/assets/scenario-builder/components/elements/Email/NodeModel.js
new file mode 100755
index 0000000..501c9a0
--- /dev/null
+++ b/src/assets/scenario-builder/components/elements/Email/NodeModel.js
@@ -0,0 +1,27 @@
+import { NodeModel as BaseNodeModel } from '@projectstorm/react-diagrams';
+import * as _ from 'lodash';
+import { PortModel } from './PortModel';
+
+export class NodeModel extends BaseNodeModel {
+ constructor(element) {
+ super('email', element.id);
+
+ this.name = element.name;
+ this.selectedMail = element.selectedMail;
+ this.addPort(new PortModel('left'));
+ this.addPort(new PortModel('right'));
+ }
+
+ deSerialize(ob, engine) {
+ super.deSerialize(ob, engine);
+ this.name = ob.name;
+ this.selectedMail = ob.selectedMail;
+ }
+
+ serialize() {
+ return _.merge(super.serialize(), {
+ name: this.name,
+ selectedMail: this.selectedMail,
+ });
+ }
+}
diff --git a/src/assets/scenario-builder/components/elements/Email/NodeWidget.js b/src/assets/scenario-builder/components/elements/Email/NodeWidget.js
new file mode 100755
index 0000000..dbb0fb1
--- /dev/null
+++ b/src/assets/scenario-builder/components/elements/Email/NodeWidget.js
@@ -0,0 +1,263 @@
+import * as React from 'react';
+import { connect } from 'react-redux';
+import ActionIcon from '@material-ui/icons/Mail';
+import Grid from '@material-ui/core/Grid';
+import TextField from '@material-ui/core/TextField';
+import Button from '@material-ui/core/Button';
+import Dialog from '@material-ui/core/Dialog';
+import DialogActions from '@material-ui/core/DialogActions';
+import DialogContent from '@material-ui/core/DialogContent';
+import DialogContentText from '@material-ui/core/DialogContentText';
+import DialogTitle from '@material-ui/core/DialogTitle';
+import {styled} from '@material-ui/core/styles';
+import { PortWidget } from '../../widgets/PortWidget';
+import { setCanvasZoomingAndPanning } from '../../../actions';
+import StatisticBadge from "../../StatisticBadge";
+import StatisticsTooltip from "../../StatisticTooltip";
+import {Autocomplete} from "@material-ui/lab";
+import {withStyles} from "@material-ui/core";
+import {createFilterOptions} from "@material-ui/lab/Autocomplete";
+
+const PreviewEmailButton = styled(Button)({
+ marginRight: 'auto'
+});
+
+const styles = theme => ({
+ autocomplete: {
+ margin: theme.spacing(1)
+ },
+ subtitle: {
+ paddingLeft: '6px',
+ color: theme.palette.grey[600]
+ },
+});
+
+class NodeWidget extends React.Component {
+ constructor(props) {
+ super(props);
+ this.state = {
+ nodeFormName: this.props.node.name,
+ selectedMail: this.props.node.selectedMail,
+ dialogOpened: false,
+ anchorElementForTooltip: null
+ };
+ }
+
+ bem(selector) {
+ return (
+ this.props.classBaseName +
+ selector +
+ ' ' +
+ this.props.className +
+ selector +
+ ' '
+ );
+ }
+
+ getClassName() {
+ return this.props.classBaseName + ' ' + this.props.className;
+ }
+
+ openDialog = () => {
+ this.setState({
+ dialogOpened: true,
+ nodeFormName: this.props.node.name,
+ selectedMail: this.props.node.selectedMail,
+ anchorElementForTooltip: null
+ });
+ this.props.dispatch(setCanvasZoomingAndPanning(false));
+ };
+
+ closeDialog = () => {
+ this.setState({ dialogOpened: false });
+ this.props.dispatch(setCanvasZoomingAndPanning(true));
+ };
+
+ handleNodeMouseEnter = event => {
+ if (!this.state.dialogOpened) {
+ this.setState({ anchorElementForTooltip: event.currentTarget });
+ }
+ };
+
+ handleNodeMouseLeave = () => {
+ this.setState({ anchorElementForTooltip: null });
+ };
+
+ getSelectedMail = () => {
+ const selected = this.props.mails.find(
+ mail => mail.code === this.state.selectedMail
+ );
+
+ return selected ? selected : null;
+ };
+
+ getSelectedMailValue = () => {
+ const selected = this.props.mails.find(
+ mail => mail.code === this.props.node.selectedMail
+ );
+
+ return selected ? ` - ${selected.name}` : '';
+ };
+
+ filterOptions = () => createFilterOptions({
+ matchFrom: 'any',
+ trim: true,
+ ignoreAccents: true,
+ ignoreCase: true,
+ stringify: option => {
+ return option.name + " " + option.code;
+ },
+ });
+
+ render() {
+ const {classes} = this.props;
+
+ return (
+ {
+ this.openDialog();
+ }}
+ onMouseEnter={this.handleNodeMouseEnter}
+ onMouseLeave={this.handleNodeMouseLeave}
+ >
+
+
+
+ {this.props.node.name
+ ? this.props.node.name
+ : `Mail ${this.getSelectedMailValue()}`}
+
+
+
+
+
+
+
+ );
+ }
+}
+
+function mapStateToProps(state) {
+ return {
+ mails: state.mails.availableMails
+ };
+}
+
+export default connect(mapStateToProps)(
+ withStyles(styles)(NodeWidget)
+);
diff --git a/src/assets/scenario-builder/components/elements/Email/PortModel.js b/src/assets/scenario-builder/components/elements/Email/PortModel.js
new file mode 100755
index 0000000..39b38ec
--- /dev/null
+++ b/src/assets/scenario-builder/components/elements/Email/PortModel.js
@@ -0,0 +1,7 @@
+import { LeftRightPort } from '../Ports';
+
+export class PortModel extends LeftRightPort {
+ constructor(position = 'left') {
+ super(position, 'email');
+ }
+}
diff --git a/src/assets/scenario-builder/components/elements/Email/index.js b/src/assets/scenario-builder/components/elements/Email/index.js
new file mode 100755
index 0000000..af068d7
--- /dev/null
+++ b/src/assets/scenario-builder/components/elements/Email/index.js
@@ -0,0 +1,9 @@
+import { NodeModel } from "./NodeModel";
+import { NodeFactory } from "./NodeFactory";
+import { PortModel } from "./PortModel";
+
+export {
+ NodeModel,
+ NodeFactory,
+ PortModel
+};
diff --git a/src/assets/scenario-builder/components/elements/Email/sass/style.scss b/src/assets/scenario-builder/components/elements/Email/sass/style.scss
new file mode 100644
index 0000000..f18f6d6
--- /dev/null
+++ b/src/assets/scenario-builder/components/elements/Email/sass/style.scss
@@ -0,0 +1,30 @@
+$nodeColor: $lightViolet;
+
+.srd-node--selected {
+ .square-node.email-node .node-container {
+ box-shadow: 0 0 10px $nodeColor;
+ }
+}
+
+.email-node {
+ .node-container {
+ border: solid 2px $nodeColor;
+ color: $nodeColor;
+ }
+
+ &__title {
+ color: $nodeColor;
+ }
+
+ &__left,
+ &__right {
+ .port {
+ box-shadow: 0 0 10px $nodeColor;
+
+ &:hover,
+ &.selected {
+ background: $nodeColor;
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/assets/scenario-builder/components/elements/Generic/NodeFactory.js b/src/assets/scenario-builder/components/elements/Generic/NodeFactory.js
new file mode 100644
index 0000000..a59609b
--- /dev/null
+++ b/src/assets/scenario-builder/components/elements/Generic/NodeFactory.js
@@ -0,0 +1,26 @@
+import * as React from 'react';
+import { AbstractNodeFactory } from '@projectstorm/react-diagrams';
+
+import NodeWidget from './NodeWidget';
+import { NodeModel } from './NodeModel';
+
+export class NodeFactory extends AbstractNodeFactory {
+ constructor() {
+ super('generic');
+ }
+
+ generateReactWidget(diagramEngine, node) {
+ return (
+
+ )
+ }
+
+ getNewInstance() {
+ return new NodeModel();
+ }
+}
\ No newline at end of file
diff --git a/src/assets/scenario-builder/components/elements/Generic/NodeModel.js b/src/assets/scenario-builder/components/elements/Generic/NodeModel.js
new file mode 100644
index 0000000..a53b809
--- /dev/null
+++ b/src/assets/scenario-builder/components/elements/Generic/NodeModel.js
@@ -0,0 +1,30 @@
+import { NodeModel as BaseNodeModel } from '@projectstorm/react-diagrams';
+import * as _ from 'lodash';
+import { PortModel } from './PortModel';
+
+export class NodeModel extends BaseNodeModel {
+ constructor(element) {
+ super('generic', element.id);
+
+ this.name = element.name;
+ this.selectedGeneric = element.selectedGeneric;
+ this.options = element.options;
+ this.addPort(new PortModel('left'));
+ this.addPort(new PortModel('right'));
+ }
+
+ deSerialize(ob, engine) {
+ super.deSerialize(ob, engine);
+ this.name = ob.name;
+ this.selectedGeneric = ob.selectedGeneric;
+ this.options = ob.options;
+ }
+
+ serialize() {
+ return _.merge(super.serialize(), {
+ name: this.name,
+ selectedGeneric: this.selectedGeneric,
+ options: this.options,
+ });
+ }
+}
diff --git a/src/assets/scenario-builder/components/elements/Generic/NodeWidget.js b/src/assets/scenario-builder/components/elements/Generic/NodeWidget.js
new file mode 100644
index 0000000..d25937a
--- /dev/null
+++ b/src/assets/scenario-builder/components/elements/Generic/NodeWidget.js
@@ -0,0 +1,303 @@
+import * as React from 'react';
+import * as _ from 'lodash';
+import PropTypes from 'prop-types';
+import { connect } from 'react-redux';
+import ActionIcon from '@material-ui/icons/Extension';
+import Grid from '@material-ui/core/Grid';
+import TextField from '@material-ui/core/TextField';
+import Button from '@material-ui/core/Button';
+import Dialog from '@material-ui/core/Dialog';
+import DialogActions from '@material-ui/core/DialogActions';
+import DialogContent from '@material-ui/core/DialogContent';
+import DialogContentText from '@material-ui/core/DialogContentText';
+import DialogTitle from '@material-ui/core/DialogTitle';
+
+import { PortWidget } from "../../widgets/PortWidget";
+import StatisticsTooltip from '../../StatisticTooltip';
+import Autocomplete from '@material-ui/lab/Autocomplete';
+import { setCanvasZoomingAndPanning } from "../../../actions";
+import { withStyles } from '@material-ui/core/styles';
+import { createFilterOptions } from '@material-ui/lab/Autocomplete';
+import OptionsForm from "./OptionsForm";
+import StatisticBadge from "../../StatisticBadge";
+
+const styles = theme => ({
+ autocomplete: {
+ margin: theme.spacing(1)
+ },
+ subtitle: {
+ paddingLeft: '6px',
+ color: theme.palette.grey[600]
+ },
+});
+
+const filterOptions = createFilterOptions({
+ matchFrom: 'any',
+ trim: true,
+ ignoreAccents: true,
+ ignoreCase: true,
+ stringify: option => {
+ return option.label + " " + option.value;
+ },
+});
+
+class NodeWidget extends React.Component {
+ constructor(props) {
+ super(props);
+
+ // Use it to access CriteriaBuilder state
+ this.optionsFormRef = React.createRef();
+
+ this.state = {
+ nodeFormName: this.props.node.name,
+ selectedGeneric: this.props.node.selectedGeneric,
+ dialogOpened: false,
+ anchorElementForTooltip: null
+ };
+ }
+
+ bem(selector) {
+ return (
+ this.props.classBaseName +
+ selector +
+ ' ' +
+ this.props.className +
+ selector +
+ ' '
+ );
+ }
+
+ getClassName() {
+ return this.props.classBaseName + ' ' + this.props.className;
+ }
+
+ openDialog = () => {
+ this.setState({
+ dialogOpened: true,
+ nodeFormName: this.props.node.name,
+ anchorElementForTooltip: null
+ });
+ this.props.dispatch(setCanvasZoomingAndPanning(false));
+ };
+
+ closeDialog = () => {
+ this.setState({ dialogOpened: false });
+ this.props.dispatch(setCanvasZoomingAndPanning(true));
+ };
+
+ handleNodeMouseEnter = event => {
+ if (!this.state.dialogOpened) {
+ this.setState({ anchorElementForTooltip: event.currentTarget });
+ }
+ };
+
+ handleNodeMouseLeave = () => {
+ this.setState({ anchorElementForTooltip: null });
+ };
+
+ getSelectedGeneric = () => {
+ const match = this.props.generics.find(generic => {
+ return generic.code === this.state.selectedGeneric;
+ });
+
+ return match ? match : null;
+ };
+
+ getSelectedGenericOptionBlueprints = () => {
+ const generic = this.getSelectedGeneric();
+
+ let blueprints = [];
+ if (generic !== null && generic.options !== null) {
+ _.forOwn(generic.options, function(value, key) {
+ blueprints.push({
+ key: key,
+ blueprint: value
+ });
+ });
+ }
+
+ return blueprints;
+ };
+
+ // maybe refactor to more effective way if is a problem
+ transformOptionsForSelect = () => {
+ const generics = [];
+
+ Object.keys(this.props.generics).forEach(key => {
+ generics.push({
+ value: this.props.generics[key].code,
+ label: this.props.generics[key].label
+ });
+ });
+
+ return generics;
+ };
+
+ getSelectedGenericDefaultLabel = () => {
+ const generic = this.getSelectedGeneric();
+ return generic ? ` - ${generic.label}` : '';
+ };
+
+ render() {
+ const { classes } = this.props;
+ return (
+ {
+ this.openDialog();
+ }}
+ onMouseEnter={this.handleNodeMouseEnter}
+ onMouseLeave={this.handleNodeMouseLeave}
+ >
+
+
+
+ {this.props.node.name
+ ? this.props.node.name
+ : `Generic ${this.getSelectedGenericDefaultLabel()}`}
+
+
+
+
+
+
+
+ );
+ }
+}
+
+NodeWidget.propTypes = {
+ classes: PropTypes.object.isRequired,
+};
+
+function mapStateToProps(state) {
+ return {
+ generics: state.generics.generics,
+ };
+}
+
+export default connect(mapStateToProps)(
+ withStyles(styles)(NodeWidget)
+);
diff --git a/src/assets/scenario-builder/components/elements/Generic/OptionsForm.js b/src/assets/scenario-builder/components/elements/Generic/OptionsForm.js
new file mode 100644
index 0000000..7f781f1
--- /dev/null
+++ b/src/assets/scenario-builder/components/elements/Generic/OptionsForm.js
@@ -0,0 +1,97 @@
+import React, {forwardRef, useContext, useImperativeHandle, useReducer} from "react";
+import {createOption, reducer, actionDeleteOption, actionCreateOption} from "./optionsReducer";
+import Card from "@material-ui/core/Card";
+import {CardContent} from "@material-ui/core";
+import {makeStyles} from "@material-ui/core/styles";
+import BooleanParam from "../params/BooleanParam";
+import NumberParam from "../params/NumberParam";
+import StringLabeledArrayParam from "../params/StringLabeledArrayParam";
+
+const OptionsFormDispatch = React.createContext(null);
+
+function Option(props) {
+ const dispatch = useContext(OptionsFormDispatch);
+
+ switch (props.blueprint.type) {
+ case 'boolean':
+ return (
+
+ );
+ case 'number':
+ return (
+
+ );
+ case 'string_labeled_array':
+ return (
+
+ );
+ default:
+ throw new Error("unsupported option type " + props.blueprint.type);
+ }
+}
+
+const useOptionsFormStyles = makeStyles((theme) => ({
+ option: {
+ flex: '0 0 100%',
+ borderBottom: '1px solid #dfdfdf',
+ marginBottom: theme.spacing(2),
+ paddingBottom: theme.spacing(1),
+ "&:last-child": {
+ borderBottom: 'none',
+ marginBottom: 0,
+ paddingBottom: 0
+ }
+ }
+}));
+
+function OptionsForm(props, ref) {
+ const classes = useOptionsFormStyles();
+ const [state, dispatch] = useReducer(reducer, {
+ version: 1,
+ // event: criteria[0].event,
+ options: props.options ?? [] // by default, one empty node
+ });
+
+ // expose state to outer node
+ useImperativeHandle(ref, () => ({
+ state: state
+ }));
+
+ // remove all options which doesnt have blueprint for current generic
+ state.options.forEach(option => {
+ if (props.blueprints.find(blueprint => blueprint.key === option.key) === undefined) {
+ dispatch(actionDeleteOption(option.key));
+ }
+ });
+
+ // create not existing options from blueprints
+ props.blueprints.forEach(blueprint => {
+ if (state.options.find(option => blueprint.key === option.key) === undefined) {
+ dispatch(actionCreateOption(blueprint.key));
+ }
+ });
+
+ return (
+
+
+
+ {props.blueprints.map((blueprint) => {
+ let option = state.options.find(option => option.key === blueprint.key) ?? createOption(blueprint.key, null);
+ return (
+
+
+
+ );
+ })}
+
+
+
+ );
+}
+
+// forwardRef is here used to access local state from parent node
+export default forwardRef(OptionsForm);
diff --git a/src/assets/scenario-builder/components/elements/Generic/PortModel.js b/src/assets/scenario-builder/components/elements/Generic/PortModel.js
new file mode 100644
index 0000000..1420ff8
--- /dev/null
+++ b/src/assets/scenario-builder/components/elements/Generic/PortModel.js
@@ -0,0 +1,7 @@
+import { LeftRightPort } from '../Ports';
+
+export class PortModel extends LeftRightPort {
+ constructor(position = 'left') {
+ super(position, 'generic');
+ }
+}
diff --git a/src/assets/scenario-builder/components/elements/Generic/index.js b/src/assets/scenario-builder/components/elements/Generic/index.js
new file mode 100644
index 0000000..0b3fa31
--- /dev/null
+++ b/src/assets/scenario-builder/components/elements/Generic/index.js
@@ -0,0 +1,9 @@
+import { NodeModel } from "./NodeModel";
+import { NodeFactory } from "./NodeFactory";
+import { PortModel } from "./PortModel";
+
+export {
+ NodeModel,
+ NodeFactory,
+ PortModel
+};
diff --git a/src/assets/scenario-builder/components/elements/Generic/optionsReducer.js b/src/assets/scenario-builder/components/elements/Generic/optionsReducer.js
new file mode 100644
index 0000000..5ce614a
--- /dev/null
+++ b/src/assets/scenario-builder/components/elements/Generic/optionsReducer.js
@@ -0,0 +1,71 @@
+export function createOption(key, values) {
+ return {
+ key: key,
+ values: {
+ selection: values
+ }
+ };
+}
+
+export function actionCreateOption(optionKey, values) {
+ return {
+ type: 'CREATE_OPTION',
+ payload: {
+ values: values,
+ optionKey: optionKey,
+ }
+ };
+}
+
+export function actionDeleteOption(optionKey) {
+ return {
+ type: 'DELETE_OPTION',
+ payload: {
+ optionKey: optionKey,
+ }
+ };
+}
+
+export function reducer(state, action) {
+ switch (action.type) {
+ case 'CREATE_OPTION':
+ return {
+ ...state, options: [...state.options, {
+ key: action.payload.optionKey,
+ values: {
+ selection: action.payload.values
+ }
+ }]
+ };
+ case 'DELETE_OPTION':
+ return {
+ ...state, options: state.options.filter(n => n.key !== action.payload.optionKey)
+ };
+ case 'SET_PARAM_VALUES':
+ return {
+ ...state, options: state.options.map(option => {
+ if (option.key === action.payload.name) {
+ return {
+ ...option,
+ values: action.payload.values
+ };
+ }
+ return option;
+ })
+ };
+ case 'UPDATE_PARAM_VALUES':
+ return {
+ ...state, options: state.options.map(option => {
+ if (option.key === action.payload.name) {
+ return {
+ ...option,
+ values: Object.assign(option.values, action.payload.values)
+ };
+ }
+ return option;
+ })
+ };
+ default:
+ throw new Error("unsupported action type " + action.type);
+ }
+}
diff --git a/src/assets/scenario-builder/components/elements/Generic/sass/style.scss b/src/assets/scenario-builder/components/elements/Generic/sass/style.scss
new file mode 100644
index 0000000..0512c49
--- /dev/null
+++ b/src/assets/scenario-builder/components/elements/Generic/sass/style.scss
@@ -0,0 +1,30 @@
+$nodeColor: $lightViolet;
+
+.srd-node--selected {
+ .square-node.generic-node .node-container {
+ box-shadow: 0 0 10px $nodeColor;
+ }
+}
+
+.generic-node {
+ .node-container {
+ border: solid 2px $nodeColor;
+ color: $nodeColor;
+ }
+
+ &__title {
+ color: $nodeColor;
+ }
+
+ &__left,
+ &__right {
+ .port {
+ box-shadow: 0 0 10px $nodeColor;
+
+ &:hover,
+ &.selected {
+ background: $nodeColor;
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/assets/scenario-builder/components/elements/Goal/NodeFactory.js b/src/assets/scenario-builder/components/elements/Goal/NodeFactory.js
new file mode 100755
index 0000000..c2a8a32
--- /dev/null
+++ b/src/assets/scenario-builder/components/elements/Goal/NodeFactory.js
@@ -0,0 +1,26 @@
+import * as React from 'react';
+import { AbstractNodeFactory } from '@projectstorm/react-diagrams';
+
+import NodeWidget from './NodeWidget';
+import { NodeModel } from './NodeModel';
+
+export class NodeFactory extends AbstractNodeFactory {
+ constructor() {
+ super('goal');
+ }
+
+ generateReactWidget(diagramEngine, node) {
+ return (
+
+ );
+ }
+
+ getNewInstance() {
+ return new NodeModel();
+ }
+}
diff --git a/src/assets/scenario-builder/components/elements/Goal/NodeModel.js b/src/assets/scenario-builder/components/elements/Goal/NodeModel.js
new file mode 100755
index 0000000..64fc6c2
--- /dev/null
+++ b/src/assets/scenario-builder/components/elements/Goal/NodeModel.js
@@ -0,0 +1,44 @@
+import { NodeModel as BaseNodeModel } from '@projectstorm/react-diagrams';
+import * as _ from 'lodash';
+import { PortModel } from './PortModel';
+
+export class NodeModel extends BaseNodeModel {
+ constructor(element) {
+ super('goal', element.id);
+
+ this.name = element.name;
+ this.selectedGoals = element.selectedGoals;
+ this.timeoutTime = element.timeoutTime;
+ this.timeoutUnit = element.timeoutUnit;
+
+ this.recheckPeriodTime = element.recheckPeriodTime;
+ this.recheckPeriodUnit = element.recheckPeriodUnit;
+
+ this.addPort(new PortModel('left'));
+ this.addPort(new PortModel('bottom'));
+ this.addPort(new PortModel('right'));
+ }
+
+ deSerialize(ob, engine) {
+ super.deSerialize(ob, engine);
+ this.name = ob.name;
+ this.selectedGoals = ob.selectedGoals;
+
+ this.timeoutTime = ob.timeoutTime !== null && ob.timeoutTime !== undefined ? ob.timeoutTime : '';
+ this.timeoutUnit = ob.timeoutUnit !== null && ob.timeoutUnit !== undefined ? ob.timeoutUnit : 'days';
+
+ this.recheckPeriodTime = ob.recheckPeriodTime !== null && ob.recheckPeriodTime !== undefined ? ob.recheckPeriodTime : '1';
+ this.recheckPeriodUnit = ob.recheckPeriodUnit !== null && ob.recheckPeriodUnit !== undefined ? ob.recheckPeriodUnit : 'hours';
+ }
+
+ serialize() {
+ return _.merge(super.serialize(), {
+ name: this.name,
+ selectedGoals: this.selectedGoals,
+ timeoutTime: this.timeoutTime,
+ timeoutUnit: this.timeoutUnit,
+ recheckPeriodTime: this.recheckPeriodTime,
+ recheckPeriodUnit: this.recheckPeriodUnit,
+ });
+ }
+}
diff --git a/src/assets/scenario-builder/components/elements/Goal/NodeWidget.js b/src/assets/scenario-builder/components/elements/Goal/NodeWidget.js
new file mode 100755
index 0000000..e52cf0d
--- /dev/null
+++ b/src/assets/scenario-builder/components/elements/Goal/NodeWidget.js
@@ -0,0 +1,334 @@
+import * as React from 'react';
+import { connect } from 'react-redux';
+import OkIcon from '@material-ui/icons/Check';
+import TimeoutIcon from '@material-ui/icons/AccessTime';
+import Grid from '@material-ui/core/Grid';
+import TextField from '@material-ui/core/TextField';
+import Button from '@material-ui/core/Button';
+import Dialog from '@material-ui/core/Dialog';
+import DialogActions from '@material-ui/core/DialogActions';
+import DialogContent from '@material-ui/core/DialogContent';
+import FormControl from '@material-ui/core/FormControl';
+import InputLabel from '@material-ui/core/InputLabel';
+import Select from '@material-ui/core/Select';
+import MenuItem from '@material-ui/core/MenuItem';
+import DialogContentText from '@material-ui/core/DialogContentText';
+import DialogTitle from '@material-ui/core/DialogTitle';
+import GoalIcon from '@material-ui/icons/CheckBox';
+
+import StatisticsTooltip from '../../StatisticTooltip';
+import { PortWidget } from './../../widgets/PortWidget';
+import { setCanvasZoomingAndPanning } from '../../../actions';
+import StatisticBadge from "../../StatisticBadge";
+import {Autocomplete} from "@material-ui/lab";
+
+class NodeWidget extends React.Component {
+ constructor(props) {
+ super(props);
+ this.state = {
+ nodeFormName: this.props.node.name,
+ selectedGoals: this.props.node.selectedGoals,
+ timeoutTime: this.props.node.timeoutTime,
+ timeoutUnit: this.props.node.timeoutUnit,
+ recheckPeriodTime: this.props.node.recheckPeriodTime,
+ recheckPeriodUnit: this.props.node.recheckPeriodUnit,
+ dialogOpened: false,
+ anchorElementForTooltip: null,
+ };
+ }
+
+ bem(selector) {
+ return (
+ this.props.classBaseName +
+ selector +
+ ' ' +
+ this.props.className +
+ selector +
+ ' '
+ );
+ }
+
+ getClassName() {
+ return this.props.classBaseName + ' ' + this.props.className;
+ }
+
+ openDialog = () => {
+ this.setState({
+ dialogOpened: true,
+ nodeFormName: this.props.node.name,
+ selectedGoals: this.props.node.selectedGoals,
+ timeoutTime: this.props.node.timeoutTime,
+ timeoutUnit: this.props.node.timeoutUnit,
+ recheckPeriodTime: this.props.node.recheckPeriodTime,
+ recheckPeriodUnit: this.props.node.recheckPeriodUnit,
+ anchorElementForTooltip: null
+ });
+ this.props.dispatch(setCanvasZoomingAndPanning(false));
+ };
+
+ closeDialog = () => {
+ this.setState({ dialogOpened: false });
+ this.props.dispatch(setCanvasZoomingAndPanning(true));
+ };
+
+ transformOptionsForSelect = () => {
+ const goals = this.props.goals.map(goal => ({
+ value: goal.code,
+ label: goal.name,
+ }));
+ return goals;
+ };
+
+ handleNodeMouseEnter = event => {
+ if (!this.state.dialogOpened) {
+ this.setState({ anchorElementForTooltip: event.currentTarget });
+ }
+ };
+
+ handleNodeMouseLeave = () => {
+ this.setState({ anchorElementForTooltip: null });
+ };
+
+ getSelectedGoals = () => {
+ if (this.state.selectedGoals === undefined) {
+ return [];
+ }
+
+ return this.props.goals.filter((item) => {
+ return this.state.selectedGoals.includes(item.code)
+ }, this.state.selectedGoals);
+ };
+
+ render() {
+ return (
+ {
+ this.openDialog();
+ }}
+ onMouseEnter={this.handleNodeMouseEnter}
+ onMouseLeave={this.handleNodeMouseLeave}
+ >
+
+
+ {this.props.node.name ? this.props.node.name : 'Goal'}
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {this.props.statistics[this.props.node.id] ?
+
:
+
+ }
+
+
+
+
+ {this.props.statistics[this.props.node.id] ?
+
:
+
+ }
+
+
+
+
+
+
+
+
+ );
+ }
+}
+
+function mapStateToProps(state) {
+ const { goals, dispatch } = state;
+
+ return {
+ goals: goals.availableGoals,
+ dispatch,
+ statistics: state.statistics.statistics
+ };
+}
+
+export default connect(mapStateToProps)(NodeWidget);
diff --git a/src/assets/scenario-builder/components/elements/Goal/PortModel.js b/src/assets/scenario-builder/components/elements/Goal/PortModel.js
new file mode 100755
index 0000000..5749f53
--- /dev/null
+++ b/src/assets/scenario-builder/components/elements/Goal/PortModel.js
@@ -0,0 +1,7 @@
+import { LeftRightBottomPort } from '../Ports';
+
+export class PortModel extends LeftRightBottomPort {
+ constructor(position = 'top') {
+ super(position, 'goal');
+ }
+}
diff --git a/src/assets/scenario-builder/components/elements/Goal/index.js b/src/assets/scenario-builder/components/elements/Goal/index.js
new file mode 100755
index 0000000..af068d7
--- /dev/null
+++ b/src/assets/scenario-builder/components/elements/Goal/index.js
@@ -0,0 +1,9 @@
+import { NodeModel } from "./NodeModel";
+import { NodeFactory } from "./NodeFactory";
+import { PortModel } from "./PortModel";
+
+export {
+ NodeModel,
+ NodeFactory,
+ PortModel
+};
diff --git a/src/assets/scenario-builder/components/elements/Goal/sass/style.scss b/src/assets/scenario-builder/components/elements/Goal/sass/style.scss
new file mode 100644
index 0000000..693c40f
--- /dev/null
+++ b/src/assets/scenario-builder/components/elements/Goal/sass/style.scss
@@ -0,0 +1,31 @@
+$nodeColor: $grey;
+
+.srd-node--selected {
+ .diamond-node.goal-node .node-container {
+ box-shadow: 0 0 10px $nodeColor;
+ }
+}
+
+.goal-node {
+ .node-container {
+ border: solid 2px $nodeColor;
+ color: $nodeColor;
+ }
+
+ &__title {
+ color: $nodeColor;
+ }
+
+ &__left,
+ &__right,
+ &__bottom {
+ .port {
+ box-shadow: 0 0 10px $nodeColor;
+
+ &:hover,
+ &.selected {
+ background: $nodeColor;
+ }
+ }
+ }
+}
diff --git a/src/assets/scenario-builder/components/elements/Link/LinkFactory.js b/src/assets/scenario-builder/components/elements/Link/LinkFactory.js
new file mode 100644
index 0000000..6c1fccf
--- /dev/null
+++ b/src/assets/scenario-builder/components/elements/Link/LinkFactory.js
@@ -0,0 +1,26 @@
+import * as React from 'react';
+import { DefaultLinkFactory } from '@projectstorm/react-diagrams';
+
+import { LinkModel } from './LinkModel';
+
+export class LinkFactory extends DefaultLinkFactory {
+ constructor() {
+ super();
+ this.type = 'custom';
+ }
+
+ getNewInstance(initialConfig) {
+ return new LinkModel();
+ }
+
+ generateLinkSegment(model, widget, selected, path) {
+ return (
+
+ );
+ }
+}
diff --git a/src/assets/scenario-builder/components/elements/Link/LinkModel.js b/src/assets/scenario-builder/components/elements/Link/LinkModel.js
new file mode 100644
index 0000000..9dacdb4
--- /dev/null
+++ b/src/assets/scenario-builder/components/elements/Link/LinkModel.js
@@ -0,0 +1,11 @@
+import { DefaultLinkModel } from '@projectstorm/react-diagrams';
+
+export class LinkModel extends DefaultLinkModel {
+ constructor() {
+ super('custom');
+
+ this.width = 2;
+ this.curvyness = 50;
+ this.color = 'rgba(0,0,0,0.3)';
+ }
+}
diff --git a/src/assets/scenario-builder/components/elements/Link/index.js b/src/assets/scenario-builder/components/elements/Link/index.js
new file mode 100644
index 0000000..7dd05b3
--- /dev/null
+++ b/src/assets/scenario-builder/components/elements/Link/index.js
@@ -0,0 +1,4 @@
+import { LinkModel } from './LinkModel';
+import { LinkFactory } from './LinkFactory';
+
+export { LinkModel, LinkFactory };
diff --git a/src/assets/scenario-builder/components/elements/Link/sass/style.scss b/src/assets/scenario-builder/components/elements/Link/sass/style.scss
new file mode 100644
index 0000000..73c5d85
--- /dev/null
+++ b/src/assets/scenario-builder/components/elements/Link/sass/style.scss
@@ -0,0 +1,38 @@
+.srd-default-link {
+ @keyframes dash {
+ from {
+ stroke-dashoffset: 24;
+ }
+ to {
+ stroke-dashoffset: 0;
+ }
+ }
+
+ path {
+ fill: none;
+ pointer-events: all;
+ }
+
+ &--path-selected {
+ stroke: $lightBlue !important;
+ stroke-dasharray: 10, 2;
+ animation: dash 1s linear infinite;
+ }
+
+ &__label {
+ pointer-events: none;
+
+ > div {
+ display: inline-block;
+ position: absolute;
+ }
+ }
+
+ &__point {
+ fill: rgba(white, 0.5);
+ }
+
+ &--point-selected {
+ fill: rgb(0, 192, 255);
+ }
+}
diff --git a/src/assets/scenario-builder/components/elements/Ports/LeftRightBottomPort.js b/src/assets/scenario-builder/components/elements/Ports/LeftRightBottomPort.js
new file mode 100644
index 0000000..059170b
--- /dev/null
+++ b/src/assets/scenario-builder/components/elements/Ports/LeftRightBottomPort.js
@@ -0,0 +1,43 @@
+import * as _ from 'lodash';
+import { PortModel as BasePortModel } from '@projectstorm/react-diagrams';
+
+import { LinkModel } from './../Link';
+
+export class LeftRightBottomPort extends BasePortModel {
+ position;
+
+ constructor(pos = 'left', type) {
+ super(pos, type);
+
+ this.position = pos;
+ this.in = this.position === 'left';
+ }
+
+ link(port) {
+ let link = this.createLinkModel();
+
+ link.setSourcePort(this);
+ link.setTargetPort(port);
+
+ return link;
+ }
+
+ serialize() {
+ return _.merge(super.serialize(), {
+ position: this.position
+ });
+ }
+
+ canLinkToPort(port) {
+ return this.in !== port.in;
+ }
+
+ deSerialize(data, engine) {
+ super.deSerialize(data, engine);
+ this.position = data.position;
+ }
+
+ createLinkModel() {
+ return new LinkModel();
+ }
+}
diff --git a/src/assets/scenario-builder/components/elements/Ports/LeftRightPort.js b/src/assets/scenario-builder/components/elements/Ports/LeftRightPort.js
new file mode 100644
index 0000000..8a706f9
--- /dev/null
+++ b/src/assets/scenario-builder/components/elements/Ports/LeftRightPort.js
@@ -0,0 +1,44 @@
+import * as _ from 'lodash';
+import { PortModel as BasePortModel } from '@projectstorm/react-diagrams';
+
+import { LinkModel } from './../Link';
+
+export class LeftRightPort extends BasePortModel {
+ in;
+ position;
+
+ constructor(pos = 'left', type) {
+ super(pos, type);
+
+ this.position = pos;
+ this.in = this.position === 'left';
+ }
+
+ link(port) {
+ let link = this.createLinkModel();
+
+ link.setSourcePort(this);
+ link.setTargetPort(port);
+
+ return link;
+ }
+
+ canLinkToPort(port) {
+ return this.in !== port.in;
+ }
+
+ serialize() {
+ return _.merge(super.serialize(), {
+ position: this.position
+ });
+ }
+
+ deSerialize(data, engine) {
+ super.deSerialize(data, engine);
+ this.position = data.position;
+ }
+
+ createLinkModel() {
+ return new LinkModel();
+ }
+}
diff --git a/src/assets/scenario-builder/components/elements/Ports/index.js b/src/assets/scenario-builder/components/elements/Ports/index.js
new file mode 100644
index 0000000..3a5eedb
--- /dev/null
+++ b/src/assets/scenario-builder/components/elements/Ports/index.js
@@ -0,0 +1,7 @@
+import { LeftRightPort } from "./LeftRightPort";
+import { LeftRightBottomPort } from "./LeftRightBottomPort";
+
+export {
+ LeftRightPort,
+ LeftRightBottomPort
+};
diff --git a/src/assets/scenario-builder/components/elements/PushNotification/NodeFactory.js b/src/assets/scenario-builder/components/elements/PushNotification/NodeFactory.js
new file mode 100755
index 0000000..8d0529a
--- /dev/null
+++ b/src/assets/scenario-builder/components/elements/PushNotification/NodeFactory.js
@@ -0,0 +1,26 @@
+import * as React from 'react';
+import { AbstractNodeFactory } from '@projectstorm/react-diagrams';
+
+import NodeWidget from './NodeWidget';
+import { NodeModel } from './NodeModel';
+
+export class NodeFactory extends AbstractNodeFactory {
+ constructor() {
+ super('push_notification');
+ }
+
+ generateReactWidget(diagramEngine, node) {
+ return (
+
+ );
+ }
+
+ getNewInstance() {
+ return new NodeModel();
+ }
+}
diff --git a/src/assets/scenario-builder/components/elements/PushNotification/NodeModel.js b/src/assets/scenario-builder/components/elements/PushNotification/NodeModel.js
new file mode 100755
index 0000000..d7ada01
--- /dev/null
+++ b/src/assets/scenario-builder/components/elements/PushNotification/NodeModel.js
@@ -0,0 +1,30 @@
+import { NodeModel as BaseNodeModel } from '@projectstorm/react-diagrams';
+import * as _ from 'lodash';
+import { PortModel } from './PortModel';
+
+export class NodeModel extends BaseNodeModel {
+ constructor(element) {
+ super('push_notification', element.id);
+
+ this.name = element.name;
+ this.selectedTemplate = element.selectedTemplate;
+ this.selectedApplication = element.selectedApplication;
+ this.addPort(new PortModel('left'));
+ this.addPort(new PortModel('right'));
+ }
+
+ deSerialize(ob, engine) {
+ super.deSerialize(ob, engine);
+ this.name = ob.name;
+ this.selectedTemplate = ob.selectedTemplate;
+ this.selectedApplication = ob.selectedApplication;
+ }
+
+ serialize() {
+ return _.merge(super.serialize(), {
+ name: this.name,
+ selectedTemplate: this.selectedTemplate,
+ selectedApplication: this.selectedApplication,
+ });
+ }
+}
diff --git a/src/assets/scenario-builder/components/elements/PushNotification/NodeWidget.js b/src/assets/scenario-builder/components/elements/PushNotification/NodeWidget.js
new file mode 100755
index 0000000..2b4904b
--- /dev/null
+++ b/src/assets/scenario-builder/components/elements/PushNotification/NodeWidget.js
@@ -0,0 +1,255 @@
+import * as React from 'react';
+import { connect } from 'react-redux';
+import ActionIcon from '@material-ui/icons/PhonelinkRing';
+import Grid from '@material-ui/core/Grid';
+import TextField from '@material-ui/core/TextField';
+import Button from '@material-ui/core/Button';
+import Dialog from '@material-ui/core/Dialog';
+import DialogActions from '@material-ui/core/DialogActions';
+import DialogContent from '@material-ui/core/DialogContent';
+import DialogContentText from '@material-ui/core/DialogContentText';
+import DialogTitle from '@material-ui/core/DialogTitle';
+import { PortWidget } from '../../widgets/PortWidget';
+import StatisticsTooltip from '../../StatisticTooltip';
+import { setCanvasZoomingAndPanning } from '../../../actions';
+import Autocomplete from "@material-ui/lab/Autocomplete";
+import StatisticBadge from "../../StatisticBadge";
+
+class NodeWidget extends React.Component {
+ constructor(props) {
+ super(props);
+ this.state = {
+ nodeFormName: this.props.node.name,
+ selectedTemplate: this.props.node.selectedTemplate,
+ selectedApplication: this.props.node.selectedApplication,
+ dialogOpened: false,
+ anchorElementForTooltip: null
+ };
+ }
+
+ bem(selector) {
+ return (
+ this.props.classBaseName +
+ selector +
+ ' ' +
+ this.props.className +
+ selector +
+ ' '
+ );
+ }
+
+ getClassName() {
+ return this.props.classBaseName + ' ' + this.props.className;
+ }
+
+ openDialog = () => {
+ this.setState({
+ dialogOpened: true,
+ nodeFormName: this.props.node.name,
+ anchorElementForTooltip: null
+ });
+ this.props.dispatch(setCanvasZoomingAndPanning(false));
+ };
+
+ closeDialog = () => {
+ this.setState({ dialogOpened: false });
+ this.props.dispatch(setCanvasZoomingAndPanning(true));
+ };
+
+ handleNodeMouseEnter = event => {
+ if (!this.state.dialogOpened) {
+ this.setState({ anchorElementForTooltip: event.currentTarget });
+ }
+ };
+
+ handleNodeMouseLeave = () => {
+ this.setState({ anchorElementForTooltip: null });
+ };
+
+ getTemplatesInSelectableFormat = () => {
+ return this.props.templates.map(item => {
+ return {
+ value: item.code,
+ label: item.name,
+ };
+ });
+ };
+
+ getApplicationsInSelectableFormat = () => {
+ return this.props.applications.map(item => {
+ return {
+ value: item.code,
+ label: item.name,
+ };
+ });
+ };
+
+ getSelectedTemplateValue = () => {
+ const selected = this.props.templates.find(
+ item => item.code === this.props.node.selectedTemplate
+ );
+
+ return selected ? ` - ${selected.name}` : '';
+ };
+
+ render() {
+ return (
+ {
+ this.openDialog();
+ }}
+ onMouseEnter={this.handleNodeMouseEnter}
+ onMouseLeave={this.handleNodeMouseLeave}
+ >
+
+
+
+ {this.props.node.name
+ ? this.props.node.name
+ : `Notification ${this.getSelectedTemplateValue()}`}
+
+
+
+
+
+
+
+ );
+ }
+}
+
+function mapStateToProps(state) {
+ return {
+ templates: state.pushNotifications.availableTemplates,
+ applications: state.pushNotifications.availableApplications,
+ };
+}
+
+export default connect(mapStateToProps)(NodeWidget);
diff --git a/src/assets/scenario-builder/components/elements/PushNotification/PortModel.js b/src/assets/scenario-builder/components/elements/PushNotification/PortModel.js
new file mode 100755
index 0000000..3d9003c
--- /dev/null
+++ b/src/assets/scenario-builder/components/elements/PushNotification/PortModel.js
@@ -0,0 +1,7 @@
+import { LeftRightPort } from '../Ports';
+
+export class PortModel extends LeftRightPort {
+ constructor(position = 'left') {
+ super(position, 'push_notification');
+ }
+}
diff --git a/src/assets/scenario-builder/components/elements/PushNotification/index.js b/src/assets/scenario-builder/components/elements/PushNotification/index.js
new file mode 100755
index 0000000..af068d7
--- /dev/null
+++ b/src/assets/scenario-builder/components/elements/PushNotification/index.js
@@ -0,0 +1,9 @@
+import { NodeModel } from "./NodeModel";
+import { NodeFactory } from "./NodeFactory";
+import { PortModel } from "./PortModel";
+
+export {
+ NodeModel,
+ NodeFactory,
+ PortModel
+};
diff --git a/src/assets/scenario-builder/components/elements/PushNotification/sass/style.scss b/src/assets/scenario-builder/components/elements/PushNotification/sass/style.scss
new file mode 100644
index 0000000..92c1f50
--- /dev/null
+++ b/src/assets/scenario-builder/components/elements/PushNotification/sass/style.scss
@@ -0,0 +1,30 @@
+$nodeColor: $lightPurple;
+
+.srd-node--selected {
+ .square-node.push-notification-node .node-container {
+ box-shadow: 0 0 10px $nodeColor;
+ }
+}
+
+.push-notification-node {
+ .node-container {
+ border: solid 2px $nodeColor;
+ color: $nodeColor;
+ }
+
+ &__title {
+ color: $nodeColor;
+ }
+
+ &__left,
+ &__right {
+ .port {
+ box-shadow: 0 0 10px $nodeColor;
+
+ &:hover,
+ &.selected {
+ background: $nodeColor;
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/assets/scenario-builder/components/elements/Segment/NodeFactory.js b/src/assets/scenario-builder/components/elements/Segment/NodeFactory.js
new file mode 100755
index 0000000..2d06b35
--- /dev/null
+++ b/src/assets/scenario-builder/components/elements/Segment/NodeFactory.js
@@ -0,0 +1,26 @@
+import * as React from 'react';
+import { AbstractNodeFactory } from '@projectstorm/react-diagrams';
+
+import NodeWidget from './NodeWidget';
+import { NodeModel } from './NodeModel';
+
+export class NodeFactory extends AbstractNodeFactory {
+ constructor() {
+ super('segment');
+ }
+
+ generateReactWidget(diagramEngine, node) {
+ return (
+
+ );
+ }
+
+ getNewInstance() {
+ return new NodeModel();
+ }
+}
diff --git a/src/assets/scenario-builder/components/elements/Segment/NodeModel.js b/src/assets/scenario-builder/components/elements/Segment/NodeModel.js
new file mode 100755
index 0000000..61d5d9c
--- /dev/null
+++ b/src/assets/scenario-builder/components/elements/Segment/NodeModel.js
@@ -0,0 +1,29 @@
+import { NodeModel as BaseNodeModel } from '@projectstorm/react-diagrams';
+import * as _ from 'lodash';
+import { PortModel } from './PortModel';
+
+export class NodeModel extends BaseNodeModel {
+ constructor(element) {
+ super('segment', element.id);
+
+ this.name = element.name;
+ this.selectedSegment = element.selectedSegment;
+
+ this.addPort(new PortModel('left'));
+ this.addPort(new PortModel('bottom'));
+ this.addPort(new PortModel('right'));
+ }
+
+ deSerialize(ob, engine) {
+ super.deSerialize(ob, engine);
+ this.name = ob.name;
+ this.selectedSegment = ob.selectedSegment;
+ }
+
+ serialize() {
+ return _.merge(super.serialize(), {
+ name: this.name,
+ selectedSegment: this.selectedSegment
+ });
+ }
+}
\ No newline at end of file
diff --git a/src/assets/scenario-builder/components/elements/Segment/NodeWidget.js b/src/assets/scenario-builder/components/elements/Segment/NodeWidget.js
new file mode 100755
index 0000000..a69fa2f
--- /dev/null
+++ b/src/assets/scenario-builder/components/elements/Segment/NodeWidget.js
@@ -0,0 +1,269 @@
+import * as React from 'react';
+import { connect } from 'react-redux';
+import SegmentIcon from '@material-ui/icons/SubdirectoryArrowRight';
+import Grid from '@material-ui/core/Grid';
+import TextField from '@material-ui/core/TextField';
+import Button from '@material-ui/core/Button';
+import Dialog from '@material-ui/core/Dialog';
+import DialogActions from '@material-ui/core/DialogActions';
+import DialogContent from '@material-ui/core/DialogContent';
+import DialogContentText from '@material-ui/core/DialogContentText';
+import DialogTitle from '@material-ui/core/DialogTitle';
+import Icon from '@material-ui/core/Icon';
+import { PortWidget } from '../../widgets/PortWidget';
+import { setCanvasZoomingAndPanning } from '../../../actions';
+import SegmentSelector from './SegmentSelector';
+import * as config from '../../../config';
+import { styled } from '@material-ui/core/styles';
+import StatisticBadge from "../../StatisticBadge";
+import StatisticsTooltip from "../../StatisticTooltip";
+import OkIcon from "@material-ui/icons/Check";
+import NopeIcon from "@material-ui/icons/Close";
+
+const NewSegmentButton = styled(Button)({
+ marginRight: 'auto'
+});
+
+class NodeWidget extends React.Component {
+ constructor(props) {
+ super(props);
+ this.state = {
+ nodeFormName: this.props.node.name,
+ selectedSegment: this.props.node.selectedSegment,
+ dialogOpened: false,
+ anchorElementForTooltip: null,
+ creatingNewSegment: false,
+ selectedSegmentSourceTable: null
+ };
+ }
+
+ bem(selector) {
+ return (
+ this.props.classBaseName +
+ selector +
+ ' ' +
+ this.props.className +
+ selector +
+ ' '
+ );
+ }
+
+ getClassName() {
+ return this.props.classBaseName + ' ' + this.props.className;
+ }
+
+ openDialog = () => {
+ this.setState({
+ dialogOpened: true,
+ nodeFormName: this.props.node.name,
+ selectedSegment: this.props.node.selectedSegment,
+ anchorElementForTooltip: null
+ });
+ this.props.dispatch(setCanvasZoomingAndPanning(false));
+ };
+
+ closeDialog = () => {
+ this.setState({ dialogOpened: false });
+ this.props.dispatch(setCanvasZoomingAndPanning(true));
+ };
+
+ handleNodeMouseEnter = event => {
+ if (!this.state.dialogOpened) {
+ this.setState({ anchorElementForTooltip: event.currentTarget });
+ }
+ };
+
+ handleNodeMouseLeave = () => {
+ this.setState({ anchorElementForTooltip: null });
+ };
+
+ actionSetTable = table => {
+ if (this.state.selectedSegmentSourceTable !== table) {
+ this.setState({selectedSegment: null});
+ this.setState({selectedSegmentSourceTable: table});
+ }
+ };
+
+ segmentSelectedChange = segment => {
+ let value = null;
+ if (segment && segment.hasOwnProperty('code')) {
+ value = segment.code;
+ }
+
+ this.setState({selectedSegment: value});
+ };
+
+ getSelectedSegmentValue = () => {
+ const selected = this.props.segments.flatMap(
+ item => item.segments).find(
+ segment => segment.code === this.props.node.selectedSegment
+ );
+
+ return selected ? ` - ${selected.name}` : '';
+ };
+
+ handleNewSegmentClick = () => {
+ window.open(config.URL_SEGMENT_NEW);
+ };
+
+ render() {
+ let displayStatisticBadge = false;
+ if (this.props.statistics.length === 0 || this.props.statistics[this.props.node.id]) {
+ displayStatisticBadge = true;
+ }
+
+ return (
+ {
+ this.openDialog();
+ }}
+ onMouseEnter={this.handleNodeMouseEnter}
+ onMouseLeave={this.handleNodeMouseLeave}
+ >
+
+
+ {this.props.node.name
+ ? this.props.node.name
+ : `Segment ${this.getSelectedSegmentValue()}`}
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {displayStatisticBadge ?
+
:
+
+ }
+
+
+
+
+ {displayStatisticBadge ?
+
:
+
+ }
+
+
+
+
+
+
+
+
+ );
+ }
+}
+
+function mapStateToProps(state) {
+ const { segments, dispatch } = state;
+
+ return {
+ segments: segments.avalaibleSegments,
+ statistics: state.statistics.statistics,
+ dispatch
+ };
+}
+
+export default connect(mapStateToProps)(NodeWidget);
diff --git a/src/assets/scenario-builder/components/elements/Segment/PortModel.js b/src/assets/scenario-builder/components/elements/Segment/PortModel.js
new file mode 100755
index 0000000..5f01520
--- /dev/null
+++ b/src/assets/scenario-builder/components/elements/Segment/PortModel.js
@@ -0,0 +1,7 @@
+import { LeftRightBottomPort } from './../Ports';
+
+export class PortModel extends LeftRightBottomPort {
+ constructor(position = 'top') {
+ super(position, 'segment');
+ }
+}
diff --git a/src/assets/scenario-builder/components/elements/Segment/SegmentFormSelect.js b/src/assets/scenario-builder/components/elements/Segment/SegmentFormSelect.js
new file mode 100644
index 0000000..fc3bc0d
--- /dev/null
+++ b/src/assets/scenario-builder/components/elements/Segment/SegmentFormSelect.js
@@ -0,0 +1,75 @@
+import React from 'react';
+import {useSelector} from "react-redux";
+import Autocomplete from "@material-ui/lab/Autocomplete";
+import TextField from "@material-ui/core/TextField";
+import { makeStyles } from '@material-ui/core/styles';
+import { createFilterOptions } from '@material-ui/lab/Autocomplete';
+
+const useStyles = makeStyles((theme) => ({
+ autocomplete: {
+ margin: theme.spacing(1)
+ },
+ subtitle: {
+ paddingLeft: '6px',
+ color: theme.palette.grey[600]
+ },
+ }));
+
+function optionLabel(option) {
+ return typeof(option) === 'string' ? option : option.name;
+}
+
+function optionSelected(option, value) {
+ if (value && value.hasOwnProperty('code')) {
+ return option.code === value.code;
+ }
+ return false;
+}
+
+function value(selectedSegment, items) {
+ const item = items.filter(item => item.code === selectedSegment)[0];
+ return item ? item : null;
+}
+
+// Defines what values are searched within option
+const filterOptions = createFilterOptions({
+ matchFrom: 'any',
+ trim: true,
+ ignoreAccents: true,
+ ignoreCase: true,
+ stringify: option => {
+ return option.name + " " + option.code;
+ },
+ });
+
+export default function SegmentFormSelect(props) {
+ const classes = useStyles();
+ const items = useSelector(state => state.segments.avalaibleSegments.filter(
+ item => item.table === props.selectedSegmentSourceTable
+ ))[0].segments.sort(
+ (a,b) => a.group.sorting - b.group.sorting === 0 ? a.group.id - b.group.id : a.group.sorting - b.group.sorting
+ );
+
+ return (
+ option.group.name}
+ filterOptions={filterOptions}
+ onChange={(event, value) => {props.onSegmentSelectedChange(value)}}
+ renderInput={params => (
+
+ )}
+ renderOption={(option, { selected }) => (
+
+ {optionLabel(option)}
+ ({option.code})
+
+ )}
+ />
+ );
+}
\ No newline at end of file
diff --git a/src/assets/scenario-builder/components/elements/Segment/SegmentSelector.js b/src/assets/scenario-builder/components/elements/Segment/SegmentSelector.js
new file mode 100644
index 0000000..482ecfc
--- /dev/null
+++ b/src/assets/scenario-builder/components/elements/Segment/SegmentSelector.js
@@ -0,0 +1,58 @@
+import React from 'react';
+import Grid from '@material-ui/core/Grid';
+import ButtonGroup from "@material-ui/core/ButtonGroup";
+import {makeStyles} from "@material-ui/core/styles";
+import Button from "@material-ui/core/Button";
+import {useSelector} from "react-redux";
+import SegmentFormSelect from "./SegmentFormSelect";
+
+const useCriteriaBuilderStyles = makeStyles({
+ selectedButton: {
+ backgroundColor: "#E4E4E4"
+ },
+ deselectedButton: {
+ color: "#A6A6A6"
+ }
+});
+
+function getSourceTable(selectedSegmentSourceTable, selectedSegment, items) {
+ if (selectedSegmentSourceTable) {
+ return selectedSegmentSourceTable;
+ }
+
+ if (selectedSegment) {
+ const segment = items.filter(item => item.segments.filter(item => item.code === selectedSegment).length > 0);
+
+ return (segment[0] && segment[0].hasOwnProperty('table')) ? segment[0].table : 'users';
+ }
+
+ return 'users';
+}
+
+export default function SegmentSelector(props) {
+ const classes = useCriteriaBuilderStyles();
+ const items = useSelector(state => state.segments.avalaibleSegments);
+ const sourceTable = getSourceTable(props.selectedSegmentSourceTable, props.selectedSegment, items);
+
+ return (
+
+
+
+ {items.map(item => (
+
+ ))}
+
+
+
+
+
+ );
+}
\ No newline at end of file
diff --git a/src/assets/scenario-builder/components/elements/Segment/index.js b/src/assets/scenario-builder/components/elements/Segment/index.js
new file mode 100755
index 0000000..af068d7
--- /dev/null
+++ b/src/assets/scenario-builder/components/elements/Segment/index.js
@@ -0,0 +1,9 @@
+import { NodeModel } from "./NodeModel";
+import { NodeFactory } from "./NodeFactory";
+import { PortModel } from "./PortModel";
+
+export {
+ NodeModel,
+ NodeFactory,
+ PortModel
+};
diff --git a/src/assets/scenario-builder/components/elements/Segment/sass/style.scss b/src/assets/scenario-builder/components/elements/Segment/sass/style.scss
new file mode 100644
index 0000000..b43e6ea
--- /dev/null
+++ b/src/assets/scenario-builder/components/elements/Segment/sass/style.scss
@@ -0,0 +1,33 @@
+$nodeColor: $lightRed;
+
+.srd-node--selected {
+ .diamond-node.segment-node .node-container {
+ box-shadow: 0 0 10px $nodeColor;
+ }
+}
+
+.segment-node {
+ .node-container {
+ border: solid 2px $nodeColor;
+ color: $nodeColor;
+ }
+
+ &__title {
+ color: $nodeColor;
+ }
+
+ &__left,
+ &__right,
+ &__bottom {
+ .port {
+ box-shadow: 0 0 10px $nodeColor;
+
+ &:hover,
+ &.selected {
+ background: $nodeColor;
+ }
+ }
+ }
+}
+
+@import url(https://fonts.googleapis.com/css?family=Roboto:300,400,500,700|Material+Icons);
\ No newline at end of file
diff --git a/src/assets/scenario-builder/components/elements/SimplePortFactory.js b/src/assets/scenario-builder/components/elements/SimplePortFactory.js
new file mode 100644
index 0000000..441718d
--- /dev/null
+++ b/src/assets/scenario-builder/components/elements/SimplePortFactory.js
@@ -0,0 +1,14 @@
+import { AbstractPortFactory } from '@projectstorm/react-diagrams';
+
+export class SimplePortFactory extends AbstractPortFactory {
+ cb;
+
+ constructor(type, cb) {
+ super(type);
+ this.cb = cb;
+ }
+
+ getNewInstance(initialConfig) {
+ return this.cb(initialConfig);
+ }
+}
diff --git a/src/assets/scenario-builder/components/elements/Trigger/NodeFactory.js b/src/assets/scenario-builder/components/elements/Trigger/NodeFactory.js
new file mode 100755
index 0000000..9a74c1b
--- /dev/null
+++ b/src/assets/scenario-builder/components/elements/Trigger/NodeFactory.js
@@ -0,0 +1,26 @@
+import * as React from 'react';
+import { AbstractNodeFactory } from '@projectstorm/react-diagrams';
+
+import NodeWidget from './NodeWidget';
+import { NodeModel } from './NodeModel';
+
+export class NodeFactory extends AbstractNodeFactory {
+ constructor() {
+ super('trigger');
+ }
+
+ generateReactWidget(diagramEngine, node) {
+ return (
+
+ );
+ }
+
+ getNewInstance() {
+ return new NodeModel();
+ }
+}
diff --git a/src/assets/scenario-builder/components/elements/Trigger/NodeModel.js b/src/assets/scenario-builder/components/elements/Trigger/NodeModel.js
new file mode 100755
index 0000000..5755fca
--- /dev/null
+++ b/src/assets/scenario-builder/components/elements/Trigger/NodeModel.js
@@ -0,0 +1,26 @@
+import * as _ from 'lodash';
+import { NodeModel as BaseNodeModel } from '@projectstorm/react-diagrams';
+import { PortModel } from './PortModel';
+
+export class NodeModel extends BaseNodeModel {
+ constructor(element) {
+ super('trigger', element.id);
+
+ this.name = element.name;
+ this.selectedTrigger = element.selectedTrigger;
+ this.addPort(new PortModel('right'));
+ }
+
+ deSerialize(ob, engine) {
+ super.deSerialize(ob, engine);
+ this.name = ob.name;
+ this.selectedTrigger = ob.selectedTrigger;
+ }
+
+ serialize() {
+ return _.merge(super.serialize(), {
+ name: this.name,
+ selectedTrigger: this.selectedTrigger
+ });
+ }
+}
diff --git a/src/assets/scenario-builder/components/elements/Trigger/NodeWidget.js b/src/assets/scenario-builder/components/elements/Trigger/NodeWidget.js
new file mode 100755
index 0000000..6755fdf
--- /dev/null
+++ b/src/assets/scenario-builder/components/elements/Trigger/NodeWidget.js
@@ -0,0 +1,223 @@
+import * as React from 'react';
+import { connect } from 'react-redux';
+import TriggerIcon from '@material-ui/icons/Notifications';
+import Grid from '@material-ui/core/Grid';
+import TextField from '@material-ui/core/TextField';
+import Button from '@material-ui/core/Button';
+import Dialog from '@material-ui/core/Dialog';
+import DialogActions from '@material-ui/core/DialogActions';
+import DialogContent from '@material-ui/core/DialogContent';
+import DialogContentText from '@material-ui/core/DialogContentText';
+import DialogTitle from '@material-ui/core/DialogTitle';
+import Autocomplete from '@material-ui/lab/Autocomplete';
+import { PortWidget } from './../../widgets/PortWidget';
+import { setCanvasZoomingAndPanning } from '../../../actions';
+import StatisticBadge from "../../StatisticBadge";
+import StatisticsTooltip from "../../StatisticTooltip";
+
+class NodeWidget extends React.Component {
+ constructor(props) {
+ super(props);
+
+ this.state = {
+ nodeFormName: this.props.node.name,
+ selectedTrigger: this.props.node.selectedTrigger,
+ dialogOpened: false,
+ anchorElementForTooltip: null
+ };
+ }
+
+ bem(selector) {
+ return (
+ this.props.classBaseName +
+ selector +
+ ' ' +
+ this.props.className +
+ selector +
+ ' '
+ );
+ }
+
+ getClassName() {
+ return this.props.classBaseName + ' ' + this.props.className;
+ }
+
+ openDialog = () => {
+ this.setState({
+ dialogOpened: true,
+ nodeFormName: this.props.node.name,
+ anchorElementForTooltip: null
+ });
+ this.props.dispatch(setCanvasZoomingAndPanning(false));
+ };
+
+ closeDialog = () => {
+ this.setState({ dialogOpened: false });
+ this.props.dispatch(setCanvasZoomingAndPanning(true));
+ };
+
+ handleNodeMouseEnter = event => {
+ if (!this.state.dialogOpened) {
+ this.setState({ anchorElementForTooltip: event.currentTarget });
+ }
+ };
+
+ handleNodeMouseLeave = () => {
+ this.setState({ anchorElementForTooltip: null });
+ };
+
+ getTriggersInSelectableFormat = () => {
+ return this.props.triggers.map(trigger => {
+ return {
+ value: trigger.code,
+ label: trigger.name
+ };
+ });
+ };
+
+ getSelectedTriggerValue = () => {
+ const selected = this.getTriggersInSelectableFormat().find(
+ trigger => trigger.value === this.props.node.selectedTrigger
+ );
+
+ return selected ? ` - ${selected.label}` : '';
+ };
+
+ render() {
+ return (
+
+
{this.openDialog();}}
+ onMouseEnter={this.handleNodeMouseEnter}
+ onMouseLeave={this.handleNodeMouseLeave}
+ >
+
+
+
+
+
+
+
+
+
+ {this.props.node.name
+ ? this.props.node.name
+ : `Event ${this.getSelectedTriggerValue()}`}
+
+
+
+
+
+
+
+ );
+ }
+}
+
+function mapStateToProps(state) {
+ const { triggers } = state;
+
+ return {
+ triggers: triggers.avalaibleTriggers
+ };
+}
+
+export default connect(mapStateToProps)(NodeWidget);
diff --git a/src/assets/scenario-builder/components/elements/Trigger/PortModel.js b/src/assets/scenario-builder/components/elements/Trigger/PortModel.js
new file mode 100755
index 0000000..da87906
--- /dev/null
+++ b/src/assets/scenario-builder/components/elements/Trigger/PortModel.js
@@ -0,0 +1,7 @@
+import { LeftRightPort } from './../Ports';
+
+export class PortModel extends LeftRightPort {
+ constructor(position = 'left') {
+ super(position, 'trigger');
+ }
+}
diff --git a/src/assets/scenario-builder/components/elements/Trigger/index.js b/src/assets/scenario-builder/components/elements/Trigger/index.js
new file mode 100755
index 0000000..af068d7
--- /dev/null
+++ b/src/assets/scenario-builder/components/elements/Trigger/index.js
@@ -0,0 +1,9 @@
+import { NodeModel } from "./NodeModel";
+import { NodeFactory } from "./NodeFactory";
+import { PortModel } from "./PortModel";
+
+export {
+ NodeModel,
+ NodeFactory,
+ PortModel
+};
diff --git a/src/assets/scenario-builder/components/elements/Trigger/sass/style.scss b/src/assets/scenario-builder/components/elements/Trigger/sass/style.scss
new file mode 100644
index 0000000..473eca8
--- /dev/null
+++ b/src/assets/scenario-builder/components/elements/Trigger/sass/style.scss
@@ -0,0 +1,30 @@
+$nodeColor: $lightGreen;
+
+.srd-node--selected {
+ .square-node.trigger-node .node-container {
+ box-shadow: 0 0 10px $nodeColor;
+ }
+}
+
+.trigger-node {
+ .node-container {
+ border: solid 2px $nodeColor;
+ color: $nodeColor;
+ }
+
+ &__title {
+ color: $nodeColor;
+ }
+
+ &__left,
+ &__right {
+ .port {
+ box-shadow: 0 0 10px $nodeColor;
+
+ &:hover,
+ &.selected {
+ background: $nodeColor;
+ }
+ }
+ }
+}
diff --git a/src/assets/scenario-builder/components/elements/Wait/NodeFactory.js b/src/assets/scenario-builder/components/elements/Wait/NodeFactory.js
new file mode 100755
index 0000000..8d0f041
--- /dev/null
+++ b/src/assets/scenario-builder/components/elements/Wait/NodeFactory.js
@@ -0,0 +1,26 @@
+import { AbstractNodeFactory } from '@projectstorm/react-diagrams';
+
+import NodeWidget from './NodeWidget';
+import { NodeModel } from './NodeModel';
+import * as React from 'react';
+
+export class NodeFactory extends AbstractNodeFactory {
+ constructor() {
+ super('wait');
+ }
+
+ generateReactWidget(diagramEngine, node) {
+ return (
+
+ );
+ }
+
+ getNewInstance() {
+ return new NodeModel();
+ }
+}
diff --git a/src/assets/scenario-builder/components/elements/Wait/NodeModel.js b/src/assets/scenario-builder/components/elements/Wait/NodeModel.js
new file mode 100755
index 0000000..eb16c2b
--- /dev/null
+++ b/src/assets/scenario-builder/components/elements/Wait/NodeModel.js
@@ -0,0 +1,31 @@
+import * as _ from 'lodash';
+import { NodeModel as BaseNodeModel } from '@projectstorm/react-diagrams';
+import { PortModel } from './PortModel';
+
+export class NodeModel extends BaseNodeModel {
+ constructor(element) {
+ super('wait', element.id);
+
+ this.name = element.name;
+ this.waitingTime = element.waitingTime !== undefined ? element.waitingTime : 10;
+ this.waitingUnit = element.waitingUnit !== undefined ? element.waitingUnit : 'minutes';
+
+ this.addPort(new PortModel('left'));
+ this.addPort(new PortModel('right'));
+ }
+
+ deSerialize(ob, engine) {
+ super.deSerialize(ob, engine);
+ this.name = ob.name;
+ this.waitingTime = ob.waitingTime;
+ this.waitingUnit = ob.waitingUnit;
+ }
+
+ serialize() {
+ return _.merge(super.serialize(), {
+ name: this.name,
+ waitingTime: this.waitingTime,
+ waitingUnit: this.waitingUnit
+ });
+ }
+}
diff --git a/src/assets/scenario-builder/components/elements/Wait/NodeWidget.js b/src/assets/scenario-builder/components/elements/Wait/NodeWidget.js
new file mode 100755
index 0000000..41fda18
--- /dev/null
+++ b/src/assets/scenario-builder/components/elements/Wait/NodeWidget.js
@@ -0,0 +1,229 @@
+import * as React from 'react';
+import { connect } from 'react-redux';
+import WaitIcon from '@material-ui/icons/AccessAlarmsOutlined';
+import Grid from '@material-ui/core/Grid';
+import TextField from '@material-ui/core/TextField';
+import Button from '@material-ui/core/Button';
+import Dialog from '@material-ui/core/Dialog';
+import MenuItem from '@material-ui/core/MenuItem';
+import InputLabel from '@material-ui/core/InputLabel';
+import Select from '@material-ui/core/Select';
+import FormControl from '@material-ui/core/FormControl';
+import DialogActions from '@material-ui/core/DialogActions';
+import DialogContent from '@material-ui/core/DialogContent';
+import DialogContentText from '@material-ui/core/DialogContentText';
+import DialogTitle from '@material-ui/core/DialogTitle';
+import { PortWidget } from '../../widgets/PortWidget';
+import { setCanvasZoomingAndPanning } from '../../../actions';
+import StatisticBadge from "../../StatisticBadge";
+import StatisticsTooltip from "../../StatisticTooltip";
+
+class NodeWidget extends React.Component {
+ constructor(props) {
+ super(props);
+ this.state = {
+ nodeFormWaitingTime: this.props.node.waitingTime,
+ nodeFormName: this.props.node.name,
+ timeUnit: this.props.node.waitingUnit,
+ dialogOpened: false,
+ anchorElementForTooltip: null
+ };
+ }
+
+ bem(selector) {
+ return (
+ this.props.classBaseName +
+ selector +
+ ' ' +
+ this.props.className +
+ selector +
+ ' '
+ );
+ }
+
+ getClassName() {
+ return this.props.classBaseName + ' ' + this.props.className;
+ }
+
+ openDialog = () => {
+ this.setState({
+ dialogOpened: true,
+ nodeFormWaitingTime: this.props.node.waitingTime,
+ nodeFormName: this.props.node.name,
+ timeUnit: this.props.node.waitingUnit,
+ anchorElementForTooltip: null
+ });
+ this.props.dispatch(setCanvasZoomingAndPanning(false));
+ };
+
+ closeDialog = () => {
+ this.setState({ dialogOpened: false });
+ this.props.dispatch(setCanvasZoomingAndPanning(true));
+ };
+
+ handleNodeMouseEnter = event => {
+ if (!this.state.dialogOpened) {
+ this.setState({ anchorElementForTooltip: event.currentTarget });
+ }
+ };
+
+ handleNodeMouseLeave = () => {
+ this.setState({ anchorElementForTooltip: null });
+ };
+
+ render() {
+ return (
+ {
+ this.openDialog();
+ }}
+ onMouseEnter={this.handleNodeMouseEnter}
+ onMouseLeave={this.handleNodeMouseLeave}
+ >
+
+
+
+ {this.props.node.name
+ ? this.props.node.name
+ : `Wait - ${this.props.node.waitingTime} ${
+ this.props.node.waitingUnit
+ }`}
+
+
+
+
+
+
+
+ );
+ }
+}
+
+function mapStateToProps(state) {
+ const { segments } = state;
+
+ return {
+ segments: segments.avalaibleSegments
+ };
+}
+
+export default connect(mapStateToProps)(NodeWidget);
diff --git a/src/assets/scenario-builder/components/elements/Wait/PortModel.js b/src/assets/scenario-builder/components/elements/Wait/PortModel.js
new file mode 100755
index 0000000..871b6cb
--- /dev/null
+++ b/src/assets/scenario-builder/components/elements/Wait/PortModel.js
@@ -0,0 +1,7 @@
+import { LeftRightPort } from './../Ports';
+
+export class PortModel extends LeftRightPort {
+ constructor(position = 'left') {
+ super(position, 'wait');
+ }
+}
diff --git a/src/assets/scenario-builder/components/elements/Wait/index.js b/src/assets/scenario-builder/components/elements/Wait/index.js
new file mode 100755
index 0000000..af068d7
--- /dev/null
+++ b/src/assets/scenario-builder/components/elements/Wait/index.js
@@ -0,0 +1,9 @@
+import { NodeModel } from "./NodeModel";
+import { NodeFactory } from "./NodeFactory";
+import { PortModel } from "./PortModel";
+
+export {
+ NodeModel,
+ NodeFactory,
+ PortModel
+};
diff --git a/src/assets/scenario-builder/components/elements/Wait/sass/style.scss b/src/assets/scenario-builder/components/elements/Wait/sass/style.scss
new file mode 100644
index 0000000..c8d6ca3
--- /dev/null
+++ b/src/assets/scenario-builder/components/elements/Wait/sass/style.scss
@@ -0,0 +1,30 @@
+$nodeColor: $lightOrange;
+
+.srd-node--selected {
+ .round-node.wait-node .node-container {
+ box-shadow: 0 0 10px $nodeColor;
+ }
+}
+
+.wait-node {
+ .node-container {
+ border: solid 2px $nodeColor;
+ color: $nodeColor;
+ }
+
+ &__title {
+ color: $nodeColor;
+ }
+
+ &__left,
+ &__right {
+ .port {
+ box-shadow: 0 0 10px $nodeColor;
+
+ &:hover,
+ &.selected {
+ background: $nodeColor;
+ }
+ }
+ }
+}
diff --git a/src/assets/scenario-builder/components/elements/defaultElementsStyle.scss b/src/assets/scenario-builder/components/elements/defaultElementsStyle.scss
new file mode 100644
index 0000000..eaf18d1
--- /dev/null
+++ b/src/assets/scenario-builder/components/elements/defaultElementsStyle.scss
@@ -0,0 +1,118 @@
+.square-node,
+.round-node,
+.diamond-node {
+ background-color: transparent;
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ width: 150px;
+
+ .node-container {
+ position: relative;
+ display: flex;
+ align-items: center;
+ width: 50px;
+ height: 50px;
+ border-radius: 5px;
+ overflow: visible;
+ background-color: white;
+ transition: all 0.15s;
+ }
+
+ &__title {
+ display: flex;
+ text-align: center;
+ font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI',
+ 'Helvetica Neue', Arial, sans-serif;
+ font-size: 14px;
+ font-weight: 500;
+
+ > * {
+ align-self: center;
+ }
+ .fa {
+ padding: 5px;
+ opacity: 0.2;
+ cursor: pointer;
+
+ &:hover {
+ opacity: 1;
+ }
+ }
+ }
+
+ &__name {
+ flex-grow: 1;
+ padding: 5px 0;
+ }
+
+ &__ports {
+ display: flex;
+ background-image: none;
+ width: 100%;
+ }
+
+ &__left,
+ &__right,
+ &__bottom {
+ flex-grow: 1;
+ display: flex;
+ flex-direction: column;
+
+ .port {
+ border-radius: 13px;
+ width: 13px;
+ height: 13px;
+ position: relative;
+ background: white;
+ &:hover,
+ &.selected {
+ background: #a291fb;
+ }
+ }
+ }
+
+ &__left {
+ align-items: flex-start;
+ .port {
+ left: -6.5px;
+ }
+ }
+
+ &__right {
+ align-items: flex-end;
+ .port {
+ right: -6.5px;
+ }
+ }
+
+ &__bottom {
+ align-items: center;
+ .port {
+ bottom: -6.5px;
+ }
+ }
+
+ &__icon {
+ position: absolute;
+ width: 100%;
+ height: 100%;
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ }
+}
+
+.round-node {
+ .node-container {
+ border-radius: 50px;
+ }
+}
+
+.diamond-node {
+ &__bottom {
+ position: absolute;
+ bottom: 0;
+ width: 100%;
+ }
+}
diff --git a/src/assets/scenario-builder/components/elements/index.js b/src/assets/scenario-builder/components/elements/index.js
new file mode 100644
index 0000000..c05a700
--- /dev/null
+++ b/src/assets/scenario-builder/components/elements/index.js
@@ -0,0 +1,15 @@
+import { SimplePortFactory } from './SimplePortFactory';
+
+import * as Email from './Email';
+import * as Banner from './Banner';
+import * as Generic from './Generic';
+import * as Segment from './Segment';
+import * as Trigger from './Trigger';
+import * as BeforeTrigger from './BeforeTrigger';
+import * as Wait from './Wait';
+import * as Goal from './Goal';
+import * as Condition from './Condition';
+import * as PushNotification from './PushNotification';
+import * as ABTest from './ABTest';
+
+export { SimplePortFactory, Email, Banner, Generic, Segment, Trigger, BeforeTrigger, Wait, Goal, Condition, PushNotification, ABTest};
diff --git a/src/assets/scenario-builder/components/elements/index.scss b/src/assets/scenario-builder/components/elements/index.scss
new file mode 100644
index 0000000..e10492a
--- /dev/null
+++ b/src/assets/scenario-builder/components/elements/index.scss
@@ -0,0 +1,43 @@
+/*--- Colors ---*/
+$red: #db2828;
+$orange: #f2711c;
+$yellow: #fbbd08;
+$olive: #b5cc18;
+$green: #21ba45;
+$teal: #00b5ad;
+$blue: #2185d0;
+$violet: #6435c9;
+$purple: #a333c8;
+$pink: #e03997;
+$brown: #a5673f;
+$grey: #767676;
+$black: #1b1c1d;
+
+/*--- Light Colors ---*/
+$lightRed: #ff695e;
+$lightOrange: #ff851b;
+$lightYellow: #ffe21f;
+$lightOlive: #d9e778;
+$lightGreen: #2ecc40;
+$lightTeal: #6dffff;
+$lightBlue: #54c8ff;
+$lightViolet: #a291fb;
+$lightPurple: #dc73ff;
+$lightPink: #ff8edf;
+$lightBrown: #d67c1c;
+$lightGrey: #dcddde;
+$lightBlack: #54545418;
+
+@import './defaultElementsStyle';
+@import './Email/sass/style';
+@import './Generic/sass/style';
+@import './Segment/sass/style';
+@import './Trigger/sass/style';
+@import './BeforeTrigger/sass/style';
+@import './Wait/sass/style';
+@import './Link/sass/style';
+@import './Goal/sass/style';
+@import './Banner/sass/style';
+@import './Condition/sass/style';
+@import './PushNotification/sass/style';
+@import './ABTest/sass/style';
diff --git a/src/assets/scenario-builder/components/elements/params/BooleanParam.js b/src/assets/scenario-builder/components/elements/params/BooleanParam.js
new file mode 100644
index 0000000..e086a92
--- /dev/null
+++ b/src/assets/scenario-builder/components/elements/params/BooleanParam.js
@@ -0,0 +1,49 @@
+import React from 'react';
+import PropTypes from 'prop-types';
+import Switch from '@material-ui/core/Switch';
+import FormControlLabel from '@material-ui/core/FormControlLabel';
+import { actionSetParamValues } from './actions';
+import { makeStyles } from '@material-ui/core/styles';
+
+const useStyles = makeStyles(theme => ({
+ formControl: {
+ marginBottom: theme.spacing(1),
+ }
+}));
+
+export default function BooleanParam(props) {
+ const classes = useStyles();
+
+ // if not selected yet, set selection to True
+ if (props.values.selection === undefined) {
+ props.dispatch(actionSetParamValues(props.name, {
+ selection: true
+ }));
+ }
+
+ const handleChange = (event) => {
+ props.dispatch(actionSetParamValues(props.name, {
+ selection: event.target.checked
+ }));
+ };
+
+ return (
+ }
+ checked={props.values.selection !== undefined && props.values.selection}
+ label={props.blueprint.label}
+ className={classes.formControl}
+ />
+ );
+ }
+
+BooleanParam.propTypes = {
+ // name identifying input (same function as in HTML ), used in dispatch
+ name: PropTypes.any.isRequired,
+ // values, example: {selection: true}
+ values: PropTypes.object.isRequired,
+ // blueprint, example: {label: 'Is recurrent', type: 'boolean'}
+ blueprint: PropTypes.object.isRequired,
+ dispatch: PropTypes.func.isRequired,
+};
\ No newline at end of file
diff --git a/src/assets/scenario-builder/components/elements/params/NumberParam.js b/src/assets/scenario-builder/components/elements/params/NumberParam.js
new file mode 100644
index 0000000..fcab531
--- /dev/null
+++ b/src/assets/scenario-builder/components/elements/params/NumberParam.js
@@ -0,0 +1,95 @@
+import React from 'react';
+import PropTypes from 'prop-types';
+import TextField from '@material-ui/core/TextField';
+import InputLabel from '@material-ui/core/InputLabel';
+import FormLabel from '@material-ui/core/FormLabel';
+import MenuItem from '@material-ui/core/MenuItem';
+import FormControl from '@material-ui/core/FormControl';
+import Select from '@material-ui/core/Select';
+import { makeStyles } from '@material-ui/core/styles';
+import { actionSetParamValues, actionUpdateParamValues } from './actions';
+
+const useStyles = makeStyles((theme) => ({
+ formControl: {
+ marginRight: theme.spacing(1),
+ marginBottom: theme.spacing(1),
+ minWidth: 100,
+ },
+ formLabel: {
+ display: 'block',
+ marginBottom: theme.spacing(1),
+ },
+ numberInput: {
+ marginRight: theme.spacing(1),
+ marginBottom: theme.spacing(1),
+ }
+}));
+
+export default function NumberParam(props) {
+ const classes = useStyles();
+
+ // if only one operator, select it by default
+ if (props.values.operator === undefined && props.blueprint.operators && props.blueprint.operators.length === 1) {
+ props.dispatch(actionSetParamValues(props.name, {
+ operator: props.blueprint.operators[0]
+ }));
+ }
+
+ const handleOperatorChange = (event) => {
+ props.dispatch(actionUpdateParamValues(props.name, {
+ operator: event.target.value
+ }));
+ };
+
+ const handleInputChange = (event) => {
+ props.dispatch(actionUpdateParamValues(props.name, {
+ selection: event.target.value
+ }));
+ };
+
+ return (
+
+ {!props.hideLabel &&
+
+ {props.blueprint.label}
+
+ }
+
+ {props.blueprint.operators && props.blueprint.operators.length &&
+
+ Operator
+
+
+ }
+
+ HTML tag
+ inputProps={props.blueprint.numberInputAttributes ?? {}}
+ />
+
+ );
+}
+
+NumberParam.propTypes = {
+ // name identifying input (same function as in HTML ), used in dispatch
+ name: PropTypes.any.isRequired,
+ // values, example: {selection: 3, operator: '>'}
+ values: PropTypes.object.isRequired,
+ // blueprint, example: {label: 'Subscription type length', type: 'number', 'operators': ['=', '<', '>'], unit: 'Day(s)', numberInputAttributes: {min: 0}}
+ blueprint: PropTypes.object.isRequired,
+ dispatch: PropTypes.func.isRequired,
+ hideOperator: PropTypes.bool,
+ hideLabel: PropTypes.bool,
+};
\ No newline at end of file
diff --git a/src/assets/scenario-builder/components/elements/params/StringLabeledArrayParam.js b/src/assets/scenario-builder/components/elements/params/StringLabeledArrayParam.js
new file mode 100644
index 0000000..ef7f3a9
--- /dev/null
+++ b/src/assets/scenario-builder/components/elements/params/StringLabeledArrayParam.js
@@ -0,0 +1,148 @@
+import React from 'react';
+import PropTypes from 'prop-types';
+import Autocomplete from '@material-ui/lab/Autocomplete';
+import { createFilterOptions } from '@material-ui/lab/Autocomplete';
+import { TextField } from '@material-ui/core';
+import { makeStyles } from '@material-ui/core/styles';
+import { actionSetParamValues } from './actions';
+
+const elementStyles = makeStyles(theme => ({
+ // Puts visually OR/AND between tags
+ chipRoot: props => ({
+ "&:not(:first-child)": {
+ "&::before": {
+ content: "'" + props.operator + "'",
+ textTransform: 'uppercase',
+ position: 'absolute',
+ left: '-20px',
+ },
+ marginLeft: '20px'
+ },
+ position: 'relative'
+ }),
+ subtitle: {
+ paddingLeft: '6px',
+ color: theme.palette.grey[600]
+ },
+ autocomplete: {
+ marginBottom: theme.spacing(1),
+ }
+}));
+
+function selectedOptions(selectedValues, options) {
+ const s = new Set(selectedValues);
+ let selected = options.filter(option => {
+ let has = s.has(option.value);
+ if (has) {
+ // for free-solo mode
+ s.delete(option.value);
+ }
+ return has;
+ });
+ // If free solo mode is enabled, there might be additional selected values (outside of options), add them as well
+ return selected.concat([...s]);
+}
+
+function optionLabel(option) {
+ if (typeof(option) === 'string') {
+ // free-solo value
+ return option;
+ } else {
+ // predefined option value
+ return option.label;
+ }
+}
+
+function optionSubtitle(option) {
+ if (typeof(option) === 'string') {
+ return '';
+ } else {
+ return option.subtitle !== undefined ? option.subtitle : '';
+ }
+}
+
+function optionGroup(option) {
+ if (typeof(option) === 'string') {
+ // free-solo value
+ return '';
+ } else if (option.hasOwnProperty('group')) {
+ return option.group;
+ } else {
+ return '';
+ }
+}
+
+// https://material-ui.com/components/autocomplete/#createfilteroptions-config-filteroptions
+// Defines what values are searched within option
+const filterOptions = createFilterOptions({
+ matchFrom: 'any',
+ trim: true,
+ ignoreAccents: true,
+ ignoreCase: true,
+ stringify: option => {
+ return optionLabel(option) + " " + optionSubtitle(option);
+ },
+});
+
+export default function StringLabeledArrayParam(props) {
+ const classes = elementStyles({operator: props.blueprint.operator});
+ const handleChange = (event, values) => {
+ props.dispatch(actionSetParamValues(props.name, {
+ operator: props.blueprint.operator, // TODO add ability to change operator
+ selection: values.map(item => {
+ if (typeof(item) === 'string') {
+ // free-solo value
+ return item;
+ } else {
+ // predefined option value
+ return item.value;
+ }
+ })
+ }));
+ };
+
+ return (
+ (
+
+ )}
+ renderOption={(option, { selected }) => (
+
+ {optionLabel(option)}
+ {optionSubtitle(option)}
+
+ )}
+ />
+ );
+}
+
+StringLabeledArrayParam.propTypes = {
+ // name identifying input (same function as in HTML ), used in dispatch
+ name: PropTypes.any.isRequired,
+ // values, example: {selection: ['city_1'], operator: 'or'}
+ values: PropTypes.object.isRequired,
+ // blueprint, example: {label: 'Cities', type: 'string_labeled_array', options: [{value: 'city_1', label: 'City 1', subtitle: '(best city)' group: 'Group 1'}], operator: 'or', freeSolo: true}
+ blueprint: PropTypes.object.isRequired,
+ dispatch: PropTypes.func.isRequired,
+};
\ No newline at end of file
diff --git a/src/assets/scenario-builder/components/elements/params/TimeframeParam.js b/src/assets/scenario-builder/components/elements/params/TimeframeParam.js
new file mode 100644
index 0000000..b6d8d57
--- /dev/null
+++ b/src/assets/scenario-builder/components/elements/params/TimeframeParam.js
@@ -0,0 +1,122 @@
+import React from 'react';
+import PropTypes from 'prop-types';
+import TextField from '@material-ui/core/TextField';
+import InputLabel from '@material-ui/core/InputLabel';
+import FormLabel from '@material-ui/core/FormLabel';
+import MenuItem from '@material-ui/core/MenuItem';
+import FormControl from '@material-ui/core/FormControl';
+import Select from '@material-ui/core/Select';
+import { makeStyles } from '@material-ui/core/styles';
+import { actionSetParamValues, actionUpdateParamValues } from './actions';
+
+const useStyles = makeStyles((theme) => ({
+ formControl: {
+ marginRight: theme.spacing(1),
+ marginBottom: theme.spacing(1),
+ minWidth: 150,
+ },
+ formLabel: {
+ display: 'block',
+ marginBottom: theme.spacing(1),
+ },
+ amountInput: {
+ marginRight: theme.spacing(1),
+ marginBottom: theme.spacing(1),
+ }
+}));
+
+export default function TimeframeParam(props) {
+ const classes = useStyles();
+
+ // if only one operator, select it by default
+ if (props.values.operator === undefined && props.blueprint.operators && props.blueprint.operators.length === 1) {
+ props.dispatch(actionSetParamValues(props.name, {
+ operator: props.blueprint.operators[0]
+ }));
+ }
+
+ // if only one unit, select it by default
+ if (props.values.unit === undefined && props.blueprint.units && props.blueprint.units.length === 1) {
+ props.dispatch(actionUpdateParamValues(props.name, {
+ unit: props.blueprint.units[0]
+ }));
+ }
+
+ const handleOperatorChange = (event) => {
+ props.dispatch(actionUpdateParamValues(props.name, {
+ operator: event.target.value
+ }));
+ };
+
+ const handleUnitChange = (event) => {
+ props.dispatch(actionUpdateParamValues(props.name, {
+ unit: event.target.value
+ }));
+ };
+
+ const handleAmountInputChange = (event) => {
+ props.dispatch(actionUpdateParamValues(props.name, {
+ selection: event.target.value
+ }));
+ };
+
+ return (
+
+ {!props.hideLabel &&
+
+ {props.blueprint.label}
+
+ }
+
+ {props.blueprint.operators && props.blueprint.operators.length &&
+
+ Operator
+
+
+ }
+
+ HTML tag
+ inputProps={props.blueprint.amountInputAttributes ?? {}}
+ />
+
+ {props.blueprint.units && props.blueprint.units.length &&
+
+ {props.blueprint.unitsLabel}
+
+
+ }
+
+
+ );
+};
+
+TimeframeParam.propTypes = {
+ // name identifying input (same function as in HTML ), used in dispatch
+ name: PropTypes.any.isRequired,
+ // values, example: {selection: true}
+ values: PropTypes.object.isRequired,
+ // blueprint, example: {label: 'Timeframe', type: 'timeframe', 'operators': ['=', '<', '>'], 'units': ['days', 'months', 'years'], 'amountLabel': 'Amount', 'unitsLabel': 'Time unit', 'amountInputAttributes': {min: 0}}
+ blueprint: PropTypes.object.isRequired,
+ dispatch: PropTypes.func.isRequired,
+};
diff --git a/src/assets/scenario-builder/components/elements/params/actions.js b/src/assets/scenario-builder/components/elements/params/actions.js
new file mode 100644
index 0000000..7919352
--- /dev/null
+++ b/src/assets/scenario-builder/components/elements/params/actions.js
@@ -0,0 +1,19 @@
+export function actionSetParamValues(name, values) {
+ return {
+ type: 'SET_PARAM_VALUES',
+ payload: {
+ name: name,
+ values: values,
+ }
+ };
+}
+
+export function actionUpdateParamValues(name, values) {
+ return {
+ type: 'UPDATE_PARAM_VALUES',
+ payload: {
+ name: name,
+ values: values,
+ }
+ };
+}
\ No newline at end of file
diff --git a/src/assets/scenario-builder/components/sass/main.scss b/src/assets/scenario-builder/components/sass/main.scss
new file mode 100644
index 0000000..a637d0a
--- /dev/null
+++ b/src/assets/scenario-builder/components/sass/main.scss
@@ -0,0 +1,159 @@
+@import '~@projectstorm/react-diagrams/dist/style.min.css';
+@import '../elements/index';
+
+.srd-demo-workspace {
+ background: black;
+ display: flex;
+ flex-direction: column;
+ height: 100%;
+ border-radius: 5px;
+ overflow: hidden;
+
+ &__toolbar {
+ padding: 5px;
+ display: flex;
+ flex-shrink: 0;
+
+ button {
+ background: rgb(60, 60, 60);
+ font-size: 14px;
+ padding: 5px 10px;
+ border: none;
+ color: white;
+ outline: none;
+ cursor: pointer;
+ margin: 2px;
+ border-radius: 3px;
+
+ &:hover {
+ background: rgb(0, 192, 255);
+ }
+ }
+ }
+
+ &__content {
+ flex-grow: 1;
+ height: 100%;
+ }
+}
+
+.docs-preview-wrapper {
+ background: rgb(60, 60, 60);
+ border-radius: 10px;
+ overflow: hidden;
+ padding: 10px;
+ margin-top: 20px;
+ margin-bottom: 20px;
+}
+
+.srd-demo-canvas {
+ height: 100vh;
+ min-height: 300px;
+
+ background-color: rgba(0, 0, 0, 0.05) !important;
+ $color: rgba(0, 0, 0, 0.06);
+ background-size: 50px 50px;
+
+ .pointui {
+ fill: rgba(white, 0.5);
+ }
+}
+
+.diagram-layer {
+ position: relative;
+ top: 64px;
+}
+
+.body {
+ flex-grow: 1;
+ display: flex;
+ flex-direction: column;
+ min-height: 100%;
+
+ .tray-item {
+ cursor: move;
+ cursor: grab;
+ cursor: -moz-grab;
+ cursor: -webkit-grab;
+ }
+
+ .tray-item:active {
+ cursor: grabbing;
+ cursor: -moz-grabbing;
+ cursor: -webkit-grabbing;
+ }
+}
+
+.scenario-name {
+ &:hover {
+ cursor: pointer;
+ }
+ width: 100%;
+ display: inline-block;
+}
+.changing-name-input {
+ font-size: 20px;
+ width: 100%;
+ border: 0;
+ padding: 2px 5px;
+}
+
+.circular-loading {
+ margin-right: 15px;
+ position: relative;
+ top: 7px;
+}
+
+.toast-success {
+ background-color: #5d9d52 !important;
+}
+
+.toast-error {
+ background-color: #c33e37 !important;
+}
+
+.toast-info {
+ background-color: #3477cb !important;
+}
+
+.toast-warning {
+ background-color: #f3a33a !important;
+}
+
+.toast__icon {
+ font-size: 20px;
+}
+
+.toast__icon-variant {
+ opacity: 0.9;
+ margin-right: 10px;
+}
+
+.toast__message {
+ display: flex;
+ align-items: center;
+}
+
+.node-tooltip-loader {
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ padding: 20px;
+}
+
+.statistic-badge-container-bottom {
+ width: 100%;
+ display: flex;
+ justify-content: center;
+}
+
+.statistic-badge-right {
+ position: absolute;
+ top: 15px;
+ left: 60px;
+}
+
+.statistic-badge-bottom {
+ position: absolute;
+ top: 25px;
+}
diff --git a/src/assets/scenario-builder/components/widgets/BodyWidget.js b/src/assets/scenario-builder/components/widgets/BodyWidget.js
new file mode 100755
index 0000000..7eddfb1
--- /dev/null
+++ b/src/assets/scenario-builder/components/widgets/BodyWidget.js
@@ -0,0 +1,572 @@
+import * as React from 'react';
+import axios from 'axios';
+import { connect } from 'react-redux';
+import compose from 'recompose/compose';
+import { DiagramWidget, NodeModel } from '@projectstorm/react-diagrams';
+import Button from '@material-ui/core/Button';
+import Drawer from '@material-ui/core/Drawer';
+import AppBar from '@material-ui/core/AppBar';
+import CssBaseline from '@material-ui/core/CssBaseline';
+import Toolbar from '@material-ui/core/Toolbar';
+import List from '@material-ui/core/List';
+import ListSubheader from '@material-ui/core/ListSubheader';
+import Typography from '@material-ui/core/Typography';
+import Grid from '@material-ui/core/Grid';
+import { withStyles } from '@material-ui/core/styles';
+import CircularProgress from '@material-ui/core/CircularProgress';
+import EmailIcon from '@material-ui/icons/Mail';
+import ExtensionIcon from '@material-ui/icons/Extension';
+import BannerIcon from '@material-ui/icons/Adjust';
+import TriggerIcon from '@material-ui/icons/Notifications';
+import WaitIcon from '@material-ui/icons/AccessAlarmsOutlined';
+import SegmentIcon from '@material-ui/icons/SubdirectoryArrowRight';
+import ConditionIcon from '@material-ui/icons/CallSplit';
+import GoalIcon from '@material-ui/icons/CheckBox';
+import NotificationsActiveIcon from '@material-ui/icons/NotificationsActive';
+import PushNotificationIcon from '@material-ui/icons/PhonelinkRing';
+import ABTestIcon from '@material-ui/icons/SwapVert';
+
+import * as config from './../../config';
+import { TrayItemWidget } from './TrayItemWidget';
+import { ExportService } from '../../services/ExportService';
+import Notification from '../Notification';
+import {
+ Email,
+ Generic,
+ Segment,
+ Trigger,
+ BeforeTrigger,
+ Wait,
+ Goal,
+ Banner,
+ Condition,
+ PushNotification,
+ ABTest
+} from './../elements';
+import {
+ setScenarioId,
+ setScenarioName,
+ setCanvasNotification,
+ setScenarioLoading
+} from '../../actions';
+import {ZoomIn, ZoomOut, ZoomOutMap} from "@material-ui/icons";
+import {Divider} from "@material-ui/core";
+
+const drawerWidth = 240;
+
+const styles = theme => ({
+ root: {
+ display: 'flex'
+ },
+ appBar: {
+ zIndex: theme.zIndex.drawer + 1
+ },
+ drawer: {
+ width: drawerWidth,
+ flexShrink: 0
+ },
+ drawerPaper: {
+ width: drawerWidth
+ },
+ content: {
+ flexGrow: 1,
+ padding: 0
+ },
+ toolbar: theme.mixins.toolbar
+});
+
+const ctrlKey = 17,
+ cmdKey = 91,
+ vKey = 86,
+ cKey = 67;
+
+class BodyWidget extends React.Component {
+ constructor(props) {
+ super(props);
+ this.state = {
+ editingName: false,
+ editedName: ''
+ };
+
+ this.ctrlDown = false;
+ this.nodesToCopy = [];
+
+ // Required to bind 'this' inside callback methods
+ this.keydownHandler = this.keydownHandler.bind(this);
+ this.keyupHandler = this.keyupHandler.bind(this);
+ this.copyNode = this.copyNode.bind(this);
+ }
+
+ copyNode(nodeId) {
+ let offset = { x: 75, y: 75 };
+ let model = this.props.app.getDiagramEngine().getDiagramModel();
+ let nodes = model.getNodes();
+
+ if (nodes[nodeId] !== undefined) {
+ let newNode = nodes[nodeId].clone({});
+ newNode.setPosition(newNode.x + offset.x, newNode.y + offset.y);
+ newNode.selected = false;
+ model.addNode(newNode);
+ this.forceUpdate();
+ } else {
+ console.warn("Unable to copy node with ID " + nodeId);
+ }
+ }
+
+ keydownHandler(e) {
+ if (e.keyCode === ctrlKey || e.keyCode === cmdKey) {
+ this.ctrlDown = true;
+ }
+
+ // CTRL/CMD + C
+ if (this.ctrlDown && (e.keyCode === cKey)) {
+ let model = this.props.app.getDiagramEngine().getDiagramModel();
+ this.nodesToCopy = [];
+ for (const node of model.getSelectedItems()) {
+ // currently do not allow to copy links
+ if (node.selected && node instanceof NodeModel) {
+ this.nodesToCopy.push(node.id);
+ }
+ }
+ }
+
+ // CTRL/CMD + V
+ if (this.ctrlDown && (e.keyCode === vKey)) {
+ for (const nodeId of this.nodesToCopy) {
+ this.copyNode(nodeId);
+ }
+ this.nodesToCopy = [];
+ }
+ }
+
+ keyupHandler(e) {
+ if (e.keyCode === ctrlKey || e.keyCode === cmdKey) {
+ this.ctrlDown = false;
+ }
+ }
+
+ componentDidMount() {
+ document.addEventListener('keydown', this.keydownHandler);
+ document.addEventListener('keyup', this.keyupHandler);
+ }
+
+ componentWillUnmount() {
+ document.removeEventListener('keydown', this.keydownHandler);
+ document.removeEventListener('keyup', this.keyupHandler);
+ }
+
+ componentDidUpdate(prevProps) {
+ // Typical usage (don't forget to compare props):
+ if (this.props.app.isCorruptedPayload() === true && prevProps.app.isCorruptedPayload() === false) {
+ this.props.dispatch(
+ setCanvasNotification({
+ open: true,
+ variant: 'error',
+ text: 'Unable to load corrupted scenario.'
+ })
+ );
+ }
+ }
+
+ saveChanges = () => {
+ const { dispatch } = this.props;
+
+ // Check for corruption to prevent override
+ if (this.props.app.isCorruptedPayload()) {
+ dispatch(
+ setCanvasNotification({
+ open: true,
+ variant: 'error',
+ text: 'Cannot modify corrupted scenario.'
+ })
+ );
+ return;
+ };
+
+ const exportService = new ExportService(
+ this.props.app.getDiagramEngine().getDiagramModel()
+ );
+
+ const payload = {
+ name: this.props.scenario.name,
+ ...exportService.exportPayload()
+ };
+
+ const scenarioId = this.props.scenario.id;
+ if (scenarioId) {
+ payload.id = scenarioId;
+ }
+
+ dispatch(setScenarioLoading(true));
+
+ axios
+ .post(`${config.URL_SCENARIO_CREATE}`, payload)
+ .then(response => {
+ dispatch(setScenarioId(response.data.id));
+ dispatch(setScenarioLoading(false));
+ dispatch(
+ setCanvasNotification({
+ open: true,
+ variant: 'success',
+ text: 'Scenario saving succeeded.'
+ })
+ );
+ })
+ .catch(error => {
+ dispatch(setScenarioLoading(false));
+
+ let errorMessage = 'Scenario saving failed.';
+ if (error.response.data && error.response.data.message) {
+ errorMessage = error.response.data.message;
+ }
+
+ dispatch(
+ setCanvasNotification({
+ open: true,
+ variant: 'error',
+ text: errorMessage
+ })
+ );
+ console.log(error);
+ });
+ };
+
+ startEditingName = () => {
+ this.setState({
+ editedName: this.props.scenario.name,
+ editingName: true
+ });
+ };
+
+ cancelEditingName = () => {
+ this.setState({
+ editedName: '',
+ editingName: false
+ });
+ };
+
+ submitEditingName = () => {
+ if (this.state.editedName.trim().length === 0) {
+ this.cancelEditingName();
+ return;
+ }
+
+ this.props.dispatch(setScenarioName(this.state.editedName));
+ this.setState({
+ editedName: '',
+ editingName: false
+ });
+ };
+
+ handleCloseAndSaveDuringChangingName = event => {
+ if (event.keyCode === 27) {
+ this.cancelEditingName();
+ } else if (event.keyCode === 13) {
+ this.submitEditingName();
+ }
+ };
+
+ handleNameTyping = event => {
+ this.setState({
+ editedName: event.target.value
+ });
+ };
+
+ closeNotification = () => {
+ this.props.dispatch(setCanvasNotification({ open: false }));
+ };
+
+ zoomOut = () => {
+ let zoomLevel = this.props.app.diagramEngine.getDiagramModel().getZoomLevel();
+ this.props.app.diagramEngine.getDiagramModel().setZoomLevel(zoomLevel - 5);
+ this.props.app.diagramEngine.repaintCanvas();
+ };
+
+ zoomIn = () => {
+ let zoomLevel = this.props.app.diagramEngine.getDiagramModel().getZoomLevel();
+ this.props.app.diagramEngine.getDiagramModel().setZoomLevel(zoomLevel + 5);
+ this.props.app.diagramEngine.repaintCanvas();
+ };
+
+ zoomToFit = () => {
+ this.props.app.diagramEngine.zoomToFit();
+ };
+
+ render() {
+ const { classes, canvas } = this.props;
+
+ const diagramProps = {
+ className: 'srd-demo-canvas',
+ diagramEngine: this.props.app.getDiagramEngine(),
+ maxNumberPointsPerLink: 0,
+ allowLooseLinks: false,
+ allowCanvasTranslation: canvas.pannable,
+ allowCanvasZoom: canvas.zoomable
+ }; // as DiagramProps;
+
+ return (
+
+
+
+
+
+
+
+
+ {this.state.editingName ? (
+
+ ) : (
+
+ {this.props.scenario.name}
+
+ )}
+
+
+
+
+
+ {!!this.props.scenario.loading && (
+
+ )}
+
+
+
+
+
+
+
+
+
+
+
+
+ Triggers
+ }
+ >
+ }
+ />
+
+ }
+ />
+
+
+ Actions}
+ >
+ }
+ />
+
+ }
+ />
+
+ {config.BANNER_ENABLED &&
+ }
+ />
+ }
+
+ {config.PUSH_NOTIFICATION_ENABLED &&
+ }
+ />
+ }
+
+
+
+ Operations
+ }
+ >
+ }
+ />
+
+ }
+ />
+
+ }
+ />
+
+ }
+ />
+
+ }
+ />
+
+
+
+
+
+ {
+ const stormDiagramNode = event.dataTransfer.getData(
+ 'storm-diagram-node'
+ );
+ if (!stormDiagramNode) return;
+ var data = JSON.parse(stormDiagramNode);
+
+ var node = null;
+ if (data.type === 'email') {
+ node = new Email.NodeModel({});
+ } else if (data.type === 'generic') {
+ node = new Generic.NodeModel({});
+ } else if (data.type === 'banner') {
+ node = new Banner.NodeModel({
+ expiresInUnit: 'days',
+ expiresInTime: 1,
+ });
+ } else if (data.type === 'push_notification') {
+ node = new PushNotification.NodeModel({});
+ } else if (data.type === 'segment') {
+ node = new Segment.NodeModel({});
+ } else if (data.type === 'condition') {
+ node = new Condition.NodeModel({});
+ } else if (data.type === 'trigger') {
+ node = new Trigger.NodeModel({});
+ } else if (data.type === 'before_trigger') {
+ node = new BeforeTrigger.NodeModel({});
+ } else if (data.type === 'wait') {
+ node = new Wait.NodeModel({});
+ } else if (data.type === 'goal') {
+ node = new Goal.NodeModel({
+ recheckPeriodUnit: 'hours',
+ recheckPeriodTime: 1,
+ });
+ } else if (data.type === 'ab_test') {
+ node = new ABTest.NodeModel({
+ name: "AB Test",
+ scenarioName: this.props.scenario.name
+ });
+ }
+ var points = this.props.app
+ .getDiagramEngine()
+ .getRelativeMousePoint(event);
+ node.x = points.x;
+ node.y = points.y;
+ this.props.app
+ .getDiagramEngine()
+ .getDiagramModel()
+ .addNode(node);
+ this.forceUpdate();
+ }}
+ onDragOver={event => {
+ event.preventDefault();
+ }}
+ >
+
+
+
+
+
+ );
+ }
+}
+
+function mapStateToProps(state) {
+ return {
+ canvas: state.canvas,
+ scenario: state.scenario
+ };
+}
+
+export default compose(
+ withStyles(styles, { name: 'BodyWidget' }),
+ connect(
+ mapStateToProps,
+ null
+ )
+)(BodyWidget);
diff --git a/src/assets/scenario-builder/components/widgets/PortWidget.js b/src/assets/scenario-builder/components/widgets/PortWidget.js
new file mode 100644
index 0000000..d5a54b3
--- /dev/null
+++ b/src/assets/scenario-builder/components/widgets/PortWidget.js
@@ -0,0 +1,38 @@
+import * as React from 'react';
+
+import { PortWidget as BasePortWidget } from '@projectstorm/react-diagrams';
+
+export class PortWidget extends BasePortWidget {
+ constructor(props) {
+ super(props);
+ this.state = {
+ selected: false
+ };
+ }
+
+ getClassName() {
+ return (
+ 'port ' +
+ super.getClassName() +
+ (this.state.selected ? this.bem('--selected') : '')
+ );
+ }
+
+ render() {
+ return (
+ {
+ this.setState({ selected: true });
+ }}
+ onMouseLeave={() => {
+ this.setState({ selected: false });
+ }}
+ data-name={this.props.name}
+ data-nodeid={this.props.node.getID()}
+ >
+ {this.props.children}
+
+ );
+ }
+}
diff --git a/src/assets/scenario-builder/components/widgets/TrayItemWidget.js b/src/assets/scenario-builder/components/widgets/TrayItemWidget.js
new file mode 100755
index 0000000..5a9aaaa
--- /dev/null
+++ b/src/assets/scenario-builder/components/widgets/TrayItemWidget.js
@@ -0,0 +1,32 @@
+import * as React from 'react';
+
+import ListItem from '@material-ui/core/ListItem';
+import ListItemIcon from '@material-ui/core/ListItemIcon';
+import ListItemText from '@material-ui/core/ListItemText';
+
+export class TrayItemWidget extends React.Component {
+ constructor(props) {
+ super(props);
+ this.state = {};
+ }
+
+ render() {
+ return (
+ {
+ event.dataTransfer.setData(
+ 'storm-diagram-node',
+ JSON.stringify(this.props.model)
+ );
+ }}
+ className='tray-item'
+ >
+ {this.props.icon}
+
+
+ );
+ }
+}
diff --git a/src/assets/scenario-builder/config.js b/src/assets/scenario-builder/config.js
new file mode 100644
index 0000000..9de0267
--- /dev/null
+++ b/src/assets/scenario-builder/config.js
@@ -0,0 +1,28 @@
+// window.Scenario = {
+// config: {
+// AUTH_TOKEN: '',
+// CRM_HOST: 'https://predplatne.dennikn.sk',
+// SCENARIO_ID: null,
+// BANNER_ENABLED: null,
+// PUSH_NOTIFICATION_ENABLED: null,
+// }
+// };
+
+export const { AUTH_TOKEN, CRM_HOST, SCENARIO_ID, BANNER_ENABLED, PUSH_NOTIFICATION_ENABLED } = window.Scenario.config;
+
+export const URL_SCENARIO_DETAIL = `${CRM_HOST}/api/v1/scenarios/info?id=`;
+export const URL_SCENARIO_CREATE = `${CRM_HOST}/api/v1/scenarios/create`;
+export const URL_SCENARIO_CRITERIA = `${CRM_HOST}/api/v1/scenarios/criteria`;
+export const URL_SEGMENTS_INDEX = `${CRM_HOST}/api/v1/segments/list`;
+export const URL_TRIGGERS_INDEX = `${CRM_HOST}/api/v1/events/list`;
+export const URL_BEFORE_TRIGGERS_INDEX = `${CRM_HOST}/api/v1/event-generators/list`;
+export const URL_MAILS_INDEX = `${CRM_HOST}/api/v1/mail-template/list`;
+export const URL_GENERICS_INDEX = `${CRM_HOST}/api/v1/scenarios/generics`;
+export const URL_GOALS_INDEX = `${CRM_HOST}/api/v1/onboarding-goals/list`;
+export const URL_BANNERS_INDEX = `${CRM_HOST}/api/v1/remp/list-banners`;
+export const URL_PUSH_NOTIFICATION_TEMPLATES = `${CRM_HOST}/api/v1/onesignal-templates/list`;
+export const URL_PUSH_NOTIFICATION_APPLICATIONS = `${CRM_HOST}/api/v1/onesignal-applications/list`;
+export const URL_SCENARIO_STATISTIC = `${CRM_HOST}/api/v1/scenarios/stats?id=`;
+
+export const URL_SEGMENT_NEW = `${CRM_HOST}/segment/stored-segments/new`;
+export const URL_SEGMENT_SHOW = `${CRM_HOST}/segment/stored-segments/show/`;
\ No newline at end of file
diff --git a/src/assets/scenario-builder/index.js b/src/assets/scenario-builder/index.js
new file mode 100644
index 0000000..f131976
--- /dev/null
+++ b/src/assets/scenario-builder/index.js
@@ -0,0 +1,28 @@
+import React from 'react';
+import { render } from 'react-dom';
+import { Provider } from 'react-redux';
+import { createStore, applyMiddleware, compose } from 'redux';
+import thunkMiddleware from 'redux-thunk';
+import axios from 'axios';
+
+import rootReducer from './reducers';
+import App from './App';
+import * as config from './config';
+
+window.__MUI_USE_NEXT_TYPOGRAPHY_VARIANTS__ = true;
+axios.defaults.headers.common['Authorization'] = config.AUTH_TOKEN;
+
+const composeEnhancers = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose;
+
+const store = createStore(
+ rootReducer,
+ {},
+ composeEnhancers(applyMiddleware(thunkMiddleware))
+);
+
+render(
+
+
+ ,
+ document.getElementById('root')
+);
diff --git a/src/assets/scenario-builder/public/index.html b/src/assets/scenario-builder/public/index.html
new file mode 100644
index 0000000..35b319a
--- /dev/null
+++ b/src/assets/scenario-builder/public/index.html
@@ -0,0 +1,34 @@
+
+
+
+
+
+
+ remp-scenario
+
+
+
+
+
+
+
diff --git a/src/assets/scenario-builder/reducers/BannersReducer.js b/src/assets/scenario-builder/reducers/BannersReducer.js
new file mode 100644
index 0000000..96e1a96
--- /dev/null
+++ b/src/assets/scenario-builder/reducers/BannersReducer.js
@@ -0,0 +1,15 @@
+import { BANNERS_CHANGED } from '../actions/types';
+
+const INITIAL_STATE = {
+ availableBanners: []
+};
+
+export default (state = INITIAL_STATE, action) => {
+ switch (action.type) {
+ case BANNERS_CHANGED:
+ return { ...state, availableBanners: action.payload };
+
+ default:
+ return state;
+ }
+};
diff --git a/src/assets/scenario-builder/reducers/BeforeTriggersReducer.js b/src/assets/scenario-builder/reducers/BeforeTriggersReducer.js
new file mode 100644
index 0000000..e582103
--- /dev/null
+++ b/src/assets/scenario-builder/reducers/BeforeTriggersReducer.js
@@ -0,0 +1,15 @@
+import {BEFORE_TRIGGERS_CHANGED} from '../actions/types';
+
+const INITIAL_STATE = {
+ availableBeforeTriggers: []
+};
+
+export default (state = INITIAL_STATE, action) => {
+ switch (action.type) {
+ case BEFORE_TRIGGERS_CHANGED:
+ return { ...state, availableBeforeTriggers: action.payload };
+
+ default:
+ return state;
+ }
+};
diff --git a/src/assets/scenario-builder/reducers/CanvasReducer.js b/src/assets/scenario-builder/reducers/CanvasReducer.js
new file mode 100644
index 0000000..f5bd929
--- /dev/null
+++ b/src/assets/scenario-builder/reducers/CanvasReducer.js
@@ -0,0 +1,38 @@
+import {
+ CANVAS_PANNABLE,
+ CANVAS_ZOOMABLE,
+ CANVAS_ZOOMABLE_PANNABLE,
+ CANVAS_NOTIFICATION
+} from './../actions/types';
+
+const INITIAL_STATE = {
+ pannable: true,
+ zoomable: true,
+ notification: {
+ open: false,
+ variant: 'success',
+ text: ''
+ }
+};
+
+export default (state = INITIAL_STATE, action) => {
+ switch (action.type) {
+ case CANVAS_PANNABLE:
+ return { ...state, pannable: action.payload };
+
+ case CANVAS_ZOOMABLE:
+ return { ...state, zoomable: action.payload };
+
+ case CANVAS_ZOOMABLE_PANNABLE:
+ return { ...state, zoomable: action.payload, pannable: action.payload };
+
+ case CANVAS_NOTIFICATION:
+ return {
+ ...state,
+ notification: { ...state.notification, ...action.payload }
+ };
+
+ default:
+ return state;
+ }
+};
diff --git a/src/assets/scenario-builder/reducers/CriteriaReducer.js b/src/assets/scenario-builder/reducers/CriteriaReducer.js
new file mode 100644
index 0000000..d12ca7e
--- /dev/null
+++ b/src/assets/scenario-builder/reducers/CriteriaReducer.js
@@ -0,0 +1,18 @@
+
+import {
+ CRITERIA_CHANGED
+} from './../actions/types';
+
+const INITIAL_STATE = {
+ criteria: []
+};
+
+export default (state = INITIAL_STATE, action) => {
+ switch (action.type) {
+ case CRITERIA_CHANGED:
+ return { ...state, criteria: action.payload };
+
+ default:
+ return state;
+ }
+};
\ No newline at end of file
diff --git a/src/assets/scenario-builder/reducers/GenericsReducer.js b/src/assets/scenario-builder/reducers/GenericsReducer.js
new file mode 100644
index 0000000..fd48c7a
--- /dev/null
+++ b/src/assets/scenario-builder/reducers/GenericsReducer.js
@@ -0,0 +1,15 @@
+import { GENERICS_CHANGED } from './../actions/types';
+
+const INITIAL_STATE = {
+ generics: []
+};
+
+export default (state = INITIAL_STATE, action) => {
+ switch (action.type) {
+ case GENERICS_CHANGED:
+ return { ...state, generics: action.payload };
+
+ default:
+ return state;
+ }
+};
diff --git a/src/assets/scenario-builder/reducers/GoalsReducer.js b/src/assets/scenario-builder/reducers/GoalsReducer.js
new file mode 100644
index 0000000..d096d28
--- /dev/null
+++ b/src/assets/scenario-builder/reducers/GoalsReducer.js
@@ -0,0 +1,15 @@
+import { GOALS_CHANGED } from './../actions/types';
+
+const INITIAL_STATE = {
+ availableGoals: []
+};
+
+export default (state = INITIAL_STATE, action) => {
+ switch (action.type) {
+ case GOALS_CHANGED:
+ return { ...state, availableGoals: action.payload };
+
+ default:
+ return state;
+ }
+};
diff --git a/src/assets/scenario-builder/reducers/MailsReducer.js b/src/assets/scenario-builder/reducers/MailsReducer.js
new file mode 100644
index 0000000..049abfe
--- /dev/null
+++ b/src/assets/scenario-builder/reducers/MailsReducer.js
@@ -0,0 +1,15 @@
+import { MAILS_CHANGED } from './../actions/types';
+
+const INITIAL_STATE = {
+ availableMails: []
+};
+
+export default (state = INITIAL_STATE, action) => {
+ switch (action.type) {
+ case MAILS_CHANGED:
+ return { ...state, availableMails: action.payload };
+
+ default:
+ return state;
+ }
+};
diff --git a/src/assets/scenario-builder/reducers/PushNotificationsReducer.js b/src/assets/scenario-builder/reducers/PushNotificationsReducer.js
new file mode 100644
index 0000000..134ecec
--- /dev/null
+++ b/src/assets/scenario-builder/reducers/PushNotificationsReducer.js
@@ -0,0 +1,20 @@
+import { PUSH_NOTIFICATIONS_CHANGED } from './../actions/types';
+
+const INITIAL_STATE = {
+ availableTemplates: [],
+ availableApplications: [],
+};
+
+export default (state = INITIAL_STATE, action) => {
+ switch (action.type) {
+ case PUSH_NOTIFICATIONS_CHANGED:
+ return {
+ ...state,
+ availableTemplates: action.payload.templates,
+ availableApplications: action.payload.applications,
+ };
+
+ default:
+ return state;
+ }
+};
diff --git a/src/assets/scenario-builder/reducers/ScenarioReducer.js b/src/assets/scenario-builder/reducers/ScenarioReducer.js
new file mode 100644
index 0000000..fc9651d
--- /dev/null
+++ b/src/assets/scenario-builder/reducers/ScenarioReducer.js
@@ -0,0 +1,38 @@
+import {
+ SET_SCENARIO_ID,
+ SET_SCENARIO_NAME,
+ SET_SCENARIO_LOADING,
+ SET_SCENARIO_PAYLOAD
+} from './../actions/types';
+
+const INITIAL_STATE = {
+ id: null,
+ name: '',
+ loading: 0,
+ payload: null
+};
+
+export default (state = INITIAL_STATE, action) => {
+ switch (action.type) {
+ case SET_SCENARIO_ID:
+ return { ...state, id: action.payload };
+
+ case SET_SCENARIO_NAME:
+ return { ...state, name: action.payload };
+
+ case SET_SCENARIO_LOADING:
+ let loading = state.loading;
+ if (action.payload) {
+ ++loading;
+ } else {
+ --loading;
+ }
+ return { ...state, loading };
+
+ case SET_SCENARIO_PAYLOAD:
+ return { ...state, payload: action.payload };
+
+ default:
+ return state;
+ }
+};
diff --git a/src/assets/scenario-builder/reducers/SegmentsReducer.js b/src/assets/scenario-builder/reducers/SegmentsReducer.js
new file mode 100644
index 0000000..7320de9
--- /dev/null
+++ b/src/assets/scenario-builder/reducers/SegmentsReducer.js
@@ -0,0 +1,18 @@
+
+import {
+ SEGMENTS_CHANGED
+} from './../actions/types';
+
+const INITIAL_STATE = {
+ avalaibleSegments: []
+};
+
+export default (state = INITIAL_STATE, action) => {
+ switch (action.type) {
+ case SEGMENTS_CHANGED:
+ return { ...state, avalaibleSegments: action.payload };
+
+ default:
+ return state;
+ }
+};
\ No newline at end of file
diff --git a/src/assets/scenario-builder/reducers/StatisticsReducer.js b/src/assets/scenario-builder/reducers/StatisticsReducer.js
new file mode 100644
index 0000000..780f2ea
--- /dev/null
+++ b/src/assets/scenario-builder/reducers/StatisticsReducer.js
@@ -0,0 +1,19 @@
+import {STATISTICS_CHANGED} from "../actions/types";
+
+const INITIAL_STATE = {
+ statistics: []
+};
+
+export default (state = INITIAL_STATE, action) => {
+ switch (action.type) {
+ case STATISTICS_CHANGED:
+ return {
+ ...state,
+ statistics: action.payload.statistics,
+ };
+
+ default:
+ return state;
+
+ }
+};
\ No newline at end of file
diff --git a/src/assets/scenario-builder/reducers/TriggersReducer.js b/src/assets/scenario-builder/reducers/TriggersReducer.js
new file mode 100644
index 0000000..37b2ad3
--- /dev/null
+++ b/src/assets/scenario-builder/reducers/TriggersReducer.js
@@ -0,0 +1,15 @@
+import { TRIGGERS_CHANGED } from './../actions/types';
+
+const INITIAL_STATE = {
+ avalaibleTriggers: []
+};
+
+export default (state = INITIAL_STATE, action) => {
+ switch (action.type) {
+ case TRIGGERS_CHANGED:
+ return { ...state, avalaibleTriggers: action.payload };
+
+ default:
+ return state;
+ }
+};
diff --git a/src/assets/scenario-builder/reducers/index.js b/src/assets/scenario-builder/reducers/index.js
new file mode 100644
index 0000000..78436e6
--- /dev/null
+++ b/src/assets/scenario-builder/reducers/index.js
@@ -0,0 +1,28 @@
+import { combineReducers } from 'redux';
+import SegmentsReducer from './SegmentsReducer';
+import CriteriaReducer from './CriteriaReducer';
+import TriggersReducer from './TriggersReducer';
+import BeforeTriggersReducer from './BeforeTriggersReducer';
+import CanvasReducer from './CanvasReducer';
+import ScenarioReducer from './ScenarioReducer';
+import MailsReducer from './MailsReducer';
+import GenericsReducer from './GenericsReducer';
+import GoalsReducer from './GoalsReducer';
+import BannersReducer from './BannersReducer';
+import PushNotificationsReducer from './PushNotificationsReducer';
+import StatisticsReducer from "./StatisticsReducer";
+
+export default combineReducers({
+ segments: SegmentsReducer,
+ triggers: TriggersReducer,
+ beforeTriggers: BeforeTriggersReducer,
+ canvas: CanvasReducer,
+ criteria: CriteriaReducer,
+ scenario: ScenarioReducer,
+ mails: MailsReducer,
+ generics: GenericsReducer,
+ goals: GoalsReducer,
+ banners: BannersReducer,
+ pushNotifications: PushNotificationsReducer,
+ statistics: StatisticsReducer,
+});
diff --git a/src/assets/scenario-builder/services/ExportService.js b/src/assets/scenario-builder/services/ExportService.js
new file mode 100644
index 0000000..0c2c284
--- /dev/null
+++ b/src/assets/scenario-builder/services/ExportService.js
@@ -0,0 +1,244 @@
+function unitTimeToMinutes(time, unit) {
+ switch (unit) {
+ case 'minutes':
+ return parseInt(time);
+ case 'hours':
+ return time * 60;
+ case 'days':
+ return time * 60 * 24;
+ default:
+ return parseInt(time);
+ }
+}
+
+export class ExportService {
+ constructor(model) {
+ this.model = model;
+ }
+
+ exportPayload() {
+ const payload = {};
+ const serializedModel = this.model.serializeDiagram();
+ const triggers = ['trigger', 'before_trigger'];
+
+ payload.triggers = {};
+ payload.elements = {};
+
+ payload.visual = {};
+
+ serializedModel.nodes
+ .filter(node => triggers.includes(node.type))
+ .map(node => (payload.triggers[node.id] = this.formatNode(node)));
+
+ Object.entries(this.model.getNodes()).forEach(node => {
+ payload.visual[node[0]] = {
+ x: node[1].x,
+ y: node[1].y
+ };
+ });
+
+ Object.entries(this.model.getNodes()).forEach(node => {
+
+ if (!triggers.includes(node[1].type)) {
+ payload.elements[node[0]] = this.formatNode(node[1].serialize());
+ }
+ });
+
+ return payload;
+ }
+
+ getAllChildrenNodes(node, portName = 'right') {
+ const port = node.ports.find(port => port.name === portName);
+
+ let childrenNodes = port.links.map(link => {
+ let nextNode = null;
+
+ if (this.model.links[link].targetPort.parent.id !== node.id) {
+ nextNode = this.model.links[link].targetPort.parent;
+ } else {
+ nextNode = this.model.links[link].sourcePort.parent;
+ }
+
+ return { ...nextNode.serialize(), portName };
+ });
+
+ return childrenNodes;
+ }
+
+ getPositiveAndNegativeDescendants(node) {
+ const descendantsPositive = this.getAllChildrenNodes(node, 'right').map(
+ descendantNode => this.formatDescendant(descendantNode, node)
+ );
+ const descendantsNegative = this.getAllChildrenNodes(node, 'bottom').map(
+ descendantNode => this.formatDescendant(descendantNode, node)
+ );
+ return [...descendantsPositive, ...descendantsNegative];
+ }
+
+ formatNode(node) {
+ if (node.type === 'email') {
+ return {
+ id: node.id,
+ name: node.name ? node.name : '',
+ type: 'email',
+ email: {
+ code: node.selectedMail,
+ descendants: this.getAllChildrenNodes(node).map(descendantNode =>
+ this.formatDescendant(descendantNode, node)
+ )
+ }
+ };
+ } else if (node.type === 'banner') {
+ return {
+ id: node.id,
+ name: node.name ? node.name : '',
+ type: 'banner',
+ banner: {
+ id: node.selectedBanner,
+ expiresInMinutes: unitTimeToMinutes(node.expiresInTime, node.expiresInUnit),
+ descendants: this.getAllChildrenNodes(node).map(descendantNode =>
+ this.formatDescendant(descendantNode, node)
+ )
+ }
+ };
+ } else if (node.type === 'generic') {
+ return {
+ id: node.id,
+ name: node.name ? node.name : '',
+ type: 'generic',
+ generic: {
+ code: node.selectedGeneric,
+ options: node.options,
+ descendants: this.getAllChildrenNodes(node).map(descendantNode =>
+ this.formatDescendant(descendantNode, node)
+ )
+ }
+ };
+ } else if (node.type === 'condition') {
+ return {
+ id: node.id,
+ name: node.name ? node.name : '',
+ type: 'condition',
+ condition: {
+ conditions: node.conditions,
+ descendants: this.getPositiveAndNegativeDescendants(node),
+ }
+ };
+ } else if (node.type === 'segment') {
+ return {
+ id: node.id,
+ name: node.name ? node.name : '',
+ type: 'segment',
+ segment: {
+ code: node.selectedSegment ?? null,
+ descendants: this.getPositiveAndNegativeDescendants(node),
+ }
+ };
+ } else if (node.type === 'trigger') {
+ return {
+ id: node.id,
+ name: node.name ? node.name : '',
+ type: 'event',
+ event: {
+ code: node.selectedTrigger ?? null
+ },
+ elements: this.getAllChildrenNodes(node).map(
+ descendantNode => descendantNode.id
+ )
+ };
+ } else if (node.type === 'before_trigger') {
+ return {
+ id: node.id,
+ name: node.name ? node.name : '',
+ type: 'before_event',
+ event: {
+ code: node.selectedTrigger ?? null
+ },
+ elements: this.getAllChildrenNodes(node).map(
+ descendantNode => descendantNode.id
+ ),
+ options: {
+ minutes: unitTimeToMinutes(node.time, node.timeUnit)
+ }
+ };
+ } else if (node.type === 'wait') {
+ return {
+ id: node.id,
+ name: node.name ? node.name : '',
+ type: 'wait',
+ wait: {
+ minutes: unitTimeToMinutes(node.waitingTime, node.waitingUnit),
+ descendants: this.getAllChildrenNodes(node).map(descendantNode =>
+ this.formatDescendant(descendantNode, node)
+ )
+ }
+ };
+ } else if (node.type === 'goal') {
+ let goalProperties = {
+ codes: node.selectedGoals ? node.selectedGoals : [],
+ descendants: this.getPositiveAndNegativeDescendants(node),
+ recheckPeriodMinutes: unitTimeToMinutes(node.recheckPeriodTime, node.recheckPeriodUnit)
+ };
+
+ if (node.timeoutTime && node.timeoutUnit) {
+ goalProperties.timeoutMinutes = unitTimeToMinutes(node.timeoutTime, node.timeoutUnit);
+ }
+
+ return {
+ id: node.id,
+ name: node.name ? node.name : '',
+ type: 'goal',
+ goal: goalProperties,
+ };
+ } else if (node.type === 'push_notification') {
+ return {
+ id: node.id,
+ name: node.name ? node.name : '',
+ type: 'push_notification',
+ push_notification: {
+ template: node.selectedTemplate,
+ application: node.selectedApplication,
+ descendants: this.getAllChildrenNodes(node).map(descendantNode =>
+ this.formatDescendant(descendantNode, node)
+ )
+ }
+ }
+ } else if (node.type === 'ab_test') {
+ let descendants = node.ports
+ .filter(port => port.name.startsWith('right.'))
+ .flatMap(port => this.getAllChildrenNodes(node, port.name)
+ .map(descendantNode => this.formatDescendant(descendantNode, node)
+ )
+ );
+
+ return {
+ id: node.id,
+ name: node.name ? node.name : '',
+ type: 'ab_test',
+ ab_test: {
+ variants: node.variants,
+ descendants: descendants
+ }
+ }
+ }
+ }
+
+ formatDescendant = (node, parentNode, index = 0) => {
+ let descendant = {
+ uuid: node.id
+ };
+
+ if (parentNode.type === 'segment') {
+ descendant.direction = node.portName === 'right' ? 'positive' : 'negative';
+ } else if (parentNode.type === 'goal') {
+ descendant.direction = node.portName === 'right' ? 'positive' : 'negative';
+ } else if (parentNode.type === 'condition') {
+ descendant.direction = node.portName === 'right' ? 'positive' : 'negative';
+ } else if (parentNode.type === 'ab_test') {
+ descendant.direction = 'positive';
+ descendant.position = node.portName.split('.')[1];
+ }
+
+ return descendant;
+ };
+}
diff --git a/src/assets/scenario-builder/services/RenderService.js b/src/assets/scenario-builder/services/RenderService.js
new file mode 100644
index 0000000..d62803b
--- /dev/null
+++ b/src/assets/scenario-builder/services/RenderService.js
@@ -0,0 +1,201 @@
+import flatMap from 'lodash/flatMap';
+
+// import the custom models
+import {
+ Banner,
+ Email,
+ Segment,
+ Trigger,
+ Wait,
+ Goal,
+ Condition,
+ BeforeTrigger,
+ Generic,
+ PushNotification,
+ ABTest
+} from './../components/elements';
+import { BANNER_ENABLED } from './../config';
+
+function minutesToTimeUnit(minutes) {
+ if (minutes === 0) {
+ return {
+ unit: 'minutes',
+ time: minutes
+ };
+ }
+
+ if (minutes % 1440 === 0) {
+ return {
+ unit: 'days',
+ time: minutes / 1440
+ };
+ } else if (minutes % 60 === 0) {
+ return {
+ unit: 'hours',
+ time: minutes / 60
+ };
+ }
+ return {
+ unit: 'minutes',
+ time: minutes
+ };
+}
+
+export class RenderService {
+ constructor(activeModel, payload = {}) {
+ this.activeModel = activeModel;
+ this.payload = payload;
+ }
+
+ renderPayload(payload) {
+ this.payload = payload;
+
+ const visual = this.payload.visual;
+
+ //render Nodes
+ flatMap(payload.elements, element => {
+ let node = null;
+
+ if (element.type === 'segment') {
+
+ element.selectedSegment = element.segment.code;
+ node = new Segment.NodeModel(element);
+
+ } else if (element.type === 'condition') {
+
+ node = new Condition.NodeModel({
+ id: element.id,
+ name: element.name,
+ conditions: element.condition.conditions
+ });
+
+ } else if (element.type === 'email') {
+
+ element.selectedMail = element.email.code;
+ node = new Email.NodeModel(element);
+
+ } else if (element.type === 'generic') {
+
+ element.selectedGeneric = element.generic.code;
+ element.options = element.generic.options;
+ node = new Generic.NodeModel(element);
+
+ } else if (element.type === 'wait') {
+
+ const timeUnit = minutesToTimeUnit(element.wait.minutes);
+ element.waitingUnit = timeUnit.unit;
+ element.waitingTime = timeUnit.time;
+
+ node = new Wait.NodeModel(element);
+
+ } else if (element.type === 'banner') {
+
+ if (!BANNER_ENABLED) {
+ throw Error("BANNER_ENABLED configuration is false, but loaded scenario contains banner element.");
+ }
+
+ const timeUnit = minutesToTimeUnit(element.banner.expiresInMinutes);
+ element.expiresInUnit = timeUnit.unit;
+ element.expiresInTime = timeUnit.time;
+
+ element.selectedBanner = element.banner.id;
+
+ node = new Banner.NodeModel(element);
+
+ } else if (element.type === 'goal') {
+
+ if (element.goal.hasOwnProperty("timeoutMinutes")) {
+ const timeUnit = minutesToTimeUnit(element.goal.timeoutMinutes);
+ element.timeoutUnit = timeUnit.unit;
+ element.timeoutTime = timeUnit.time;
+ }
+
+ const recheckPeriodTimeUnit = minutesToTimeUnit(element.goal.recheckPeriodMinutes);
+ element.recheckPeriodUnit = recheckPeriodTimeUnit.unit;
+ element.recheckPeriodTime = recheckPeriodTimeUnit.time;
+
+ element.selectedGoals = element.goal.codes;
+
+ node = new Goal.NodeModel(element);
+
+ } else if (element.type === 'push_notification') {
+
+ element.selectedTemplate = element.push_notification.template;
+ element.selectedApplication = element.push_notification.application;
+
+ node = new PushNotification.NodeModel(element);
+
+ } else if (element.type === 'ab_test') {
+
+ node = new ABTest.NodeModel({
+ 'id': element.id,
+ 'name': element.name,
+ 'variants': element.ab_test.variants,
+ 'scenarioName': this.payload.name
+ });
+ }
+
+ this.activeModel.addNode(node);
+ node.setPosition(visual[element.id].x, visual[element.id].y);
+ });
+
+ // link nodes
+ flatMap(payload.elements, element => {
+ let sourceNode = this.activeModel.getNode(element.id);
+
+ element[element.type].descendants.forEach(item => {
+ this.linkNodes(sourceNode, this.activeModel.getNode(item.uuid), item.direction, item.position);
+ });
+ });
+
+ // renderTriggers
+ flatMap(payload.triggers, trigger => {
+
+ let node = null;
+ if (trigger.type === 'event') {
+
+ trigger.selectedTrigger = trigger.event.code;
+ node = new Trigger.NodeModel(trigger);
+
+ } else if (trigger.type === 'before_event') {
+
+ const timeUnit = minutesToTimeUnit(trigger.options.minutes);
+ trigger.timeUnit = timeUnit.unit;
+ trigger.time = timeUnit.time;
+ trigger.selectedTrigger = trigger.event.code;
+
+ node = new BeforeTrigger.NodeModel(trigger);
+ }
+
+ this.activeModel.addNode(node);
+ node.setPosition(visual[trigger.id].x, visual[trigger.id].y);
+
+ // link triggers with nodes
+ trigger.elements.forEach(element => {
+ this.linkNodes(node, this.activeModel.getNode(element));
+ });
+ });
+ }
+
+ linkNodes(sourceNode, targetNode, direction, position = 0) {
+ if (direction){
+ if (direction === 'positive') {
+ let link;
+ if (sourceNode.type === 'ab_test') {
+ link = sourceNode.getPort('right.' + position).link(targetNode.getPort('left'));
+ } else {
+ link = sourceNode.getPort('right').link(targetNode.getPort('left'));
+ }
+ this.activeModel.addLink(link);
+ return;
+ } else if (direction === 'negative') {
+ const link = sourceNode.getPort('bottom').link(targetNode.getPort('left'));
+ this.activeModel.addLink(link);
+ return;
+ }
+ }
+
+ const link = sourceNode.getPort('right').link(targetNode.getPort('left'));
+ this.activeModel.addLink(link);
+ }
+}
diff --git a/src/assets/scenario-builder/services/index.js b/src/assets/scenario-builder/services/index.js
new file mode 100644
index 0000000..422e486
--- /dev/null
+++ b/src/assets/scenario-builder/services/index.js
@@ -0,0 +1,7 @@
+import RenderService from "./RenderService";
+import ExportService from ".ExportService";
+
+export {
+ RenderService,
+ ExportService
+};
diff --git a/src/assets/scenariobuilder/css/2.31f6971f.chunk.css b/src/assets/scenariobuilder/css/2.31f6971f.chunk.css
deleted file mode 100644
index ace14ed..0000000
--- a/src/assets/scenariobuilder/css/2.31f6971f.chunk.css
+++ /dev/null
@@ -1 +0,0 @@
-.srd-diagram{position:relative;flex-grow:1;display:flex;cursor:move;overflow:hidden}.srd-diagram__selector{position:absolute;background-color:rgba(0,192,255,.2);border:2px solid #00c0ff}.srd-link-layer{overflow:visible!important}.srd-link-layer,.srd-node-layer{position:absolute;height:100%;width:100%;transform-origin:0 0;top:0;bottom:0;left:0;right:0}.srd-node-layer{pointer-events:none}.srd-node{position:absolute;-webkit-touch-callout:none;-webkit-user-select:none;user-select:none;cursor:move;pointer-events:all}.srd-node--selected>*{border-color:#00c0ff!important}.srd-port{width:15px;height:15px;background:hsla(0,0%,100%,.1)}.srd-port.selected,.srd-port:hover{background:#c0ff00}.srd-default-node{background-color:#1e1e1e;border-radius:5px;font-family:sans-serif;color:#fff;border:2px solid #000;overflow:visible;font-size:11px}.srd-default-node__title{background:rgba(0,0,0,.3);display:flex;white-space:nowrap}.srd-default-node__title>*{align-self:center}.srd-default-node__title .fa{padding:5px;opacity:.2;cursor:pointer}.srd-default-node__title .fa:hover{opacity:1}.srd-default-node__name{flex-grow:1;padding:5px}.srd-default-node__ports{display:flex;background-image:linear-gradient(rgba(0,0,0,.1),rgba(0,0,0,.2))}.srd-default-node__in,.srd-default-node__out{flex-grow:1;display:flex;flex-direction:column}.srd-default-port{display:flex;margin-top:1px}.srd-default-port>*{align-self:center}.srd-default-port__name{padding:0 5px}.srd-default-port--out{justify-content:flex-end}.srd-default-port--out .srd-default-port__name{justify-content:flex-end;text-align:right}.srd-default-label{background:rgba(70,70,70,.8);border:1px solid #333;border-radius:4px;color:#fff;display:inline-block;font-size:smaller;padding:5px}@keyframes dash{0%{stroke-dashoffset:24}to{stroke-dashoffset:0}}.srd-default-link path{fill:none;pointer-events:all}.srd-default-link--path-selected{stroke:#00c0ff!important;stroke-dasharray:10,2;animation:dash 1s linear infinite}.srd-default-link__label{pointer-events:none}.srd-default-link__label>div{display:inline-block;position:absolute}.srd-default-link__point{fill:hsla(0,0%,100%,.5)}.srd-default-link--point-selected{fill:#00c0ff}
\ No newline at end of file
diff --git a/src/assets/scenariobuilder/css/main.ed16f2f1.chunk.css b/src/assets/scenariobuilder/css/main.ed16f2f1.chunk.css
deleted file mode 100644
index 66c6c6c..0000000
--- a/src/assets/scenariobuilder/css/main.ed16f2f1.chunk.css
+++ /dev/null
@@ -1 +0,0 @@
-@import url(https://fonts.googleapis.com/css?family=Roboto:300,400,500,700|Material+Icons);.diamond-node,.round-node,.square-node{background-color:initial;display:flex;flex-direction:column;align-items:center;width:150px}.diamond-node .node-container,.round-node .node-container,.square-node .node-container{position:relative;display:flex;align-items:center;width:50px;height:50px;border-radius:5px;overflow:visible;background-color:#fff;transition:all .15s}.diamond-node__title,.round-node__title,.square-node__title{display:flex;text-align:center;font-family:system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI","Helvetica Neue",Arial,sans-serif;font-size:14px;font-weight:500}.diamond-node__title>*,.round-node__title>*,.square-node__title>*{align-self:center}.diamond-node__title .fa,.round-node__title .fa,.square-node__title .fa{padding:5px;opacity:.2;cursor:pointer}.diamond-node__title .fa:hover,.round-node__title .fa:hover,.square-node__title .fa:hover{opacity:1}.diamond-node__name,.round-node__name,.square-node__name{flex-grow:1;padding:5px 0}.diamond-node__ports,.round-node__ports,.square-node__ports{display:flex;background-image:none;width:100%}.diamond-node__bottom,.diamond-node__left,.diamond-node__right,.round-node__bottom,.round-node__left,.round-node__right,.square-node__bottom,.square-node__left,.square-node__right{flex-grow:1;display:flex;flex-direction:column}.diamond-node__bottom .port,.diamond-node__left .port,.diamond-node__right .port,.round-node__bottom .port,.round-node__left .port,.round-node__right .port,.square-node__bottom .port,.square-node__left .port,.square-node__right .port{border-radius:13px;width:13px;height:13px;position:relative;background:#fff}.diamond-node__bottom .port.selected,.diamond-node__bottom .port:hover,.diamond-node__left .port.selected,.diamond-node__left .port:hover,.diamond-node__right .port.selected,.diamond-node__right .port:hover,.round-node__bottom .port.selected,.round-node__bottom .port:hover,.round-node__left .port.selected,.round-node__left .port:hover,.round-node__right .port.selected,.round-node__right .port:hover,.square-node__bottom .port.selected,.square-node__bottom .port:hover,.square-node__left .port.selected,.square-node__left .port:hover,.square-node__right .port.selected,.square-node__right .port:hover{background:#a291fb}.diamond-node__left,.round-node__left,.square-node__left{align-items:flex-start}.diamond-node__left .port,.round-node__left .port,.square-node__left .port{left:-6.5px}.diamond-node__right,.round-node__right,.square-node__right{align-items:flex-end}.diamond-node__right .port,.round-node__right .port,.square-node__right .port{right:-6.5px}.diamond-node__bottom,.round-node__bottom,.square-node__bottom{align-items:center}.diamond-node__bottom .port,.round-node__bottom .port,.square-node__bottom .port{bottom:-6.5px}.diamond-node__icon,.round-node__icon,.square-node__icon{position:absolute;width:100%;height:100%;display:flex;justify-content:center;align-items:center}.round-node .node-container{border-radius:50px}.diamond-node__bottom{position:absolute;bottom:0;width:100%}.srd-node--selected .square-node.email-node .node-container{box-shadow:0 0 10px #a291fb}.email-node .node-container{border:2px solid #a291fb;color:#a291fb}.email-node__title{color:#a291fb}.email-node__left .port,.email-node__right .port{box-shadow:0 0 10px #a291fb}.email-node__left .port.selected,.email-node__left .port:hover,.email-node__right .port.selected,.email-node__right .port:hover{background:#a291fb}.srd-node--selected .square-node.generic-node .node-container{box-shadow:0 0 10px #a291fb}.generic-node .node-container{border:2px solid #a291fb;color:#a291fb}.generic-node__title{color:#a291fb}.generic-node__left .port,.generic-node__right .port{box-shadow:0 0 10px #a291fb}.generic-node__left .port.selected,.generic-node__left .port:hover,.generic-node__right .port.selected,.generic-node__right .port:hover{background:#a291fb}.srd-node--selected .diamond-node.segment-node .node-container{box-shadow:0 0 10px #ff695e}.segment-node .node-container{border:2px solid #ff695e;color:#ff695e}.segment-node__title{color:#ff695e}.segment-node__bottom .port,.segment-node__left .port,.segment-node__right .port{box-shadow:0 0 10px #ff695e}.segment-node__bottom .port.selected,.segment-node__bottom .port:hover,.segment-node__left .port.selected,.segment-node__left .port:hover,.segment-node__right .port.selected,.segment-node__right .port:hover{background:#ff695e}.srd-node--selected .square-node.trigger-node .node-container{box-shadow:0 0 10px #2ecc40}.trigger-node .node-container{border:2px solid #2ecc40;color:#2ecc40}.trigger-node__title{color:#2ecc40}.trigger-node__left .port,.trigger-node__right .port{box-shadow:0 0 10px #2ecc40}.trigger-node__left .port.selected,.trigger-node__left .port:hover,.trigger-node__right .port.selected,.trigger-node__right .port:hover{background:#2ecc40}.srd-node--selected .square-node.before-trigger-node .node-container{box-shadow:0 0 10px #00b5ad}.before-trigger-node .node-container{border:2px solid #00b5ad;color:#00b5ad}.before-trigger-node__title{color:#00b5ad}.before-trigger-node__left .port,.before-trigger-node__right .port{box-shadow:0 0 10px #00b5ad}.before-trigger-node__left .port.selected,.before-trigger-node__left .port:hover,.before-trigger-node__right .port.selected,.before-trigger-node__right .port:hover{background:#00b5ad}.srd-node--selected .round-node.wait-node .node-container{box-shadow:0 0 10px #ff851b}.wait-node .node-container{border:2px solid #ff851b;color:#ff851b}.wait-node__title{color:#ff851b}.wait-node__left .port,.wait-node__right .port{box-shadow:0 0 10px #ff851b}.wait-node__left .port.selected,.wait-node__left .port:hover,.wait-node__right .port.selected,.wait-node__right .port:hover{background:#ff851b}@keyframes dash{0%{stroke-dashoffset:24}to{stroke-dashoffset:0}}.srd-default-link path{fill:none;pointer-events:all}.srd-default-link--path-selected{stroke:#54c8ff!important;stroke-dasharray:10,2;animation:dash 1s linear infinite}.srd-default-link__label{pointer-events:none}.srd-default-link__label>div{display:inline-block;position:absolute}.srd-default-link__point{fill:hsla(0,0%,100%,.5)}.srd-default-link--point-selected{fill:#00c0ff}.srd-node--selected .diamond-node.goal-node .node-container{box-shadow:0 0 10px #767676}.goal-node .node-container{border:2px solid #767676;color:#767676}.goal-node__title{color:#767676}.goal-node__bottom .port,.goal-node__left .port,.goal-node__right .port{box-shadow:0 0 10px #767676}.goal-node__bottom .port.selected,.goal-node__bottom .port:hover,.goal-node__left .port.selected,.goal-node__left .port:hover,.goal-node__right .port.selected,.goal-node__right .port:hover{background:#767676}.srd-node--selected .square-node.banner-node .node-container{box-shadow:0 0 10px #6435c9}.banner-node .node-container{border:2px solid #6435c9;color:#6435c9}.banner-node__title{color:#6435c9}.banner-node__left .port,.banner-node__right .port{box-shadow:0 0 10px #6435c9}.banner-node__left .port.selected,.banner-node__left .port:hover,.banner-node__right .port.selected,.banner-node__right .port:hover{background:#6435c9}.srd-node--selected .diamond-node.condition-node .node-container{box-shadow:0 0 10px #f2711c}.condition-node .node-container{border:2px solid #f2711c;color:#f2711c}.condition-node__title{color:#f2711c}.condition-node__bottom .port,.condition-node__left .port,.condition-node__right .port{box-shadow:0 0 10px #f2711c}.condition-node__bottom .port.selected,.condition-node__bottom .port:hover,.condition-node__left .port.selected,.condition-node__left .port:hover,.condition-node__right .port.selected,.condition-node__right .port:hover{background:#f2711c}.srd-node--selected .square-node.push-notification-node .node-container{box-shadow:0 0 10px #dc73ff}.push-notification-node .node-container{border:2px solid #dc73ff;color:#dc73ff}.push-notification-node__title{color:#dc73ff}.push-notification-node__left .port,.push-notification-node__right .port{box-shadow:0 0 10px #dc73ff}.push-notification-node__left .port.selected,.push-notification-node__left .port:hover,.push-notification-node__right .port.selected,.push-notification-node__right .port:hover{background:#dc73ff}.srd-node--selected .diamond-node .abtest-node .node-container{box-shadow:0 0 10px #767676}.abtest-node .node-container{border:2px solid #767676;color:#767676;height:auto}.abtest-node__title{color:#767676}.abtest-node__ports{width:50%;height:100%;flex-direction:column}.abtest-node__right{margin-top:10px;height:20px}.abtest-node__description{display:flex;position:absolute;left:40px;top:-2px;font-size:.8rem;color:#1b1c1d}.abtest-node .port{box-shadow:0 0 10px #767676}.srd-demo-workspace{background:#000;display:flex;flex-direction:column;height:100%;border-radius:5px;overflow:hidden}.srd-demo-workspace__toolbar{padding:5px;display:flex;flex-shrink:0}.srd-demo-workspace__toolbar button{background:#3c3c3c;font-size:14px;padding:5px 10px;border:none;color:#fff;outline:none;cursor:pointer;margin:2px;border-radius:3px}.srd-demo-workspace__toolbar button:hover{background:#00c0ff}.srd-demo-workspace__content{flex-grow:1;height:100%}.docs-preview-wrapper{background:#3c3c3c;border-radius:10px;overflow:hidden;padding:10px;margin-top:20px;margin-bottom:20px}.srd-demo-canvas{height:100vh;min-height:300px;background-color:rgba(0,0,0,.05)!important;background-size:50px 50px}.srd-demo-canvas .pointui{fill:hsla(0,0%,100%,.5)}.diagram-layer{position:relative;top:64px}.body{flex-grow:1;display:flex;flex-direction:column;min-height:100%}.body .tray-item{cursor:move;cursor:grab;cursor:-webkit-grab}.body .tray-item:active{cursor:grabbing;cursor:-webkit-grabbing}.scenario-name{width:100%;display:inline-block}.scenario-name:hover{cursor:pointer}.changing-name-input{font-size:20px;width:100%;border:0;padding:2px 5px}.circular-loading{margin-right:15px;position:relative;top:7px}.toast-success{background-color:#5d9d52!important}.toast-error{background-color:#c33e37!important}.toast-info{background-color:#3477cb!important}.toast-warning{background-color:#f3a33a!important}.toast__icon{font-size:20px}.toast__icon-variant{opacity:.9;margin-right:10px}.node-tooltip-loader,.toast__message{display:flex;align-items:center}.node-tooltip-loader{justify-content:center;padding:20px}.statistic-badge-container-bottom{width:100%;display:flex;justify-content:center}.statistic-badge-right{position:absolute;top:15px;left:60px}.statistic-badge-bottom{position:absolute;top:25px}
\ No newline at end of file
diff --git a/src/assets/scenariobuilder/js/2.cffd56c7.chunk.js b/src/assets/scenariobuilder/js/2.cffd56c7.chunk.js
deleted file mode 100644
index 3784661..0000000
--- a/src/assets/scenariobuilder/js/2.cffd56c7.chunk.js
+++ /dev/null
@@ -1,2 +0,0 @@
-/*! For license information please see 2.cffd56c7.chunk.js.LICENSE.txt */
-(this["webpackJsonpremp-scenario-builder"]=this["webpackJsonpremp-scenario-builder"]||[]).push([[2],[function(e,t,n){"use strict";e.exports=n(195)},function(e,t,n){"use strict";function r(){return(r=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}},function(e,t,n){"use strict";function r(e){var t,n,o="";if("string"==typeof e||"number"==typeof e)o+=e;else if("object"==typeof e)if(Array.isArray(e))for(t=0;t1&&void 0!==arguments[1]?arguments[1]:{};return function(n){var i=t.defaultTheme,l=t.withTheme,f=void 0!==l&&l,p=t.name,h=Object(o.a)(t,["defaultTheme","withTheme","name"]);var m=p,v=Object(u.a)(e,Object(r.a)({defaultTheme:i,Component:n,name:p||n.displayName,classNamePrefix:m},h)),g=a.a.forwardRef((function(e,t){e.classes;var l,s=e.innerRef,u=Object(o.a)(e,["classes","innerRef"]),h=v(Object(r.a)({},n.defaultProps,e)),m=u;return("string"===typeof p||f)&&(l=Object(d.a)()||i,p&&(m=Object(c.a)({theme:l,name:p,props:u})),f&&!m.theme&&(m.theme=l)),a.a.createElement(n,Object(r.a)({ref:s||t,classes:h},m))}));return s()(g,n),g}},p=n(52);t.a=function(e,t){return f(e,Object(r.a)({defaultTheme:p.a},t))}},,function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(173);function o(e){if("string"!==typeof e)throw new Error(Object(r.a)(7));return e.charAt(0).toUpperCase()+e.slice(1)}},function(e,t,n){window,e.exports=function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=17)}([function(e,t){e.exports=n(14)},function(e,t){e.exports=n(0)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(1);t.BaseWidget=class extends r.Component{constructor(e,t){super(t),this.className=e}bem(e){return(this.props.baseClass||this.className)+e+" "}getClassName(){return(this.props.baseClass||this.className)+" "+(this.props.className?this.props.className+" ":"")}getProps(){return Object.assign({},this.props.extraProps||{},{className:this.getClassName()})}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(38),o=n(8),i=n(40);class a{static UID(){return a.TESTING?(a.TESTING_UID++,""+a.TESTING_UID):"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)})}static closest(e,t){return document.body.closest?e.closest(t):r(e,t)}static generateLinePath(e,t){return"M".concat(e.x,",").concat(e.y," L ").concat(t.x,",").concat(t.y)}static generateCurvePath(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;var r=Math.abs(e.x-t.x)>Math.abs(e.y-t.y),o=r?"x":"y";let i=n;e[o]>e[o]&&(i=-n);var a=r?i:0,l=r?0:i;return"M".concat(e.x,",").concat(e.y," C ").concat(e.x+a,",").concat(e.y+l,"\n ").concat(t.x-a,",").concat(t.y-l," ").concat(t.x,",").concat(t.y)}static generateDynamicPath(e){let t=i();return t=t.moveto(e[0][0]*o.ROUTING_SCALING_FACTOR,e[0][1]*o.ROUTING_SCALING_FACTOR),e.slice(1).forEach(e=>{t=t.lineto(e[0]*o.ROUTING_SCALING_FACTOR,e[1]*o.ROUTING_SCALING_FACTOR)}),t.print()}}a.TESTING=!1,a.TESTING_UID=0,t.Toolkit=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(9),o=n(0);t.BaseModel=class extends r.BaseEntity{constructor(e,t){super(t),this.type=e,this.selected=!1}getParent(){return this.parent}setParent(e){this.parent=e}getSelectedEntities(){return this.isSelected()?[this]:[]}deSerialize(e,t){super.deSerialize(e,t),this.type=e.type,this.selected=e.selected}serialize(){return o.merge(super.serialize(),{type:this.type,selected:this.selected})}getType(){return this.type}getID(){return this.id}isSelected(){return this.selected}setSelected(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.selected=e,this.iterateListeners((t,n)=>{t.selectionChanged&&t.selectionChanged(Object.assign({},n,{isSelected:e}))})}remove(){this.iterateListeners((e,t)=>{e.entityRemoved&&e.entityRemoved(t)})}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(4),o=n(0);t.PointModel=class extends r.BaseModel{constructor(e,t){super(),this.x=t.x,this.y=t.y,this.parent=e}getSelectedEntities(){return super.isSelected()&&!this.isConnectedToPort()?[this]:[]}isConnectedToPort(){return null!==this.parent.getPortForPoint(this)}getLink(){return this.getParent()}deSerialize(e,t){super.deSerialize(e,t),this.x=e.x,this.y=e.y}serialize(){return o.merge(super.serialize(),{x:this.x,y:this.y})}remove(){this.parent&&this.parent.removePoint(this),super.remove()}updateLocation(e){this.x=e.x,this.y=e.y}getX(){return this.x}getY(){return this.y}isLocked(){return super.isLocked()||this.getParent().isLocked()}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(4),o=n(0);t.NodeModel=class extends r.BaseModel{constructor(){super(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default",arguments.length>1?arguments[1]:void 0),this.x=0,this.y=0,this.extras={},this.ports={}}setPosition(e,t){let n=this.x,r=this.y;o.forEach(this.ports,i=>{o.forEach(i.getLinks(),o=>{let a=o.getPointForPort(i);a.x=a.x+e-n,a.y=a.y+t-r})}),this.x=e,this.y=t}positionChanged(){this.iterateListeners((e,t)=>e.positionChanged&&e.positionChanged(t))}getSelectedEntities(){let e=super.getSelectedEntities();return this.isSelected()&&o.forEach(this.ports,t=>{e=e.concat(o.map(t.getLinks(),e=>e.getPointForPort(t)))}),e}deSerialize(e,t){super.deSerialize(e,t),this.x=e.x,this.y=e.y,this.extras=e.extras,o.forEach(e.ports,e=>{let n=t.getPortFactory(e.type).getNewInstance();n.deSerialize(e,t),this.addPort(n)})}serialize(){return o.merge(super.serialize(),{x:this.x,y:this.y,extras:this.extras,ports:o.map(this.ports,e=>e.serialize())})}doClone(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;t.ports={},o.forEach(this.ports,n=>{t.addPort(n.clone(e))})}remove(){super.remove(),o.forEach(this.ports,e=>{o.forEach(e.getLinks(),e=>{e.remove()})})}getPortFromID(e){for(var t in this.ports)if(this.ports[t].id===e)return this.ports[t];return null}getPort(e){return this.ports[e]}getPorts(){return this.ports}removePort(e){this.ports[e.name]&&(this.ports[e.name].setParent(null),delete this.ports[e.name])}addPort(e){return e.setParent(this),this.ports[e.name]=e,e}updateDimensions(e){let{width:t,height:n}=e;this.width=t,this.height=n}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AbstractFactory=class{constructor(e){this.type=e}getType(){return this.type}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(39);t.ROUTING_SCALING_FACTOR=5;const o=new r.JumpPointFinder({heuristic:r.Heuristic.manhattan,diagonalMovement:r.DiagonalMovement.Never});t.default=class{constructor(e){this.instance=o,this.diagramEngine=e}calculateDirectPath(e,n){const i=this.diagramEngine.getCanvasMatrix(),a=new r.Grid(i);return o.findPath(this.diagramEngine.translateRoutingX(Math.floor(e.x/t.ROUTING_SCALING_FACTOR)),this.diagramEngine.translateRoutingY(Math.floor(e.y/t.ROUTING_SCALING_FACTOR)),this.diagramEngine.translateRoutingX(Math.floor(n.x/t.ROUTING_SCALING_FACTOR)),this.diagramEngine.translateRoutingY(Math.floor(n.y/t.ROUTING_SCALING_FACTOR)),a)}calculateLinkStartEndCoords(e,t){const n=t.findIndex(t=>0===e[t[1]][t[0]]),r=t.length-1-t.slice().reverse().findIndex(t=>0===e[t[1]][t[0]]);if(-1===n||-1===r)return;const o=t.slice(0,n),i=t.slice(r);return{start:{x:t[n][0],y:t[n][1]},end:{x:t[r][0],y:t[r][1]},pathToStart:o,pathToEnd:i}}calculateDynamicPath(e,t,n,i,a){const l=new r.Grid(e),s=o.findPath(t.x,t.y,n.x,n.y,l),u=i.concat(s,a).map(e=>[this.diagramEngine.translateRoutingX(e[0],!0),this.diagramEngine.translateRoutingY(e[1],!0)]);return r.Util.compressPath(u)}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(3),o=n(0);t.BaseEntity=class{constructor(e){this.listeners={},this.id=e||r.Toolkit.UID(),this.locked=!1}getID(){return this.id}doClone(){}clone(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(e[this.id])return e[this.id];let t=o.clone(this);return t.id=r.Toolkit.UID(),t.clearListeners(),e[this.id]=t,this.doClone(e,t),t}clearListeners(){this.listeners={}}deSerialize(e,t){this.id=e.id}serialize(){return{id:this.id}}iterateListeners(e){let t={id:r.Toolkit.UID(),firing:!0,entity:this,stopPropagation:()=>{t.firing=!1}};for(var n in this.listeners)if(this.listeners.hasOwnProperty(n)){if(!t.firing)return;e(this.listeners[n],t)}}removeListener(e){return!!this.listeners[e]&&(delete this.listeners[e],!0)}addListener(e){var t=r.Toolkit.UID();return this.listeners[t]=e,t}isLocked(){return this.locked}setLocked(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.locked=e,this.iterateListeners((t,n)=>{t.lockChanged&&t.lockChanged(Object.assign({},n,{locked:e}))})}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(4),o=n(0);t.PortModel=class extends r.BaseModel{constructor(e,t,n,r){super(t,n),this.name=e,this.links={},this.maximumLinks=r}deSerialize(e,t){super.deSerialize(e,t),this.name=e.name,this.maximumLinks=e.maximumLinks}serialize(){return o.merge(super.serialize(),{name:this.name,parentNode:this.parent.id,links:o.map(this.links,e=>e.id),maximumLinks:this.maximumLinks})}doClone(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;t.links={},t.parentNode=this.getParent().clone(e)}getNode(){return this.getParent()}getName(){return this.name}getMaximumLinks(){return this.maximumLinks}setMaximumLinks(e){this.maximumLinks=e}removeLink(e){delete this.links[e.getID()]}addLink(e){this.links[e.getID()]=e}getLinks(){return this.links}createLinkModel(){if(o.isFinite(this.maximumLinks)){var e=o.size(this.links);if(1===this.maximumLinks&&e>=1)return o.values(this.links)[0];if(e>=this.maximumLinks)return null}return null}updateCoords(e){let{x:t,y:n,width:r,height:o}=e;this.x=t,this.y=n,this.width=r,this.height=o}canLinkToPort(e){return!0}isLocked(){return super.isLocked()||this.getParent().isLocked()}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BaseAction=class{constructor(e,t){this.mouseX=e,this.mouseY=t,this.ms=(new Date).getTime()}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(4),o=n(5),i=n(0);t.LinkModel=class extends r.BaseModel{constructor(){super(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default",arguments.length>1?arguments[1]:void 0),this.points=[new o.PointModel(this,{x:0,y:0}),new o.PointModel(this,{x:0,y:0})],this.extras={},this.sourcePort=null,this.targetPort=null,this.labels=[]}deSerialize(e,t){super.deSerialize(e,t),this.extras=e.extras,this.points=i.map(e.points||[],e=>{var n=new o.PointModel(this,{x:e.x,y:e.y});return n.deSerialize(e,t),n}),i.forEach(e.labels||[],e=>{let n=t.getLabelFactory(e.type).getNewInstance();n.deSerialize(e,t),this.addLabel(n)}),e.target&&this.setTargetPort(this.getParent().getNode(e.target).getPortFromID(e.targetPort)),e.source&&this.setSourcePort(this.getParent().getNode(e.source).getPortFromID(e.sourcePort))}serialize(){return i.merge(super.serialize(),{source:this.sourcePort?this.sourcePort.getParent().id:null,sourcePort:this.sourcePort?this.sourcePort.id:null,target:this.targetPort?this.targetPort.getParent().id:null,targetPort:this.targetPort?this.targetPort.id:null,points:i.map(this.points,e=>e.serialize()),extras:this.extras,labels:i.map(this.labels,e=>e.serialize())})}doClone(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;t.setPoints(i.map(this.getPoints(),t=>t.clone(e))),this.sourcePort&&t.setSourcePort(this.sourcePort.clone(e)),this.targetPort&&t.setTargetPort(this.targetPort.clone(e))}remove(){this.sourcePort&&this.sourcePort.removeLink(this),this.targetPort&&this.targetPort.removeLink(this),super.remove()}isLastPoint(e){return this.getPointIndex(e)===this.points.length-1}getPointIndex(e){return this.points.indexOf(e)}getPointModel(e){for(var t=0;t{t.sourcePortChanged&&t.sourcePortChanged(Object.assign({},n,{port:e}))})}getSourcePort(){return this.sourcePort}getTargetPort(){return this.targetPort}setTargetPort(e){null!==e&&e.addLink(this),null!==this.targetPort&&this.targetPort.removeLink(this),this.targetPort=e,this.iterateListeners((t,n)=>{t.targetPortChanged&&t.targetPortChanged(Object.assign({},n,{port:e}))})}point(e,t){return this.addPoint(this.generatePoint(e,t))}addLabel(e){e.setParent(this),this.labels.push(e)}getPoints(){return this.points}setPoints(e){i.forEach(e,e=>{e.setParent(this)}),this.points=e}removePoint(e){this.points.splice(this.getPointIndex(e),1)}removePointsBefore(e){this.points.splice(0,this.getPointIndex(e))}removePointsAfter(e){this.points.splice(this.getPointIndex(e)+1)}removeMiddlePoints(){this.points.length>2&&this.points.splice(0,this.points.length-2)}addPoint(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return e.setParent(this),this.points.splice(t,0,e),e}generatePoint(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return new o.PointModel(this,{x:e,y:t})}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(0),o=n(10),i=n(14);class a extends o.PortModel{constructor(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;super(t,"default",arguments.length>3?arguments[3]:void 0),this.in=e,this.label=n||t}deSerialize(e,t){super.deSerialize(e,t),this.in=e.in,this.label=e.label}serialize(){return r.merge(super.serialize(),{in:this.in,label:this.label})}link(e){let t=this.createLinkModel();return t.setSourcePort(this),t.setTargetPort(e),t}canLinkToPort(e){return!(e instanceof a)||this.in!==e.in}createLinkModel(){return super.createLinkModel()||new i.DefaultLinkModel}}t.DefaultPortModel=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(12),o=n(0),i=n(15),a=n(16);t.DefaultLinkModel=class extends r.LinkModel{constructor(){super(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default"),this.color="rgba(255,255,255,0.5)",this.width=3,this.curvyness=50}serialize(){return o.merge(super.serialize(),{width:this.width,color:this.color,curvyness:this.curvyness})}deSerialize(e,t){super.deSerialize(e,t),this.color=e.color,this.width=e.width,this.curvyness=e.curvyness}addLabel(e){if(e instanceof a.LabelModel)return super.addLabel(e);let t=new i.DefaultLabelModel;return t.setLabel(e),super.addLabel(t)}setWidth(e){this.width=e,this.iterateListeners((t,n)=>{t.widthChanged&&t.widthChanged(Object.assign({},n,{width:e}))})}setColor(e){this.color=e,this.iterateListeners((t,n)=>{t.colorChanged&&t.colorChanged(Object.assign({},n,{color:e}))})}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(16),o=n(0);t.DefaultLabelModel=class extends r.LabelModel{constructor(){super("default"),this.offsetY=-23}setLabel(e){this.label=e}deSerialize(e,t){super.deSerialize(e,t),this.label=e.label}serialize(){return o.merge(super.serialize(),{label:this.label})}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(4),o=n(0);t.LabelModel=class extends r.BaseModel{constructor(e,t){super(e,t),this.offsetX=0,this.offsetY=0}deSerialize(e,t){super.deSerialize(e,t),this.offsetX=e.offsetX,this.offsetY=e.offsetY}serialize(){return o.merge(super.serialize(),{offsetX:this.offsetX,offsetY:this.offsetY})}}},function(e,t,n){"use strict";function r(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}Object.defineProperty(t,"__esModule",{value:!0}),r(n(3)),r(n(9)),r(n(41)),r(n(24)),r(n(13)),r(n(14)),r(n(15)),r(n(42)),r(n(43)),r(n(19)),r(n(21)),r(n(25)),r(n(23)),r(n(27)),r(n(28)),r(n(7)),r(n(22)),r(n(26)),r(n(30)),r(n(20)),r(n(8)),r(n(11)),r(n(31)),r(n(32)),r(n(33)),r(n(4)),r(n(18)),r(n(12)),r(n(6)),r(n(5)),r(n(10)),r(n(16)),r(n(44)),r(n(35)),r(n(37)),r(n(29)),r(n(2)),r(n(34)),r(n(36))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(9),o=n(0),i=n(12),a=n(6),l=n(10),s=n(5);t.DiagramModel=class extends r.BaseEntity{constructor(){super(),this.links={},this.nodes={},this.offsetX=0,this.offsetY=0,this.zoom=100,this.rendered=!1,this.gridSize=0}setGridSize(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;this.gridSize=e,this.iterateListeners((t,n)=>{t.gridUpdated&&t.gridUpdated(Object.assign({},n,{size:e}))})}getGridPosition(e){return 0===this.gridSize?e:this.gridSize*Math.floor((e+this.gridSize/2)/this.gridSize)}deSerializeDiagram(e,t){this.deSerialize(e,t),this.offsetX=e.offsetX,this.offsetY=e.offsetY,this.zoom=e.zoom,this.gridSize=e.gridSize,o.forEach(e.nodes,e=>{let n=t.getNodeFactory(e.type).getNewInstance(e);n.setParent(this),n.deSerialize(e,t),this.addNode(n)}),o.forEach(e.links,e=>{let n=t.getLinkFactory(e.type).getNewInstance();n.setParent(this),n.deSerialize(e,t),this.addLink(n)})}serializeDiagram(){return o.merge(this.serialize(),{offsetX:this.offsetX,offsetY:this.offsetY,zoom:this.zoom,gridSize:this.gridSize,links:o.map(this.links,e=>e.serialize()),nodes:o.map(this.nodes,e=>e.serialize())})}clearSelection(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;o.forEach(this.getSelectedItems(),t=>{e&&e.getID()===t.getID()||t.setSelected(!1)})}getSelectedItems(){for(var e=arguments.length,t=new Array(e),n=0;ne.getSelectedEntities()))).concat(o.flatMap(this.links,e=>e.getSelectedEntities()))).concat(o.flatMap(this.links,e=>o.flatMap(e.points,e=>e.getSelectedEntities()))),r=o.uniq(r),t.length>0&&(r=o.filter(o.uniq(r),e=>!!(o.includes(t,"node")&&e instanceof a.NodeModel||o.includes(t,"link")&&e instanceof i.LinkModel||o.includes(t,"port")&&e instanceof l.PortModel||o.includes(t,"point")&&e instanceof s.PointModel))),r}setZoomLevel(e){this.zoom=e,this.iterateListeners((t,n)=>{t.zoomUpdated&&t.zoomUpdated(Object.assign({},n,{zoom:e}))})}setOffset(e,t){this.offsetX=e,this.offsetY=t,this.iterateListeners((n,r)=>{n.offsetUpdated&&n.offsetUpdated(Object.assign({},r,{offsetX:e,offsetY:t}))})}setOffsetX(e){this.offsetX=e,this.iterateListeners((t,n)=>{t.offsetUpdated&&t.offsetUpdated(Object.assign({},n,{offsetX:e,offsetY:this.offsetY}))})}setOffsetY(e){this.offsetY=e,this.iterateListeners((e,t)=>{e.offsetUpdated&&e.offsetUpdated(Object.assign({},t,{offsetX:this.offsetX,offsetY:this.offsetY}))})}getOffsetY(){return this.offsetY}getOffsetX(){return this.offsetX}getZoomLevel(){return this.zoom}getNode(e){return e instanceof a.NodeModel?e:this.nodes[e]?this.nodes[e]:null}getLink(e){return e instanceof i.LinkModel?e:this.links[e]?this.links[e]:null}addAll(){for(var e=arguments.length,t=new Array(e),n=0;n{e instanceof i.LinkModel?this.addLink(e):e instanceof a.NodeModel&&this.addNode(e)}),t}addLink(e){return e.addListener({entityRemoved:()=>{this.removeLink(e)}}),this.links[e.getID()]=e,this.iterateListeners((t,n)=>{t.linksUpdated&&t.linksUpdated(Object.assign({},n,{link:e,isCreated:!0}))}),e}addNode(e){return e.addListener({entityRemoved:()=>{this.removeNode(e)}}),this.nodes[e.getID()]=e,this.iterateListeners((t,n)=>{t.nodesUpdated&&t.nodesUpdated(Object.assign({},n,{node:e,isCreated:!0}))}),e}removeLink(e){e=this.getLink(e),delete this.links[e.getID()],this.iterateListeners((t,n)=>{t.linksUpdated&&t.linksUpdated(Object.assign({},n,{link:e,isCreated:!1}))})}removeNode(e){e=this.getNode(e),delete this.nodes[e.getID()],this.iterateListeners((t,n)=>{t.nodesUpdated&&t.nodesUpdated(Object.assign({},n,{node:e,isCreated:!1}))})}getLinks(){return this.links}getNodes(){return this.nodes}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(13),o=n(20);t.DefaultPortFactory=class extends o.AbstractPortFactory{constructor(){super("default")}getNewInstance(e){return new r.DefaultPortModel(!0,"unknown")}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(7);t.AbstractPortFactory=class extends r.AbstractFactory{}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(1),o=n(22),i=n(15),a=n(23);t.DefaultLabelFactory=class extends o.AbstractLabelFactory{constructor(){super("default")}generateReactWidget(e,t){return r.createElement(a.DefaultLabelWidget,{model:t})}getNewInstance(e){return new i.DefaultLabelModel}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(7);t.AbstractLabelFactory=class extends r.AbstractFactory{}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(1),o=n(2);t.DefaultLabelWidget=class extends o.BaseWidget{constructor(e){super("srd-default-label",e)}render(){return r.createElement("div",Object.assign({},this.getProps()),this.props.model.label)}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(13),o=n(0),i=n(6),a=n(3);t.DefaultNodeModel=class extends i.NodeModel{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"Untitled",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"rgb(0,192,255)";super("default"),this.name=e,this.color=t}addInPort(e){return this.addPort(new r.DefaultPortModel(!0,a.Toolkit.UID(),e))}addOutPort(e){return this.addPort(new r.DefaultPortModel(!1,a.Toolkit.UID(),e))}deSerialize(e,t){super.deSerialize(e,t),this.name=e.name,this.color=e.color}serialize(){return o.merge(super.serialize(),{name:this.name,color:this.color})}getInPorts(){return o.filter(this.ports,e=>e.in)}getOutPorts(){return o.filter(this.ports,e=>!e.in)}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(1),o=n(5),i=n(3),a=n(8),l=n(0),s=n(2);class u extends s.BaseWidget{constructor(e){super("srd-default-link",e),this.addPointToLink=(e,t)=>{if(!e.shiftKey&&!this.props.diagramEngine.isModelLocked(this.props.link)&&this.props.link.points.length-1<=this.props.diagramEngine.getMaxNumberPointsPerLink()){const n=new o.PointModel(this.props.link,this.props.diagramEngine.getRelativeMousePoint(e));n.setSelected(!0),this.forceUpdate(),this.props.link.addPoint(n,t),this.props.pointAdded(n,e)}},this.findPathAndRelativePositionToRenderLabel=e=>{const t=this.refPaths.map(e=>e.getTotalLength());let n=t.reduce((e,t)=>e+t,0)*(e/(this.props.link.labels.length+1)),r=0;for(;r{if(!this.refLabels[e.id])return;const{path:n,position:r}=this.findPathAndRelativePositionToRenderLabel(t),o=this.refLabels[e.id].offsetWidth,i=this.refLabels[e.id].offsetHeight,a=n.getPointAtLength(r),l=a.x-o/2+e.offsetX,s=a.y-i/2+e.offsetY;this.refLabels[e.id].setAttribute("style","transform: translate(".concat(l,"px, ").concat(s,"px);"))},this.refLabels={},this.refPaths=[],this.state={selected:!1},e.diagramEngine.isSmartRoutingEnabled()&&(this.pathFinding=new a.default(this.props.diagramEngine))}calculateAllLabelPosition(){l.forEach(this.props.link.labels,(e,t)=>{this.calculateLabelPosition(e,t+1)})}componentDidUpdate(){this.props.link.labels.length>0&&window.requestAnimationFrame(this.calculateAllLabelPosition.bind(this))}componentDidMount(){this.props.link.labels.length>0&&window.requestAnimationFrame(this.calculateAllLabelPosition.bind(this))}generatePoint(e){let t=this.props.link.points[e].x,n=this.props.link.points[e].y;return r.createElement("g",{key:"point-"+this.props.link.points[e].id},r.createElement("circle",{cx:t,cy:n,r:5,className:"point "+this.bem("__point")+(this.props.link.points[e].isSelected()?this.bem("--point-selected"):"")}),r.createElement("circle",{onMouseLeave:()=>{this.setState({selected:!1})},onMouseEnter:()=>{this.setState({selected:!0})},"data-id":this.props.link.points[e].id,"data-linkid":this.props.link.id,cx:t,cy:n,r:15,opacity:0,className:"point "+this.bem("__point")}))}generateLabel(e){const t=this.props.diagramEngine.canvas;return r.createElement("foreignObject",{key:e.id,className:this.bem("__label"),width:t.offsetWidth,height:t.offsetHeight},r.createElement("div",{ref:t=>this.refLabels[e.id]=t},this.props.diagramEngine.getFactoryForLabel(e).generateReactWidget(this.props.diagramEngine,e)))}generateLink(e,t,n){var o=this.props,i=r.cloneElement(o.diagramEngine.getFactoryForLink(this.props.link).generateLinkSegment(this.props.link,this,this.state.selected||this.props.link.isSelected(),e),{ref:e=>e&&this.refPaths.push(e)}),a=r.cloneElement(i,Object.assign({},t,{strokeLinecap:"round",onMouseLeave:()=>{this.setState({selected:!1})},onMouseEnter:()=>{this.setState({selected:!0})},ref:null,"data-linkid":this.props.link.getID(),strokeOpacity:this.state.selected?.1:0,strokeWidth:20,onContextMenu:()=>{this.props.diagramEngine.isModelLocked(this.props.link)||(event.preventDefault(),this.props.link.remove())}}));return r.createElement("g",{key:"link-"+n},i,a)}isSmartRoutingApplicable(){const{diagramEngine:e,link:t}=this.props;return!!e.isSmartRoutingEnabled()&&2===t.points.length&&null!==t.sourcePort&&null!==t.targetPort}render(){const{diagramEngine:e}=this.props;if(!e.nodesRendered)return null;var t=this.props.link.points,n=[];if(this.isSmartRoutingApplicable()){const r=this.pathFinding.calculateDirectPath(l.first(t),l.last(t)),o=e.getRoutingMatrix(),a=this.pathFinding.calculateLinkStartEndCoords(o,r);if(a){const{start:e,end:t,pathToStart:r,pathToEnd:l}=a,s=this.pathFinding.calculateDynamicPath(o,e,t,r,l);n.push(this.generateLink(i.Toolkit.generateDynamicPath(s),{onMouseDown:e=>{this.addPointToLink(e,1)}},"0"))}}if(0===n.length)if(2===t.length){var o=Math.abs(t[0].x-t[1].x)>Math.abs(t[0].y-t[1].y)?"x":"y";Math.abs(t[0][o]-t[1][o]);var a=t[0],s=t[1];n.push(this.generateLink(i.Toolkit.generateCurvePath(a,s,this.props.link.curvyness),{onMouseDown:e=>{this.addPointToLink(e,1)}},"0")),null===this.props.link.targetPort&&n.push(this.generatePoint(1))}else{for(let e=0;e{this.addPointToLink(t,e+1)}},e));for(var u=1;uthis.generateLabel(e)))}}u.defaultProps={color:"black",width:3,link:null,engine:null,smooth:!1,diagramEngine:null},t.DefaultLinkWidget=u},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(7);t.AbstractLinkFactory=class extends r.AbstractFactory{}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(1),o=n(0),i=n(28),a=n(2);t.DefaultNodeWidget=class extends a.BaseWidget{constructor(e){super("srd-default-node",e),this.state={}}generatePort(e){return r.createElement(i.DefaultPortLabel,{model:e,key:e.id})}render(){return r.createElement("div",Object.assign({},this.getProps(),{style:{background:this.props.node.color}}),r.createElement("div",{className:this.bem("__title")},r.createElement("div",{className:this.bem("__name")},this.props.node.name)),r.createElement("div",{className:this.bem("__ports")},r.createElement("div",{className:this.bem("__in")},o.map(this.props.node.getInPorts(),this.generatePort.bind(this))),r.createElement("div",{className:this.bem("__out")},o.map(this.props.node.getOutPorts(),this.generatePort.bind(this)))))}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(1),o=n(29),i=n(2);t.DefaultPortLabel=class extends i.BaseWidget{constructor(e){super("srd-default-port",e)}getClassName(){return super.getClassName()+(this.props.model.in?this.bem("--in"):this.bem("--out"))}render(){var e=r.createElement(o.PortWidget,{node:this.props.model.getParent(),name:this.props.model.name}),t=r.createElement("div",{className:"name"},this.props.model.label);return r.createElement("div",Object.assign({},this.getProps()),this.props.model.in?e:t,this.props.model.in?t:e)}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(1),o=n(2);t.PortWidget=class extends o.BaseWidget{constructor(e){super("srd-port",e),this.state={selected:!1}}getClassName(){return"port "+super.getClassName()+(this.state.selected?this.bem("--selected"):"")}render(){return r.createElement("div",Object.assign({},this.getProps(),{onMouseEnter:()=>{this.setState({selected:!0})},onMouseLeave:()=>{this.setState({selected:!1})},"data-name":this.props.name,"data-nodeid":this.props.node.getID()}))}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(7);t.AbstractNodeFactory=class extends r.AbstractFactory{}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(11);t.MoveCanvasAction=class extends r.BaseAction{constructor(e,t,n){super(e,t),this.initialOffsetX=n.getOffsetX(),this.initialOffsetY=n.getOffsetY()}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(11);t.MoveItemsAction=class extends r.BaseAction{constructor(e,t,n){super(e,t),this.moved=!1,n.enableRepaintEntities(n.getDiagramModel().getSelectedItems());var r=n.getDiagramModel().getSelectedItems();r=r.filter(e=>!n.isModelLocked(e)),this.selectionModels=r.map(e=>({model:e,initialX:e.x,initialY:e.y}))}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(11);t.SelectingAction=class extends r.BaseAction{constructor(e,t){super(e,t),this.mouseX2=e,this.mouseY2=t}getBoxDimensions(){return{left:this.mouseX2>this.mouseX?this.mouseX:this.mouseX2,top:this.mouseY2>this.mouseY?this.mouseY:this.mouseY2,width:Math.abs(this.mouseX2-this.mouseX),height:Math.abs(this.mouseY2-this.mouseY),right:this.mouseX2o.left&&e*r+n.getOffsetX()o.top&&t*r+n.getOffsetY(){if(this.props.diagramEngine.nodesRendered&&!this.props.diagramEngine.linksThatHaveInitiallyRendered[e.id]){if(null!==e.sourcePort)try{const t=this.props.diagramEngine.getPortCenter(e.sourcePort);e.points[0].updateLocation(t);const n=this.props.diagramEngine.getPortCoords(e.sourcePort);e.sourcePort.updateCoords(n),this.props.diagramEngine.linksThatHaveInitiallyRendered[e.id]=!0}catch(e){}if(null!==e.targetPort)try{const t=this.props.diagramEngine.getPortCenter(e.targetPort);i.last(e.points).updateLocation(t);const n=this.props.diagramEngine.getPortCoords(e.targetPort);e.targetPort.updateCoords(n),this.props.diagramEngine.linksThatHaveInitiallyRendered[e.id]=!0}catch(e){}}var t=this.props.diagramEngine.generateWidgetForLink(e);if(!t)throw new Error("no link generated for type: ".concat(e.getType()));return r.createElement(o.LinkWidget,{key:e.getID(),link:e,diagramEngine:this.props.diagramEngine},r.cloneElement(t,{pointAdded:this.props.pointAdded}))}))}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(2);t.LinkWidget=class extends r.BaseWidget{constructor(e){super("srd-link",e),this.state={}}shouldComponentUpdate(){return this.props.diagramEngine.canEntityRepaint(this.props.link)}render(){return this.props.children}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(1),o=n(0),i=n(37),a=n(2);t.NodeLayerWidget=class extends a.BaseWidget{constructor(e){super("srd-node-layer",e),this.updateNodeDimensions=()=>{if(!this.props.diagramEngine.nodesRendered){const e=this.props.diagramEngine.getDiagramModel();o.map(e.getNodes(),e=>{e.updateDimensions(this.props.diagramEngine.getNodeDimensions(e))})}},this.state={}}componentDidUpdate(){this.updateNodeDimensions(),this.props.diagramEngine.nodesRendered=!0}render(){var e=this.props.diagramEngine.getDiagramModel();return r.createElement("div",Object.assign({},this.getProps(),{style:{transform:"translate("+e.getOffsetX()+"px,"+e.getOffsetY()+"px) scale("+e.getZoomLevel()/100+")"}}),o.map(e.getNodes(),e=>r.createElement(i.NodeWidget,{diagramEngine:this.props.diagramEngine,key:e.id,node:e},this.props.diagramEngine.generateWidgetForNode(e))))}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(1),o=n(2);t.NodeWidget=class extends o.BaseWidget{constructor(e){super("srd-node",e),this.state={}}shouldComponentUpdate(){return this.props.diagramEngine.canEntityRepaint(this.props.node)}getClassName(){return"node "+super.getClassName()+(this.props.node.isSelected()?this.bem("--selected"):"")}render(){return r.createElement("div",Object.assign({},this.getProps(),{"data-nodeid":this.props.node.id,style:{top:this.props.node.y,left:this.props.node.x}}),this.props.children)}}},function(e,t){e.exports=n(220)},function(e,t){e.exports=n(222)},function(e,t){e.exports=n(238)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(9),o=n(18),i=n(0),a=n(6),l=n(5),s=n(17),u=n(8),c=n(19),d=n(21),f=n(3);t.DiagramEngine=class extends r.BaseEntity{constructor(){super(),this.canvasMatrix=[],this.routingMatrix=[],this.hAdjustmentFactor=0,this.vAdjustmentFactor=0,this.calculateMatrixDimensions=()=>{const e=i.values(this.diagramModel.nodes).map(e=>({x:e.x,width:e.width,y:e.y,height:e.height})),t=i.values(this.diagramModel.links),n=i.flatMap(t.map(e=>[e.sourcePort,e.targetPort])).filter(e=>null!==e).map(e=>({x:e.x,width:e.width,y:e.y,height:e.height})),r=i.flatMap(t.map(e=>e.points)).map(e=>({x:e.x,width:0,y:e.y,height:0})),o=this.canvas,a=Math.floor(Math.min(i.minBy(i.concat(e,n,r),e=>e.x).x,0)/u.ROUTING_SCALING_FACTOR)*u.ROUTING_SCALING_FACTOR,l=i.maxBy(i.concat(e,n,r),e=>e.x+e.width),s=Math.max(l.x+l.width,o.offsetWidth),c=Math.floor(Math.min(i.minBy(i.concat(e,n,r),e=>e.y).y,0)/u.ROUTING_SCALING_FACTOR)*u.ROUTING_SCALING_FACTOR,d=i.maxBy(i.concat(e,n,r),e=>e.y+e.height),f=Math.max(d.y+d.height,o.offsetHeight);return{width:Math.ceil(Math.abs(a)+s),hAdjustmentFactor:Math.abs(a)/u.ROUTING_SCALING_FACTOR+1,height:Math.ceil(Math.abs(c)+f),vAdjustmentFactor:Math.abs(c)/u.ROUTING_SCALING_FACTOR+1}},this.markNodes=e=>{i.values(this.diagramModel.nodes).forEach(t=>{const n=Math.floor(t.x/u.ROUTING_SCALING_FACTOR),r=Math.ceil((t.x+t.width)/u.ROUTING_SCALING_FACTOR),o=Math.floor(t.y/u.ROUTING_SCALING_FACTOR),i=Math.ceil((t.y+t.height)/u.ROUTING_SCALING_FACTOR);for(let a=n-1;a<=r+1;a++)for(let t=o-1;t{i.flatMap(i.values(this.diagramModel.links).map(e=>[].concat(e.sourcePort,e.targetPort))).filter(e=>null!==e).forEach(t=>{const n=Math.floor(t.x/u.ROUTING_SCALING_FACTOR),r=Math.ceil((t.x+t.width)/u.ROUTING_SCALING_FACTOR),o=Math.floor(t.y/u.ROUTING_SCALING_FACTOR),i=Math.ceil((t.y+t.height)/u.ROUTING_SCALING_FACTOR);for(let a=n-1;a<=r+1;a++)for(let t=o-1;t{void 0!==e[n]&&void 0!==e[n][t]&&(e[n][t]=1)},this.diagramModel=new o.DiagramModel,this.nodeFactories={},this.linkFactories={},this.portFactories={},this.labelFactories={},this.canvas=null,this.paintableWidgets=null,this.linksThatHaveInitiallyRendered={},f.Toolkit.TESTING&&(f.Toolkit.TESTING_UID=0,window&&(window.diagram_instance=this))}installDefaultFactories(){this.registerNodeFactory(new s.DefaultNodeFactory),this.registerLinkFactory(new s.DefaultLinkFactory),this.registerPortFactory(new c.DefaultPortFactory),this.registerLabelFactory(new d.DefaultLabelFactory)}repaintCanvas(){this.iterateListeners(e=>{e.repaintCanvas&&e.repaintCanvas()})}clearRepaintEntities(){this.paintableWidgets=null}enableRepaintEntities(e){this.paintableWidgets={},e.forEach(e=>{e instanceof a.NodeModel&&i.forEach(e.getPorts(),e=>{i.forEach(e.getLinks(),e=>{this.paintableWidgets[e.getID()]=!0})}),e instanceof l.PointModel&&(this.paintableWidgets[e.getLink().getID()]=!0),this.paintableWidgets[e.getID()]=!0})}isModelLocked(e){return!!this.diagramModel.isLocked()||e.isLocked()}recalculatePortsVisually(){this.nodesRendered=!1,this.linksThatHaveInitiallyRendered={}}canEntityRepaint(e){return null===this.paintableWidgets||void 0!==this.paintableWidgets[e.getID()]}setCanvas(e){this.canvas=e}setDiagramModel(e){this.diagramModel=e,this.recalculatePortsVisually()}getDiagramModel(){return this.diagramModel}getNodeFactories(){return this.nodeFactories}getLinkFactories(){return this.linkFactories}getLabelFactories(){return this.labelFactories}registerLabelFactory(e){this.labelFactories[e.getType()]=e,this.iterateListeners(e=>{e.labelFactoriesUpdated&&e.labelFactoriesUpdated()})}registerPortFactory(e){this.portFactories[e.getType()]=e,this.iterateListeners(e=>{e.portFactoriesUpdated&&e.portFactoriesUpdated()})}registerNodeFactory(e){this.nodeFactories[e.getType()]=e,this.iterateListeners(e=>{e.nodeFactoriesUpdated&&e.nodeFactoriesUpdated()})}registerLinkFactory(e){this.linkFactories[e.getType()]=e,this.iterateListeners(e=>{e.linkFactoriesUpdated&&e.linkFactoriesUpdated()})}getPortFactory(e){if(this.portFactories[e])return this.portFactories[e];throw new Error("cannot find factory for port of type: [".concat(e,"]"))}getNodeFactory(e){if(this.nodeFactories[e])return this.nodeFactories[e];throw new Error("cannot find factory for node of type: [".concat(e,"]"))}getLinkFactory(e){if(this.linkFactories[e])return this.linkFactories[e];throw new Error("cannot find factory for link of type: [".concat(e,"]"))}getLabelFactory(e){if(this.labelFactories[e])return this.labelFactories[e];throw new Error("cannot find factory for label of type: [".concat(e,"]"))}getFactoryForNode(e){return this.getNodeFactory(e.getType())}getFactoryForLink(e){return this.getLinkFactory(e.getType())}getFactoryForLabel(e){return this.getLabelFactory(e.getType())}generateWidgetForLink(e){var t=this.getFactoryForLink(e);if(!t)throw new Error("Cannot find link factory for link: "+e.getType());return t.generateReactWidget(this,e)}generateWidgetForNode(e){var t=this.getFactoryForNode(e);if(!t)throw new Error("Cannot find widget factory for node: "+e.getType());return t.generateReactWidget(this,e)}getRelativeMousePoint(e){var t=this.getRelativePoint(e.clientX,e.clientY);return{x:(t.x-this.diagramModel.getOffsetX())/(this.diagramModel.getZoomLevel()/100),y:(t.y-this.diagramModel.getOffsetY())/(this.diagramModel.getZoomLevel()/100)}}getRelativePoint(e,t){var n=this.canvas.getBoundingClientRect();return{x:e-n.left,y:t-n.top}}getNodeElement(e){const t=this.canvas.querySelector('.node[data-nodeid="'.concat(e.getID(),'"]'));if(null===t)throw new Error("Cannot find Node element with nodeID: ["+e.getID()+"]");return t}getNodePortElement(e){var t=this.canvas.querySelector('.port[data-name="'.concat(e.getName(),'"][data-nodeid="').concat(e.getParent().getID(),'"]'));if(null===t)throw new Error("Cannot find Node Port element with nodeID: ["+e.getParent().getID()+"] and name: ["+e.getName()+"]");return t}getPortCenter(e){var t=this.getNodePortElement(e),n=t.getBoundingClientRect(),r=this.getRelativePoint(n.left,n.top);return{x:t.offsetWidth/2+(r.x-this.diagramModel.getOffsetX())/(this.diagramModel.getZoomLevel()/100),y:t.offsetHeight/2+(r.y-this.diagramModel.getOffsetY())/(this.diagramModel.getZoomLevel()/100)}}getPortCoords(e){const t=this.getNodePortElement(e).getBoundingClientRect(),n=this.canvas.getBoundingClientRect();return{x:(t.x-this.diagramModel.getOffsetX())/(this.diagramModel.getZoomLevel()/100)-n.left,y:(t.y-this.diagramModel.getOffsetY())/(this.diagramModel.getZoomLevel()/100)-n.top,width:t.width,height:t.height}}getNodeDimensions(e){if(!this.canvas)return{width:0,height:0};const t=this.getNodeElement(e).getBoundingClientRect();return{width:t.width,height:t.height}}getMaxNumberPointsPerLink(){return this.maxNumberPointsPerLink}setMaxNumberPointsPerLink(e){this.maxNumberPointsPerLink=e}isSmartRoutingEnabled(){return!!this.smartRouting}setSmartRoutingStatus(e){this.smartRouting=e}getCanvasMatrix(){return 0===this.canvasMatrix.length&&this.calculateCanvasMatrix(),this.canvasMatrix}calculateCanvasMatrix(){const{width:e,hAdjustmentFactor:t,height:n,vAdjustmentFactor:r}=this.calculateMatrixDimensions();this.hAdjustmentFactor=t,this.vAdjustmentFactor=r;const o=Math.ceil(e/u.ROUTING_SCALING_FACTOR),a=Math.ceil(n/u.ROUTING_SCALING_FACTOR);this.canvasMatrix=i.range(0,a).map(()=>new Array(o).fill(0))}getRoutingMatrix(){return 0===this.routingMatrix.length&&this.calculateRoutingMatrix(),this.routingMatrix}calculateRoutingMatrix(){const e=i.cloneDeep(this.getCanvasMatrix());this.markNodes(e),this.markPorts(e),this.routingMatrix=e}translateRoutingX(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return e+this.hAdjustmentFactor*(t?-1:1)}translateRoutingY(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return e+this.vAdjustmentFactor*(t?-1:1)}zoomToFit(){const e=this.canvas.clientWidth/this.canvas.scrollWidth,t=this.canvas.clientHeight/this.canvas.scrollHeight,n=ethis.forceUpdate()});this.setState({diagramEngineListener:t})}}componentWillUpdate(e){this.props.diagramEngine.diagramModel.id!==e.diagramEngine.diagramModel.id&&(this.setState({renderedNodes:!1}),e.diagramEngine.diagramModel.rendered=!0),e.diagramEngine.diagramModel.rendered||(this.setState({renderedNodes:!1}),e.diagramEngine.diagramModel.rendered=!0)}componentDidUpdate(){this.state.renderedNodes||this.setState({renderedNodes:!0})}componentDidMount(){this.onKeyUpPointer=this.onKeyUp.bind(this),this.setState({document:document,renderedNodes:!0,diagramEngineListener:this.props.diagramEngine.addListener({repaintCanvas:()=>{this.forceUpdate()}})}),window.addEventListener("keyup",this.onKeyUpPointer,!1),window.focus()}getMouseElement(e){var t=e.target,n=this.props.diagramEngine.diagramModel,r=l.Toolkit.closest(t,".port[data-name]");if(r){var o=l.Toolkit.closest(t,".node[data-nodeid]");return{model:n.getNode(o.getAttribute("data-nodeid")).getPort(r.getAttribute("data-name")),element:r}}return(r=l.Toolkit.closest(t,".point[data-id]"))?{model:n.getLink(r.getAttribute("data-linkid")).getPointModel(r.getAttribute("data-id")),element:r}:(r=l.Toolkit.closest(t,"[data-linkid]"))?{model:n.getLink(r.getAttribute("data-linkid")),element:r}:(r=l.Toolkit.closest(t,".node[data-nodeid]"))?{model:n.getNode(r.getAttribute("data-nodeid")),element:r}:null}fireAction(){this.state.action&&this.props.actionStillFiring&&this.props.actionStillFiring(this.state.action)}stopFiringAction(e){this.props.actionStoppedFiring&&!e&&this.props.actionStoppedFiring(this.state.action),this.setState({action:null})}startFiringAction(e){var t=!0;this.props.actionStartedFiring&&(t=this.props.actionStartedFiring(e)),t&&this.setState({action:e})}onMouseMove(e){var t=this.props.diagramEngine,n=t.getDiagramModel();if(this.state.action instanceof c.SelectingAction){var r=t.getRelativePoint(e.clientX,e.clientY);return o.forEach(n.getNodes(),e=>{this.state.action.containsElement(e.x,e.y,n)&&e.setSelected(!0)}),o.forEach(n.getLinks(),e=>{var t=!0;o.forEach(e.points,e=>{this.state.action.containsElement(e.x,e.y,n)?e.setSelected(!0):t=!1}),t&&e.setSelected(!0)}),this.state.action.mouseX2=r.x,this.state.action.mouseY2=r.y,this.fireAction(),void this.setState({action:this.state.action})}if(this.state.action instanceof u.MoveItemsAction){let r=e.clientX-this.state.action.mouseX,i=e.clientY-this.state.action.mouseY,a=n.getZoomLevel()/100;o.forEach(this.state.action.selectionModels,e=>{e.model instanceof d.NodeModel||e.model instanceof f.PointModel&&!e.model.isConnectedToPort()?(e.model.x=n.getGridPosition(e.initialX+r/a),e.model.y=n.getGridPosition(e.initialY+i/a),e.model instanceof d.NodeModel&&(e.model.positionChanged(),o.forEach(e.model.getPorts(),e=>{const t=this.props.diagramEngine.getPortCoords(e);e.updateCoords(t)})),t.isSmartRoutingEnabled()&&t.calculateRoutingMatrix()):e.model instanceof f.PointModel&&(e.model.x=e.initialX+n.getGridPosition(r/a),e.model.y=e.initialY+n.getGridPosition(i/a))}),t.isSmartRoutingEnabled()&&t.calculateCanvasMatrix(),this.fireAction(),this.state.wasMoved?this.forceUpdate():this.setState({wasMoved:!0})}else this.state.action instanceof s.MoveCanvasAction&&this.props.allowCanvasTranslation&&(n.setOffset(this.state.action.initialOffsetX+(e.clientX-this.state.action.mouseX),this.state.action.initialOffsetY+(e.clientY-this.state.action.mouseY)),this.fireAction(),this.forceUpdate())}onKeyUp(e){-1!==this.props.deleteKeys.indexOf(e.keyCode)&&(o.forEach(this.props.diagramEngine.getDiagramModel().getSelectedItems(),e=>{this.props.diagramEngine.isModelLocked(e)||e.remove()}),this.forceUpdate())}onMouseUp(e){var t=this.props.diagramEngine;if(this.state.action instanceof u.MoveItemsAction){var n=this.getMouseElement(e);o.forEach(this.state.action.selectionModels,e=>{if(e.model instanceof f.PointModel&&n&&n.model instanceof p.PortModel&&!t.isModelLocked(n.model)){let r=e.model.getLink();if(null!==r.getTargetPort())if(r.getTargetPort()!==n.model&&r.getSourcePort()!==n.model){const o=r.getTargetPort();let i=r.clone({});i.setSourcePort(n.model),i.setTargetPort(o),r.setTargetPort(n.model),o.removeLink(r),i.removePointsBefore(i.getPoints()[r.getPointIndex(e.model)]),r.removePointsAfter(e.model),t.getDiagramModel().addLink(i)}else r.getTargetPort()===n.model?r.removePointsAfter(e.model):r.getSourcePort()===n.model&&r.removePointsBefore(e.model);else r.setTargetPort(n.model);delete this.props.diagramEngine.linksThatHaveInitiallyRendered[r.getID()]}}),!this.props.allowLooseLinks&&this.state.wasMoved&&o.forEach(this.state.action.selectionModels,e=>{if(!(e.model instanceof f.PointModel))return;let t=e.model.getLink();null!==t.getSourcePort()&&null!==t.getTargetPort()||t.remove()}),o.forEach(this.state.action.selectionModels,e=>{if(!(e.model instanceof f.PointModel))return;let t=e.model.getLink(),n=t.getSourcePort(),r=t.getTargetPort();null!==n&&null!==r&&(n.canLinkToPort(r)?o.some(o.values(r.getLinks()),e=>e!==t&&(e.getSourcePort()===n||e.getTargetPort()===n))&&t.remove():t.remove())}),t.clearRepaintEntities(),this.stopFiringAction(!this.state.wasMoved)}else t.clearRepaintEntities(),this.stopFiringAction();this.state.document.removeEventListener("mousemove",this.onMouseMove),this.state.document.removeEventListener("mouseup",this.onMouseUp)}drawSelectionBox(){let e=this.state.action.getBoxDimensions();return r.createElement("div",{className:this.bem("__selector"),style:{top:e.top,left:e.left,width:e.width,height:e.height}})}render(){var e=this.props.diagramEngine;e.setMaxNumberPointsPerLink(this.props.maxNumberPointsPerLink),e.setSmartRoutingStatus(this.props.smartRouting);var t=e.getDiagramModel();return r.createElement("div",Object.assign({},this.getProps(),{ref:e=>{e&&this.props.diagramEngine.setCanvas(e)},onWheel:n=>{if(this.props.allowCanvasZoom){n.preventDefault(),n.stopPropagation();const r=t.getZoomLevel()/100;let o=this.props.inverseZoom?-n.deltaY:n.deltaY;n.ctrlKey&&o%1!=0?o/=3:o/=60,t.getZoomLevel()+o>10&&t.setZoomLevel(t.getZoomLevel()+o);const i=t.getZoomLevel()/100,a=n.currentTarget.getBoundingClientRect(),l=a.width,s=a.height,u=l*i-l*r,c=s*i-s*r,d=n.clientX-a.left,f=n.clientY-a.top,p=(d-t.getOffsetX())/r/l,h=(f-t.getOffsetY())/r/s;t.setOffset(t.getOffsetX()-u*p,t.getOffsetY()-c*h),e.enableRepaintEntities([]),this.forceUpdate()}},onMouseDown:n=>{if(3!==n.nativeEvent.which){this.setState(Object.assign({},this.state,{wasMoved:!1})),e.clearRepaintEntities();var r=this.getMouseElement(n);if(null===r)if(n.shiftKey){var o=e.getRelativePoint(n.clientX,n.clientY);this.startFiringAction(new c.SelectingAction(o.x,o.y))}else t.clearSelection(),this.startFiringAction(new s.MoveCanvasAction(n.clientX,n.clientY,t));else if(r.model instanceof p.PortModel)if(this.props.diagramEngine.isModelLocked(r.model))t.clearSelection();else{o=e.getRelativeMousePoint(n);var i=r.model,a=i.createLinkModel();a.setSourcePort(i),a&&(a.removeMiddlePoints(),a.getSourcePort()!==i&&a.setSourcePort(i),a.setTargetPort(null),a.getFirstPoint().updateLocation(o),a.getLastPoint().updateLocation(o),t.clearSelection(),a.getLastPoint().setSelected(!0),t.addLink(a),this.startFiringAction(new u.MoveItemsAction(n.clientX,n.clientY,e)))}else n.shiftKey||r.model.isSelected()||t.clearSelection(),r.model.setSelected(!0),this.startFiringAction(new u.MoveItemsAction(n.clientX,n.clientY,e));this.state.document.addEventListener("mousemove",this.onMouseMove),this.state.document.addEventListener("mouseup",this.onMouseUp)}}}),this.state.renderedNodes&&r.createElement(i.LinkLayerWidget,{diagramEngine:e,pointAdded:(n,r)=>{this.state.document.addEventListener("mousemove",this.onMouseMove),this.state.document.addEventListener("mouseup",this.onMouseUp),r.stopPropagation(),t.clearSelection(n),this.setState({action:new u.MoveItemsAction(r.clientX,r.clientY,e)})}}),r.createElement(a.NodeLayerWidget,{diagramEngine:e}),this.state.action instanceof c.SelectingAction&&this.drawSelectionBox())}}m.defaultProps={diagramEngine:null,allowLooseLinks:!0,allowCanvasTranslation:!0,allowCanvasZoom:!0,inverseZoom:!1,maxNumberPointsPerLink:1/0,smartRouting:!1,deleteKeys:[46,8]},t.DiagramWidget=m}])},function(e,t,n){"use strict";n.d(t,"d",(function(){return l})),n.d(t,"c",(function(){return u})),n.d(t,"a",(function(){return c})),n.d(t,"b",(function(){return d})),n.d(t,"e",(function(){return f}));var r=n(173);function o(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;return Math.min(Math.max(t,e),n)}function i(e){if(e.type)return e;if("#"===e.charAt(0))return i(function(e){e=e.substr(1);var t=new RegExp(".{1,".concat(e.length>=6?2:1,"}"),"g"),n=e.match(t);return n&&1===n[0].length&&(n=n.map((function(e){return e+e}))),n?"rgb".concat(4===n.length?"a":"","(").concat(n.map((function(e,t){return t<3?parseInt(e,16):Math.round(parseInt(e,16)/255*1e3)/1e3})).join(", "),")"):""}(e));var t=e.indexOf("("),n=e.substring(0,t);if(-1===["rgb","rgba","hsl","hsla"].indexOf(n))throw new Error(Object(r.a)(3,e));var o=e.substring(t+1,e.length-1).split(",");return{type:n,values:o=o.map((function(e){return parseFloat(e)}))}}function a(e){var t=e.type,n=e.values;return-1!==t.indexOf("rgb")?n=n.map((function(e,t){return t<3?parseInt(e,10):e})):-1!==t.indexOf("hsl")&&(n[1]="".concat(n[1],"%"),n[2]="".concat(n[2],"%")),"".concat(t,"(").concat(n.join(", "),")")}function l(e,t){var n=s(e),r=s(t);return(Math.max(n,r)+.05)/(Math.min(n,r)+.05)}function s(e){var t="hsl"===(e=i(e)).type?i(function(e){var t=(e=i(e)).values,n=t[0],r=t[1]/100,o=t[2]/100,l=r*Math.min(o,1-o),s=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:(e+n/30)%12;return o-l*Math.max(Math.min(t-3,9-t,1),-1)},u="rgb",c=[Math.round(255*s(0)),Math.round(255*s(8)),Math.round(255*s(4))];return"hsla"===e.type&&(u+="a",c.push(t[3])),a({type:u,values:c})}(e)).values:e.values;return t=t.map((function(e){return(e/=255)<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4)})),Number((.2126*t[0]+.7152*t[1]+.0722*t[2]).toFixed(3))}function u(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.15;return s(e)>.5?d(e,t):f(e,t)}function c(e,t){return e=i(e),t=o(t),"rgb"!==e.type&&"hsl"!==e.type||(e.type+="a"),e.values[3]=t,a(e)}function d(e,t){if(e=i(e),t=o(t),-1!==e.type.indexOf("hsl"))e.values[2]*=1-t;else if(-1!==e.type.indexOf("rgb"))for(var n=0;n<3;n+=1)e.values[n]*=1-t;return a(e)}function f(e,t){if(e=i(e),t=o(t),-1!==e.type.indexOf("hsl"))e.values[2]+=(100-e.values[2])*t;else if(-1!==e.type.indexOf("rgb"))for(var n=0;n<3;n+=1)e.values[n]+=(255-e.values[n])*t;return a(e)}},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(0),o=n(29);function i(e,t){return r.useMemo((function(){return null==e&&null==t?null:function(n){Object(o.a)(e,n),Object(o.a)(t,n)}}),[e,t])}},,function(e,t,n){"use strict";n.d(t,"a",(function(){return d})),n.d(t,"b",(function(){return V})),n.d(t,"c",(function(){return G}));var r=n(0),o=n.n(r),i=o.a.createContext(null);var a=function(e){e()};function l(){var e=a,t=null,n=null;return{clear:function(){t=null,n=null},notify:function(){e((function(){for(var e=t;e;)e.callback(),e=e.next}))},get:function(){for(var e=[],n=t;n;)e.push(n),n=n.next;return e},subscribe:function(e){var r=!0,o=n={callback:e,next:null,prev:n};return o.prev?o.prev.next=o:t=o,function(){r&&null!==t&&(r=!1,o.next?o.next.prev=o.prev:n=o.prev,o.prev?o.prev.next=o.next:t=o.next)}}}}var s={notify:function(){},get:function(){return[]}};function u(e,t){var n,r=s;function o(){a.onStateChange&&a.onStateChange()}function i(){n||(n=t?t.addNestedSub(o):e.subscribe(o),r=l())}var a={addNestedSub:function(e){return i(),r.subscribe(e)},notifyNestedSubs:function(){r.notify()},handleChangeWrapper:o,isSubscribed:function(){return Boolean(n)},trySubscribe:i,tryUnsubscribe:function(){n&&(n(),n=void 0,r.clear(),r=s)},getListeners:function(){return r}};return a}var c="undefined"!==typeof window&&"undefined"!==typeof window.document&&"undefined"!==typeof window.document.createElement?r.useLayoutEffect:r.useEffect;var d=function(e){var t=e.store,n=e.context,a=e.children,l=Object(r.useMemo)((function(){var e=u(t);return{store:t,subscription:e}}),[t]),s=Object(r.useMemo)((function(){return t.getState()}),[t]);c((function(){var e=l.subscription;return e.onStateChange=e.notifyNestedSubs,e.trySubscribe(),s!==t.getState()&&e.notifyNestedSubs(),function(){e.tryUnsubscribe(),e.onStateChange=null}}),[l,s]);var d=n||i;return o.a.createElement(d.Provider,{value:l},a)},f=n(1),p=n(23),h=n(58),m=n.n(h),v=n(67),g=["getDisplayName","methodName","renderCountProp","shouldHandleStateChanges","storeKey","withRef","forwardRef","context"],b=["reactReduxForwardedRef"],y=[],x=[null,null];function w(e,t){var n=e[1];return[t.payload,n+1]}function O(e,t,n){c((function(){return e.apply(void 0,t)}),n)}function k(e,t,n,r,o,i,a){e.current=r,t.current=o,n.current=!1,i.current&&(i.current=null,a())}function E(e,t,n,r,o,i,a,l,s,u){if(e){var c=!1,d=null,f=function(){if(!c){var e,n,f=t.getState();try{e=r(f,o.current)}catch(p){n=p,d=p}n||(d=null),e===i.current?a.current||s():(i.current=e,l.current=e,a.current=!0,u({type:"STORE_UPDATED",payload:{error:n}}))}};n.onStateChange=f,n.trySubscribe(),f();return function(){if(c=!0,n.tryUnsubscribe(),n.onStateChange=null,d)throw d}}}var S=function(){return[null,0]};function j(e,t){void 0===t&&(t={});var n=t,a=n.getDisplayName,l=void 0===a?function(e){return"ConnectAdvanced("+e+")"}:a,s=n.methodName,c=void 0===s?"connectAdvanced":s,d=n.renderCountProp,h=void 0===d?void 0:d,j=n.shouldHandleStateChanges,C=void 0===j||j,_=n.storeKey,P=void 0===_?"store":_,T=(n.withRef,n.forwardRef),M=void 0!==T&&T,R=n.context,N=void 0===R?i:R,A=Object(p.a)(n,g),L=N;return function(t){var n=t.displayName||t.name||"Component",i=l(n),a=Object(f.a)({},A,{getDisplayName:l,methodName:c,renderCountProp:h,shouldHandleStateChanges:C,storeKey:P,displayName:i,wrappedComponentName:n,WrappedComponent:t}),s=A.pure;var d=s?r.useMemo:function(e){return e()};function g(n){var i=Object(r.useMemo)((function(){var e=n.reactReduxForwardedRef,t=Object(p.a)(n,b);return[n.context,e,t]}),[n]),l=i[0],s=i[1],c=i[2],h=Object(r.useMemo)((function(){return l&&l.Consumer&&Object(v.isContextConsumer)(o.a.createElement(l.Consumer,null))?l:L}),[l,L]),m=Object(r.useContext)(h),g=Boolean(n.store)&&Boolean(n.store.getState)&&Boolean(n.store.dispatch);Boolean(m)&&Boolean(m.store);var j=g?n.store:m.store,_=Object(r.useMemo)((function(){return function(t){return e(t.dispatch,a)}(j)}),[j]),P=Object(r.useMemo)((function(){if(!C)return x;var e=u(j,g?null:m.subscription),t=e.notifyNestedSubs.bind(e);return[e,t]}),[j,g,m]),T=P[0],M=P[1],R=Object(r.useMemo)((function(){return g?m:Object(f.a)({},m,{subscription:T})}),[g,m,T]),N=Object(r.useReducer)(w,y,S),A=N[0][0],I=N[1];if(A&&A.error)throw A.error;var z=Object(r.useRef)(),D=Object(r.useRef)(c),F=Object(r.useRef)(),W=Object(r.useRef)(!1),B=d((function(){return F.current&&c===D.current?F.current:_(j.getState(),c)}),[j,A,c]);O(k,[D,z,W,c,B,F,M]),O(E,[C,j,T,_,D,z,W,F,M,I],[j,T,_]);var U=Object(r.useMemo)((function(){return o.a.createElement(t,Object(f.a)({},B,{ref:s}))}),[s,t,B]);return Object(r.useMemo)((function(){return C?o.a.createElement(h.Provider,{value:R},U):U}),[h,U,R])}var j=s?o.a.memo(g):g;if(j.WrappedComponent=t,j.displayName=g.displayName=i,M){var _=o.a.forwardRef((function(e,t){return o.a.createElement(j,Object(f.a)({},e,{reactReduxForwardedRef:t}))}));return _.displayName=i,_.WrappedComponent=t,m()(_,t)}return m()(j,t)}}function C(e,t){return e===t?0!==e||0!==t||1/e===1/t:e!==e&&t!==t}function _(e,t){if(C(e,t))return!0;if("object"!==typeof e||null===e||"object"!==typeof t||null===t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(var o=0;o=0;r--){var o=t[r](e);if(o)return o}return function(t,r){throw new Error("Invalid value of type "+typeof e+" for "+n+" argument when connecting component "+r.wrappedComponentName+".")}}function U(e,t){return e===t}function $(e){var t=void 0===e?{}:e,n=t.connectHOC,r=void 0===n?j:n,o=t.mapStateToPropsFactories,i=void 0===o?N:o,a=t.mapDispatchToPropsFactories,l=void 0===a?R:a,s=t.mergePropsFactories,u=void 0===s?L:s,c=t.selectorFactory,d=void 0===c?F:c;return function(e,t,n,o){void 0===o&&(o={});var a=o,s=a.pure,c=void 0===s||s,h=a.areStatesEqual,m=void 0===h?U:h,v=a.areOwnPropsEqual,g=void 0===v?_:v,b=a.areStatePropsEqual,y=void 0===b?_:b,x=a.areMergedPropsEqual,w=void 0===x?_:x,O=Object(p.a)(a,W),k=B(e,i,"mapStateToProps"),E=B(t,l,"mapDispatchToProps"),S=B(n,u,"mergeProps");return r(d,Object(f.a)({methodName:"connect",getDisplayName:function(e){return"Connect("+e+")"},shouldHandleStateChanges:Boolean(e),initMapStateToProps:k,initMapDispatchToProps:E,initMergeProps:S,pure:c,areStatesEqual:m,areOwnPropsEqual:g,areStatePropsEqual:y,areMergedPropsEqual:w},O))}}var V=$();function H(){return Object(r.useContext)(i)}var q=function(e,t){return e===t};function Y(e){void 0===e&&(e=i);var t=e===i?H:function(){return Object(r.useContext)(e)};return function(e,n){void 0===n&&(n=q);var o=t(),i=function(e,t,n,o){var i,a=Object(r.useReducer)((function(e){return e+1}),0)[1],l=Object(r.useMemo)((function(){return u(n,o)}),[n,o]),s=Object(r.useRef)(),d=Object(r.useRef)(),f=Object(r.useRef)(),p=Object(r.useRef)(),h=n.getState();try{if(e!==d.current||h!==f.current||s.current){var m=e(h);i=void 0!==p.current&&t(m,p.current)?p.current:m}else i=p.current}catch(v){throw s.current&&(v.message+="\nThe error may be correlated with this previous error:\n"+s.current.stack+"\n\n"),v}return c((function(){d.current=e,f.current=h,p.current=i,s.current=void 0})),c((function(){function e(){try{var e=n.getState();if(e===f.current)return;var r=d.current(e);if(t(r,p.current))return;p.current=r,f.current=e}catch(v){s.current=v}a()}return l.onStateChange=e,l.trySubscribe(),e(),function(){return l.tryUnsubscribe()}}),[n,l]),i}(e,n,o.store,o.subscription);return Object(r.useDebugValue)(i),i}}var X,G=Y(),K=n(13);X=K.unstable_batchedUpdates,a=X},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(109);function o(e,t,n){return(t=Object(r.a)(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}},function(e,t,n){"use strict";!function e(){if("undefined"!==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"===typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE){0;try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}}(),e.exports=n(196)},function(e,t,n){(function(e,r){var o;(function(){var i="Expected a function",a="__lodash_placeholder__",l=[["ary",128],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",32],["partialRight",64],["rearg",256]],s="[object Arguments]",u="[object Array]",c="[object Boolean]",d="[object Date]",f="[object Error]",p="[object Function]",h="[object GeneratorFunction]",m="[object Map]",v="[object Number]",g="[object Object]",b="[object RegExp]",y="[object Set]",x="[object String]",w="[object Symbol]",O="[object WeakMap]",k="[object ArrayBuffer]",E="[object DataView]",S="[object Float32Array]",j="[object Float64Array]",C="[object Int8Array]",_="[object Int16Array]",P="[object Int32Array]",T="[object Uint8Array]",M="[object Uint16Array]",R="[object Uint32Array]",N=/\b__p \+= '';/g,A=/\b(__p \+=) '' \+/g,L=/(__e\(.*?\)|\b__t\)) \+\n'';/g,I=/&(?:amp|lt|gt|quot|#39);/g,z=/[&<>"']/g,D=RegExp(I.source),F=RegExp(z.source),W=/<%-([\s\S]+?)%>/g,B=/<%([\s\S]+?)%>/g,U=/<%=([\s\S]+?)%>/g,$=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,V=/^\w*$/,H=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,q=/[\\^$.*+?()[\]{}|]/g,Y=RegExp(q.source),X=/^\s+/,G=/\s/,K=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Q=/\{\n\/\* \[wrapped with (.+)\] \*/,Z=/,? & /,J=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,ee=/[()=,{}\[\]\/\s]/,te=/\\(\\)?/g,ne=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,re=/\w*$/,oe=/^[-+]0x[0-9a-f]+$/i,ie=/^0b[01]+$/i,ae=/^\[object .+?Constructor\]$/,le=/^0o[0-7]+$/i,se=/^(?:0|[1-9]\d*)$/,ue=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,ce=/($^)/,de=/['\n\r\u2028\u2029\\]/g,fe="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",pe="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\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",he="[\\ud800-\\udfff]",me="["+pe+"]",ve="["+fe+"]",ge="\\d+",be="[\\u2700-\\u27bf]",ye="[a-z\\xdf-\\xf6\\xf8-\\xff]",xe="[^\\ud800-\\udfff"+pe+ge+"\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde]",we="\\ud83c[\\udffb-\\udfff]",Oe="[^\\ud800-\\udfff]",ke="(?:\\ud83c[\\udde6-\\uddff]){2}",Ee="[\\ud800-\\udbff][\\udc00-\\udfff]",Se="[A-Z\\xc0-\\xd6\\xd8-\\xde]",je="(?:"+ye+"|"+xe+")",Ce="(?:"+Se+"|"+xe+")",_e="(?:"+ve+"|"+we+")"+"?",Pe="[\\ufe0e\\ufe0f]?"+_e+("(?:\\u200d(?:"+[Oe,ke,Ee].join("|")+")[\\ufe0e\\ufe0f]?"+_e+")*"),Te="(?:"+[be,ke,Ee].join("|")+")"+Pe,Me="(?:"+[Oe+ve+"?",ve,ke,Ee,he].join("|")+")",Re=RegExp("['\u2019]","g"),Ne=RegExp(ve,"g"),Ae=RegExp(we+"(?="+we+")|"+Me+Pe,"g"),Le=RegExp([Se+"?"+ye+"+(?:['\u2019](?:d|ll|m|re|s|t|ve))?(?="+[me,Se,"$"].join("|")+")",Ce+"+(?:['\u2019](?:D|LL|M|RE|S|T|VE))?(?="+[me,Se+je,"$"].join("|")+")",Se+"?"+je+"+(?:['\u2019](?:d|ll|m|re|s|t|ve))?",Se+"+(?:['\u2019](?:D|LL|M|RE|S|T|VE))?","\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",ge,Te].join("|"),"g"),Ie=RegExp("[\\u200d\\ud800-\\udfff"+fe+"\\ufe0e\\ufe0f]"),ze=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,De=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Fe=-1,We={};We[S]=We[j]=We[C]=We[_]=We[P]=We[T]=We["[object Uint8ClampedArray]"]=We[M]=We[R]=!0,We[s]=We[u]=We[k]=We[c]=We[E]=We[d]=We[f]=We[p]=We[m]=We[v]=We[g]=We[b]=We[y]=We[x]=We[O]=!1;var Be={};Be[s]=Be[u]=Be[k]=Be[E]=Be[c]=Be[d]=Be[S]=Be[j]=Be[C]=Be[_]=Be[P]=Be[m]=Be[v]=Be[g]=Be[b]=Be[y]=Be[x]=Be[w]=Be[T]=Be["[object Uint8ClampedArray]"]=Be[M]=Be[R]=!0,Be[f]=Be[p]=Be[O]=!1;var Ue={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},$e=parseFloat,Ve=parseInt,He="object"==typeof e&&e&&e.Object===Object&&e,qe="object"==typeof self&&self&&self.Object===Object&&self,Ye=He||qe||Function("return this")(),Xe=t&&!t.nodeType&&t,Ge=Xe&&"object"==typeof r&&r&&!r.nodeType&&r,Ke=Ge&&Ge.exports===Xe,Qe=Ke&&He.process,Ze=function(){try{var e=Ge&&Ge.require&&Ge.require("util").types;return e||Qe&&Qe.binding&&Qe.binding("util")}catch(t){}}(),Je=Ze&&Ze.isArrayBuffer,et=Ze&&Ze.isDate,tt=Ze&&Ze.isMap,nt=Ze&&Ze.isRegExp,rt=Ze&&Ze.isSet,ot=Ze&&Ze.isTypedArray;function it(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function at(e,t,n,r){for(var o=-1,i=null==e?0:e.length;++o-1}function ft(e,t,n){for(var r=-1,o=null==e?0:e.length;++r-1;);return n}function Lt(e,t){for(var n=e.length;n--&&wt(t,e[n],0)>-1;);return n}function It(e,t){for(var n=e.length,r=0;n--;)e[n]===t&&++r;return r}var zt=jt({"\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","\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"}),Dt=jt({"&":"&","<":"<",">":">",'"':""","'":"'"});function Ft(e){return"\\"+Ue[e]}function Wt(e){return Ie.test(e)}function Bt(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n}function Ut(e,t){return function(n){return e(t(n))}}function $t(e,t){for(var n=-1,r=e.length,o=0,i=[];++n",""":'"',"'":"'"});var Kt=function e(t){var n=(t=null==t?Ye:Kt.defaults(Ye.Object(),t,Kt.pick(Ye,De))).Array,r=t.Date,o=t.Error,G=t.Function,fe=t.Math,pe=t.Object,he=t.RegExp,me=t.String,ve=t.TypeError,ge=n.prototype,be=G.prototype,ye=pe.prototype,xe=t["__core-js_shared__"],we=be.toString,Oe=ye.hasOwnProperty,ke=0,Ee=function(){var e=/[^.]+$/.exec(xe&&xe.keys&&xe.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),Se=ye.toString,je=we.call(pe),Ce=Ye._,_e=he("^"+we.call(Oe).replace(q,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Pe=Ke?t.Buffer:void 0,Te=t.Symbol,Me=t.Uint8Array,Ae=Pe?Pe.allocUnsafe:void 0,Ie=Ut(pe.getPrototypeOf,pe),Ue=pe.create,He=ye.propertyIsEnumerable,qe=ge.splice,Xe=Te?Te.isConcatSpreadable:void 0,Ge=Te?Te.iterator:void 0,Qe=Te?Te.toStringTag:void 0,Ze=function(){try{var e=ei(pe,"defineProperty");return e({},"",{}),e}catch(t){}}(),bt=t.clearTimeout!==Ye.clearTimeout&&t.clearTimeout,jt=r&&r.now!==Ye.Date.now&&r.now,Qt=t.setTimeout!==Ye.setTimeout&&t.setTimeout,Zt=fe.ceil,Jt=fe.floor,en=pe.getOwnPropertySymbols,tn=Pe?Pe.isBuffer:void 0,nn=t.isFinite,rn=ge.join,on=Ut(pe.keys,pe),an=fe.max,ln=fe.min,sn=r.now,un=t.parseInt,cn=fe.random,dn=ge.reverse,fn=ei(t,"DataView"),pn=ei(t,"Map"),hn=ei(t,"Promise"),mn=ei(t,"Set"),vn=ei(t,"WeakMap"),gn=ei(pe,"create"),bn=vn&&new vn,yn={},xn=Ci(fn),wn=Ci(pn),On=Ci(hn),kn=Ci(mn),En=Ci(vn),Sn=Te?Te.prototype:void 0,jn=Sn?Sn.valueOf:void 0,Cn=Sn?Sn.toString:void 0;function _n(e){if(Va(e)&&!Na(e)&&!(e instanceof Rn)){if(e instanceof Mn)return e;if(Oe.call(e,"__wrapped__"))return _i(e)}return new Mn(e)}var Pn=function(){function e(){}return function(t){if(!$a(t))return{};if(Ue)return Ue(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();function Tn(){}function Mn(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=void 0}function Rn(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=4294967295,this.__views__=[]}function Nn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t=t?e:t)),e}function Kn(e,t,n,r,o,i){var a,l=1&t,u=2&t,f=4&t;if(n&&(a=o?n(e,r,o,i):n(e)),void 0!==a)return a;if(!$a(e))return e;var O=Na(e);if(O){if(a=function(e){var t=e.length,n=new e.constructor(t);t&&"string"==typeof e[0]&&Oe.call(e,"index")&&(n.index=e.index,n.input=e.input);return n}(e),!l)return bo(e,a)}else{var N=ri(e),A=N==p||N==h;if(za(e))return fo(e,l);if(N==g||N==s||A&&!o){if(a=u||A?{}:ii(e),!l)return u?function(e,t){return yo(e,ni(e),t)}(e,function(e,t){return e&&yo(t,wl(t),e)}(a,e)):function(e,t){return yo(e,ti(e),t)}(e,qn(a,e))}else{if(!Be[N])return o?e:{};a=function(e,t,n){var r=e.constructor;switch(t){case k:return po(e);case c:case d:return new r(+e);case E:return function(e,t){var n=t?po(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}(e,n);case S:case j:case C:case _:case P:case T:case"[object Uint8ClampedArray]":case M:case R:return ho(e,n);case m:return new r;case v:case x:return new r(e);case b:return function(e){var t=new e.constructor(e.source,re.exec(e));return t.lastIndex=e.lastIndex,t}(e);case y:return new r;case w:return o=e,jn?pe(jn.call(o)):{}}var o}(e,N,l)}}i||(i=new zn);var L=i.get(e);if(L)return L;i.set(e,a),Ga(e)?e.forEach((function(r){a.add(Kn(r,t,n,r,e,i))})):Ha(e)&&e.forEach((function(r,o){a.set(o,Kn(r,t,n,o,e,i))}));var I=O?void 0:(f?u?Yo:qo:u?wl:xl)(e);return lt(I||e,(function(r,o){I&&(r=e[o=r]),$n(a,o,Kn(r,t,n,o,e,i))})),a}function Qn(e,t,n){var r=n.length;if(null==e)return!r;for(e=pe(e);r--;){var o=n[r],i=t[o],a=e[o];if(void 0===a&&!(o in e)||!i(a))return!1}return!0}function Zn(e,t,n){if("function"!=typeof e)throw new ve(i);return xi((function(){e.apply(void 0,n)}),t)}function Jn(e,t,n,r){var o=-1,i=dt,a=!0,l=e.length,s=[],u=t.length;if(!l)return s;n&&(t=pt(t,Mt(n))),r?(i=ft,a=!1):t.length>=200&&(i=Nt,a=!1,t=new In(t));e:for(;++o-1},An.prototype.set=function(e,t){var n=this.__data__,r=Vn(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this},Ln.prototype.clear=function(){this.size=0,this.__data__={hash:new Nn,map:new(pn||An),string:new Nn}},Ln.prototype.delete=function(e){var t=Zo(this,e).delete(e);return this.size-=t?1:0,t},Ln.prototype.get=function(e){return Zo(this,e).get(e)},Ln.prototype.has=function(e){return Zo(this,e).has(e)},Ln.prototype.set=function(e,t){var n=Zo(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this},In.prototype.add=In.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},In.prototype.has=function(e){return this.__data__.has(e)},zn.prototype.clear=function(){this.__data__=new An,this.size=0},zn.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},zn.prototype.get=function(e){return this.__data__.get(e)},zn.prototype.has=function(e){return this.__data__.has(e)},zn.prototype.set=function(e,t){var n=this.__data__;if(n instanceof An){var r=n.__data__;if(!pn||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new Ln(r)}return n.set(e,t),this.size=n.size,this};var er=Oo(sr),tr=Oo(ur,!0);function nr(e,t){var n=!0;return er(e,(function(e,r,o){return n=!!t(e,r,o)})),n}function rr(e,t,n){for(var r=-1,o=e.length;++r0&&n(l)?t>1?ir(l,t-1,n,r,o):ht(o,l):r||(o[o.length]=l)}return o}var ar=ko(),lr=ko(!0);function sr(e,t){return e&&ar(e,t,xl)}function ur(e,t){return e&&lr(e,t,xl)}function cr(e,t){return ct(t,(function(t){return Wa(e[t])}))}function dr(e,t){for(var n=0,r=(t=lo(t,e)).length;null!=e&&nt}function mr(e,t){return null!=e&&Oe.call(e,t)}function vr(e,t){return null!=e&&t in pe(e)}function gr(e,t,r){for(var o=r?ft:dt,i=e[0].length,a=e.length,l=a,s=n(a),u=1/0,c=[];l--;){var d=e[l];l&&t&&(d=pt(d,Mt(t))),u=ln(d.length,u),s[l]=!r&&(t||i>=120&&d.length>=120)?new In(l&&d):void 0}d=e[0];var f=-1,p=s[0];e:for(;++f=l)return s;var u=n[r];return s*("desc"==u?-1:1)}}return e.index-t.index}(e,t,n)}))}function Nr(e,t,n){for(var r=-1,o=t.length,i={};++r-1;)l!==e&&qe.call(l,s,1),qe.call(e,s,1);return e}function Lr(e,t){for(var n=e?t.length:0,r=n-1;n--;){var o=t[n];if(n==r||o!==i){var i=o;li(o)?qe.call(e,o,1):Jr(e,o)}}return e}function Ir(e,t){return e+Jt(cn()*(t-e+1))}function zr(e,t){var n="";if(!e||t<1||t>9007199254740991)return n;do{t%2&&(n+=e),(t=Jt(t/2))&&(e+=e)}while(t);return n}function Dr(e,t){return wi(mi(e,t,ql),e+"")}function Fr(e){return Fn(Pl(e))}function Wr(e,t){var n=Pl(e);return Ei(n,Gn(t,0,n.length))}function Br(e,t,n,r){if(!$a(e))return e;for(var o=-1,i=(t=lo(t,e)).length,a=i-1,l=e;null!=l&&++oi?0:i+t),(r=r>i?i:r)<0&&(r+=i),i=t>r?0:r-t>>>0,t>>>=0;for(var a=n(i);++o>>1,a=e[i];null!==a&&!Qa(a)&&(n?a<=t:a=200){var u=t?null:Do(e);if(u)return Vt(u);a=!1,o=Nt,s=new In}else s=t?[]:l;e:for(;++r=r?e:Hr(e,t,n)}var co=bt||function(e){return Ye.clearTimeout(e)};function fo(e,t){if(t)return e.slice();var n=e.length,r=Ae?Ae(n):new e.constructor(n);return e.copy(r),r}function po(e){var t=new e.constructor(e.byteLength);return new Me(t).set(new Me(e)),t}function ho(e,t){var n=t?po(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function mo(e,t){if(e!==t){var n=void 0!==e,r=null===e,o=e===e,i=Qa(e),a=void 0!==t,l=null===t,s=t===t,u=Qa(t);if(!l&&!u&&!i&&e>t||i&&a&&s&&!l&&!u||r&&a&&s||!n&&s||!o)return 1;if(!r&&!i&&!u&&e1?n[o-1]:void 0,a=o>2?n[2]:void 0;for(i=e.length>3&&"function"==typeof i?(o--,i):void 0,a&&si(n[0],n[1],a)&&(i=o<3?void 0:i,o=1),t=pe(t);++r-1?o[i?t[a]:a]:void 0}}function _o(e){return Ho((function(t){var n=t.length,r=n,o=Mn.prototype.thru;for(e&&t.reverse();r--;){var a=t[r];if("function"!=typeof a)throw new ve(i);if(o&&!l&&"wrapper"==Go(a))var l=new Mn([],!0)}for(r=l?r:n;++r1&&y.reverse(),d&&ul))return!1;var u=i.get(e),c=i.get(t);if(u&&c)return u==t&&c==e;var d=-1,f=!0,p=2&n?new In:void 0;for(i.set(e,t),i.set(t,e);++d-1&&e%1==0&&e1?"& ":"")+t[r],t=t.join(n>2?", ":" "),e.replace(K,"{\n/* [wrapped with "+t+"] */\n")}(r,function(e,t){return lt(l,(function(n){var r="_."+n[0];t&n[1]&&!dt(e,r)&&e.push(r)})),e.sort()}(function(e){var t=e.match(Q);return t?t[1].split(Z):[]}(r),n)))}function ki(e){var t=0,n=0;return function(){var r=sn(),o=16-(r-n);if(n=r,o>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function Ei(e,t){var n=-1,r=e.length,o=r-1;for(t=void 0===t?r:t;++n1?e[t-1]:void 0;return n="function"==typeof n?(e.pop(),n):void 0,Xi(e,n)}));function ta(e){var t=_n(e);return t.__chain__=!0,t}function na(e,t){return t(e)}var ra=Ho((function(e){var t=e.length,n=t?e[0]:0,r=this.__wrapped__,o=function(t){return Xn(t,e)};return!(t>1||this.__actions__.length)&&r instanceof Rn&&li(n)?((r=r.slice(n,+n+(t?1:0))).__actions__.push({func:na,args:[o],thisArg:void 0}),new Mn(r,this.__chain__).thru((function(e){return t&&!e.length&&e.push(void 0),e}))):this.thru(o)}));var oa=xo((function(e,t,n){Oe.call(e,n)?++e[n]:Yn(e,n,1)}));var ia=Co(Ri),aa=Co(Ni);function la(e,t){return(Na(e)?lt:er)(e,Qo(t,3))}function sa(e,t){return(Na(e)?st:tr)(e,Qo(t,3))}var ua=xo((function(e,t,n){Oe.call(e,n)?e[n].push(t):Yn(e,n,[t])}));var ca=Dr((function(e,t,r){var o=-1,i="function"==typeof t,a=La(e)?n(e.length):[];return er(e,(function(e){a[++o]=i?it(t,e,r):br(e,t,r)})),a})),da=xo((function(e,t,n){Yn(e,n,t)}));function fa(e,t){return(Na(e)?pt:Cr)(e,Qo(t,3))}var pa=xo((function(e,t,n){e[n?0:1].push(t)}),(function(){return[[],[]]}));var ha=Dr((function(e,t){if(null==e)return[];var n=t.length;return n>1&&si(e,t[0],t[1])?t=[]:n>2&&si(t[0],t[1],t[2])&&(t=[t[0]]),Rr(e,ir(t,1),[])})),ma=jt||function(){return Ye.Date.now()};function va(e,t,n){return t=n?void 0:t,Wo(e,128,void 0,void 0,void 0,void 0,t=e&&null==t?e.length:t)}function ga(e,t){var n;if("function"!=typeof t)throw new ve(i);return e=rl(e),function(){return--e>0&&(n=t.apply(this,arguments)),e<=1&&(t=void 0),n}}var ba=Dr((function(e,t,n){var r=1;if(n.length){var o=$t(n,Ko(ba));r|=32}return Wo(e,r,t,n,o)})),ya=Dr((function(e,t,n){var r=3;if(n.length){var o=$t(n,Ko(ya));r|=32}return Wo(t,r,e,n,o)}));function xa(e,t,n){var r,o,a,l,s,u,c=0,d=!1,f=!1,p=!0;if("function"!=typeof e)throw new ve(i);function h(t){var n=r,i=o;return r=o=void 0,c=t,l=e.apply(i,n)}function m(e){return c=e,s=xi(g,t),d?h(e):l}function v(e){var n=e-u;return void 0===u||n>=t||n<0||f&&e-c>=a}function g(){var e=ma();if(v(e))return b(e);s=xi(g,function(e){var n=t-(e-u);return f?ln(n,a-(e-c)):n}(e))}function b(e){return s=void 0,p&&r?h(e):(r=o=void 0,l)}function y(){var e=ma(),n=v(e);if(r=arguments,o=this,u=e,n){if(void 0===s)return m(u);if(f)return co(s),s=xi(g,t),h(u)}return void 0===s&&(s=xi(g,t)),l}return t=il(t)||0,$a(n)&&(d=!!n.leading,a=(f="maxWait"in n)?an(il(n.maxWait)||0,t):a,p="trailing"in n?!!n.trailing:p),y.cancel=function(){void 0!==s&&co(s),c=0,r=u=o=s=void 0},y.flush=function(){return void 0===s?l:b(ma())},y}var wa=Dr((function(e,t){return Zn(e,1,t)})),Oa=Dr((function(e,t,n){return Zn(e,il(t)||0,n)}));function ka(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new ve(i);var n=function(){var r=arguments,o=t?t.apply(this,r):r[0],i=n.cache;if(i.has(o))return i.get(o);var a=e.apply(this,r);return n.cache=i.set(o,a)||i,a};return n.cache=new(ka.Cache||Ln),n}function Ea(e){if("function"!=typeof e)throw new ve(i);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}ka.Cache=Ln;var Sa=so((function(e,t){var n=(t=1==t.length&&Na(t[0])?pt(t[0],Mt(Qo())):pt(ir(t,1),Mt(Qo()))).length;return Dr((function(r){for(var o=-1,i=ln(r.length,n);++o=t})),Ra=yr(function(){return arguments}())?yr:function(e){return Va(e)&&Oe.call(e,"callee")&&!He.call(e,"callee")},Na=n.isArray,Aa=Je?Mt(Je):function(e){return Va(e)&&pr(e)==k};function La(e){return null!=e&&Ua(e.length)&&!Wa(e)}function Ia(e){return Va(e)&&La(e)}var za=tn||is,Da=et?Mt(et):function(e){return Va(e)&&pr(e)==d};function Fa(e){if(!Va(e))return!1;var t=pr(e);return t==f||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!Ya(e)}function Wa(e){if(!$a(e))return!1;var t=pr(e);return t==p||t==h||"[object AsyncFunction]"==t||"[object Proxy]"==t}function Ba(e){return"number"==typeof e&&e==rl(e)}function Ua(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}function $a(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function Va(e){return null!=e&&"object"==typeof e}var Ha=tt?Mt(tt):function(e){return Va(e)&&ri(e)==m};function qa(e){return"number"==typeof e||Va(e)&&pr(e)==v}function Ya(e){if(!Va(e)||pr(e)!=g)return!1;var t=Ie(e);if(null===t)return!0;var n=Oe.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&we.call(n)==je}var Xa=nt?Mt(nt):function(e){return Va(e)&&pr(e)==b};var Ga=rt?Mt(rt):function(e){return Va(e)&&ri(e)==y};function Ka(e){return"string"==typeof e||!Na(e)&&Va(e)&&pr(e)==x}function Qa(e){return"symbol"==typeof e||Va(e)&&pr(e)==w}var Za=ot?Mt(ot):function(e){return Va(e)&&Ua(e.length)&&!!We[pr(e)]};var Ja=Lo(jr),el=Lo((function(e,t){return e<=t}));function tl(e){if(!e)return[];if(La(e))return Ka(e)?Yt(e):bo(e);if(Ge&&e[Ge])return function(e){for(var t,n=[];!(t=e.next()).done;)n.push(t.value);return n}(e[Ge]());var t=ri(e);return(t==m?Bt:t==y?Vt:Pl)(e)}function nl(e){return e?(e=il(e))===1/0||e===-1/0?17976931348623157e292*(e<0?-1:1):e===e?e:0:0===e?e:0}function rl(e){var t=nl(e),n=t%1;return t===t?n?t-n:t:0}function ol(e){return e?Gn(rl(e),0,4294967295):0}function il(e){if("number"==typeof e)return e;if(Qa(e))return NaN;if($a(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=$a(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=Tt(e);var n=ie.test(e);return n||le.test(e)?Ve(e.slice(2),n?2:8):oe.test(e)?NaN:+e}function al(e){return yo(e,wl(e))}function ll(e){return null==e?"":Qr(e)}var sl=wo((function(e,t){if(fi(t)||La(t))yo(t,xl(t),e);else for(var n in t)Oe.call(t,n)&&$n(e,n,t[n])})),ul=wo((function(e,t){yo(t,wl(t),e)})),cl=wo((function(e,t,n,r){yo(t,wl(t),e,r)})),dl=wo((function(e,t,n,r){yo(t,xl(t),e,r)})),fl=Ho(Xn);var pl=Dr((function(e,t){e=pe(e);var n=-1,r=t.length,o=r>2?t[2]:void 0;for(o&&si(t[0],t[1],o)&&(r=1);++n1),t})),yo(e,Yo(e),n),r&&(n=Kn(n,7,$o));for(var o=t.length;o--;)Jr(n,t[o]);return n}));var Sl=Ho((function(e,t){return null==e?{}:function(e,t){return Nr(e,t,(function(t,n){return vl(e,n)}))}(e,t)}));function jl(e,t){if(null==e)return{};var n=pt(Yo(e),(function(e){return[e]}));return t=Qo(t),Nr(e,n,(function(e,n){return t(e,n[0])}))}var Cl=Fo(xl),_l=Fo(wl);function Pl(e){return null==e?[]:Rt(e,xl(e))}var Tl=So((function(e,t,n){return t=t.toLowerCase(),e+(n?Ml(t):t)}));function Ml(e){return Fl(ll(e).toLowerCase())}function Rl(e){return(e=ll(e))&&e.replace(ue,zt).replace(Ne,"")}var Nl=So((function(e,t,n){return e+(n?"-":"")+t.toLowerCase()})),Al=So((function(e,t,n){return e+(n?" ":"")+t.toLowerCase()})),Ll=Eo("toLowerCase");var Il=So((function(e,t,n){return e+(n?"_":"")+t.toLowerCase()}));var zl=So((function(e,t,n){return e+(n?" ":"")+Fl(t)}));var Dl=So((function(e,t,n){return e+(n?" ":"")+t.toUpperCase()})),Fl=Eo("toUpperCase");function Wl(e,t,n){return e=ll(e),void 0===(t=n?void 0:t)?function(e){return ze.test(e)}(e)?function(e){return e.match(Le)||[]}(e):function(e){return e.match(J)||[]}(e):e.match(t)||[]}var Bl=Dr((function(e,t){try{return it(e,void 0,t)}catch(n){return Fa(n)?n:new o(n)}})),Ul=Ho((function(e,t){return lt(t,(function(t){t=ji(t),Yn(e,t,ba(e[t],e))})),e}));function $l(e){return function(){return e}}var Vl=_o(),Hl=_o(!0);function ql(e){return e}function Yl(e){return kr("function"==typeof e?e:Kn(e,1))}var Xl=Dr((function(e,t){return function(n){return br(n,e,t)}})),Gl=Dr((function(e,t){return function(n){return br(e,n,t)}}));function Kl(e,t,n){var r=xl(t),o=cr(t,r);null!=n||$a(t)&&(o.length||!r.length)||(n=t,t=e,e=this,o=cr(t,xl(t)));var i=!($a(n)&&"chain"in n)||!!n.chain,a=Wa(e);return lt(o,(function(n){var r=t[n];e[n]=r,a&&(e.prototype[n]=function(){var t=this.__chain__;if(i||t){var n=e(this.__wrapped__),o=n.__actions__=bo(this.__actions__);return o.push({func:r,args:arguments,thisArg:e}),n.__chain__=t,n}return r.apply(e,ht([this.value()],arguments))})})),e}function Ql(){}var Zl=Ro(pt),Jl=Ro(ut),es=Ro(gt);function ts(e){return ui(e)?St(ji(e)):function(e){return function(t){return dr(t,e)}}(e)}var ns=Ao(),rs=Ao(!0);function os(){return[]}function is(){return!1}var as=Mo((function(e,t){return e+t}),0),ls=zo("ceil"),ss=Mo((function(e,t){return e/t}),1),us=zo("floor");var cs=Mo((function(e,t){return e*t}),1),ds=zo("round"),fs=Mo((function(e,t){return e-t}),0);return _n.after=function(e,t){if("function"!=typeof t)throw new ve(i);return e=rl(e),function(){if(--e<1)return t.apply(this,arguments)}},_n.ary=va,_n.assign=sl,_n.assignIn=ul,_n.assignInWith=cl,_n.assignWith=dl,_n.at=fl,_n.before=ga,_n.bind=ba,_n.bindAll=Ul,_n.bindKey=ya,_n.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return Na(e)?e:[e]},_n.chain=ta,_n.chunk=function(e,t,r){t=(r?si(e,t,r):void 0===t)?1:an(rl(t),0);var o=null==e?0:e.length;if(!o||t<1)return[];for(var i=0,a=0,l=n(Zt(o/t));io?0:o+n),(r=void 0===r||r>o?o:rl(r))<0&&(r+=o),r=n>r?0:ol(r);n>>0)?(e=ll(e))&&("string"==typeof t||null!=t&&!Xa(t))&&!(t=Qr(t))&&Wt(e)?uo(Yt(e),0,n):e.split(t,n):[]},_n.spread=function(e,t){if("function"!=typeof e)throw new ve(i);return t=null==t?0:an(rl(t),0),Dr((function(n){var r=n[t],o=uo(n,0,t);return r&&ht(o,r),it(e,this,o)}))},_n.tail=function(e){var t=null==e?0:e.length;return t?Hr(e,1,t):[]},_n.take=function(e,t,n){return e&&e.length?Hr(e,0,(t=n||void 0===t?1:rl(t))<0?0:t):[]},_n.takeRight=function(e,t,n){var r=null==e?0:e.length;return r?Hr(e,(t=r-(t=n||void 0===t?1:rl(t)))<0?0:t,r):[]},_n.takeRightWhile=function(e,t){return e&&e.length?to(e,Qo(t,3),!1,!0):[]},_n.takeWhile=function(e,t){return e&&e.length?to(e,Qo(t,3)):[]},_n.tap=function(e,t){return t(e),e},_n.throttle=function(e,t,n){var r=!0,o=!0;if("function"!=typeof e)throw new ve(i);return $a(n)&&(r="leading"in n?!!n.leading:r,o="trailing"in n?!!n.trailing:o),xa(e,t,{leading:r,maxWait:t,trailing:o})},_n.thru=na,_n.toArray=tl,_n.toPairs=Cl,_n.toPairsIn=_l,_n.toPath=function(e){return Na(e)?pt(e,ji):Qa(e)?[e]:bo(Si(ll(e)))},_n.toPlainObject=al,_n.transform=function(e,t,n){var r=Na(e),o=r||za(e)||Za(e);if(t=Qo(t,4),null==n){var i=e&&e.constructor;n=o?r?new i:[]:$a(e)&&Wa(i)?Pn(Ie(e)):{}}return(o?lt:sr)(e,(function(e,r,o){return t(n,e,r,o)})),n},_n.unary=function(e){return va(e,1)},_n.union=Vi,_n.unionBy=Hi,_n.unionWith=qi,_n.uniq=function(e){return e&&e.length?Zr(e):[]},_n.uniqBy=function(e,t){return e&&e.length?Zr(e,Qo(t,2)):[]},_n.uniqWith=function(e,t){return t="function"==typeof t?t:void 0,e&&e.length?Zr(e,void 0,t):[]},_n.unset=function(e,t){return null==e||Jr(e,t)},_n.unzip=Yi,_n.unzipWith=Xi,_n.update=function(e,t,n){return null==e?e:eo(e,t,ao(n))},_n.updateWith=function(e,t,n,r){return r="function"==typeof r?r:void 0,null==e?e:eo(e,t,ao(n),r)},_n.values=Pl,_n.valuesIn=function(e){return null==e?[]:Rt(e,wl(e))},_n.without=Gi,_n.words=Wl,_n.wrap=function(e,t){return ja(ao(t),e)},_n.xor=Ki,_n.xorBy=Qi,_n.xorWith=Zi,_n.zip=Ji,_n.zipObject=function(e,t){return oo(e||[],t||[],$n)},_n.zipObjectDeep=function(e,t){return oo(e||[],t||[],Br)},_n.zipWith=ea,_n.entries=Cl,_n.entriesIn=_l,_n.extend=ul,_n.extendWith=cl,Kl(_n,_n),_n.add=as,_n.attempt=Bl,_n.camelCase=Tl,_n.capitalize=Ml,_n.ceil=ls,_n.clamp=function(e,t,n){return void 0===n&&(n=t,t=void 0),void 0!==n&&(n=(n=il(n))===n?n:0),void 0!==t&&(t=(t=il(t))===t?t:0),Gn(il(e),t,n)},_n.clone=function(e){return Kn(e,4)},_n.cloneDeep=function(e){return Kn(e,5)},_n.cloneDeepWith=function(e,t){return Kn(e,5,t="function"==typeof t?t:void 0)},_n.cloneWith=function(e,t){return Kn(e,4,t="function"==typeof t?t:void 0)},_n.conformsTo=function(e,t){return null==t||Qn(e,t,xl(t))},_n.deburr=Rl,_n.defaultTo=function(e,t){return null==e||e!==e?t:e},_n.divide=ss,_n.endsWith=function(e,t,n){e=ll(e),t=Qr(t);var r=e.length,o=n=void 0===n?r:Gn(rl(n),0,r);return(n-=t.length)>=0&&e.slice(n,o)==t},_n.eq=Pa,_n.escape=function(e){return(e=ll(e))&&F.test(e)?e.replace(z,Dt):e},_n.escapeRegExp=function(e){return(e=ll(e))&&Y.test(e)?e.replace(q,"\\$&"):e},_n.every=function(e,t,n){var r=Na(e)?ut:nr;return n&&si(e,t,n)&&(t=void 0),r(e,Qo(t,3))},_n.find=ia,_n.findIndex=Ri,_n.findKey=function(e,t){return yt(e,Qo(t,3),sr)},_n.findLast=aa,_n.findLastIndex=Ni,_n.findLastKey=function(e,t){return yt(e,Qo(t,3),ur)},_n.floor=us,_n.forEach=la,_n.forEachRight=sa,_n.forIn=function(e,t){return null==e?e:ar(e,Qo(t,3),wl)},_n.forInRight=function(e,t){return null==e?e:lr(e,Qo(t,3),wl)},_n.forOwn=function(e,t){return e&&sr(e,Qo(t,3))},_n.forOwnRight=function(e,t){return e&&ur(e,Qo(t,3))},_n.get=ml,_n.gt=Ta,_n.gte=Ma,_n.has=function(e,t){return null!=e&&oi(e,t,mr)},_n.hasIn=vl,_n.head=Li,_n.identity=ql,_n.includes=function(e,t,n,r){e=La(e)?e:Pl(e),n=n&&!r?rl(n):0;var o=e.length;return n<0&&(n=an(o+n,0)),Ka(e)?n<=o&&e.indexOf(t,n)>-1:!!o&&wt(e,t,n)>-1},_n.indexOf=function(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var o=null==n?0:rl(n);return o<0&&(o=an(r+o,0)),wt(e,t,o)},_n.inRange=function(e,t,n){return t=nl(t),void 0===n?(n=t,t=0):n=nl(n),function(e,t,n){return e>=ln(t,n)&&e=-9007199254740991&&e<=9007199254740991},_n.isSet=Ga,_n.isString=Ka,_n.isSymbol=Qa,_n.isTypedArray=Za,_n.isUndefined=function(e){return void 0===e},_n.isWeakMap=function(e){return Va(e)&&ri(e)==O},_n.isWeakSet=function(e){return Va(e)&&"[object WeakSet]"==pr(e)},_n.join=function(e,t){return null==e?"":rn.call(e,t)},_n.kebabCase=Nl,_n.last=Fi,_n.lastIndexOf=function(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var o=r;return void 0!==n&&(o=(o=rl(n))<0?an(r+o,0):ln(o,r-1)),t===t?function(e,t,n){for(var r=n+1;r--;)if(e[r]===t)return r;return r}(e,t,o):xt(e,kt,o,!0)},_n.lowerCase=Al,_n.lowerFirst=Ll,_n.lt=Ja,_n.lte=el,_n.max=function(e){return e&&e.length?rr(e,ql,hr):void 0},_n.maxBy=function(e,t){return e&&e.length?rr(e,Qo(t,2),hr):void 0},_n.mean=function(e){return Et(e,ql)},_n.meanBy=function(e,t){return Et(e,Qo(t,2))},_n.min=function(e){return e&&e.length?rr(e,ql,jr):void 0},_n.minBy=function(e,t){return e&&e.length?rr(e,Qo(t,2),jr):void 0},_n.stubArray=os,_n.stubFalse=is,_n.stubObject=function(){return{}},_n.stubString=function(){return""},_n.stubTrue=function(){return!0},_n.multiply=cs,_n.nth=function(e,t){return e&&e.length?Mr(e,rl(t)):void 0},_n.noConflict=function(){return Ye._===this&&(Ye._=Ce),this},_n.noop=Ql,_n.now=ma,_n.pad=function(e,t,n){e=ll(e);var r=(t=rl(t))?qt(e):0;if(!t||r>=t)return e;var o=(t-r)/2;return No(Jt(o),n)+e+No(Zt(o),n)},_n.padEnd=function(e,t,n){e=ll(e);var r=(t=rl(t))?qt(e):0;return t&&rt){var r=e;e=t,t=r}if(n||e%1||t%1){var o=cn();return ln(e+o*(t-e+$e("1e-"+((o+"").length-1))),t)}return Ir(e,t)},_n.reduce=function(e,t,n){var r=Na(e)?mt:Ct,o=arguments.length<3;return r(e,Qo(t,4),n,o,er)},_n.reduceRight=function(e,t,n){var r=Na(e)?vt:Ct,o=arguments.length<3;return r(e,Qo(t,4),n,o,tr)},_n.repeat=function(e,t,n){return t=(n?si(e,t,n):void 0===t)?1:rl(t),zr(ll(e),t)},_n.replace=function(){var e=arguments,t=ll(e[0]);return e.length<3?t:t.replace(e[1],e[2])},_n.result=function(e,t,n){var r=-1,o=(t=lo(t,e)).length;for(o||(o=1,e=void 0);++r9007199254740991)return[];var n=4294967295,r=ln(e,4294967295);e-=4294967295;for(var o=Pt(r,t=Qo(t));++n=i)return e;var l=n-qt(r);if(l<1)return r;var s=a?uo(a,0,l).join(""):e.slice(0,l);if(void 0===o)return s+r;if(a&&(l+=s.length-l),Xa(o)){if(e.slice(l).search(o)){var u,c=s;for(o.global||(o=he(o.source,ll(re.exec(o))+"g")),o.lastIndex=0;u=o.exec(c);)var d=u.index;s=s.slice(0,void 0===d?l:d)}}else if(e.indexOf(Qr(o),l)!=l){var f=s.lastIndexOf(o);f>-1&&(s=s.slice(0,f))}return s+r},_n.unescape=function(e){return(e=ll(e))&&D.test(e)?e.replace(I,Gt):e},_n.uniqueId=function(e){var t=++ke;return ll(e)+t},_n.upperCase=Dl,_n.upperFirst=Fl,_n.each=la,_n.eachRight=sa,_n.first=Li,Kl(_n,function(){var e={};return sr(_n,(function(t,n){Oe.call(_n.prototype,n)||(e[n]=t)})),e}(),{chain:!1}),_n.VERSION="4.17.21",lt(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(e){_n[e].placeholder=_n})),lt(["drop","take"],(function(e,t){Rn.prototype[e]=function(n){n=void 0===n?1:an(rl(n),0);var r=this.__filtered__&&!t?new Rn(this):this.clone();return r.__filtered__?r.__takeCount__=ln(n,r.__takeCount__):r.__views__.push({size:ln(n,4294967295),type:e+(r.__dir__<0?"Right":"")}),r},Rn.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}})),lt(["filter","map","takeWhile"],(function(e,t){var n=t+1,r=1==n||3==n;Rn.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:Qo(e,3),type:n}),t.__filtered__=t.__filtered__||r,t}})),lt(["head","last"],(function(e,t){var n="take"+(t?"Right":"");Rn.prototype[e]=function(){return this[n](1).value()[0]}})),lt(["initial","tail"],(function(e,t){var n="drop"+(t?"":"Right");Rn.prototype[e]=function(){return this.__filtered__?new Rn(this):this[n](1)}})),Rn.prototype.compact=function(){return this.filter(ql)},Rn.prototype.find=function(e){return this.filter(e).head()},Rn.prototype.findLast=function(e){return this.reverse().find(e)},Rn.prototype.invokeMap=Dr((function(e,t){return"function"==typeof e?new Rn(this):this.map((function(n){return br(n,e,t)}))})),Rn.prototype.reject=function(e){return this.filter(Ea(Qo(e)))},Rn.prototype.slice=function(e,t){e=rl(e);var n=this;return n.__filtered__&&(e>0||t<0)?new Rn(n):(e<0?n=n.takeRight(-e):e&&(n=n.drop(e)),void 0!==t&&(n=(t=rl(t))<0?n.dropRight(-t):n.take(t-e)),n)},Rn.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},Rn.prototype.toArray=function(){return this.take(4294967295)},sr(Rn.prototype,(function(e,t){var n=/^(?:filter|find|map|reject)|While$/.test(t),r=/^(?:head|last)$/.test(t),o=_n[r?"take"+("last"==t?"Right":""):t],i=r||/^find/.test(t);o&&(_n.prototype[t]=function(){var t=this.__wrapped__,a=r?[1]:arguments,l=t instanceof Rn,s=a[0],u=l||Na(t),c=function(e){var t=o.apply(_n,ht([e],a));return r&&d?t[0]:t};u&&n&&"function"==typeof s&&1!=s.length&&(l=u=!1);var d=this.__chain__,f=!!this.__actions__.length,p=i&&!d,h=l&&!f;if(!i&&u){t=h?t:new Rn(this);var m=e.apply(t,a);return m.__actions__.push({func:na,args:[c],thisArg:void 0}),new Mn(m,d)}return p&&h?e.apply(this,a):(m=this.thru(c),p?r?m.value()[0]:m.value():m)})})),lt(["pop","push","shift","sort","splice","unshift"],(function(e){var t=ge[e],n=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",r=/^(?:pop|shift)$/.test(e);_n.prototype[e]=function(){var e=arguments;if(r&&!this.__chain__){var o=this.value();return t.apply(Na(o)?o:[],e)}return this[n]((function(n){return t.apply(Na(n)?n:[],e)}))}})),sr(Rn.prototype,(function(e,t){var n=_n[t];if(n){var r=n.name+"";Oe.call(yn,r)||(yn[r]=[]),yn[r].push({name:t,func:n})}})),yn[Po(void 0,2).name]=[{name:"wrapper",func:void 0}],Rn.prototype.clone=function(){var e=new Rn(this.__wrapped__);return e.__actions__=bo(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=bo(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=bo(this.__views__),e},Rn.prototype.reverse=function(){if(this.__filtered__){var e=new Rn(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},Rn.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,n=Na(e),r=t<0,o=n?e.length:0,i=function(e,t,n){var r=-1,o=n.length;for(;++r=this.__values__.length;return{done:e,value:e?void 0:this.__values__[this.__index__++]}},_n.prototype.plant=function(e){for(var t,n=this;n instanceof Tn;){var r=_i(n);r.__index__=0,r.__values__=void 0,t?o.__wrapped__=r:t=r;var o=r;n=n.__wrapped__}return o.__wrapped__=e,t},_n.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof Rn){var t=e;return this.__actions__.length&&(t=new Rn(this)),(t=t.reverse()).__actions__.push({func:na,args:[$i],thisArg:void 0}),new Mn(t,this.__chain__)}return this.thru($i)},_n.prototype.toJSON=_n.prototype.valueOf=_n.prototype.value=function(){return no(this.__wrapped__,this.__actions__)},_n.prototype.first=_n.prototype.head,Ge&&(_n.prototype[Ge]=function(){return this}),_n}();Ye._=Kt,void 0===(o=function(){return Kt}.call(t,n,t,r))||(r.exports=o)}).call(this)}).call(this,n(114),n(84)(e))},function(e,t,n){e.exports=n(202)},function(e,t){e.exports=function(e){return e&&e.__esModule?e:{default:e}},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,n){var r=n(240).default;function o(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(o=function(e){return e?n:t})(e)}e.exports=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=r(e)&&"function"!=typeof e)return{default:e};var n=o(t);if(n&&n.has(e))return n.get(e);var i={__proto__:null},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var l in e)if("default"!==l&&Object.prototype.hasOwnProperty.call(e,l)){var s=a?Object.getOwnPropertyDescriptor(e,l):null;s&&(s.get||s.set)?Object.defineProperty(i,l,s):i[l]=e[l]}return i.default=e,n&&n.set(e,i),i},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return r.createSvgIcon}});var r=n(87)},function(e,t,n){"use strict";function r(e){return e&&e.ownerDocument||document}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(0),o="undefined"!==typeof window?r.useLayoutEffect:r.useEffect;function i(e){var t=r.useRef(e);return o((function(){t.current=e})),r.useCallback((function(){return t.current.apply(void 0,arguments)}),[])}},function(e,t,n){"use strict";n.d(t,"b",(function(){return i}));var r=n(2),o={easeInOut:"cubic-bezier(0.4, 0, 0.2, 1)",easeOut:"cubic-bezier(0.0, 0, 0.2, 1)",easeIn:"cubic-bezier(0.4, 0, 1, 1)",sharp:"cubic-bezier(0.4, 0, 0.6, 1)"},i={shortest:150,shorter:200,short:250,standard:300,complex:375,enteringScreen:225,leavingScreen:195};function a(e){return"".concat(Math.round(e),"ms")}t.a={easing:o,duration:i,create:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:["all"],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.duration,l=void 0===n?i.standard:n,s=t.easing,u=void 0===s?o.easeInOut:s,c=t.delay,d=void 0===c?0:c;Object(r.a)(t,["duration","easing","delay"]);return(Array.isArray(e)?e:[e]).map((function(e){return"".concat(e," ").concat("string"===typeof l?l:a(l)," ").concat(u," ").concat("string"===typeof d?d:a(d))})).join(",")},getAutoHeightDuration:function(e){if(!e)return 0;var t=e/36;return Math.round(10*(4+15*Math.pow(t,.25)+t/5))}}},,function(e,t,n){"use strict";function r(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r=0||(o[n]=e[n]);return o}n.d(t,"a",(function(){return r}))},,function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var r=n(162);var o=n(94),i=n(163);function a(e,t){return Object(r.a)(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,l=[],s=!0,u=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;s=!1}else for(;!(s=(r=i.call(n)).done)&&(l.push(r.value),l.length!==t);s=!0);}catch(e){u=!0,o=e}finally{try{if(!s&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw o}}return l}}(e,t)||Object(o.a)(e,t)||Object(i.a)()}},,function(e,t){e.exports={Always:1,Never:2,IfAtMostOneObstacle:3,OnlyWhenNoObstacles:4}},function(e,t,n){"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";function r(e,t){"function"===typeof e?e(t):e&&(e.current=t)}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";function r(){for(var e=arguments.length,t=new Array(e),n=0;n1&&void 0!==arguments[1]?arguments[1]:166;function r(){for(var r=arguments.length,o=new Array(r),i=0;i0?r:e)-u/100).concat(i,")")},between:f,only:function(e){return f(e,e)},width:function(e){return n[e]}},c)}function u(e,t,n){var o;return Object(a.a)({gutters:function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return console.warn(["Material-UI: theme.mixins.gutters() is deprecated.","You can use the source of the mixin directly:","\n paddingLeft: theme.spacing(2),\n paddingRight: theme.spacing(2),\n [theme.breakpoints.up('sm')]: {\n paddingLeft: theme.spacing(3),\n paddingRight: theme.spacing(3),\n },\n "].join("\n")),Object(a.a)({paddingLeft:t(2),paddingRight:t(2)},n,Object(r.a)({},e.up("sm"),Object(a.a)({paddingLeft:t(3),paddingRight:t(3)},n[e.up("sm")])))},toolbar:(o={minHeight:56},Object(r.a)(o,"".concat(e.up("xs")," and (orientation: landscape)"),{minHeight:48}),Object(r.a)(o,e.up("sm"),{minHeight:64}),o)},n)}var c=n(173),d={black:"#000",white:"#fff"},f={50:"#fafafa",100:"#f5f5f5",200:"#eeeeee",300:"#e0e0e0",400:"#bdbdbd",500:"#9e9e9e",600:"#757575",700:"#616161",800:"#424242",900:"#212121",A100:"#d5d5d5",A200:"#aaaaaa",A400:"#303030",A700:"#616161"},p={50:"#e8eaf6",100:"#c5cae9",200:"#9fa8da",300:"#7986cb",400:"#5c6bc0",500:"#3f51b5",600:"#3949ab",700:"#303f9f",800:"#283593",900:"#1a237e",A100:"#8c9eff",A200:"#536dfe",A400:"#3d5afe",A700:"#304ffe"},h={50:"#fce4ec",100:"#f8bbd0",200:"#f48fb1",300:"#f06292",400:"#ec407a",500:"#e91e63",600:"#d81b60",700:"#c2185b",800:"#ad1457",900:"#880e4f",A100:"#ff80ab",A200:"#ff4081",A400:"#f50057",A700:"#c51162"},m={50:"#ffebee",100:"#ffcdd2",200:"#ef9a9a",300:"#e57373",400:"#ef5350",500:"#f44336",600:"#e53935",700:"#d32f2f",800:"#c62828",900:"#b71c1c",A100:"#ff8a80",A200:"#ff5252",A400:"#ff1744",A700:"#d50000"},v={50:"#fff3e0",100:"#ffe0b2",200:"#ffcc80",300:"#ffb74d",400:"#ffa726",500:"#ff9800",600:"#fb8c00",700:"#f57c00",800:"#ef6c00",900:"#e65100",A100:"#ffd180",A200:"#ffab40",A400:"#ff9100",A700:"#ff6d00"},g={50:"#e3f2fd",100:"#bbdefb",200:"#90caf9",300:"#64b5f6",400:"#42a5f5",500:"#2196f3",600:"#1e88e5",700:"#1976d2",800:"#1565c0",900:"#0d47a1",A100:"#82b1ff",A200:"#448aff",A400:"#2979ff",A700:"#2962ff"},b={50:"#e8f5e9",100:"#c8e6c9",200:"#a5d6a7",300:"#81c784",400:"#66bb6a",500:"#4caf50",600:"#43a047",700:"#388e3c",800:"#2e7d32",900:"#1b5e20",A100:"#b9f6ca",A200:"#69f0ae",A400:"#00e676",A700:"#00c853"},y=n(8),x={text:{primary:"rgba(0, 0, 0, 0.87)",secondary:"rgba(0, 0, 0, 0.54)",disabled:"rgba(0, 0, 0, 0.38)",hint:"rgba(0, 0, 0, 0.38)"},divider:"rgba(0, 0, 0, 0.12)",background:{paper:d.white,default:f[50]},action:{active:"rgba(0, 0, 0, 0.54)",hover:"rgba(0, 0, 0, 0.04)",hoverOpacity:.04,selected:"rgba(0, 0, 0, 0.08)",selectedOpacity:.08,disabled:"rgba(0, 0, 0, 0.26)",disabledBackground:"rgba(0, 0, 0, 0.12)",disabledOpacity:.38,focus:"rgba(0, 0, 0, 0.12)",focusOpacity:.12,activatedOpacity:.12}},w={text:{primary:d.white,secondary:"rgba(255, 255, 255, 0.7)",disabled:"rgba(255, 255, 255, 0.5)",hint:"rgba(255, 255, 255, 0.5)",icon:"rgba(255, 255, 255, 0.5)"},divider:"rgba(255, 255, 255, 0.12)",background:{paper:f[800],default:"#303030"},action:{active:d.white,hover:"rgba(255, 255, 255, 0.08)",hoverOpacity:.08,selected:"rgba(255, 255, 255, 0.16)",selectedOpacity:.16,disabled:"rgba(255, 255, 255, 0.3)",disabledBackground:"rgba(255, 255, 255, 0.12)",disabledOpacity:.38,focus:"rgba(255, 255, 255, 0.12)",focusOpacity:.12,activatedOpacity:.24}};function O(e,t,n,r){var o=r.light||r,i=r.dark||1.5*r;e[t]||(e.hasOwnProperty(n)?e[t]=e[n]:"light"===t?e.light=Object(y.e)(e.main,o):"dark"===t&&(e.dark=Object(y.b)(e.main,i)))}function k(e){var t=e.primary,n=void 0===t?{light:p[300],main:p[500],dark:p[700]}:t,r=e.secondary,l=void 0===r?{light:h.A200,main:h.A400,dark:h.A700}:r,s=e.error,u=void 0===s?{light:m[300],main:m[500],dark:m[700]}:s,k=e.warning,E=void 0===k?{light:v[300],main:v[500],dark:v[700]}:k,S=e.info,j=void 0===S?{light:g[300],main:g[500],dark:g[700]}:S,C=e.success,_=void 0===C?{light:b[300],main:b[500],dark:b[700]}:C,P=e.type,T=void 0===P?"light":P,M=e.contrastThreshold,R=void 0===M?3:M,N=e.tonalOffset,A=void 0===N?.2:N,L=Object(o.a)(e,["primary","secondary","error","warning","info","success","type","contrastThreshold","tonalOffset"]);function I(e){return Object(y.d)(e,w.text.primary)>=R?w.text.primary:x.text.primary}var z=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:500,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:300,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:700;if(!(e=Object(a.a)({},e)).main&&e[t]&&(e.main=e[t]),!e.main)throw new Error(Object(c.a)(4,t));if("string"!==typeof e.main)throw new Error(Object(c.a)(5,JSON.stringify(e.main)));return O(e,"light",n,A),O(e,"dark",r,A),e.contrastText||(e.contrastText=I(e.main)),e},D={dark:w,light:x};return Object(i.a)(Object(a.a)({common:d,type:T,primary:z(n),secondary:z(l,"A400","A200","A700"),error:z(u),warning:z(E),info:z(j),success:z(_),grey:f,contrastThreshold:R,getContrastText:I,augmentColor:z,tonalOffset:A},D[T]),L)}function E(e){return Math.round(1e5*e)/1e5}function S(e){return E(e)}var j={textTransform:"uppercase"};function C(e,t){var n="function"===typeof t?t(e):t,r=n.fontFamily,l=void 0===r?'"Roboto", "Helvetica", "Arial", sans-serif':r,s=n.fontSize,u=void 0===s?14:s,c=n.fontWeightLight,d=void 0===c?300:c,f=n.fontWeightRegular,p=void 0===f?400:f,h=n.fontWeightMedium,m=void 0===h?500:h,v=n.fontWeightBold,g=void 0===v?700:v,b=n.htmlFontSize,y=void 0===b?16:b,x=n.allVariants,w=n.pxToRem,O=Object(o.a)(n,["fontFamily","fontSize","fontWeightLight","fontWeightRegular","fontWeightMedium","fontWeightBold","htmlFontSize","allVariants","pxToRem"]);var k=u/14,C=w||function(e){return"".concat(e/y*k,"rem")},_=function(e,t,n,r,o){return Object(a.a)({fontFamily:l,fontWeight:e,fontSize:C(t),lineHeight:n},'"Roboto", "Helvetica", "Arial", sans-serif'===l?{letterSpacing:"".concat(E(r/t),"em")}:{},o,x)},P={h1:_(d,96,1.167,-1.5),h2:_(d,60,1.2,-.5),h3:_(p,48,1.167,0),h4:_(p,34,1.235,.25),h5:_(p,24,1.334,0),h6:_(m,20,1.6,.15),subtitle1:_(p,16,1.75,.15),subtitle2:_(m,14,1.57,.1),body1:_(p,16,1.5,.15),body2:_(p,14,1.43,.15),button:_(m,14,1.75,.4,j),caption:_(p,12,1.66,.4),overline:_(p,12,2.66,1,j)};return Object(i.a)(Object(a.a)({htmlFontSize:y,pxToRem:C,round:S,fontFamily:l,fontSize:u,fontWeightLight:d,fontWeightRegular:p,fontWeightMedium:m,fontWeightBold:g},P),O,{clone:!1})}function _(){return["".concat(arguments.length<=0?void 0:arguments[0],"px ").concat(arguments.length<=1?void 0:arguments[1],"px ").concat(arguments.length<=2?void 0:arguments[2],"px ").concat(arguments.length<=3?void 0:arguments[3],"px rgba(0,0,0,").concat(.2,")"),"".concat(arguments.length<=4?void 0:arguments[4],"px ").concat(arguments.length<=5?void 0:arguments[5],"px ").concat(arguments.length<=6?void 0:arguments[6],"px ").concat(arguments.length<=7?void 0:arguments[7],"px rgba(0,0,0,").concat(.14,")"),"".concat(arguments.length<=8?void 0:arguments[8],"px ").concat(arguments.length<=9?void 0:arguments[9],"px ").concat(arguments.length<=10?void 0:arguments[10],"px ").concat(arguments.length<=11?void 0:arguments[11],"px rgba(0,0,0,").concat(.12,")")].join(",")}var P=["none",_(0,2,1,-1,0,1,1,0,0,1,3,0),_(0,3,1,-2,0,2,2,0,0,1,5,0),_(0,3,3,-2,0,3,4,0,0,1,8,0),_(0,2,4,-1,0,4,5,0,0,1,10,0),_(0,3,5,-1,0,5,8,0,0,1,14,0),_(0,3,5,-1,0,6,10,0,0,1,18,0),_(0,4,5,-2,0,7,10,1,0,2,16,1),_(0,5,5,-3,0,8,10,1,0,3,14,2),_(0,5,6,-3,0,9,12,1,0,3,16,2),_(0,6,6,-3,0,10,14,1,0,4,18,3),_(0,6,7,-4,0,11,15,1,0,4,20,3),_(0,7,8,-4,0,12,17,2,0,5,22,4),_(0,7,8,-4,0,13,19,2,0,5,24,4),_(0,7,9,-4,0,14,21,2,0,5,26,4),_(0,8,9,-5,0,15,22,2,0,6,28,5),_(0,8,10,-5,0,16,24,2,0,6,30,5),_(0,8,11,-5,0,17,26,2,0,6,32,5),_(0,9,11,-5,0,18,28,2,0,7,34,6),_(0,9,12,-6,0,19,29,2,0,7,36,6),_(0,10,13,-6,0,20,31,3,0,8,38,7),_(0,10,13,-6,0,21,33,3,0,8,40,7),_(0,10,14,-6,0,22,35,3,0,8,42,7),_(0,11,14,-7,0,23,36,3,0,9,44,8),_(0,11,15,-7,0,24,38,3,0,9,46,8)],T={borderRadius:4},M=n(25),R=(n(53),n(28));var N=function(e,t){return t?Object(i.a)(e,t,{clone:!1}):e},A={xs:0,sm:600,md:960,lg:1280,xl:1920},L={keys:["xs","sm","md","lg","xl"],up:function(e){return"@media (min-width:".concat(A[e],"px)")}};var I={m:"margin",p:"padding"},z={t:"Top",r:"Right",b:"Bottom",l:"Left",x:["Left","Right"],y:["Top","Bottom"]},D={marginX:"mx",marginY:"my",paddingX:"px",paddingY:"py"},F=function(e){var t={};return function(n){return void 0===t[n]&&(t[n]=e(n)),t[n]}}((function(e){if(e.length>2){if(!D[e])return[e];e=D[e]}var t=e.split(""),n=Object(M.a)(t,2),r=n[0],o=n[1],i=I[r],a=z[o]||"";return Array.isArray(a)?a.map((function(e){return i+e})):[i+a]})),W=["m","mt","mr","mb","ml","mx","my","p","pt","pr","pb","pl","px","py","margin","marginTop","marginRight","marginBottom","marginLeft","marginX","marginY","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingX","paddingY"];function B(e){var t=e.spacing||8;return"number"===typeof t?function(e){return t*e}:Array.isArray(t)?function(e){return t[e]}:"function"===typeof t?t:function(){}}function U(e,t){return function(n){return e.reduce((function(e,r){return e[r]=function(e,t){if("string"===typeof t||null==t)return t;var n=e(Math.abs(t));return t>=0?n:"number"===typeof n?-n:"-".concat(n)}(t,n),e}),{})}}function $(e){var t=B(e.theme);return Object.keys(e).map((function(n){if(-1===W.indexOf(n))return null;var r=U(F(n),t),o=e[n];return function(e,t,n){if(Array.isArray(t)){var r=e.theme.breakpoints||L;return t.reduce((function(e,o,i){return e[r.up(r.keys[i])]=n(t[i]),e}),{})}if("object"===Object(R.a)(t)){var o=e.theme.breakpoints||L;return Object.keys(t).reduce((function(e,r){return e[o.up(r)]=n(t[r]),e}),{})}return n(t)}(e,o,r)})).reduce(N,{})}$.propTypes={},$.filterProps=W;function V(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:8;if(e.mui)return e;var t=B({spacing:e}),n=function(){for(var e=arguments.length,n=new Array(e),r=0;r0&&void 0!==arguments[0]?arguments[0]:{},t=e.breakpoints,n=void 0===t?{}:t,r=e.mixins,a=void 0===r?{}:r,l=e.palette,c=void 0===l?{}:l,d=e.spacing,f=e.typography,p=void 0===f?{}:f,h=Object(o.a)(e,["breakpoints","mixins","palette","spacing","typography"]),m=k(c),v=s(n),g=V(d),b=Object(i.a)({breakpoints:v,direction:"ltr",mixins:u(v,g,a),overrides:{},palette:m,props:{},shadows:P,typography:C(m,p),spacing:g,shape:T,transitions:H.a,zIndex:q.a},h),y=arguments.length,x=new Array(y>1?y-1:0),w=1;w-l&&(s-=l,e+=o),u1&&void 0!==arguments[1]&&arguments[1];return e&&(r(e.value)&&""!==e.value||t&&r(e.defaultValue)&&""!==e.defaultValue)}function i(e){return e.startAdornment}n.d(t,"b",(function(){return o})),n.d(t,"a",(function(){return i}))},function(e,t,n){var r=n(241),o=n(242);e.exports=function(e,t,n){var i=t&&n||0;"string"==typeof e&&(t="binary"===e?new Array(16):null,e=null);var a=(e=e||{}).random||(e.rng||r)();if(a[6]=15&a[6]|64,a[8]=63&a[8]|128,t)for(var l=0;l<16;++l)t[i+l]=a[l];return t||o(a)}},,,,,function(e,t,n){var r=n(263),o=n(266);e.exports=function(e,t){var n=o(e,t);return r(n)?n:void 0}},function(e,t,n){"use strict";e.exports=n(201)},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(19);function o(e){return Object(r.a)(e).defaultView||window}},function(e,t,n){"use strict";var r=n(16),o=n(17);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=o(n(0)),a=(0,r(n(18)).default)(i.createElement("path",{d:"M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"}),"Check");t.default=a},function(e,t,n){"use strict";var r=n(16),o=n(17);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=o(n(0)),a=(0,r(n(18)).default)(i.createElement("path",{d:"M13 7h-2v4H7v2h4v4h2v-4h4v-2h-4V7zm-1-5C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8z"}),"AddCircleOutline");t.default=a},function(e,t,n){"use strict";var r=n(0),o=n.n(r);t.a=o.a.createContext(null)},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(109);function o(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};r.forEach(["delete","get","head"],(function(e){l.headers[e]={}})),r.forEach(["post","put","patch"],(function(e){l.headers[e]=r.merge(i)})),e.exports=l}).call(this,n(205))},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(r){"object"===typeof window&&(n=window)}e.exports=n},function(e,t){e.exports=function(e,t,n){this.x=e,this.y=t,this.walkable=void 0===n||n}},function(e,t,n){var r=n(85),o=n(57),i=n(76),a=n(27);function l(e){e=e||{},this.allowDiagonal=e.allowDiagonal,this.dontCrossCorners=e.dontCrossCorners,this.heuristic=e.heuristic||i.manhattan,this.weight=e.weight||1,this.diagonalMovement=e.diagonalMovement,this.diagonalMovement||(this.allowDiagonal?this.dontCrossCorners?this.diagonalMovement=a.OnlyWhenNoObstacles:this.diagonalMovement=a.IfAtMostOneObstacle:this.diagonalMovement=a.Never),this.diagonalMovement===a.Never?this.heuristic=e.heuristic||i.manhattan:this.heuristic=e.heuristic||i.octile}l.prototype.findPath=function(e,t,n,i,a){var l,s,u,c,d,f,p,h,m=new r((function(e,t){return e.f-t.f})),v=a.getNodeAt(e,t),g=a.getNodeAt(n,i),b=this.heuristic,y=this.diagonalMovement,x=this.weight,w=Math.abs,O=Math.SQRT2;for(v.g=0,v.f=0,m.push(v),v.opened=!0;!m.empty();){if((l=m.pop()).closed=!0,l===g)return o.backtrace(g);for(c=0,d=(s=a.getNeighbors(l,y)).length;c-1&&e%1==0&&e<=9007199254740991}},function(e,t,n){var r=n(148),o=n(125);e.exports=function(e){return null!=e&&o(e.length)&&!r(e)}},function(e,t,n){var r=n(43),o=n(128),i=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,a=/^\w*$/;e.exports=function(e,t){if(r(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!o(e))||(a.test(e)||!i.test(e)||null!=t&&e in Object(t))}},function(e,t,n){var r=n(78),o=n(79);e.exports=function(e){return"symbol"==typeof e||o(e)&&"[object Symbol]"==r(e)}},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(0);function o(e){var t=r.useState(e),n=t[0],o=t[1],i=e||n;return r.useEffect((function(){null==n&&o("mui-".concat(Math.round(1e5*Math.random())))}),[n]),i}},function(e,t,n){"use strict";var r=n(1),o=n(2),i=n(0),a=n.n(i),l=n(13),s=n(3),u=n(9),c=n(20),d=n(4),f=n(93),p=n(53),h=n(23),m=n(81),v=n(59),g=n(71);function b(e,t){var n=Object.create(null);return e&&i.Children.map(e,(function(e){return e})).forEach((function(e){n[e.key]=function(e){return t&&Object(i.isValidElement)(e)?t(e):e}(e)})),n}function y(e,t,n){return null!=n[t]?n[t]:e.props[t]}function x(e,t,n){var r=b(e.children),o=function(e,t){function n(n){return n in t?t[n]:e[n]}e=e||{},t=t||{};var r,o=Object.create(null),i=[];for(var a in e)a in t?i.length&&(o[a]=i,i=[]):i.push(a);var l={};for(var s in t){if(o[s])for(r=0;r0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0,r=t.pulsate,o=void 0!==r&&r,i=t.center,l=void 0===i?a||t.pulsate:i,s=t.fakeElement,u=void 0!==s&&s;if("mousedown"===e.type&&g.current)g.current=!1;else{"touchstart"===e.type&&(g.current=!0);var c,d,f,p=u?null:x.current,h=p?p.getBoundingClientRect():{width:0,height:0,left:0,top:0};if(l||0===e.clientX&&0===e.clientY||!e.clientX&&!e.touches)c=Math.round(h.width/2),d=Math.round(h.height/2);else{var m=e.touches?e.touches[0]:e,v=m.clientX,O=m.clientY;c=Math.round(v-h.left),d=Math.round(O-h.top)}if(l)(f=Math.sqrt((2*Math.pow(h.width,2)+Math.pow(h.height,2))/3))%2===0&&(f+=1);else{var k=2*Math.max(Math.abs((p?p.clientWidth:0)-c),c)+2,E=2*Math.max(Math.abs((p?p.clientHeight:0)-d),d)+2;f=Math.sqrt(Math.pow(k,2)+Math.pow(E,2))}e.touches?null===y.current&&(y.current=function(){w({pulsate:o,rippleX:c,rippleY:d,rippleSize:f,cb:n})},b.current=setTimeout((function(){y.current&&(y.current(),y.current=null)}),80)):w({pulsate:o,rippleX:c,rippleY:d,rippleSize:f,cb:n})}}),[a,w]),E=i.useCallback((function(){O({},{pulsate:!0})}),[O]),j=i.useCallback((function(e,t){if(clearTimeout(b.current),"touchend"===e.type&&y.current)return e.persist(),y.current(),y.current=null,void(b.current=setTimeout((function(){j(e,t)})));y.current=null,h((function(e){return e.length>0?e.slice(1):e})),v.current=t}),[]);return i.useImperativeHandle(t,(function(){return{pulsate:E,start:O,stop:j}}),[E,O,j]),i.createElement("span",Object(r.a)({className:Object(s.a)(l.root,u),ref:x},c),i.createElement(k,{component:null,exit:!0},f))})),C=Object(d.a)((function(e){return{root:{overflow:"hidden",pointerEvents:"none",position:"absolute",zIndex:0,top:0,right:0,bottom:0,left:0,borderRadius:"inherit"},ripple:{opacity:0,position:"absolute"},rippleVisible:{opacity:.3,transform:"scale(1)",animation:"$enter ".concat(550,"ms ").concat(e.transitions.easing.easeInOut)},ripplePulsate:{animationDuration:"".concat(e.transitions.duration.shorter,"ms")},child:{opacity:1,display:"block",width:"100%",height:"100%",borderRadius:"50%",backgroundColor:"currentColor"},childLeaving:{opacity:0,animation:"$exit ".concat(550,"ms ").concat(e.transitions.easing.easeInOut)},childPulsate:{position:"absolute",left:0,top:0,animation:"$pulsate 2500ms ".concat(e.transitions.easing.easeInOut," 200ms infinite")},"@keyframes enter":{"0%":{transform:"scale(0)",opacity:.1},"100%":{transform:"scale(1)",opacity:.3}},"@keyframes exit":{"0%":{opacity:1},"100%":{opacity:0}},"@keyframes pulsate":{"0%":{transform:"scale(1)"},"50%":{transform:"scale(0.92)"},"100%":{transform:"scale(1)"}}}}),{flip:!1,name:"MuiTouchRipple"})(i.memo(j)),_=i.forwardRef((function(e,t){var n=e.action,a=e.buttonRef,d=e.centerRipple,p=void 0!==d&&d,h=e.children,m=e.classes,v=e.className,g=e.component,b=void 0===g?"button":g,y=e.disabled,x=void 0!==y&&y,w=e.disableRipple,O=void 0!==w&&w,k=e.disableTouchRipple,E=void 0!==k&&k,S=e.focusRipple,j=void 0!==S&&S,_=e.focusVisibleClassName,P=e.onBlur,T=e.onClick,M=e.onFocus,R=e.onFocusVisible,N=e.onKeyDown,A=e.onKeyUp,L=e.onMouseDown,I=e.onMouseLeave,z=e.onMouseUp,D=e.onTouchEnd,F=e.onTouchMove,W=e.onTouchStart,B=e.onDragLeave,U=e.tabIndex,$=void 0===U?0:U,V=e.TouchRippleProps,H=e.type,q=void 0===H?"button":H,Y=Object(o.a)(e,["action","buttonRef","centerRipple","children","classes","className","component","disabled","disableRipple","disableTouchRipple","focusRipple","focusVisibleClassName","onBlur","onClick","onFocus","onFocusVisible","onKeyDown","onKeyUp","onMouseDown","onMouseLeave","onMouseUp","onTouchEnd","onTouchMove","onTouchStart","onDragLeave","tabIndex","TouchRippleProps","type"]),X=i.useRef(null);var G=i.useRef(null),K=i.useState(!1),Q=K[0],Z=K[1];x&&Q&&Z(!1);var J=Object(f.a)(),ee=J.isFocusVisible,te=J.onBlurVisible,ne=J.ref;function re(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:E;return Object(c.a)((function(r){return t&&t(r),!n&&G.current&&G.current[e](r),!0}))}i.useImperativeHandle(n,(function(){return{focusVisible:function(){Z(!0),X.current.focus()}}}),[]),i.useEffect((function(){Q&&j&&!O&&G.current.pulsate()}),[O,j,Q]);var oe=re("start",L),ie=re("stop",B),ae=re("stop",z),le=re("stop",(function(e){Q&&e.preventDefault(),I&&I(e)})),se=re("start",W),ue=re("stop",D),ce=re("stop",F),de=re("stop",(function(e){Q&&(te(e),Z(!1)),P&&P(e)}),!1),fe=Object(c.a)((function(e){X.current||(X.current=e.currentTarget),ee(e)&&(Z(!0),R&&R(e)),M&&M(e)})),pe=function(){var e=l.findDOMNode(X.current);return b&&"button"!==b&&!("A"===e.tagName&&e.href)},he=i.useRef(!1),me=Object(c.a)((function(e){j&&!he.current&&Q&&G.current&&" "===e.key&&(he.current=!0,e.persist(),G.current.stop(e,(function(){G.current.start(e)}))),e.target===e.currentTarget&&pe()&&" "===e.key&&e.preventDefault(),N&&N(e),e.target===e.currentTarget&&pe()&&"Enter"===e.key&&!x&&(e.preventDefault(),T&&T(e))})),ve=Object(c.a)((function(e){j&&" "===e.key&&G.current&&Q&&!e.defaultPrevented&&(he.current=!1,e.persist(),G.current.stop(e,(function(){G.current.pulsate(e)}))),A&&A(e),T&&e.target===e.currentTarget&&pe()&&" "===e.key&&!e.defaultPrevented&&T(e)})),ge=b;"button"===ge&&Y.href&&(ge="a");var be={};"button"===ge?(be.type=q,be.disabled=x):("a"===ge&&Y.href||(be.role="button"),be["aria-disabled"]=x);var ye=Object(u.a)(a,t),xe=Object(u.a)(ne,X),we=Object(u.a)(ye,xe),Oe=i.useState(!1),ke=Oe[0],Ee=Oe[1];i.useEffect((function(){Ee(!0)}),[]);var Se=ke&&!O&&!x;return i.createElement(ge,Object(r.a)({className:Object(s.a)(m.root,v,Q&&[m.focusVisible,_],x&&m.disabled),onBlur:de,onClick:T,onFocus:fe,onKeyDown:me,onKeyUp:ve,onMouseDown:oe,onMouseLeave:le,onMouseUp:ae,onDragLeave:ie,onTouchEnd:ue,onTouchMove:ce,onTouchStart:se,ref:we,tabIndex:x?-1:$},be,Y),h,Se?i.createElement(C,Object(r.a)({ref:G,center:p},V)):null)}));t.a=Object(d.a)({root:{display:"inline-flex",alignItems:"center",justifyContent:"center",position:"relative",WebkitTapHighlightColor:"transparent",backgroundColor:"transparent",outline:0,border:0,margin:0,borderRadius:0,padding:0,cursor:"pointer",userSelect:"none",verticalAlign:"middle","-moz-appearance":"none","-webkit-appearance":"none",textDecoration:"none",color:"inherit","&::-moz-focus-inner":{borderStyle:"none"},"&$disabled":{pointerEvents:"none",cursor:"default"},"@media print":{colorAdjust:"exact"}},disabled:{},focusVisible:{}},{name:"MuiButtonBase"})(_)},,,,,,,function(e,t,n){"use strict";var r=Object.getOwnPropertySymbols,o=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable;function a(e){if(null===e||void 0===e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach((function(e){r[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(o){return!1}}()?Object.assign:function(e,t){for(var n,l,s=a(e),u=1;uc))return!1;var f=s.get(e),p=s.get(t);if(f&&p)return f==t&&p==e;var h=-1,m=!0,v=2&n?new r:void 0;for(s.set(e,t),s.set(t,e);++h-1&&e%1==0&&e=0)return 1;return 0}();var o=n&&window.Promise?function(e){var t=!1;return function(){t||(t=!0,window.Promise.resolve().then((function(){t=!1,e()})))}}:function(e){var t=!1;return function(){t||(t=!0,setTimeout((function(){t=!1,e()}),r))}};function i(e){return e&&"[object Function]"==={}.toString.call(e)}function a(e,t){if(1!==e.nodeType)return[];var n=e.ownerDocument.defaultView.getComputedStyle(e,null);return t?n[t]:n}function l(e){return"HTML"===e.nodeName?e:e.parentNode||e.host}function s(e){if(!e)return document.body;switch(e.nodeName){case"HTML":case"BODY":return e.ownerDocument.body;case"#document":return e.body}var t=a(e),n=t.overflow,r=t.overflowX,o=t.overflowY;return/(auto|scroll|overlay)/.test(n+o+r)?e:s(l(e))}function u(e){return e&&e.referenceNode?e.referenceNode:e}var c=n&&!(!window.MSInputMethodContext||!document.documentMode),d=n&&/MSIE 10/.test(navigator.userAgent);function f(e){return 11===e?c:10===e?d:c||d}function p(e){if(!e)return document.documentElement;for(var t=f(10)?document.body:null,n=e.offsetParent||null;n===t&&e.nextElementSibling;)n=(e=e.nextElementSibling).offsetParent;var r=n&&n.nodeName;return r&&"BODY"!==r&&"HTML"!==r?-1!==["TH","TD","TABLE"].indexOf(n.nodeName)&&"static"===a(n,"position")?p(n):n:e?e.ownerDocument.documentElement:document.documentElement}function h(e){return null!==e.parentNode?h(e.parentNode):e}function m(e,t){if(!e||!e.nodeType||!t||!t.nodeType)return document.documentElement;var n=e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING,r=n?e:t,o=n?t:e,i=document.createRange();i.setStart(r,0),i.setEnd(o,0);var a=i.commonAncestorContainer;if(e!==a&&t!==a||r.contains(o))return function(e){var t=e.nodeName;return"BODY"!==t&&("HTML"===t||p(e.firstElementChild)===e)}(a)?a:p(a);var l=h(e);return l.host?m(l.host,t):m(e,h(t).host)}function v(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"top",n="top"===t?"scrollTop":"scrollLeft",r=e.nodeName;if("BODY"===r||"HTML"===r){var o=e.ownerDocument.documentElement,i=e.ownerDocument.scrollingElement||o;return i[n]}return e[n]}function g(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=v(t,"top"),o=v(t,"left"),i=n?-1:1;return e.top+=r*i,e.bottom+=r*i,e.left+=o*i,e.right+=o*i,e}function b(e,t){var n="x"===t?"Left":"Top",r="Left"===n?"Right":"Bottom";return parseFloat(e["border"+n+"Width"])+parseFloat(e["border"+r+"Width"])}function y(e,t,n,r){return Math.max(t["offset"+e],t["scroll"+e],n["client"+e],n["offset"+e],n["scroll"+e],f(10)?parseInt(n["offset"+e])+parseInt(r["margin"+("Height"===e?"Top":"Left")])+parseInt(r["margin"+("Height"===e?"Bottom":"Right")]):0)}function x(e){var t=e.body,n=e.documentElement,r=f(10)&&getComputedStyle(n);return{height:y("Height",t,n,r),width:y("Width",t,n,r)}}var w=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},O=function(){function e(e,t){for(var n=0;n2&&void 0!==arguments[2]&&arguments[2],r=f(10),o="HTML"===t.nodeName,i=j(e),l=j(t),u=s(e),c=a(t),d=parseFloat(c.borderTopWidth),p=parseFloat(c.borderLeftWidth);n&&o&&(l.top=Math.max(l.top,0),l.left=Math.max(l.left,0));var h=S({top:i.top-l.top-d,left:i.left-l.left-p,width:i.width,height:i.height});if(h.marginTop=0,h.marginLeft=0,!r&&o){var m=parseFloat(c.marginTop),v=parseFloat(c.marginLeft);h.top-=d-m,h.bottom-=d-m,h.left-=p-v,h.right-=p-v,h.marginTop=m,h.marginLeft=v}return(r&&!n?t.contains(u):t===u&&"BODY"!==u.nodeName)&&(h=g(h,t)),h}function _(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=e.ownerDocument.documentElement,r=C(e,n),o=Math.max(n.clientWidth,window.innerWidth||0),i=Math.max(n.clientHeight,window.innerHeight||0),a=t?0:v(n),l=t?0:v(n,"left"),s={top:a-r.top+r.marginTop,left:l-r.left+r.marginLeft,width:o,height:i};return S(s)}function P(e){var t=e.nodeName;if("BODY"===t||"HTML"===t)return!1;if("fixed"===a(e,"position"))return!0;var n=l(e);return!!n&&P(n)}function T(e){if(!e||!e.parentElement||f())return document.documentElement;for(var t=e.parentElement;t&&"none"===a(t,"transform");)t=t.parentElement;return t||document.documentElement}function M(e,t,n,r){var o=arguments.length>4&&void 0!==arguments[4]&&arguments[4],i={top:0,left:0},a=o?T(e):m(e,u(t));if("viewport"===r)i=_(a,o);else{var c=void 0;"scrollParent"===r?"BODY"===(c=s(l(t))).nodeName&&(c=e.ownerDocument.documentElement):c="window"===r?e.ownerDocument.documentElement:r;var d=C(c,a,o);if("HTML"!==c.nodeName||P(a))i=d;else{var f=x(e.ownerDocument),p=f.height,h=f.width;i.top+=d.top-d.marginTop,i.bottom=p+d.top,i.left+=d.left-d.marginLeft,i.right=h+d.left}}var v="number"===typeof(n=n||0);return i.left+=v?n:n.left||0,i.top+=v?n:n.top||0,i.right-=v?n:n.right||0,i.bottom-=v?n:n.bottom||0,i}function R(e){return e.width*e.height}function N(e,t,n,r,o){var i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0;if(-1===e.indexOf("auto"))return e;var a=M(n,r,i,o),l={top:{width:a.width,height:t.top-a.top},right:{width:a.right-t.right,height:a.height},bottom:{width:a.width,height:a.bottom-t.bottom},left:{width:t.left-a.left,height:a.height}},s=Object.keys(l).map((function(e){return E({key:e},l[e],{area:R(l[e])})})).sort((function(e,t){return t.area-e.area})),u=s.filter((function(e){var t=e.width,r=e.height;return t>=n.clientWidth&&r>=n.clientHeight})),c=u.length>0?u[0].key:s[0].key,d=e.split("-")[1];return c+(d?"-"+d:"")}function A(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,o=r?T(t):m(t,u(n));return C(n,o,r)}function L(e){var t=e.ownerDocument.defaultView.getComputedStyle(e),n=parseFloat(t.marginTop||0)+parseFloat(t.marginBottom||0),r=parseFloat(t.marginLeft||0)+parseFloat(t.marginRight||0);return{width:e.offsetWidth+r,height:e.offsetHeight+n}}function I(e){var t={left:"right",right:"left",bottom:"top",top:"bottom"};return e.replace(/left|right|bottom|top/g,(function(e){return t[e]}))}function z(e,t,n){n=n.split("-")[0];var r=L(e),o={width:r.width,height:r.height},i=-1!==["right","left"].indexOf(n),a=i?"top":"left",l=i?"left":"top",s=i?"height":"width",u=i?"width":"height";return o[a]=t[a]+t[s]/2-r[s]/2,o[l]=n===l?t[l]-r[u]:t[I(l)],o}function D(e,t){return Array.prototype.find?e.find(t):e.filter(t)[0]}function F(e,t,n){return(void 0===n?e:e.slice(0,function(e,t,n){if(Array.prototype.findIndex)return e.findIndex((function(e){return e[t]===n}));var r=D(e,(function(e){return e[t]===n}));return e.indexOf(r)}(e,"name",n))).forEach((function(e){e.function&&console.warn("`modifier.function` is deprecated, use `modifier.fn`!");var n=e.function||e.fn;e.enabled&&i(n)&&(t.offsets.popper=S(t.offsets.popper),t.offsets.reference=S(t.offsets.reference),t=n(t,e))})),t}function W(){if(!this.state.isDestroyed){var e={instance:this,styles:{},arrowStyles:{},attributes:{},flipped:!1,offsets:{}};e.offsets.reference=A(this.state,this.popper,this.reference,this.options.positionFixed),e.placement=N(this.options.placement,e.offsets.reference,this.popper,this.reference,this.options.modifiers.flip.boundariesElement,this.options.modifiers.flip.padding),e.originalPlacement=e.placement,e.positionFixed=this.options.positionFixed,e.offsets.popper=z(this.popper,e.offsets.reference,e.placement),e.offsets.popper.position=this.options.positionFixed?"fixed":"absolute",e=F(this.modifiers,e),this.state.isCreated?this.options.onUpdate(e):(this.state.isCreated=!0,this.options.onCreate(e))}}function B(e,t){return e.some((function(e){var n=e.name;return e.enabled&&n===t}))}function U(e){for(var t=[!1,"ms","Webkit","Moz","O"],n=e.charAt(0).toUpperCase()+e.slice(1),r=0;r1&&void 0!==arguments[1]&&arguments[1],n=J.indexOf(e),r=J.slice(n+1).concat(J.slice(0,n));return t?r.reverse():r}var te="flip",ne="clockwise",re="counterclockwise";function oe(e,t,n,r){var o=[0,0],i=-1!==["right","left"].indexOf(r),a=e.split(/(\+|\-)/).map((function(e){return e.trim()})),l=a.indexOf(D(a,(function(e){return-1!==e.search(/,|\s/)})));a[l]&&-1===a[l].indexOf(",")&&console.warn("Offsets separated by white space(s) are deprecated, use a comma (,) instead.");var s=/\s*,\s*|\s+/,u=-1!==l?[a.slice(0,l).concat([a[l].split(s)[0]]),[a[l].split(s)[1]].concat(a.slice(l+1))]:[a];return(u=u.map((function(e,r){var o=(1===r?!i:i)?"height":"width",a=!1;return e.reduce((function(e,t){return""===e[e.length-1]&&-1!==["+","-"].indexOf(t)?(e[e.length-1]=t,a=!0,e):a?(e[e.length-1]+=t,a=!1,e):e.concat(t)}),[]).map((function(e){return function(e,t,n,r){var o=e.match(/((?:\-|\+)?\d*\.?\d*)(.*)/),i=+o[1],a=o[2];if(!i)return e;if(0===a.indexOf("%")){var l=void 0;switch(a){case"%p":l=n;break;case"%":case"%r":default:l=r}return S(l)[t]/100*i}if("vh"===a||"vw"===a){return("vh"===a?Math.max(document.documentElement.clientHeight,window.innerHeight||0):Math.max(document.documentElement.clientWidth,window.innerWidth||0))/100*i}return i}(e,o,t,n)}))}))).forEach((function(e,t){e.forEach((function(n,r){X(n)&&(o[t]+=n*("-"===e[r-1]?-1:1))}))})),o}var ie={placement:"bottom",positionFixed:!1,eventsEnabled:!0,removeOnDestroy:!1,onCreate:function(){},onUpdate:function(){},modifiers:{shift:{order:100,enabled:!0,fn:function(e){var t=e.placement,n=t.split("-")[0],r=t.split("-")[1];if(r){var o=e.offsets,i=o.reference,a=o.popper,l=-1!==["bottom","top"].indexOf(n),s=l?"left":"top",u=l?"width":"height",c={start:k({},s,i[s]),end:k({},s,i[s]+i[u]-a[u])};e.offsets.popper=E({},a,c[r])}return e}},offset:{order:200,enabled:!0,fn:function(e,t){var n=t.offset,r=e.placement,o=e.offsets,i=o.popper,a=o.reference,l=r.split("-")[0],s=void 0;return s=X(+n)?[+n,0]:oe(n,i,a,l),"left"===l?(i.top+=s[0],i.left-=s[1]):"right"===l?(i.top+=s[0],i.left+=s[1]):"top"===l?(i.left+=s[0],i.top-=s[1]):"bottom"===l&&(i.left+=s[0],i.top+=s[1]),e.popper=i,e},offset:0},preventOverflow:{order:300,enabled:!0,fn:function(e,t){var n=t.boundariesElement||p(e.instance.popper);e.instance.reference===n&&(n=p(n));var r=U("transform"),o=e.instance.popper.style,i=o.top,a=o.left,l=o[r];o.top="",o.left="",o[r]="";var s=M(e.instance.popper,e.instance.reference,t.padding,n,e.positionFixed);o.top=i,o.left=a,o[r]=l,t.boundaries=s;var u=t.priority,c=e.offsets.popper,d={primary:function(e){var n=c[e];return c[e]s[e]&&!t.escapeWithReference&&(r=Math.min(c[n],s[e]-("right"===e?c.width:c.height))),k({},n,r)}};return u.forEach((function(e){var t=-1!==["left","top"].indexOf(e)?"primary":"secondary";c=E({},c,d[t](e))})),e.offsets.popper=c,e},priority:["left","right","top","bottom"],padding:5,boundariesElement:"scrollParent"},keepTogether:{order:400,enabled:!0,fn:function(e){var t=e.offsets,n=t.popper,r=t.reference,o=e.placement.split("-")[0],i=Math.floor,a=-1!==["top","bottom"].indexOf(o),l=a?"right":"bottom",s=a?"left":"top",u=a?"width":"height";return n[l]i(r[l])&&(e.offsets.popper[s]=i(r[l])),e}},arrow:{order:500,enabled:!0,fn:function(e,t){var n;if(!Q(e.instance.modifiers,"arrow","keepTogether"))return e;var r=t.element;if("string"===typeof r){if(!(r=e.instance.popper.querySelector(r)))return e}else if(!e.instance.popper.contains(r))return console.warn("WARNING: `arrow.element` must be child of its popper element!"),e;var o=e.placement.split("-")[0],i=e.offsets,l=i.popper,s=i.reference,u=-1!==["left","right"].indexOf(o),c=u?"height":"width",d=u?"Top":"Left",f=d.toLowerCase(),p=u?"left":"top",h=u?"bottom":"right",m=L(r)[c];s[h]-ml[h]&&(e.offsets.popper[f]+=s[f]+m-l[h]),e.offsets.popper=S(e.offsets.popper);var v=s[f]+s[c]/2-m/2,g=a(e.instance.popper),b=parseFloat(g["margin"+d]),y=parseFloat(g["border"+d+"Width"]),x=v-e.offsets.popper[f]-b-y;return x=Math.max(Math.min(l[c]-m,x),0),e.arrowElement=r,e.offsets.arrow=(k(n={},f,Math.round(x)),k(n,p,""),n),e},element:"[x-arrow]"},flip:{order:600,enabled:!0,fn:function(e,t){if(B(e.instance.modifiers,"inner"))return e;if(e.flipped&&e.placement===e.originalPlacement)return e;var n=M(e.instance.popper,e.instance.reference,t.padding,t.boundariesElement,e.positionFixed),r=e.placement.split("-")[0],o=I(r),i=e.placement.split("-")[1]||"",a=[];switch(t.behavior){case te:a=[r,o];break;case ne:a=ee(r);break;case re:a=ee(r,!0);break;default:a=t.behavior}return a.forEach((function(l,s){if(r!==l||a.length===s+1)return e;r=e.placement.split("-")[0],o=I(r);var u=e.offsets.popper,c=e.offsets.reference,d=Math.floor,f="left"===r&&d(u.right)>d(c.left)||"right"===r&&d(u.left)d(c.top)||"bottom"===r&&d(u.top)d(n.right),m=d(u.top)d(n.bottom),g="left"===r&&p||"right"===r&&h||"top"===r&&m||"bottom"===r&&v,b=-1!==["top","bottom"].indexOf(r),y=!!t.flipVariations&&(b&&"start"===i&&p||b&&"end"===i&&h||!b&&"start"===i&&m||!b&&"end"===i&&v),x=!!t.flipVariationsByContent&&(b&&"start"===i&&h||b&&"end"===i&&p||!b&&"start"===i&&v||!b&&"end"===i&&m),w=y||x;(f||g||w)&&(e.flipped=!0,(f||g)&&(r=a[s+1]),w&&(i=function(e){return"end"===e?"start":"start"===e?"end":e}(i)),e.placement=r+(i?"-"+i:""),e.offsets.popper=E({},e.offsets.popper,z(e.instance.popper,e.offsets.reference,e.placement)),e=F(e.instance.modifiers,e,"flip"))})),e},behavior:"flip",padding:5,boundariesElement:"viewport",flipVariations:!1,flipVariationsByContent:!1},inner:{order:700,enabled:!1,fn:function(e){var t=e.placement,n=t.split("-")[0],r=e.offsets,o=r.popper,i=r.reference,a=-1!==["left","right"].indexOf(n),l=-1===["top","left"].indexOf(n);return o[a?"left":"top"]=i[n]-(l?o[a?"width":"height"]:0),e.placement=I(t),e.offsets.popper=S(o),e}},hide:{order:800,enabled:!0,fn:function(e){if(!Q(e.instance.modifiers,"hide","preventOverflow"))return e;var t=e.offsets.reference,n=D(e.instance.modifiers,(function(e){return"preventOverflow"===e.name})).boundaries;if(t.bottomn.right||t.top>n.bottom||t.right2&&void 0!==arguments[2]?arguments[2]:{};w(this,e),this.scheduleUpdate=function(){return requestAnimationFrame(r.update)},this.update=o(this.update.bind(this)),this.options=E({},e.Defaults,a),this.state={isDestroyed:!1,isCreated:!1,scrollParents:[]},this.reference=t&&t.jquery?t[0]:t,this.popper=n&&n.jquery?n[0]:n,this.options.modifiers={},Object.keys(E({},e.Defaults.modifiers,a.modifiers)).forEach((function(t){r.options.modifiers[t]=E({},e.Defaults.modifiers[t]||{},a.modifiers?a.modifiers[t]:{})})),this.modifiers=Object.keys(this.options.modifiers).map((function(e){return E({name:e},r.options.modifiers[e])})).sort((function(e,t){return e.order-t.order})),this.modifiers.forEach((function(e){e.enabled&&i(e.onLoad)&&e.onLoad(r.reference,r.popper,r.options,e,r.state)})),this.update();var l=this.options.eventsEnabled;l&&this.enableEventListeners(),this.state.eventsEnabled=l}return O(e,[{key:"update",value:function(){return W.call(this)}},{key:"destroy",value:function(){return $.call(this)}},{key:"enableEventListeners",value:function(){return q.call(this)}},{key:"disableEventListeners",value:function(){return Y.call(this)}}]),e}();ae.Utils=("undefined"!==typeof window?window:e).PopperUtils,ae.placements=Z,ae.Defaults=ie,t.a=ae}).call(this,n(114))},function(e,t,n){"use strict";var r=n(16),o=n(17);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=o(n(0)),a=(0,r(n(18)).default)(i.createElement(i.Fragment,null,i.createElement("path",{d:"M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"}),i.createElement("path",{d:"M12.5 7H11v6l5.25 3.15.75-1.23-4.5-2.67z"})),"AccessTime");t.default=a},function(e,t,n){"use strict";var r=n(16),o=n(17);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=o(n(0)),a=(0,r(n(18)).default)(i.createElement("path",{d:"M3 17.25V21h3.75L17.81 9.94l-3.75-3.75L3 17.25zM20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34a.9959.9959 0 00-1.41 0l-1.83 1.83 3.75 3.75 1.83-1.83z"}),"Edit");t.default=a},function(e,t,n){"use strict";var r=n(16),o=n(17);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=o(n(0)),a=(0,r(n(18)).default)(i.createElement("path",{d:"M12 4.5C7 4.5 2.73 7.61 1 12c1.73 4.39 6 7.5 11 7.5s9.27-3.11 11-7.5c-1.73-4.39-6-7.5-11-7.5zM12 17c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5zm0-8c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3z"}),"Visibility");t.default=a},function(e,t,n){"use strict";function r(e){return function(t){var n=t.dispatch,r=t.getState;return function(t){return function(o){return"function"===typeof o?o(n,r,e):t(o)}}}}var o=r();o.withExtraArgument=r,t.a=o},function(e,t,n){"use strict";function r(e){for(var t="https://mui.com/production-error/?code="+e,n=1;n3&&void 0!==arguments[3]?arguments[3]:[],o=arguments.length>4?arguments[4]:void 0,i=[t,n].concat(Object(v.a)(r)),a=["TEMPLATE","SCRIPT","STYLE"];[].forEach.call(e.children,(function(e){1===e.nodeType&&-1===i.indexOf(e)&&-1===a.indexOf(e.tagName)&&y(e,o)}))}function O(e,t){var n=-1;return e.some((function(e,r){return!!t(e)&&(n=r,!0)})),n}function k(e,t){var n,r=[],o=[],i=e.container;if(!t.disableScrollLock){if(function(e){var t=Object(u.a)(e);return t.body===e?Object(b.a)(t).innerWidth>t.documentElement.clientWidth:e.scrollHeight>e.clientHeight}(i)){var a=Object(g.a)();r.push({value:i.style.paddingRight,key:"padding-right",el:i}),i.style["padding-right"]="".concat(x(i)+a,"px"),n=Object(u.a)(i).querySelectorAll(".mui-fixed"),[].forEach.call(n,(function(e){o.push(e.style.paddingRight),e.style.paddingRight="".concat(x(e)+a,"px")}))}var l=i.parentElement,s="HTML"===l.nodeName&&"scroll"===window.getComputedStyle(l)["overflow-y"]?l:i;r.push({value:s.style.overflow,key:"overflow",el:s}),s.style.overflow="hidden"}return function(){n&&[].forEach.call(n,(function(e,t){o[t]?e.style.paddingRight=o[t]:e.style.removeProperty("padding-right")})),r.forEach((function(e){var t=e.value,n=e.el,r=e.key;t?n.style.setProperty(r,t):n.style.removeProperty(r)}))}}var E=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.modals=[],this.containers=[]}return Object(m.a)(e,[{key:"add",value:function(e,t){var n=this.modals.indexOf(e);if(-1!==n)return n;n=this.modals.length,this.modals.push(e),e.modalRef&&y(e.modalRef,!1);var r=function(e){var t=[];return[].forEach.call(e.children,(function(e){e.getAttribute&&"true"===e.getAttribute("aria-hidden")&&t.push(e)})),t}(t);w(t,e.mountNode,e.modalRef,r,!0);var o=O(this.containers,(function(e){return e.container===t}));return-1!==o?(this.containers[o].modals.push(e),n):(this.containers.push({modals:[e],container:t,restore:null,hiddenSiblingNodes:r}),n)}},{key:"mount",value:function(e,t){var n=O(this.containers,(function(t){return-1!==t.modals.indexOf(e)})),r=this.containers[n];r.restore||(r.restore=k(r,t))}},{key:"remove",value:function(e){var t=this.modals.indexOf(e);if(-1===t)return t;var n=O(this.containers,(function(t){return-1!==t.modals.indexOf(e)})),r=this.containers[n];if(r.modals.splice(r.modals.indexOf(e),1),this.modals.splice(t,1),0===r.modals.length)r.restore&&r.restore(),e.modalRef&&y(e.modalRef,!0),w(r.container,e.mountNode,e.modalRef,r.hiddenSiblingNodes,!1),this.containers.splice(n,1);else{var o=r.modals[r.modals.length-1];o.modalRef&&y(o.modalRef,!1)}return t}},{key:"isTopModal",value:function(e){return this.modals.length>0&&this.modals[this.modals.length-1]===e}}]),e}();var S=function(e){var t=e.children,n=e.disableAutoFocus,r=void 0!==n&&n,o=e.disableEnforceFocus,l=void 0!==o&&o,s=e.disableRestoreFocus,c=void 0!==s&&s,d=e.getDoc,p=e.isEnabled,h=e.open,m=i.useRef(),v=i.useRef(null),g=i.useRef(null),b=i.useRef(),y=i.useRef(null),x=i.useCallback((function(e){y.current=a.findDOMNode(e)}),[]),w=Object(f.a)(t.ref,x),O=i.useRef();return i.useEffect((function(){O.current=h}),[h]),!O.current&&h&&"undefined"!==typeof window&&(b.current=d().activeElement),i.useEffect((function(){if(h){var e=Object(u.a)(y.current);r||!y.current||y.current.contains(e.activeElement)||(y.current.hasAttribute("tabIndex")||y.current.setAttribute("tabIndex",-1),y.current.focus());var t=function(){null!==y.current&&(e.hasFocus()&&!l&&p()&&!m.current?y.current&&!y.current.contains(e.activeElement)&&y.current.focus():m.current=!1)},n=function(t){!l&&p()&&9===t.keyCode&&e.activeElement===y.current&&(m.current=!0,t.shiftKey?g.current.focus():v.current.focus())};e.addEventListener("focus",t,!0),e.addEventListener("keydown",n,!0);var o=setInterval((function(){t()}),50);return function(){clearInterval(o),e.removeEventListener("focus",t,!0),e.removeEventListener("keydown",n,!0),c||(b.current&&b.current.focus&&b.current.focus(),b.current=null)}}}),[r,l,c,p,h]),i.createElement(i.Fragment,null,i.createElement("div",{tabIndex:0,ref:v,"data-test":"sentinelStart"}),i.cloneElement(t,{ref:w}),i.createElement("div",{tabIndex:0,ref:g,"data-test":"sentinelEnd"}))},j={root:{zIndex:-1,position:"fixed",right:0,bottom:0,top:0,left:0,backgroundColor:"rgba(0, 0, 0, 0.5)",WebkitTapHighlightColor:"transparent"},invisible:{backgroundColor:"transparent"}},C=i.forwardRef((function(e,t){var n=e.invisible,a=void 0!==n&&n,l=e.open,s=Object(r.a)(e,["invisible","open"]);return l?i.createElement("div",Object(o.a)({"aria-hidden":!0,ref:t},s,{style:Object(o.a)({},j.root,a?j.invisible:{},s.style)})):null}));var _=new E,P=i.forwardRef((function(e,t){var n=Object(l.a)(),m=Object(s.a)({name:"MuiModal",props:Object(o.a)({},e),theme:n}),v=m.BackdropComponent,g=void 0===v?C:v,b=m.BackdropProps,x=m.children,w=m.closeAfterTransition,O=void 0!==w&&w,k=m.container,E=m.disableAutoFocus,j=void 0!==E&&E,P=m.disableBackdropClick,T=void 0!==P&&P,M=m.disableEnforceFocus,R=void 0!==M&&M,N=m.disableEscapeKeyDown,A=void 0!==N&&N,L=m.disablePortal,I=void 0!==L&&L,z=m.disableRestoreFocus,D=void 0!==z&&z,F=m.disableScrollLock,W=void 0!==F&&F,B=m.hideBackdrop,U=void 0!==B&&B,$=m.keepMounted,V=void 0!==$&&$,H=m.manager,q=void 0===H?_:H,Y=m.onBackdropClick,X=m.onClose,G=m.onEscapeKeyDown,K=m.onRendered,Q=m.open,Z=Object(r.a)(m,["BackdropComponent","BackdropProps","children","closeAfterTransition","container","disableAutoFocus","disableBackdropClick","disableEnforceFocus","disableEscapeKeyDown","disablePortal","disableRestoreFocus","disableScrollLock","hideBackdrop","keepMounted","manager","onBackdropClick","onClose","onEscapeKeyDown","onRendered","open"]),J=i.useState(!0),ee=J[0],te=J[1],ne=i.useRef({}),re=i.useRef(null),oe=i.useRef(null),ie=Object(f.a)(oe,t),ae=function(e){return!!e.children&&e.children.props.hasOwnProperty("in")}(m),le=function(){return Object(u.a)(re.current)},se=function(){return ne.current.modalRef=oe.current,ne.current.mountNode=re.current,ne.current},ue=function(){q.mount(se(),{disableScrollLock:W}),oe.current.scrollTop=0},ce=Object(p.a)((function(){var e=function(e){return e="function"===typeof e?e():e,a.findDOMNode(e)}(k)||le().body;q.add(se(),e),oe.current&&ue()})),de=i.useCallback((function(){return q.isTopModal(se())}),[q]),fe=Object(p.a)((function(e){re.current=e,e&&(K&&K(),Q&&de()?ue():y(oe.current,!0))})),pe=i.useCallback((function(){q.remove(se())}),[q]);if(i.useEffect((function(){return function(){pe()}}),[pe]),i.useEffect((function(){Q?ce():ae&&O||pe()}),[Q,pe,ae,O,ce]),!V&&!Q&&(!ae||ee))return null;var he=function(e){return{root:{position:"fixed",zIndex:e.zIndex.modal,right:0,bottom:0,top:0,left:0},hidden:{visibility:"hidden"}}}(n||{zIndex:h.a}),me={};return void 0===x.props.tabIndex&&(me.tabIndex=x.props.tabIndex||"-1"),ae&&(me.onEnter=Object(d.a)((function(){te(!1)}),x.props.onEnter),me.onExited=Object(d.a)((function(){te(!0),O&&pe()}),x.props.onExited)),i.createElement(c.a,{ref:fe,container:k,disablePortal:I},i.createElement("div",Object(o.a)({ref:ie,onKeyDown:function(e){"Escape"===e.key&&de()&&(G&&G(e),A||(e.stopPropagation(),X&&X(e,"escapeKeyDown")))},role:"presentation"},Z,{style:Object(o.a)({},he.root,!Q&&ee?he.hidden:{},Z.style)}),U?null:i.createElement(g,Object(o.a)({open:Q,onClick:function(e){e.target===e.currentTarget&&(Y&&Y(e),!T&&X&&X(e,"backdropClick"))}},b)),i.createElement(S,{disableEnforceFocus:R,disableAutoFocus:j,disableRestoreFocus:D,getDoc:le,isEnabled:de,open:Q},i.cloneElement(x,me))))}));t.a=P},function(e,t,n){"use strict";var r=n(23),o=n(59),i=n(0),a=n.n(i),l=n(13),s=n.n(l),u=!1,c=n(71),d=function(e){function t(t,n){var r;r=e.call(this,t,n)||this;var o,i=n&&!n.isMounting?t.enter:t.appear;return r.appearStatus=null,t.in?i?(o="exited",r.appearStatus="entering"):o="entered":o=t.unmountOnExit||t.mountOnEnter?"unmounted":"exited",r.state={status:o},r.nextCallback=null,r}Object(o.a)(t,e),t.getDerivedStateFromProps=function(e,t){return e.in&&"unmounted"===t.status?{status:"exited"}:null};var n=t.prototype;return n.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},n.componentDidUpdate=function(e){var t=null;if(e!==this.props){var n=this.state.status;this.props.in?"entering"!==n&&"entered"!==n&&(t="entering"):"entering"!==n&&"entered"!==n||(t="exiting")}this.updateStatus(!1,t)},n.componentWillUnmount=function(){this.cancelNextCallback()},n.getTimeouts=function(){var e,t,n,r=this.props.timeout;return e=t=n=r,null!=r&&"number"!==typeof r&&(e=r.exit,t=r.enter,n=void 0!==r.appear?r.appear:t),{exit:e,enter:t,appear:n}},n.updateStatus=function(e,t){if(void 0===e&&(e=!1),null!==t)if(this.cancelNextCallback(),"entering"===t){if(this.props.unmountOnExit||this.props.mountOnEnter){var n=this.props.nodeRef?this.props.nodeRef.current:s.a.findDOMNode(this);n&&function(e){e.scrollTop}(n)}this.performEnter(e)}else this.performExit();else this.props.unmountOnExit&&"exited"===this.state.status&&this.setState({status:"unmounted"})},n.performEnter=function(e){var t=this,n=this.props.enter,r=this.context?this.context.isMounting:e,o=this.props.nodeRef?[r]:[s.a.findDOMNode(this),r],i=o[0],a=o[1],l=this.getTimeouts(),c=r?l.appear:l.enter;!e&&!n||u?this.safeSetState({status:"entered"},(function(){t.props.onEntered(i)})):(this.props.onEnter(i,a),this.safeSetState({status:"entering"},(function(){t.props.onEntering(i,a),t.onTransitionEnd(c,(function(){t.safeSetState({status:"entered"},(function(){t.props.onEntered(i,a)}))}))})))},n.performExit=function(){var e=this,t=this.props.exit,n=this.getTimeouts(),r=this.props.nodeRef?void 0:s.a.findDOMNode(this);t&&!u?(this.props.onExit(r),this.safeSetState({status:"exiting"},(function(){e.props.onExiting(r),e.onTransitionEnd(n.exit,(function(){e.safeSetState({status:"exited"},(function(){e.props.onExited(r)}))}))}))):this.safeSetState({status:"exited"},(function(){e.props.onExited(r)}))},n.cancelNextCallback=function(){null!==this.nextCallback&&(this.nextCallback.cancel(),this.nextCallback=null)},n.safeSetState=function(e,t){t=this.setNextCallback(t),this.setState(e,t)},n.setNextCallback=function(e){var t=this,n=!0;return this.nextCallback=function(r){n&&(n=!1,t.nextCallback=null,e(r))},this.nextCallback.cancel=function(){n=!1},this.nextCallback},n.onTransitionEnd=function(e,t){this.setNextCallback(t);var n=this.props.nodeRef?this.props.nodeRef.current:s.a.findDOMNode(this),r=null==e&&!this.props.addEndListener;if(n&&!r){if(this.props.addEndListener){var o=this.props.nodeRef?[this.nextCallback]:[n,this.nextCallback],i=o[0],a=o[1];this.props.addEndListener(i,a)}null!=e&&setTimeout(this.nextCallback,e)}else setTimeout(this.nextCallback,0)},n.render=function(){var e=this.state.status;if("unmounted"===e)return null;var t=this.props,n=t.children,o=(t.in,t.mountOnEnter,t.unmountOnExit,t.appear,t.enter,t.exit,t.timeout,t.addEndListener,t.onEnter,t.onEntering,t.onEntered,t.onExit,t.onExiting,t.onExited,t.nodeRef,Object(r.a)(t,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]));return a.a.createElement(c.a.Provider,{value:null},"function"===typeof n?n(e,o):a.a.cloneElement(a.a.Children.only(n),o))},t}(a.a.Component);function f(){}d.contextType=c.a,d.propTypes={},d.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:f,onEntering:f,onEntered:f,onExit:f,onExiting:f,onExited:f},d.UNMOUNTED="unmounted",d.EXITED="exited",d.ENTERING="entering",d.ENTERED="entered",d.EXITING="exiting";t.a=d},function(e,t,n){"use strict";var r=n(2),o=n(1),i=n(173),a=n(0),l=n(3),s=n(36),u=n(45),c=n(4),d=n(6),f=n(9),p=n(50);function h(e,t){return parseInt(e[t],10)||0}var m="undefined"!==typeof window?a.useLayoutEffect:a.useEffect,v={visibility:"hidden",position:"absolute",overflow:"hidden",height:0,top:0,left:0,transform:"translateZ(0)"},g=a.forwardRef((function(e,t){var n=e.onChange,i=e.rows,l=e.rowsMax,s=e.rowsMin,u=e.maxRows,c=e.minRows,d=void 0===c?1:c,g=e.style,b=e.value,y=Object(r.a)(e,["onChange","rows","rowsMax","rowsMin","maxRows","minRows","style","value"]),x=u||l,w=i||s||d,O=a.useRef(null!=b).current,k=a.useRef(null),E=Object(f.a)(t,k),S=a.useRef(null),j=a.useRef(0),C=a.useState({}),_=C[0],P=C[1],T=a.useCallback((function(){var t=k.current,n=window.getComputedStyle(t),r=S.current;r.style.width=n.width,r.value=t.value||e.placeholder||"x","\n"===r.value.slice(-1)&&(r.value+=" ");var o=n["box-sizing"],i=h(n,"padding-bottom")+h(n,"padding-top"),a=h(n,"border-bottom-width")+h(n,"border-top-width"),l=r.scrollHeight-i;r.value="x";var s=r.scrollHeight-i,u=l;w&&(u=Math.max(Number(w)*s,u)),x&&(u=Math.min(Number(x)*s,u));var c=(u=Math.max(u,s))+("border-box"===o?i+a:0),d=Math.abs(u-l)<=1;P((function(e){return j.current<20&&(c>0&&Math.abs((e.outerHeightStyle||0)-c)>1||e.overflow!==d)?(j.current+=1,{overflow:d,outerHeightStyle:c}):e}))}),[x,w,e.placeholder]);a.useEffect((function(){var e=Object(p.a)((function(){j.current=0,T()}));return window.addEventListener("resize",e),function(){e.clear(),window.removeEventListener("resize",e)}}),[T]),m((function(){T()})),a.useEffect((function(){j.current=0}),[b]);return a.createElement(a.Fragment,null,a.createElement("textarea",Object(o.a)({value:b,onChange:function(e){j.current=0,O||T(),n&&n(e)},ref:E,rows:w,style:Object(o.a)({height:_.outerHeightStyle,overflow:_.overflow?"hidden":null},g)},y)),a.createElement("textarea",{"aria-hidden":!0,className:e.className,readOnly:!0,ref:S,tabIndex:-1,style:Object(o.a)({},v,g)}))})),b=n(60),y="undefined"===typeof window?a.useEffect:a.useLayoutEffect,x=a.forwardRef((function(e,t){var n=e["aria-describedby"],c=e.autoComplete,p=e.autoFocus,h=e.classes,m=e.className,v=(e.color,e.defaultValue),x=e.disabled,w=e.endAdornment,O=(e.error,e.fullWidth),k=void 0!==O&&O,E=e.id,S=e.inputComponent,j=void 0===S?"input":S,C=e.inputProps,_=void 0===C?{}:C,P=e.inputRef,T=(e.margin,e.multiline),M=void 0!==T&&T,R=e.name,N=e.onBlur,A=e.onChange,L=e.onClick,I=e.onFocus,z=e.onKeyDown,D=e.onKeyUp,F=e.placeholder,W=e.readOnly,B=e.renderSuffix,U=e.rows,$=e.rowsMax,V=e.rowsMin,H=e.maxRows,q=e.minRows,Y=e.startAdornment,X=e.type,G=void 0===X?"text":X,K=e.value,Q=Object(r.a)(e,["aria-describedby","autoComplete","autoFocus","classes","className","color","defaultValue","disabled","endAdornment","error","fullWidth","id","inputComponent","inputProps","inputRef","margin","multiline","name","onBlur","onChange","onClick","onFocus","onKeyDown","onKeyUp","placeholder","readOnly","renderSuffix","rows","rowsMax","rowsMin","maxRows","minRows","startAdornment","type","value"]),Z=null!=_.value?_.value:K,J=a.useRef(null!=Z).current,ee=a.useRef(),te=a.useCallback((function(e){0}),[]),ne=Object(f.a)(_.ref,te),re=Object(f.a)(P,ne),oe=Object(f.a)(ee,re),ie=a.useState(!1),ae=ie[0],le=ie[1],se=Object(u.b)();var ue=Object(s.a)({props:e,muiFormControl:se,states:["color","disabled","error","hiddenLabel","margin","required","filled"]});ue.focused=se?se.focused:ae,a.useEffect((function(){!se&&x&&ae&&(le(!1),N&&N())}),[se,x,ae,N]);var ce=se&&se.onFilled,de=se&&se.onEmpty,fe=a.useCallback((function(e){Object(b.b)(e)?ce&&ce():de&&de()}),[ce,de]);y((function(){J&&fe({value:Z})}),[Z,fe,J]);a.useEffect((function(){fe(ee.current)}),[]);var pe=j,he=Object(o.a)({},_,{ref:oe});"string"!==typeof pe?he=Object(o.a)({inputRef:oe,type:G},he,{ref:null}):M?!U||H||q||$||V?(he=Object(o.a)({minRows:U||q,rowsMax:$,maxRows:H},he),pe=g):pe="textarea":he=Object(o.a)({type:G},he);return a.useEffect((function(){se&&se.setAdornedStart(Boolean(Y))}),[se,Y]),a.createElement("div",Object(o.a)({className:Object(l.a)(h.root,h["color".concat(Object(d.a)(ue.color||"primary"))],m,ue.disabled&&h.disabled,ue.error&&h.error,k&&h.fullWidth,ue.focused&&h.focused,se&&h.formControl,M&&h.multiline,Y&&h.adornedStart,w&&h.adornedEnd,"dense"===ue.margin&&h.marginDense),onClick:function(e){ee.current&&e.currentTarget===e.target&&ee.current.focus(),L&&L(e)},ref:t},Q),Y,a.createElement(u.a.Provider,{value:null},a.createElement(pe,Object(o.a)({"aria-invalid":ue.error,"aria-describedby":n,autoComplete:c,autoFocus:p,defaultValue:v,disabled:ue.disabled,id:E,onAnimationStart:function(e){fe("mui-auto-fill-cancel"===e.animationName?ee.current:{value:"x"})},name:R,placeholder:F,readOnly:W,required:ue.required,rows:U,value:Z,onKeyDown:z,onKeyUp:D},he,{className:Object(l.a)(h.input,_.className,ue.disabled&&h.disabled,M&&h.inputMultiline,ue.hiddenLabel&&h.inputHiddenLabel,Y&&h.inputAdornedStart,w&&h.inputAdornedEnd,"search"===G&&h.inputTypeSearch,"dense"===ue.margin&&h.inputMarginDense),onBlur:function(e){N&&N(e),_.onBlur&&_.onBlur(e),se&&se.onBlur?se.onBlur(e):le(!1)},onChange:function(e){if(!J){var t=e.target||ee.current;if(null==t)throw new Error(Object(i.a)(1));fe({value:t.value})}for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;oT.length&&T.push(e)}function N(e,t,n){return null==e?0:function e(t,n,r,o){var l=typeof t;"undefined"!==l&&"boolean"!==l||(t=null);var s=!1;if(null===t)s=!0;else switch(l){case"string":case"number":s=!0;break;case"object":switch(t.$$typeof){case i:case a:s=!0}}if(s)return r(o,t,""===n?"."+A(t,0):n),1;if(s=0,n=""===n?".":n+":",Array.isArray(t))for(var u=0;ut}return!1}(t,n,o,r)&&(n=null),r||null===o?function(e){return!!$.call(H,e)||!$.call(V,e)&&(U.test(e)?H[e]=!0:(V[e]=!0,!1))}(t)&&(null===n?e.removeAttribute(t):e.setAttribute(t,""+n)):o.mustUseProperty?e[o.propertyName]=null===n?3!==o.type&&"":n:(t=o.attributeName,r=o.attributeNamespace,null===n?e.removeAttribute(t):(n=3===(o=o.type)||4===o&&!0===n?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}K.hasOwnProperty("ReactCurrentDispatcher")||(K.ReactCurrentDispatcher={current:null}),K.hasOwnProperty("ReactCurrentBatchConfig")||(K.ReactCurrentBatchConfig={suspense:null});var Z=/^(.*)[\\\/]/,J="function"===typeof Symbol&&Symbol.for,ee=J?Symbol.for("react.element"):60103,te=J?Symbol.for("react.portal"):60106,ne=J?Symbol.for("react.fragment"):60107,re=J?Symbol.for("react.strict_mode"):60108,oe=J?Symbol.for("react.profiler"):60114,ie=J?Symbol.for("react.provider"):60109,ae=J?Symbol.for("react.context"):60110,le=J?Symbol.for("react.concurrent_mode"):60111,se=J?Symbol.for("react.forward_ref"):60112,ue=J?Symbol.for("react.suspense"):60113,ce=J?Symbol.for("react.suspense_list"):60120,de=J?Symbol.for("react.memo"):60115,fe=J?Symbol.for("react.lazy"):60116,pe=J?Symbol.for("react.block"):60121,he="function"===typeof Symbol&&Symbol.iterator;function me(e){return null===e||"object"!==typeof e?null:"function"===typeof(e=he&&e[he]||e["@@iterator"])?e:null}function ve(e){if(null==e)return null;if("function"===typeof e)return e.displayName||e.name||null;if("string"===typeof e)return e;switch(e){case ne:return"Fragment";case te:return"Portal";case oe:return"Profiler";case re:return"StrictMode";case ue:return"Suspense";case ce:return"SuspenseList"}if("object"===typeof e)switch(e.$$typeof){case ae:return"Context.Consumer";case ie:return"Context.Provider";case se:var t=e.render;return t=t.displayName||t.name||"",e.displayName||(""!==t?"ForwardRef("+t+")":"ForwardRef");case de:return ve(e.type);case pe:return ve(e.render);case fe:if(e=1===e._status?e._result:null)return ve(e)}return null}function ge(e){var t="";do{e:switch(e.tag){case 3:case 4:case 6:case 7:case 10:case 9:var n="";break e;default:var r=e._debugOwner,o=e._debugSource,i=ve(e.type);n=null,r&&(n=ve(r.type)),r=i,i="",o?i=" (at "+o.fileName.replace(Z,"")+":"+o.lineNumber+")":n&&(i=" (created by "+n+")"),n="\n in "+(r||"Unknown")+i}t+=n,e=e.return}while(e);return t}function be(e){switch(typeof e){case"boolean":case"number":case"object":case"string":case"undefined":return e;default:return""}}function ye(e){var t=e.type;return(e=e.nodeName)&&"input"===e.toLowerCase()&&("checkbox"===t||"radio"===t)}function xe(e){e._valueTracker||(e._valueTracker=function(e){var t=ye(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&"undefined"!==typeof n&&"function"===typeof n.get&&"function"===typeof n.set){var o=n.get,i=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(e){r=""+e,i.call(this,e)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(e){r=""+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}(e))}function we(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=ye(e)?e.checked?"true":"false":e.value),(e=r)!==n&&(t.setValue(e),!0)}function Oe(e,t){var n=t.checked;return o({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:null!=n?n:e._wrapperState.initialChecked})}function ke(e,t){var n=null==t.defaultValue?"":t.defaultValue,r=null!=t.checked?t.checked:t.defaultChecked;n=be(null!=t.value?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:"checkbox"===t.type||"radio"===t.type?null!=t.checked:null!=t.value}}function Ee(e,t){null!=(t=t.checked)&&Q(e,"checked",t,!1)}function Se(e,t){Ee(e,t);var n=be(t.value),r=t.type;if(null!=n)"number"===r?(0===n&&""===e.value||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if("submit"===r||"reset"===r)return void e.removeAttribute("value");t.hasOwnProperty("value")?Ce(e,t.type,n):t.hasOwnProperty("defaultValue")&&Ce(e,t.type,be(t.defaultValue)),null==t.checked&&null!=t.defaultChecked&&(e.defaultChecked=!!t.defaultChecked)}function je(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!("submit"!==r&&"reset"!==r||void 0!==t.value&&null!==t.value))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}""!==(n=e.name)&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,""!==n&&(e.name=n)}function Ce(e,t,n){"number"===t&&e.ownerDocument.activeElement===e||(null==n?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}function _e(e,t){return e=o({children:void 0},t),(t=function(e){var t="";return r.Children.forEach(e,(function(e){null!=e&&(t+=e)})),t}(t.children))&&(e.children=t),e}function Pe(e,t,n,r){if(e=e.options,t){t={};for(var o=0;o=n.length))throw Error(a(93));n=n[0]}t=n}null==t&&(t=""),n=t}e._wrapperState={initialValue:be(n)}}function Re(e,t){var n=be(t.value),r=be(t.defaultValue);null!=n&&((n=""+n)!==e.value&&(e.value=n),null==t.defaultValue&&e.defaultValue!==n&&(e.defaultValue=n)),null!=r&&(e.defaultValue=""+r)}function Ne(e){var t=e.textContent;t===e._wrapperState.initialValue&&""!==t&&null!==t&&(e.value=t)}var Ae="http://www.w3.org/1999/xhtml",Le="http://www.w3.org/2000/svg";function Ie(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function ze(e,t){return null==e||"http://www.w3.org/1999/xhtml"===e?Ie(t):"http://www.w3.org/2000/svg"===e&&"foreignObject"===t?"http://www.w3.org/1999/xhtml":e}var De,Fe=function(e){return"undefined"!==typeof MSApp&&MSApp.execUnsafeLocalFunction?function(t,n,r,o){MSApp.execUnsafeLocalFunction((function(){return e(t,n)}))}:e}((function(e,t){if(e.namespaceURI!==Le||"innerHTML"in e)e.innerHTML=t;else{for((De=De||document.createElement("div")).innerHTML="",t=De.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}}));function We(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&3===n.nodeType)return void(n.nodeValue=t)}e.textContent=t}function Be(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Ue={animationend:Be("Animation","AnimationEnd"),animationiteration:Be("Animation","AnimationIteration"),animationstart:Be("Animation","AnimationStart"),transitionend:Be("Transition","TransitionEnd")},$e={},Ve={};function He(e){if($e[e])return $e[e];if(!Ue[e])return e;var t,n=Ue[e];for(t in n)if(n.hasOwnProperty(t)&&t in Ve)return $e[e]=n[t];return e}C&&(Ve=document.createElement("div").style,"AnimationEvent"in window||(delete Ue.animationend.animation,delete Ue.animationiteration.animation,delete Ue.animationstart.animation),"TransitionEvent"in window||delete Ue.transitionend.transition);var qe=He("animationend"),Ye=He("animationiteration"),Xe=He("animationstart"),Ge=He("transitionend"),Ke="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),Qe=new("function"===typeof WeakMap?WeakMap:Map);function Ze(e){var t=Qe.get(e);return void 0===t&&(t=new Map,Qe.set(e,t)),t}function Je(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do{0!==(1026&(t=e).effectTag)&&(n=t.return),e=t.return}while(e)}return 3===t.tag?n:null}function et(e){if(13===e.tag){var t=e.memoizedState;if(null===t&&(null!==(e=e.alternate)&&(t=e.memoizedState)),null!==t)return t.dehydrated}return null}function tt(e){if(Je(e)!==e)throw Error(a(188))}function nt(e){if(!(e=function(e){var t=e.alternate;if(!t){if(null===(t=Je(e)))throw Error(a(188));return t!==e?null:e}for(var n=e,r=t;;){var o=n.return;if(null===o)break;var i=o.alternate;if(null===i){if(null!==(r=o.return)){n=r;continue}break}if(o.child===i.child){for(i=o.child;i;){if(i===n)return tt(o),e;if(i===r)return tt(o),t;i=i.sibling}throw Error(a(188))}if(n.return!==r.return)n=o,r=i;else{for(var l=!1,s=o.child;s;){if(s===n){l=!0,n=o,r=i;break}if(s===r){l=!0,r=o,n=i;break}s=s.sibling}if(!l){for(s=i.child;s;){if(s===n){l=!0,n=i,r=o;break}if(s===r){l=!0,r=i,n=o;break}s=s.sibling}if(!l)throw Error(a(189))}}if(n.alternate!==r)throw Error(a(190))}if(3!==n.tag)throw Error(a(188));return n.stateNode.current===n?e:t}(e)))return null;for(var t=e;;){if(5===t.tag||6===t.tag)return t;if(t.child)t.child.return=t,t=t.child;else{if(t===e)break;for(;!t.sibling;){if(!t.return||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}}return null}function rt(e,t){if(null==t)throw Error(a(30));return null==e?t:Array.isArray(e)?Array.isArray(t)?(e.push.apply(e,t),e):(e.push(t),e):Array.isArray(t)?[e].concat(t):[e,t]}function ot(e,t,n){Array.isArray(e)?e.forEach(t,n):e&&t.call(n,e)}var it=null;function at(e){if(e){var t=e._dispatchListeners,n=e._dispatchInstances;if(Array.isArray(t))for(var r=0;rct.length&&ct.push(e)}function ft(e,t,n,r){if(ct.length){var o=ct.pop();return o.topLevelType=e,o.eventSystemFlags=r,o.nativeEvent=t,o.targetInst=n,o}return{topLevelType:e,eventSystemFlags:r,nativeEvent:t,targetInst:n,ancestors:[]}}function pt(e){var t=e.targetInst,n=t;do{if(!n){e.ancestors.push(n);break}var r=n;if(3===r.tag)r=r.stateNode.containerInfo;else{for(;r.return;)r=r.return;r=3!==r.tag?null:r.stateNode.containerInfo}if(!r)break;5!==(t=n.tag)&&6!==t||e.ancestors.push(n),n=Cn(r)}while(n);for(n=0;n=t)return{node:r,offset:t-e};e=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=dn(r)}}function pn(){for(var e=window,t=cn();t instanceof e.HTMLIFrameElement;){try{var n="string"===typeof t.contentWindow.location.href}catch(r){n=!1}if(!n)break;t=cn((e=t.contentWindow).document)}return t}function hn(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&("input"===t&&("text"===e.type||"search"===e.type||"tel"===e.type||"url"===e.type||"password"===e.type)||"textarea"===t||"true"===e.contentEditable)}var mn=null,vn=null;function gn(e,t){switch(e){case"button":case"input":case"select":case"textarea":return!!t.autoFocus}return!1}function bn(e,t){return"textarea"===e||"option"===e||"noscript"===e||"string"===typeof t.children||"number"===typeof t.children||"object"===typeof t.dangerouslySetInnerHTML&&null!==t.dangerouslySetInnerHTML&&null!=t.dangerouslySetInnerHTML.__html}var yn="function"===typeof setTimeout?setTimeout:void 0,xn="function"===typeof clearTimeout?clearTimeout:void 0;function wn(e){for(;null!=e;e=e.nextSibling){var t=e.nodeType;if(1===t||3===t)break}return e}function On(e){e=e.previousSibling;for(var t=0;e;){if(8===e.nodeType){var n=e.data;if("$"===n||"$!"===n||"$?"===n){if(0===t)return e;t--}else"/$"===n&&t++}e=e.previousSibling}return null}var kn=Math.random().toString(36).slice(2),En="__reactInternalInstance$"+kn,Sn="__reactEventHandlers$"+kn,jn="__reactContainere$"+kn;function Cn(e){var t=e[En];if(t)return t;for(var n=e.parentNode;n;){if(t=n[jn]||n[En]){if(n=t.alternate,null!==t.child||null!==n&&null!==n.child)for(e=On(e);null!==e;){if(n=e[En])return n;e=On(e)}return t}n=(e=n).parentNode}return null}function _n(e){return!(e=e[En]||e[jn])||5!==e.tag&&6!==e.tag&&13!==e.tag&&3!==e.tag?null:e}function Pn(e){if(5===e.tag||6===e.tag)return e.stateNode;throw Error(a(33))}function Tn(e){return e[Sn]||null}function Mn(e){do{e=e.return}while(e&&5!==e.tag);return e||null}function Rn(e,t){var n=e.stateNode;if(!n)return null;var r=h(n);if(!r)return null;n=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(r=!("button"===(e=e.type)||"input"===e||"select"===e||"textarea"===e)),e=!r;break e;default:e=!1}if(e)return null;if(n&&"function"!==typeof n)throw Error(a(231,t,typeof n));return n}function Nn(e,t,n){(t=Rn(e,n.dispatchConfig.phasedRegistrationNames[t]))&&(n._dispatchListeners=rt(n._dispatchListeners,t),n._dispatchInstances=rt(n._dispatchInstances,e))}function An(e){if(e&&e.dispatchConfig.phasedRegistrationNames){for(var t=e._targetInst,n=[];t;)n.push(t),t=Mn(t);for(t=n.length;0this.eventPool.length&&this.eventPool.push(e)}function Yn(e){e.eventPool=[],e.getPooled=Hn,e.release=qn}o(Vn.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():"unknown"!==typeof e.returnValue&&(e.returnValue=!1),this.isDefaultPrevented=Un)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():"unknown"!==typeof e.cancelBubble&&(e.cancelBubble=!0),this.isPropagationStopped=Un)},persist:function(){this.isPersistent=Un},isPersistent:$n,destructor:function(){var e,t=this.constructor.Interface;for(e in t)this[e]=null;this.nativeEvent=this._targetInst=this.dispatchConfig=null,this.isPropagationStopped=this.isDefaultPrevented=$n,this._dispatchInstances=this._dispatchListeners=null}}),Vn.Interface={type:null,target:null,currentTarget:function(){return null},eventPhase:null,bubbles:null,cancelable:null,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:null,isTrusted:null},Vn.extend=function(e){function t(){}function n(){return r.apply(this,arguments)}var r=this;t.prototype=r.prototype;var i=new t;return o(i,n.prototype),n.prototype=i,n.prototype.constructor=n,n.Interface=o({},r.Interface,e),n.extend=r.extend,Yn(n),n},Yn(Vn);var Xn=Vn.extend({data:null}),Gn=Vn.extend({data:null}),Kn=[9,13,27,32],Qn=C&&"CompositionEvent"in window,Zn=null;C&&"documentMode"in document&&(Zn=document.documentMode);var Jn=C&&"TextEvent"in window&&!Zn,er=C&&(!Qn||Zn&&8=Zn),tr=String.fromCharCode(32),nr={beforeInput:{phasedRegistrationNames:{bubbled:"onBeforeInput",captured:"onBeforeInputCapture"},dependencies:["compositionend","keypress","textInput","paste"]},compositionEnd:{phasedRegistrationNames:{bubbled:"onCompositionEnd",captured:"onCompositionEndCapture"},dependencies:"blur compositionend keydown keypress keyup mousedown".split(" ")},compositionStart:{phasedRegistrationNames:{bubbled:"onCompositionStart",captured:"onCompositionStartCapture"},dependencies:"blur compositionstart keydown keypress keyup mousedown".split(" ")},compositionUpdate:{phasedRegistrationNames:{bubbled:"onCompositionUpdate",captured:"onCompositionUpdateCapture"},dependencies:"blur compositionupdate keydown keypress keyup mousedown".split(" ")}},rr=!1;function or(e,t){switch(e){case"keyup":return-1!==Kn.indexOf(t.keyCode);case"keydown":return 229!==t.keyCode;case"keypress":case"mousedown":case"blur":return!0;default:return!1}}function ir(e){return"object"===typeof(e=e.detail)&&"data"in e?e.data:null}var ar=!1;var lr={eventTypes:nr,extractEvents:function(e,t,n,r){var o;if(Qn)e:{switch(e){case"compositionstart":var i=nr.compositionStart;break e;case"compositionend":i=nr.compositionEnd;break e;case"compositionupdate":i=nr.compositionUpdate;break e}i=void 0}else ar?or(e,n)&&(i=nr.compositionEnd):"keydown"===e&&229===n.keyCode&&(i=nr.compositionStart);return i?(er&&"ko"!==n.locale&&(ar||i!==nr.compositionStart?i===nr.compositionEnd&&ar&&(o=Bn()):(Fn="value"in(Dn=r)?Dn.value:Dn.textContent,ar=!0)),i=Xn.getPooled(i,t,n,r),o?i.data=o:null!==(o=ir(n))&&(i.data=o),zn(i),o=i):o=null,(e=Jn?function(e,t){switch(e){case"compositionend":return ir(t);case"keypress":return 32!==t.which?null:(rr=!0,tr);case"textInput":return(e=t.data)===tr&&rr?null:e;default:return null}}(e,n):function(e,t){if(ar)return"compositionend"===e||!Qn&&or(e,t)?(e=Bn(),Wn=Fn=Dn=null,ar=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=document.documentMode,Br={select:{phasedRegistrationNames:{bubbled:"onSelect",captured:"onSelectCapture"},dependencies:"blur contextmenu dragend focus keydown keyup mousedown mouseup selectionchange".split(" ")}},Ur=null,$r=null,Vr=null,Hr=!1;function qr(e,t){var n=t.window===t?t.document:9===t.nodeType?t:t.ownerDocument;return Hr||null==Ur||Ur!==cn(n)?null:("selectionStart"in(n=Ur)&&hn(n)?n={start:n.selectionStart,end:n.selectionEnd}:n={anchorNode:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection()).anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset},Vr&&Fr(Vr,n)?null:(Vr=n,(e=Vn.getPooled(Br.select,$r,e,t)).type="select",e.target=Ur,zn(e),e))}var Yr={eventTypes:Br,extractEvents:function(e,t,n,r,o,i){if(!(i=!(o=i||(r.window===r?r.document:9===r.nodeType?r:r.ownerDocument)))){e:{o=Ze(o),i=S.onSelect;for(var a=0;alo||(e.current=ao[lo],ao[lo]=null,lo--)}function uo(e,t){lo++,ao[lo]=e.current,e.current=t}var co={},fo={current:co},po={current:!1},ho=co;function mo(e,t){var n=e.type.contextTypes;if(!n)return co;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var o,i={};for(o in n)i[o]=t[o];return r&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function vo(e){return null!==(e=e.childContextTypes)&&void 0!==e}function go(){so(po),so(fo)}function bo(e,t,n){if(fo.current!==co)throw Error(a(168));uo(fo,t),uo(po,n)}function yo(e,t,n){var r=e.stateNode;if(e=t.childContextTypes,"function"!==typeof r.getChildContext)return n;for(var i in r=r.getChildContext())if(!(i in e))throw Error(a(108,ve(t)||"Unknown",i));return o({},n,{},r)}function xo(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||co,ho=fo.current,uo(fo,e),uo(po,po.current),!0}function wo(e,t,n){var r=e.stateNode;if(!r)throw Error(a(169));n?(e=yo(e,t,ho),r.__reactInternalMemoizedMergedChildContext=e,so(po),so(fo),uo(fo,e)):so(po),uo(po,n)}var Oo=i.unstable_runWithPriority,ko=i.unstable_scheduleCallback,Eo=i.unstable_cancelCallback,So=i.unstable_requestPaint,jo=i.unstable_now,Co=i.unstable_getCurrentPriorityLevel,_o=i.unstable_ImmediatePriority,Po=i.unstable_UserBlockingPriority,To=i.unstable_NormalPriority,Mo=i.unstable_LowPriority,Ro=i.unstable_IdlePriority,No={},Ao=i.unstable_shouldYield,Lo=void 0!==So?So:function(){},Io=null,zo=null,Do=!1,Fo=jo(),Wo=1e4>Fo?jo:function(){return jo()-Fo};function Bo(){switch(Co()){case _o:return 99;case Po:return 98;case To:return 97;case Mo:return 96;case Ro:return 95;default:throw Error(a(332))}}function Uo(e){switch(e){case 99:return _o;case 98:return Po;case 97:return To;case 96:return Mo;case 95:return Ro;default:throw Error(a(332))}}function $o(e,t){return e=Uo(e),Oo(e,t)}function Vo(e,t,n){return e=Uo(e),ko(e,t,n)}function Ho(e){return null===Io?(Io=[e],zo=ko(_o,Yo)):Io.push(e),No}function qo(){if(null!==zo){var e=zo;zo=null,Eo(e)}Yo()}function Yo(){if(!Do&&null!==Io){Do=!0;var e=0;try{var t=Io;$o(99,(function(){for(;e=t&&(Ta=!0),e.firstContext=null)}function oi(e,t){if(Jo!==e&&!1!==t&&0!==t)if("number"===typeof t&&1073741823!==t||(Jo=e,t=1073741823),t={context:e,observedBits:t,next:null},null===Zo){if(null===Qo)throw Error(a(308));Zo=t,Qo.dependencies={expirationTime:0,firstContext:t,responders:null}}else Zo=Zo.next=t;return e._currentValue}var ii=!1;function ai(e){e.updateQueue={baseState:e.memoizedState,baseQueue:null,shared:{pending:null},effects:null}}function li(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,baseQueue:e.baseQueue,shared:e.shared,effects:e.effects})}function si(e,t){return(e={expirationTime:e,suspenseConfig:t,tag:0,payload:null,callback:null,next:null}).next=e}function ui(e,t){if(null!==(e=e.updateQueue)){var n=(e=e.shared).pending;null===n?t.next=t:(t.next=n.next,n.next=t),e.pending=t}}function ci(e,t){var n=e.alternate;null!==n&&li(n,e),null===(n=(e=e.updateQueue).baseQueue)?(e.baseQueue=t.next=t,t.next=t):(t.next=n.next,n.next=t)}function di(e,t,n,r){var i=e.updateQueue;ii=!1;var a=i.baseQueue,l=i.shared.pending;if(null!==l){if(null!==a){var s=a.next;a.next=l.next,l.next=s}a=l,i.shared.pending=null,null!==(s=e.alternate)&&(null!==(s=s.updateQueue)&&(s.baseQueue=l))}if(null!==a){s=a.next;var u=i.baseState,c=0,d=null,f=null,p=null;if(null!==s)for(var h=s;;){if((l=h.expirationTime)c&&(c=l)}else{null!==p&&(p=p.next={expirationTime:1073741823,suspenseConfig:h.suspenseConfig,tag:h.tag,payload:h.payload,callback:h.callback,next:null}),is(l,h.suspenseConfig);e:{var v=e,g=h;switch(l=t,m=n,g.tag){case 1:if("function"===typeof(v=g.payload)){u=v.call(m,u,l);break e}u=v;break e;case 3:v.effectTag=-4097&v.effectTag|64;case 0:if(null===(l="function"===typeof(v=g.payload)?v.call(m,u,l):v)||void 0===l)break e;u=o({},u,l);break e;case 2:ii=!0}}null!==h.callback&&(e.effectTag|=32,null===(l=i.effects)?i.effects=[h]:l.push(h))}if(null===(h=h.next)||h===s){if(null===(l=i.shared.pending))break;h=a.next=l.next,l.next=s,i.baseQueue=a=l,i.shared.pending=null}}null===p?d=u:p.next=f,i.baseState=d,i.baseQueue=p,as(c),e.expirationTime=c,e.memoizedState=u}}function fi(e,t,n){if(e=t.effects,t.effects=null,null!==e)for(t=0;tm?(v=d,d=null):v=d.sibling;var g=p(o,d,l[m],s);if(null===g){null===d&&(d=v);break}e&&d&&null===g.alternate&&t(o,d),a=i(g,a,m),null===c?u=g:c.sibling=g,c=g,d=v}if(m===l.length)return n(o,d),u;if(null===d){for(;mv?(g=m,m=null):g=m.sibling;var y=p(o,m,b.value,u);if(null===y){null===m&&(m=g);break}e&&m&&null===y.alternate&&t(o,m),l=i(y,l,v),null===d?c=y:d.sibling=y,d=y,m=g}if(b.done)return n(o,m),c;if(null===m){for(;!b.done;v++,b=s.next())null!==(b=f(o,b.value,u))&&(l=i(b,l,v),null===d?c=b:d.sibling=b,d=b);return c}for(m=r(o,m);!b.done;v++,b=s.next())null!==(b=h(m,o,v,b.value,u))&&(e&&null!==b.alternate&&m.delete(null===b.key?v:b.key),l=i(b,l,v),null===d?c=b:d.sibling=b,d=b);return e&&m.forEach((function(e){return t(o,e)})),c}return function(e,r,i,s){var u="object"===typeof i&&null!==i&&i.type===ne&&null===i.key;u&&(i=i.props.children);var c="object"===typeof i&&null!==i;if(c)switch(i.$$typeof){case ee:e:{for(c=i.key,u=r;null!==u;){if(u.key===c){switch(u.tag){case 7:if(i.type===ne){n(e,u.sibling),(r=o(u,i.props.children)).return=e,e=r;break e}break;default:if(u.elementType===i.type){n(e,u.sibling),(r=o(u,i.props)).ref=Oi(e,u,i),r.return=e,e=r;break e}}n(e,u);break}t(e,u),u=u.sibling}i.type===ne?((r=_s(i.props.children,e.mode,s,i.key)).return=e,e=r):((s=Cs(i.type,i.key,i.props,null,e.mode,s)).ref=Oi(e,r,i),s.return=e,e=s)}return l(e);case te:e:{for(u=i.key;null!==r;){if(r.key===u){if(4===r.tag&&r.stateNode.containerInfo===i.containerInfo&&r.stateNode.implementation===i.implementation){n(e,r.sibling),(r=o(r,i.children||[])).return=e,e=r;break e}n(e,r);break}t(e,r),r=r.sibling}(r=Ts(i,e.mode,s)).return=e,e=r}return l(e)}if("string"===typeof i||"number"===typeof i)return i=""+i,null!==r&&6===r.tag?(n(e,r.sibling),(r=o(r,i)).return=e,e=r):(n(e,r),(r=Ps(i,e.mode,s)).return=e,e=r),l(e);if(wi(i))return m(e,r,i,s);if(me(i))return v(e,r,i,s);if(c&&ki(e,i),"undefined"===typeof i&&!u)switch(e.tag){case 1:case 0:throw e=e.type,Error(a(152,e.displayName||e.name||"Component"))}return n(e,r)}}var Si=Ei(!0),ji=Ei(!1),Ci={},_i={current:Ci},Pi={current:Ci},Ti={current:Ci};function Mi(e){if(e===Ci)throw Error(a(174));return e}function Ri(e,t){switch(uo(Ti,t),uo(Pi,e),uo(_i,Ci),e=t.nodeType){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:ze(null,"");break;default:t=ze(t=(e=8===e?t.parentNode:t).namespaceURI||null,e=e.tagName)}so(_i),uo(_i,t)}function Ni(){so(_i),so(Pi),so(Ti)}function Ai(e){Mi(Ti.current);var t=Mi(_i.current),n=ze(t,e.type);t!==n&&(uo(Pi,e),uo(_i,n))}function Li(e){Pi.current===e&&(so(_i),so(Pi))}var Ii={current:0};function zi(e){for(var t=e;null!==t;){if(13===t.tag){var n=t.memoizedState;if(null!==n&&(null===(n=n.dehydrated)||"$?"===n.data||"$!"===n.data))return t}else if(19===t.tag&&void 0!==t.memoizedProps.revealOrder){if(0!==(64&t.effectTag))return t}else if(null!==t.child){t.child.return=t,t=t.child;continue}if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}function Di(e,t){return{responder:e,props:t}}var Fi=K.ReactCurrentDispatcher,Wi=K.ReactCurrentBatchConfig,Bi=0,Ui=null,$i=null,Vi=null,Hi=!1;function qi(){throw Error(a(321))}function Yi(e,t){if(null===t)return!1;for(var n=0;ni))throw Error(a(301));i+=1,Vi=$i=null,t.updateQueue=null,Fi.current=ya,e=n(r,o)}while(t.expirationTime===Bi)}if(Fi.current=va,t=null!==$i&&null!==$i.next,Bi=0,Vi=$i=Ui=null,Hi=!1,t)throw Error(a(300));return e}function Gi(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return null===Vi?Ui.memoizedState=Vi=e:Vi=Vi.next=e,Vi}function Ki(){if(null===$i){var e=Ui.alternate;e=null!==e?e.memoizedState:null}else e=$i.next;var t=null===Vi?Ui.memoizedState:Vi.next;if(null!==t)Vi=t,$i=e;else{if(null===e)throw Error(a(310));e={memoizedState:($i=e).memoizedState,baseState:$i.baseState,baseQueue:$i.baseQueue,queue:$i.queue,next:null},null===Vi?Ui.memoizedState=Vi=e:Vi=Vi.next=e}return Vi}function Qi(e,t){return"function"===typeof t?t(e):t}function Zi(e){var t=Ki(),n=t.queue;if(null===n)throw Error(a(311));n.lastRenderedReducer=e;var r=$i,o=r.baseQueue,i=n.pending;if(null!==i){if(null!==o){var l=o.next;o.next=i.next,i.next=l}r.baseQueue=o=i,n.pending=null}if(null!==o){o=o.next,r=r.baseState;var s=l=i=null,u=o;do{var c=u.expirationTime;if(cUi.expirationTime&&(Ui.expirationTime=c,as(c))}else null!==s&&(s=s.next={expirationTime:1073741823,suspenseConfig:u.suspenseConfig,action:u.action,eagerReducer:u.eagerReducer,eagerState:u.eagerState,next:null}),is(c,u.suspenseConfig),r=u.eagerReducer===e?u.eagerState:e(r,u.action);u=u.next}while(null!==u&&u!==o);null===s?i=r:s.next=l,zr(r,t.memoizedState)||(Ta=!0),t.memoizedState=r,t.baseState=i,t.baseQueue=s,n.lastRenderedState=r}return[t.memoizedState,n.dispatch]}function Ji(e){var t=Ki(),n=t.queue;if(null===n)throw Error(a(311));n.lastRenderedReducer=e;var r=n.dispatch,o=n.pending,i=t.memoizedState;if(null!==o){n.pending=null;var l=o=o.next;do{i=e(i,l.action),l=l.next}while(l!==o);zr(i,t.memoizedState)||(Ta=!0),t.memoizedState=i,null===t.baseQueue&&(t.baseState=i),n.lastRenderedState=i}return[i,r]}function ea(e){var t=Gi();return"function"===typeof e&&(e=e()),t.memoizedState=t.baseState=e,e=(e=t.queue={pending:null,dispatch:null,lastRenderedReducer:Qi,lastRenderedState:e}).dispatch=ma.bind(null,Ui,e),[t.memoizedState,e]}function ta(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},null===(t=Ui.updateQueue)?(t={lastEffect:null},Ui.updateQueue=t,t.lastEffect=e.next=e):null===(n=t.lastEffect)?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function na(){return Ki().memoizedState}function ra(e,t,n,r){var o=Gi();Ui.effectTag|=e,o.memoizedState=ta(1|t,n,void 0,void 0===r?null:r)}function oa(e,t,n,r){var o=Ki();r=void 0===r?null:r;var i=void 0;if(null!==$i){var a=$i.memoizedState;if(i=a.destroy,null!==r&&Yi(r,a.deps))return void ta(t,n,i,r)}Ui.effectTag|=e,o.memoizedState=ta(1|t,n,i,r)}function ia(e,t){return ra(516,4,e,t)}function aa(e,t){return oa(516,4,e,t)}function la(e,t){return oa(4,2,e,t)}function sa(e,t){return"function"===typeof t?(e=e(),t(e),function(){t(null)}):null!==t&&void 0!==t?(e=e(),t.current=e,function(){t.current=null}):void 0}function ua(e,t,n){return n=null!==n&&void 0!==n?n.concat([e]):null,oa(4,2,sa.bind(null,t,e),n)}function ca(){}function da(e,t){return Gi().memoizedState=[e,void 0===t?null:t],e}function fa(e,t){var n=Ki();t=void 0===t?null:t;var r=n.memoizedState;return null!==r&&null!==t&&Yi(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function pa(e,t){var n=Ki();t=void 0===t?null:t;var r=n.memoizedState;return null!==r&&null!==t&&Yi(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function ha(e,t,n){var r=Bo();$o(98>r?98:r,(function(){e(!0)})),$o(97<\/script>",e=e.removeChild(e.firstChild)):"string"===typeof r.is?e=s.createElement(i,{is:r.is}):(e=s.createElement(i),"select"===i&&(s=e,r.multiple?s.multiple=!0:r.size&&(s.size=r.size))):e=s.createElementNS(e,i),e[En]=t,e[Sn]=r,Wa(e,t),t.stateNode=e,s=an(i,r),i){case"iframe":case"object":case"embed":Yt("load",e),u=r;break;case"video":case"audio":for(u=0;ur.tailExpiration&&1t)&&Ul.set(e,t))}}function Gl(e,t){e.expirationTime=(e=n>(e=e.nextKnownPendingLevel)?n:e)&&t!==e?0:e}function Ql(e){if(0!==e.lastExpiredTime)e.callbackExpirationTime=1073741823,e.callbackPriority=99,e.callbackNode=Ho(Jl.bind(null,e));else{var t=Kl(e),n=e.callbackNode;if(0===t)null!==n&&(e.callbackNode=null,e.callbackExpirationTime=0,e.callbackPriority=90);else{var r=ql();if(1073741823===t?r=99:1===t||2===t?r=95:r=0>=(r=10*(1073741821-t)-10*(1073741821-r))?99:250>=r?98:5250>=r?97:95,null!==n){var o=e.callbackPriority;if(e.callbackExpirationTime===t&&o>=r)return;n!==No&&Eo(n)}e.callbackExpirationTime=t,e.callbackPriority=r,t=1073741823===t?Ho(Jl.bind(null,e)):Vo(r,Zl.bind(null,e),{timeout:10*(1073741821-t)-Wo()}),e.callbackNode=t}}}function Zl(e,t){if(Hl=0,t)return Ls(e,t=ql()),Ql(e),null;var n=Kl(e);if(0!==n){if(t=e.callbackNode,0!==(48&kl))throw Error(a(327));if(ms(),e===El&&n===jl||ns(e,n),null!==Sl){var r=kl;kl|=16;for(var o=os();;)try{ss();break}catch(s){rs(e,s)}if(ei(),kl=r,bl.current=o,1===Cl)throw t=_l,ns(e,n),Ns(e,n),Ql(e),t;if(null===Sl)switch(o=e.finishedWork=e.current.alternate,e.finishedExpirationTime=n,r=Cl,El=null,r){case xl:case 1:throw Error(a(345));case 2:Ls(e,2=n){e.lastPingedTime=n,ns(e,n);break}}if(0!==(i=Kl(e))&&i!==n)break;if(0!==r&&r!==n){e.lastPingedTime=r;break}e.timeoutHandle=yn(fs.bind(null,e),o);break}fs(e);break;case Ol:if(Ns(e,n),n===(r=e.lastSuspendedTime)&&(e.nextKnownPendingLevel=ds(o)),Nl&&(0===(o=e.lastPingedTime)||o>=n)){e.lastPingedTime=n,ns(e,n);break}if(0!==(o=Kl(e))&&o!==n)break;if(0!==r&&r!==n){e.lastPingedTime=r;break}if(1073741823!==Tl?r=10*(1073741821-Tl)-Wo():1073741823===Pl?r=0:(r=10*(1073741821-Pl)-5e3,0>(r=(o=Wo())-r)&&(r=0),(n=10*(1073741821-n)-o)<(r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*gl(r/1960))-r)&&(r=n)),10=(r=0|l.busyMinDurationMs)?r=0:(o=0|l.busyDelayMs,r=(i=Wo()-(10*(1073741821-i)-(0|l.timeoutMs||5e3)))<=o?0:o+r-i),10 component higher in the tree to provide a loading indicator or placeholder to display."+ge(a))}5!==Cl&&(Cl=2),l=Za(l,a),d=i;do{switch(d.tag){case 3:s=l,d.effectTag|=4096,d.expirationTime=t,ci(d,hl(d,s,t));break e;case 1:s=l;var x=d.type,w=d.stateNode;if(0===(64&d.effectTag)&&("function"===typeof x.getDerivedStateFromError||null!==w&&"function"===typeof w.componentDidCatch&&(null===Dl||!Dl.has(w)))){d.effectTag|=4096,d.expirationTime=t,ci(d,ml(d,s,t));break e}}d=d.return}while(null!==d)}Sl=cs(Sl)}catch(O){t=O;continue}break}}function os(){var e=bl.current;return bl.current=va,null===e?va:e}function is(e,t){eRl&&(Rl=e)}function ls(){for(;null!==Sl;)Sl=us(Sl)}function ss(){for(;null!==Sl&&!Ao();)Sl=us(Sl)}function us(e){var t=vl(e.alternate,e,jl);return e.memoizedProps=e.pendingProps,null===t&&(t=cs(e)),yl.current=null,t}function cs(e){Sl=e;do{var t=Sl.alternate;if(e=Sl.return,0===(2048&Sl.effectTag)){if(t=Ka(t,Sl,jl),1===jl||1!==Sl.childExpirationTime){for(var n=0,r=Sl.child;null!==r;){var o=r.expirationTime,i=r.childExpirationTime;o>n&&(n=o),i>n&&(n=i),r=r.sibling}Sl.childExpirationTime=n}if(null!==t)return t;null!==e&&0===(2048&e.effectTag)&&(null===e.firstEffect&&(e.firstEffect=Sl.firstEffect),null!==Sl.lastEffect&&(null!==e.lastEffect&&(e.lastEffect.nextEffect=Sl.firstEffect),e.lastEffect=Sl.lastEffect),1(e=e.childExpirationTime)?t:e}function fs(e){var t=Bo();return $o(99,ps.bind(null,e,t)),null}function ps(e,t){do{ms()}while(null!==Wl);if(0!==(48&kl))throw Error(a(327));var n=e.finishedWork,r=e.finishedExpirationTime;if(null===n)return null;if(e.finishedWork=null,e.finishedExpirationTime=0,n===e.current)throw Error(a(177));e.callbackNode=null,e.callbackExpirationTime=0,e.callbackPriority=90,e.nextKnownPendingLevel=0;var o=ds(n);if(e.firstPendingTime=o,r<=e.lastSuspendedTime?e.firstSuspendedTime=e.lastSuspendedTime=e.nextKnownPendingLevel=0:r<=e.firstSuspendedTime&&(e.firstSuspendedTime=r-1),r<=e.lastPingedTime&&(e.lastPingedTime=0),r<=e.lastExpiredTime&&(e.lastExpiredTime=0),e===El&&(Sl=El=null,jl=0),1s&&(c=s,s=l,l=c),c=fn(x,l),d=fn(x,s),c&&d&&(1!==O.rangeCount||O.anchorNode!==c.node||O.anchorOffset!==c.offset||O.focusNode!==d.node||O.focusOffset!==d.offset)&&((w=w.createRange()).setStart(c.node,c.offset),O.removeAllRanges(),l>s?(O.addRange(w),O.extend(d.node,d.offset)):(w.setEnd(d.node,d.offset),O.addRange(w))))),w=[];for(O=x;O=O.parentNode;)1===O.nodeType&&w.push({element:O,left:O.scrollLeft,top:O.scrollTop});for("function"===typeof x.focus&&x.focus(),x=0;x=n?Va(e,t,n):(uo(Ii,1&Ii.current),null!==(t=Xa(e,t,n))?t.sibling:null);uo(Ii,1&Ii.current);break;case 19:if(r=t.childExpirationTime>=n,0!==(64&e.effectTag)){if(r)return Ya(e,t,n);t.effectTag|=64}if(null!==(o=t.memoizedState)&&(o.rendering=null,o.tail=null),uo(Ii,Ii.current),!r)return null}return Xa(e,t,n)}Ta=!1}}else Ta=!1;switch(t.expirationTime=0,t.tag){case 2:if(r=t.type,null!==e&&(e.alternate=null,t.alternate=null,t.effectTag|=2),e=t.pendingProps,o=mo(t,fo.current),ri(t,n),o=Xi(null,t,r,e,o,n),t.effectTag|=1,"object"===typeof o&&null!==o&&"function"===typeof o.render&&void 0===o.$$typeof){if(t.tag=1,t.memoizedState=null,t.updateQueue=null,vo(r)){var i=!0;xo(t)}else i=!1;t.memoizedState=null!==o.state&&void 0!==o.state?o.state:null,ai(t);var l=r.getDerivedStateFromProps;"function"===typeof l&&mi(t,r,l,e),o.updater=vi,t.stateNode=o,o._reactInternalFiber=t,xi(t,r,e,n),t=Da(null,t,r,!0,i,n)}else t.tag=0,Ma(null,t,o,n),t=t.child;return t;case 16:e:{if(o=t.elementType,null!==e&&(e.alternate=null,t.alternate=null,t.effectTag|=2),e=t.pendingProps,function(e){if(-1===e._status){e._status=0;var t=e._ctor;t=t(),e._result=t,t.then((function(t){0===e._status&&(t=t.default,e._status=1,e._result=t)}),(function(t){0===e._status&&(e._status=2,e._result=t)}))}}(o),1!==o._status)throw o._result;switch(o=o._result,t.type=o,i=t.tag=function(e){if("function"===typeof e)return Ss(e)?1:0;if(void 0!==e&&null!==e){if((e=e.$$typeof)===se)return 11;if(e===de)return 14}return 2}(o),e=Go(o,e),i){case 0:t=Ia(null,t,o,e,n);break e;case 1:t=za(null,t,o,e,n);break e;case 11:t=Ra(null,t,o,e,n);break e;case 14:t=Na(null,t,o,Go(o.type,e),r,n);break e}throw Error(a(306,o,""))}return t;case 0:return r=t.type,o=t.pendingProps,Ia(e,t,r,o=t.elementType===r?o:Go(r,o),n);case 1:return r=t.type,o=t.pendingProps,za(e,t,r,o=t.elementType===r?o:Go(r,o),n);case 3:if(Fa(t),r=t.updateQueue,null===e||null===r)throw Error(a(282));if(r=t.pendingProps,o=null!==(o=t.memoizedState)?o.element:null,li(e,t),di(t,r,null,n),(r=t.memoizedState.element)===o)_a(),t=Xa(e,t,n);else{if((o=t.stateNode.hydrate)&&(wa=wn(t.stateNode.containerInfo.firstChild),xa=t,o=Oa=!0),o)for(n=ji(t,null,r,n),t.child=n;n;)n.effectTag=-3&n.effectTag|1024,n=n.sibling;else Ma(e,t,r,n),_a();t=t.child}return t;case 5:return Ai(t),null===e&&Sa(t),r=t.type,o=t.pendingProps,i=null!==e?e.memoizedProps:null,l=o.children,bn(r,o)?l=null:null!==i&&bn(r,i)&&(t.effectTag|=16),La(e,t),4&t.mode&&1!==n&&o.hidden?(t.expirationTime=t.childExpirationTime=1,t=null):(Ma(e,t,l,n),t=t.child),t;case 6:return null===e&&Sa(t),null;case 13:return Va(e,t,n);case 4:return Ri(t,t.stateNode.containerInfo),r=t.pendingProps,null===e?t.child=Si(t,null,r,n):Ma(e,t,r,n),t.child;case 11:return r=t.type,o=t.pendingProps,Ra(e,t,r,o=t.elementType===r?o:Go(r,o),n);case 7:return Ma(e,t,t.pendingProps,n),t.child;case 8:case 12:return Ma(e,t,t.pendingProps.children,n),t.child;case 10:e:{r=t.type._context,o=t.pendingProps,l=t.memoizedProps,i=o.value;var s=t.type._context;if(uo(Ko,s._currentValue),s._currentValue=i,null!==l)if(s=l.value,0===(i=zr(s,i)?0:0|("function"===typeof r._calculateChangedBits?r._calculateChangedBits(s,i):1073741823))){if(l.children===o.children&&!po.current){t=Xa(e,t,n);break e}}else for(null!==(s=t.child)&&(s.return=t);null!==s;){var u=s.dependencies;if(null!==u){l=s.child;for(var c=u.firstContext;null!==c;){if(c.context===r&&0!==(c.observedBits&i)){1===s.tag&&((c=si(n,null)).tag=2,ui(s,c)),s.expirationTime=t&&e<=t}function Ns(e,t){var n=e.firstSuspendedTime,r=e.lastSuspendedTime;nt||0===n)&&(e.lastSuspendedTime=t),t<=e.lastPingedTime&&(e.lastPingedTime=0),t<=e.lastExpiredTime&&(e.lastExpiredTime=0)}function As(e,t){t>e.firstPendingTime&&(e.firstPendingTime=t);var n=e.firstSuspendedTime;0!==n&&(t>=n?e.firstSuspendedTime=e.lastSuspendedTime=e.nextKnownPendingLevel=0:t>=e.lastSuspendedTime&&(e.lastSuspendedTime=t+1),t>e.nextKnownPendingLevel&&(e.nextKnownPendingLevel=t))}function Ls(e,t){var n=e.lastExpiredTime;(0===n||n>t)&&(e.lastExpiredTime=t)}function Is(e,t,n,r){var o=t.current,i=ql(),l=pi.suspense;i=Yl(i,o,l);e:if(n){t:{if(Je(n=n._reactInternalFiber)!==n||1!==n.tag)throw Error(a(170));var s=n;do{switch(s.tag){case 3:s=s.stateNode.context;break t;case 1:if(vo(s.type)){s=s.stateNode.__reactInternalMemoizedMergedChildContext;break t}}s=s.return}while(null!==s);throw Error(a(171))}if(1===n.tag){var u=n.type;if(vo(u)){n=yo(n,u,s);break e}}n=s}else n=co;return null===t.context?t.context=n:t.pendingContext=n,(t=si(i,l)).payload={element:e},null!==(r=void 0===r?null:r)&&(t.callback=r),ui(o,t),Xl(o,i),i}function zs(e){if(!(e=e.current).child)return null;switch(e.child.tag){case 5:default:return e.child.stateNode}}function Ds(e,t){null!==(e=e.memoizedState)&&null!==e.dehydrated&&e.retryTime=O},l=function(){},t.unstable_forceFrameRate=function(e){0>e||125>>1,o=e[r];if(!(void 0!==o&&0<_(o,t)))break e;e[r]=t,e[n]=o,n=r}}function j(e){return void 0===(e=e[0])?null:e}function C(e){var t=e[0];if(void 0!==t){var n=e.pop();if(n!==t){e[0]=n;e:for(var r=0,o=e.length;r_(a,n))void 0!==s&&0>_(s,a)?(e[r]=s,e[l]=n,r=l):(e[r]=a,e[i]=n,r=i);else{if(!(void 0!==s&&0>_(s,n)))break e;e[r]=s,e[l]=n,r=l}}}return t}return null}function _(e,t){var n=e.sortIndex-t.sortIndex;return 0!==n?n:e.id-t.id}var P=[],T=[],M=1,R=null,N=3,A=!1,L=!1,I=!1;function z(e){for(var t=j(T);null!==t;){if(null===t.callback)C(T);else{if(!(t.startTime<=e))break;C(T),t.sortIndex=t.expirationTime,S(P,t)}t=j(T)}}function D(e){if(I=!1,z(e),!L)if(null!==j(P))L=!0,r(F);else{var t=j(T);null!==t&&o(D,t.startTime-e)}}function F(e,n){L=!1,I&&(I=!1,i()),A=!0;var r=N;try{for(z(n),R=j(P);null!==R&&(!(R.expirationTime>n)||e&&!a());){var l=R.callback;if(null!==l){R.callback=null,N=R.priorityLevel;var s=l(R.expirationTime<=n);n=t.unstable_now(),"function"===typeof s?R.callback=s:R===j(P)&&C(P),z(n)}else C(P);R=j(P)}if(null!==R)var u=!0;else{var c=j(T);null!==c&&o(D,c.startTime-n),u=!1}return u}finally{R=null,N=r,A=!1}}function W(e){switch(e){case 1:return-1;case 2:return 250;case 5:return 1073741823;case 4:return 1e4;default:return 5e3}}var B=l;t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(e){e.callback=null},t.unstable_continueExecution=function(){L||A||(L=!0,r(F))},t.unstable_getCurrentPriorityLevel=function(){return N},t.unstable_getFirstCallbackNode=function(){return j(P)},t.unstable_next=function(e){switch(N){case 1:case 2:case 3:var t=3;break;default:t=N}var n=N;N=t;try{return e()}finally{N=n}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=B,t.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=N;N=e;try{return t()}finally{N=n}},t.unstable_scheduleCallback=function(e,n,a){var l=t.unstable_now();if("object"===typeof a&&null!==a){var s=a.delay;s="number"===typeof s&&0l?(e.sortIndex=s,S(T,e),null===j(P)&&e===j(T)&&(I?i():I=!0,o(D,s-l))):(e.sortIndex=a,S(P,e),L||A||(L=!0,r(F))),e},t.unstable_shouldYield=function(){var e=t.unstable_now();z(e);var n=j(P);return n!==R&&null!==R&&null!==n&&null!==n.callback&&n.startTime<=e&&n.expirationTime1)for(var n=1;n=0)return;a[t]="set-cookie"===t?(a[t]?a[t]:[]).concat([n]):a[t]?a[t]+", "+n:n}})),a):a}},function(e,t,n){"use strict";var r=n(33);e.exports=r.isStandardBrowserEnv()?function(){var e,t=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");function o(e){var r=e;return t&&(n.setAttribute("href",r),r=n.href),n.setAttribute("href",r),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:"/"===n.pathname.charAt(0)?n.pathname:"/"+n.pathname}}return e=o(window.location.href),function(t){var n=r.isString(t)?o(t):t;return n.protocol===e.protocol&&n.host===e.host}}():function(){return!0}},function(e,t,n){"use strict";var r=n(33);e.exports=r.isStandardBrowserEnv()?{write:function(e,t,n,o,i,a){var l=[];l.push(e+"="+encodeURIComponent(t)),r.isNumber(n)&&l.push("expires="+new Date(n).toGMTString()),r.isString(o)&&l.push("path="+o),r.isString(i)&&l.push("domain="+i),!0===a&&l.push("secure"),document.cookie=l.join("; ")},read:function(e){var t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}}},function(e,t,n){"use strict";var r=n(33);function o(){this.handlers=[]}o.prototype.use=function(e,t){return this.handlers.push({fulfilled:e,rejected:t}),this.handlers.length-1},o.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)},o.prototype.forEach=function(e){r.forEach(this.handlers,(function(t){null!==t&&e(t)}))},e.exports=o},function(e,t,n){"use strict";var r=n(33),o=n(215),i=n(141),a=n(113),l=n(216),s=n(217);function u(e){e.cancelToken&&e.cancelToken.throwIfRequested()}e.exports=function(e){return u(e),e.baseURL&&!l(e.url)&&(e.url=s(e.baseURL,e.url)),e.headers=e.headers||{},e.data=o(e.data,e.headers,e.transformRequest),e.headers=r.merge(e.headers.common||{},e.headers[e.method]||{},e.headers||{}),r.forEach(["delete","get","head","post","put","patch","common"],(function(t){delete e.headers[t]})),(e.adapter||a.adapter)(e).then((function(t){return u(e),t.data=o(t.data,t.headers,e.transformResponse),t}),(function(t){return i(t)||(u(e),t&&t.response&&(t.response.data=o(t.response.data,t.response.headers,e.transformResponse))),Promise.reject(t)}))}},function(e,t,n){"use strict";var r=n(33);e.exports=function(e,t,n){return r.forEach(n,(function(n){e=n(e,t)})),e}},function(e,t,n){"use strict";e.exports=function(e){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(e)}},function(e,t,n){"use strict";e.exports=function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}},function(e,t,n){"use strict";var r=n(142);function o(e){if("function"!==typeof e)throw new TypeError("executor must be a function.");var t;this.promise=new Promise((function(e){t=e}));var n=this;e((function(e){n.reason||(n.reason=new r(e),t(n.reason))}))}o.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},o.source=function(){var e;return{token:new o((function(t){e=t})),cancel:e}},e.exports=o},function(e,t,n){"use strict";e.exports=function(e){return function(t){return e.apply(null,t)}}},function(e,t,n){var r=n(221);e.exports=function(e,t,n){for(var o=n?e:e.parentNode;o&&o!==document;){if(r(o,t))return o;o=o.parentNode}}},function(e,t){var n=Element.prototype,r=n.matchesSelector||n.webkitMatchesSelector||n.mozMatchesSelector||n.msMatchesSelector||n.oMatchesSelector;e.exports=function(e,t){if(r)return r.call(e,t);for(var n=e.parentNode.querySelectorAll(t),o=0;ot?1:0},u=function(e,t,o,i,a){var l;if(null==o&&(o=0),null==a&&(a=n),o<0)throw new Error("lo must be non-negative");for(null==i&&(i=e.length);on;0<=n?t++:t--)u.push(t);return u}.apply(this).reverse()).length;im;0<=m?++f:--f)v.push(i(e,r));return v},h=function(e,t,r,o){var i,a,l;for(null==o&&(o=n),i=e[r];r>t&&o(i,a=e[l=r-1>>1])<0;)e[r]=a,r=l;return e[r]=i},m=function(e,t,r){var o,i,a,l,s;for(null==r&&(r=n),i=e.length,s=t,a=e[t],o=2*t+1;o=0&&e=0&&t0&&(new Date).getTime()-u>1e3*this.timeLimit)return 1/0;var l,s,f,h,m=t+c(e,p)*this.weight;if(m>n)return m;if(e==p)return r[a]=[e.x,e.y],e;var v,g,b=i.getNeighbors(e,this.diagonalMovement);for(f=0,l=1/0;h=b[f];++f){if(this.trackRecursion&&(h.retainCount=h.retainCount+1||1,!0!==h.tested&&(h.tested=!0)),(s=d(h,t+(g=h,(v=e).x===g.x||v.y===g.y?1:Math.SQRT2),n,r,a+1))instanceof o)return r[a]=[e.x,e.y],s;this.trackRecursion&&0===--h.retainCount&&(h.tested=!1),s=-n&&e.vec[0]*r>=-n;var i=t.vec[0]*e.vec[1]-t.vec[1]*e.vec[0];if(0===i)return!1;var a=(o*t.vec[0]-r*t.vec[1])/i,l=(o*e.vec[0]-r*e.vec[1])/i;return a>=-n&&l>=n||a>=n&&l>=-n},matrixTransform:function(e,t){return e.map((function(e){return{x:e.x*t[0]+e.y*t[2]+t[4],y:e.x*t[1]+e.y*t[3]+t[5]}}))},transformEllipse:function(e,t,n,r){var o=Math.PI/180,i=Math.cos(n*o),a=Math.sin(n*o),l=[e*(r[0]*i+r[2]*a),e*(r[1]*i+r[3]*a),t*(-r[0]*a+r[2]*i),t*(-r[1]*a+r[3]*i)],s=l[0]*l[0]+l[2]*l[2],u=l[1]*l[1]+l[3]*l[3],c=((l[0]-l[3])*(l[0]-l[3])+(l[2]+l[1])*(l[2]+l[1]))*((l[0]+l[3])*(l[0]+l[3])+(l[2]-l[1])*(l[2]-l[1])),d=(s+u)/2;if(c<1e-10*d)return{rx:Math.sqrt(d),ry:Math.sqrt(d),ax:0,isDegenerate:!1};var f=l[0]*l[1]+l[2]*l[3],p=d+(c=Math.sqrt(c))/2,h=d-c/2,m=void 0,v=void 0,g=void 0;return(m=Math.abs(f)<1e-10&&Math.abs(p-u)<1e-10?90:180*Math.atan(Math.abs(f)>Math.abs(p-u)?(p-s)/f:f/(p-u))/Math.PI)>=0?(v=Math.sqrt(p),g=Math.sqrt(h)):(m+=90,v=Math.sqrt(h),g=Math.sqrt(p)),{rx:v,ry:g,ax:m,isDegenerate:v<1e-10*g||g<1e-10*v}}},e.exports=t.default},function(e,t){function n(t){return e.exports=n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.__esModule=!0,e.exports.default=e.exports,n(t)}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t){var n="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof window.msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto);if(n){var r=new Uint8Array(16);e.exports=function(){return n(r),r}}else{var o=new Array(16);e.exports=function(){for(var e,t=0;t<16;t++)0===(3&t)&&(e=4294967296*Math.random()),o[t]=e>>>((3&t)<<3)&255;return o}}},function(e,t){for(var n=[],r=0;r<256;++r)n[r]=(r+256).toString(16).substr(1);e.exports=function(e,t){var r=t||0,o=n;return[o[e[r++]],o[e[r++]],o[e[r++]],o[e[r++]],"-",o[e[r++]],o[e[r++]],"-",o[e[r++]],o[e[r++]],"-",o[e[r++]],o[e[r++]],"-",o[e[r++]],o[e[r++]],o[e[r++]],o[e[r++]],o[e[r++]],o[e[r++]]].join("")}},,function(e,t,n){var r=n(143),o=n(245);e.exports=function e(t,n,i,a,l){var s=-1,u=t.length;for(i||(i=o),l||(l=[]);++s0&&i(c)?n>1?e(c,n-1,i,a,l):r(l,c):a||(l[l.length]=c)}return l}},function(e,t,n){var r=n(77),o=n(120),i=n(43),a=r?r.isConcatSpreadable:void 0;e.exports=function(e){return i(e)||o(e)||!!(a&&e&&e[a])}},function(e,t,n){var r=n(78),o=n(79);e.exports=function(e){return o(e)&&"[object Arguments]"==r(e)}},function(e,t,n){var r=n(77),o=Object.prototype,i=o.hasOwnProperty,a=o.toString,l=r?r.toStringTag:void 0;e.exports=function(e){var t=i.call(e,l),n=e[l];try{e[l]=void 0;var r=!0}catch(s){}var o=a.call(e);return r&&(t?e[l]=n:delete e[l]),o}},function(e,t){var n=Object.prototype.toString;e.exports=function(e){return n.call(e)}},function(e,t,n){var r=n(145),o=n(250),i=n(325),a=n(43);e.exports=function(e,t){return(a(e)?r:i)(e,o(t,3))}},function(e,t,n){var r=n(251),o=n(311),i=n(321),a=n(43),l=n(322);e.exports=function(e){return"function"==typeof e?e:null==e?i:"object"==typeof e?a(e)?o(e[0],e[1]):r(e):l(e)}},function(e,t,n){var r=n(252),o=n(310),i=n(156);e.exports=function(e){var t=o(e);return 1==t.length&&t[0][2]?i(t[0][0],t[0][1]):function(n){return n===e||r(n,e,t)}}},function(e,t,n){var r=n(146),o=n(150);e.exports=function(e,t,n,i){var a=n.length,l=a,s=!i;if(null==e)return!l;for(e=Object(e);a--;){var u=n[a];if(s&&u[2]?u[1]!==e[u[0]]:!(u[0]in e))return!1}for(;++a-1}},function(e,t,n){var r=n(89);e.exports=function(e,t){var n=this.__data__,o=r(n,e);return o<0?(++this.size,n.push([e,t])):n[o][1]=t,this}},function(e,t,n){var r=n(88);e.exports=function(){this.__data__=new r,this.size=0}},function(e,t){e.exports=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}},function(e,t){e.exports=function(e){return this.__data__.get(e)}},function(e,t){e.exports=function(e){return this.__data__.has(e)}},function(e,t,n){var r=n(88),o=n(121),i=n(123);e.exports=function(e,t){var n=this.__data__;if(n instanceof r){var a=n.__data__;if(!o||a.length<199)return a.push([e,t]),this.size=++n.size,this;n=this.__data__=new i(a)}return n.set(e,t),this.size=n.size,this}},function(e,t,n){var r=n(148),o=n(264),i=n(122),a=n(149),l=/^\[object .+?Constructor\]$/,s=Function.prototype,u=Object.prototype,c=s.toString,d=u.hasOwnProperty,f=RegExp("^"+c.call(d).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");e.exports=function(e){return!(!i(e)||o(e))&&(r(e)?f:l).test(a(e))}},function(e,t,n){var r=n(265),o=function(){var e=/[^.]+$/.exec(r&&r.keys&&r.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();e.exports=function(e){return!!o&&o in e}},function(e,t,n){var r=n(47)["__core-js_shared__"];e.exports=r},function(e,t){e.exports=function(e,t){return null==e?void 0:e[t]}},function(e,t,n){var r=n(268),o=n(88),i=n(121);e.exports=function(){this.size=0,this.__data__={hash:new r,map:new(i||o),string:new r}}},function(e,t,n){var r=n(269),o=n(270),i=n(271),a=n(272),l=n(273);function s(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t *:first-child":{fontSize:18}},iconSizeMedium:{"& > *:first-child":{fontSize:20}},iconSizeLarge:{"& > *:first-child":{fontSize:22}}}}),{name:"MuiButton"})(d)},function(e,t,n){"use strict";var r=n(1),o=n(2),i=n(0),a=n(3),l=n(4),s=n(174),u=i.forwardRef((function(e,t){var n=e.children,l=e.classes,u=e.className,c=e.invisible,d=void 0!==c&&c,f=e.open,p=e.transitionDuration,h=e.TransitionComponent,m=void 0===h?s.a:h,v=Object(o.a)(e,["children","classes","className","invisible","open","transitionDuration","TransitionComponent"]);return i.createElement(m,Object(r.a)({in:f,timeout:p},v),i.createElement("div",{className:Object(a.a)(l.root,u,d&&l.invisible),"aria-hidden":!0,ref:t},n))}));t.a=Object(l.a)({root:{zIndex:-1,position:"fixed",display:"flex",alignItems:"center",justifyContent:"center",right:0,bottom:0,top:0,left:0,backgroundColor:"rgba(0, 0, 0, 0.5)",WebkitTapHighlightColor:"transparent"},invisible:{backgroundColor:"transparent"}},{name:"MuiBackdrop"})(u)},function(e,t,n){"use strict";var r=n(2),o=n(1),i=n(0),a=n(3),l=n(36),s=n(31),u=n(6),c=n(4),d=i.forwardRef((function(e,t){var n=e.children,c=e.classes,d=e.className,f=(e.color,e.component),p=void 0===f?"label":f,h=(e.disabled,e.error,e.filled,e.focused,e.required,Object(r.a)(e,["children","classes","className","color","component","disabled","error","filled","focused","required"])),m=Object(s.a)(),v=Object(l.a)({props:e,muiFormControl:m,states:["color","required","focused","disabled","error","filled"]});return i.createElement(p,Object(o.a)({className:Object(a.a)(c.root,c["color".concat(Object(u.a)(v.color||"primary"))],d,v.disabled&&c.disabled,v.error&&c.error,v.filled&&c.filled,v.focused&&c.focused,v.required&&c.required),ref:t},h),n,v.required&&i.createElement("span",{"aria-hidden":!0,className:Object(a.a)(c.asterisk,v.error&&c.error)},"\u2009","*"))}));t.a=Object(c.a)((function(e){return{root:Object(o.a)({color:e.palette.text.secondary},e.typography.body1,{lineHeight:1,padding:0,"&$focused":{color:e.palette.primary.main},"&$disabled":{color:e.palette.text.disabled},"&$error":{color:e.palette.error.main}}),colorSecondary:{"&$focused":{color:e.palette.secondary.main}},focused:{},disabled:{},error:{},filled:{},required:{},asterisk:{"&$error":{color:e.palette.error.main}}}}),{name:"MuiFormLabel"})(d)},function(e,t,n){"use strict";n.d(t,"a",(function(){return hn}));var r=n(2),o=n(1),i=n(0),a=n.n(i),l="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},s="object"===("undefined"===typeof window?"undefined":l(window))&&"object"===("undefined"===typeof document?"undefined":l(document))&&9===document.nodeType;var u=n(72),c=n(59),d=n(81),f=n(23),p={}.constructor;function h(e){if(null==e||"object"!==typeof e)return e;if(Array.isArray(e))return e.map(h);if(e.constructor!==p)return e;var t={};for(var n in e)t[n]=h(e[n]);return t}function m(e,t,n){void 0===e&&(e="unnamed");var r=n.jss,o=h(t),i=r.plugins.onCreateRule(e,o,n);return i||(e[0],null)}var v=function(e,t){for(var n="",r=0;r<+~=|^:(),"'`\s])/g,O="undefined"!==typeof CSS&&CSS.escape,k=function(e){return O?O(e):e.replace(w,"\\$1")},E=function(){function e(e,t,n){this.type="style",this.isProcessed=!1;var r=n.sheet,o=n.Renderer;this.key=e,this.options=n,this.style=t,r?this.renderer=r.renderer:o&&(this.renderer=new o)}return e.prototype.prop=function(e,t,n){if(void 0===t)return this.style[e];var r=!!n&&n.force;if(!r&&this.style[e]===t)return this;var o=t;n&&!1===n.process||(o=this.options.jss.plugins.onChangeValue(t,e,this));var i=null==o||!1===o,a=e in this.style;if(i&&!a&&!r)return this;var l=i&&a;if(l?delete this.style[e]:this.style[e]=o,this.renderable&&this.renderer)return l?this.renderer.removeProperty(this.renderable,e):this.renderer.setProperty(this.renderable,e,o),this;var s=this.options.sheet;return s&&s.attached,this},e}(),S=function(e){function t(t,n,r){var o;o=e.call(this,t,n,r)||this;var i=r.selector,a=r.scoped,l=r.sheet,s=r.generateId;return i?o.selectorText=i:!1!==a&&(o.id=s(Object(d.a)(Object(d.a)(o)),l),o.selectorText="."+k(o.id)),o}Object(c.a)(t,e);var n=t.prototype;return n.applyTo=function(e){var t=this.renderer;if(t){var n=this.toJSON();for(var r in n)t.setProperty(e,r,n[r])}return this},n.toJSON=function(){var e={};for(var t in this.style){var n=this.style[t];"object"!==typeof n?e[t]=n:Array.isArray(n)&&(e[t]=g(n))}return e},n.toString=function(e){var t=this.options.sheet,n=!!t&&t.options.link?Object(o.a)({},e,{allowEmpty:!0}):e;return x(this.selectorText,this.style,n)},Object(u.a)(t,[{key:"selector",set:function(e){if(e!==this.selectorText){this.selectorText=e;var t=this.renderer,n=this.renderable;if(n&&t)t.setSelector(n,e)||t.replaceRule(n,this)}},get:function(){return this.selectorText}}]),t}(E),j={onCreateRule:function(e,t,n){return"@"===e[0]||n.parent&&"keyframes"===n.parent.type?null:new S(e,t,n)}},C={indent:1,children:!0},_=/@([\w-]+)/,P=function(){function e(e,t,n){this.type="conditional",this.isProcessed=!1,this.key=e;var r=e.match(_);for(var i in this.at=r?r[1]:"unknown",this.query=n.name||"@"+this.at,this.options=n,this.rules=new Z(Object(o.a)({},n,{parent:this})),t)this.rules.add(i,t[i]);this.rules.process()}var t=e.prototype;return t.getRule=function(e){return this.rules.get(e)},t.indexOf=function(e){return this.rules.indexOf(e)},t.addRule=function(e,t,n){var r=this.rules.add(e,t,n);return r?(this.options.jss.plugins.onProcessRule(r),r):null},t.replaceRule=function(e,t,n){var r=this.rules.replace(e,t,n);return r&&this.options.jss.plugins.onProcessRule(r),r},t.toString=function(e){void 0===e&&(e=C);var t=b(e).linebreak;if(null==e.indent&&(e.indent=C.indent),null==e.children&&(e.children=C.children),!1===e.children)return this.query+" {}";var n=this.rules.toString(e);return n?this.query+" {"+t+n+t+"}":""},e}(),T=/@container|@media|@supports\s+/,M={onCreateRule:function(e,t,n){return T.test(e)?new P(e,t,n):null}},R={indent:1,children:!0},N=/@keyframes\s+([\w-]+)/,A=function(){function e(e,t,n){this.type="keyframes",this.at="@keyframes",this.isProcessed=!1;var r=e.match(N);r&&r[1]?this.name=r[1]:this.name="noname",this.key=this.type+"-"+this.name,this.options=n;var i=n.scoped,a=n.sheet,l=n.generateId;for(var s in this.id=!1===i?this.name:k(l(this,a)),this.rules=new Z(Object(o.a)({},n,{parent:this})),t)this.rules.add(s,t[s],Object(o.a)({},n,{parent:this}));this.rules.process()}return e.prototype.toString=function(e){void 0===e&&(e=R);var t=b(e).linebreak;if(null==e.indent&&(e.indent=R.indent),null==e.children&&(e.children=R.children),!1===e.children)return this.at+" "+this.id+" {}";var n=this.rules.toString(e);return n&&(n=""+t+n+t),this.at+" "+this.id+" {"+n+"}"},e}(),L=/@keyframes\s+/,I=/\$([\w-]+)/g,z=function(e,t){return"string"===typeof e?e.replace(I,(function(e,n){return n in t?t[n]:e})):e},D=function(e,t,n){var r=e[t],o=z(r,n);o!==r&&(e[t]=o)},F={onCreateRule:function(e,t,n){return"string"===typeof e&&L.test(e)?new A(e,t,n):null},onProcessStyle:function(e,t,n){return"style"===t.type&&n?("animation-name"in e&&D(e,"animation-name",n.keyframes),"animation"in e&&D(e,"animation",n.keyframes),e):e},onChangeValue:function(e,t,n){var r=n.options.sheet;if(!r)return e;switch(t){case"animation":case"animation-name":return z(e,r.keyframes);default:return e}}},W=function(e){function t(){return e.apply(this,arguments)||this}return Object(c.a)(t,e),t.prototype.toString=function(e){var t=this.options.sheet,n=!!t&&t.options.link?Object(o.a)({},e,{allowEmpty:!0}):e;return x(this.key,this.style,n)},t}(E),B={onCreateRule:function(e,t,n){return n.parent&&"keyframes"===n.parent.type?new W(e,t,n):null}},U=function(){function e(e,t,n){this.type="font-face",this.at="@font-face",this.isProcessed=!1,this.key=e,this.style=t,this.options=n}return e.prototype.toString=function(e){var t=b(e).linebreak;if(Array.isArray(this.style)){for(var n="",r=0;r=this.index)t.push(e);else for(var r=0;rn)return void t.splice(r,0,e)},t.reset=function(){this.registry=[]},t.remove=function(e){var t=this.registry.indexOf(e);this.registry.splice(t,1)},t.toString=function(e){for(var t=void 0===e?{}:e,n=t.attached,r=Object(f.a)(t,["attached"]),o=b(r).linebreak,i="",a=0;a-1?r.substr(0,o-1):r;e.style.setProperty(t,i,o>-1?"important":"")}}catch(a){return!1}return!0},ue=function(e,t){try{e.attributeStyleMap?e.attributeStyleMap.delete(t):e.style.removeProperty(t)}catch(n){}},ce=function(e,t){return e.selectorText=t,e.selectorText===t},de=ae((function(){return document.querySelector("head")}));function fe(e){var t=te.registry;if(t.length>0){var n=function(e,t){for(var n=0;nt.index&&r.options.insertionPoint===t.insertionPoint)return r}return null}(t,e);if(n&&n.renderer)return{parent:n.renderer.element.parentNode,node:n.renderer.element};if((n=function(e,t){for(var n=e.length-1;n>=0;n--){var r=e[n];if(r.attached&&r.options.insertionPoint===t.insertionPoint)return r}return null}(t,e))&&n.renderer)return{parent:n.renderer.element.parentNode,node:n.renderer.element.nextSibling}}var r=e.insertionPoint;if(r&&"string"===typeof r){var o=function(e){for(var t=de(),n=0;nn?n:t},ve=function(){function e(e){this.getPropertyValue=le,this.setProperty=se,this.removeProperty=ue,this.setSelector=ce,this.hasInsertedRules=!1,this.cssRules=[],e&&te.add(e),this.sheet=e;var t=this.sheet?this.sheet.options:{},n=t.media,r=t.meta,o=t.element;this.element=o||function(){var e=document.createElement("style");return e.textContent="\n",e}(),this.element.setAttribute("data-jss",""),n&&this.element.setAttribute("media",n),r&&this.element.setAttribute("data-meta",r);var i=pe();i&&this.element.setAttribute("nonce",i)}var t=e.prototype;return t.attach=function(){if(!this.element.parentNode&&this.sheet){!function(e,t){var n=t.insertionPoint,r=fe(t);if(!1!==r&&r.parent)r.parent.insertBefore(e,r.node);else if(n&&"number"===typeof n.nodeType){var o=n,i=o.parentNode;i&&i.insertBefore(e,o.nextSibling)}else de().appendChild(e)}(this.element,this.sheet.options);var e=Boolean(this.sheet&&this.sheet.deployed);this.hasInsertedRules&&e&&(this.hasInsertedRules=!1,this.deploy())}},t.detach=function(){if(this.sheet){var e=this.element.parentNode;e&&e.removeChild(this.element),this.sheet.options.link&&(this.cssRules=[],this.element.textContent="\n")}},t.deploy=function(){var e=this.sheet;e&&(e.options.link?this.insertRules(e.rules):this.element.textContent="\n"+e.toString()+"\n")},t.insertRules=function(e,t){for(var n=0;n-1){var o=Lt[e];if(!Array.isArray(o))return ut+yt(o)in t&&ct+o;if(!r)return!1;for(var i=0;it?1:-1:e.length-t.length};return{onProcessStyle:function(t,n){if("style"!==n.type)return t;for(var r={},o=Object.keys(t).sort(e),i=0;i0&&void 0!==arguments[0]?arguments[0]:{},t=e.disableGlobal,n=void 0!==t&&t,r=e.productionPrefix,o=void 0===r?"jss":r,i=e.seed,a=void 0===i?"":i,l=""===a?"":"".concat(a,"-"),s=0,u=function(){return s+=1};return function(e,t){var r=t.options.name;if(r&&0===r.indexOf("Mui")&&!t.options.link&&!n){if(-1!==Se.indexOf(e.key))return"Mui-".concat(e.key);var i="".concat(l).concat(r,"-").concat(e.key);return t.options.theme[Ee]&&""===a?"".concat(i,"-").concat(u()):i}return"".concat(l).concat(o).concat(u())}}(),jss:en,sheetsCache:null,sheetsManager:new Map,sheetsRegistry:null},nn=a.a.createContext(tn);var rn=-1e9;function on(){return rn+=1}n(28);var an=n(371);function ln(e){var t="function"===typeof e;return{create:function(n,r){var i;try{i=t?e(n):e}catch(s){throw s}if(!r||!n.overrides||!n.overrides[r])return i;var a=n.overrides[r],l=Object(o.a)({},i);return Object.keys(a).forEach((function(e){l[e]=Object(an.a)(l[e],a[e])})),l},options:{}}}var sn={};function un(e,t,n){var r=e.state;if(e.stylesOptions.disableGeneration)return t||{};r.cacheClasses||(r.cacheClasses={value:null,lastProp:null,lastJSS:{}});var o=!1;return r.classes!==r.cacheClasses.lastJSS&&(r.cacheClasses.lastJSS=r.classes,o=!0),t!==r.cacheClasses.lastProp&&(r.cacheClasses.lastProp=t,o=!0),o&&(r.cacheClasses.value=Object(we.a)({baseClasses:r.cacheClasses.lastJSS,newClasses:t,Component:n})),r.cacheClasses.value}function cn(e,t){var n=e.state,r=e.theme,i=e.stylesOptions,a=e.stylesCreator,l=e.name;if(!i.disableGeneration){var s=Oe.get(i.sheetsManager,a,r);s||(s={refs:0,staticSheet:null,dynamicStyles:null},Oe.set(i.sheetsManager,a,r,s));var u=Object(o.a)({},a.options,i,{theme:r,flip:"boolean"===typeof i.flip?i.flip:"rtl"===r.direction});u.generateId=u.serverGenerateClassName||u.generateClassName;var c=i.sheetsRegistry;if(0===s.refs){var d;i.sheetsCache&&(d=Oe.get(i.sheetsCache,a,r));var f=a.create(r,l);d||((d=i.jss.createStyleSheet(f,Object(o.a)({link:!1},u))).attach(),i.sheetsCache&&Oe.set(i.sheetsCache,a,r,d)),c&&c.add(d),s.staticSheet=d,s.dynamicStyles=function e(t){var n=null;for(var r in t){var o=t[r],i=typeof o;if("function"===i)n||(n={}),n[r]=o;else if("object"===i&&null!==o&&!Array.isArray(o)){var a=e(o);a&&(n||(n={}),n[r]=a)}}return n}(f)}if(s.dynamicStyles){var p=i.jss.createStyleSheet(s.dynamicStyles,Object(o.a)({link:!0},u));p.update(t),p.attach(),n.dynamicSheet=p,n.classes=Object(we.a)({baseClasses:s.staticSheet.classes,newClasses:p.classes}),c&&c.add(p)}else n.classes=s.staticSheet.classes;s.refs+=1}}function dn(e,t){var n=e.state;n.dynamicSheet&&n.dynamicSheet.update(t)}function fn(e){var t=e.state,n=e.theme,r=e.stylesOptions,o=e.stylesCreator;if(!r.disableGeneration){var i=Oe.get(r.sheetsManager,o,n);i.refs-=1;var a=r.sheetsRegistry;0===i.refs&&(Oe.delete(r.sheetsManager,o,n),r.jss.removeStyleSheet(i.staticSheet),a&&a.remove(i.staticSheet)),t.dynamicSheet&&(r.jss.removeStyleSheet(t.dynamicSheet),a&&a.remove(t.dynamicSheet))}}function pn(e,t){var n,r=a.a.useRef([]),o=a.a.useMemo((function(){return{}}),t);r.current!==o&&(r.current=o,n=e()),a.a.useEffect((function(){return function(){n&&n()}}),[o])}function hn(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.name,i=t.classNamePrefix,l=t.Component,s=t.defaultTheme,u=void 0===s?sn:s,c=Object(r.a)(t,["name","classNamePrefix","Component","defaultTheme"]),d=ln(e),f=n||i||"makeStyles";d.options={index:on(),name:n,meta:f,classNamePrefix:f};var p=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=Object(ke.a)()||u,r=Object(o.a)({},a.a.useContext(nn),c),i=a.a.useRef(),s=a.a.useRef();pn((function(){var o={name:n,state:{},stylesCreator:d,stylesOptions:r,theme:t};return cn(o,e),s.current=!1,i.current=o,function(){fn(o)}}),[t,d]),a.a.useEffect((function(){s.current&&dn(i.current,e),s.current=!0}));var f=un(i.current,e.classes,l);return f};return p}},function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var r=n(0),o=n.n(r);var i=o.a.createContext(null);function a(){return o.a.useContext(i)}},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(1);function o(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.baseClasses,n=e.newClasses;e.Component;if(!n)return t;var o=Object(r.a)({},t);return Object.keys(n).forEach((function(e){n[e]&&(o[e]="".concat(t[e]," ").concat(n[e]))})),o}},function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var r=n(1),o=n(28);function i(e){return e&&"object"===Object(o.a)(e)&&e.constructor===Object}function a(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{clone:!0},o=n.clone?Object(r.a)({},e):e;return i(e)&&i(t)&&Object.keys(t).forEach((function(r){"__proto__"!==r&&(i(t[r])&&r in e?o[r]=a(e[r],t[r],n):o[r]=t[r])})),o}},function(e,t,n){"use strict";function r(e){var t=e.theme,n=e.name,r=e.props;if(!t||!t.props||!t.props[n])return r;var o,i=t.props[n];for(o in i)void 0===r[o]&&(r[o]=i[o]);return r}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";var r=n(1),o=n(2),i=n(0),a=n(3),l=n(4),s=n(44),u=i.forwardRef((function(e,t){var n=e.classes,l=e.className,u=Object(o.a)(e,["classes","className"]),c=i.useContext(s.a);return i.createElement("div",Object(r.a)({className:Object(a.a)(n.root,l,"flex-start"===c.alignItems&&n.alignItemsFlexStart),ref:t},u))}));t.a=Object(l.a)((function(e){return{root:{minWidth:56,color:e.palette.action.active,flexShrink:0,display:"inline-flex"},alignItemsFlexStart:{marginTop:8}}}),{name:"MuiListItemIcon"})(u)},function(e,t,n){"use strict";var r=n(1),o=n(2),i=n(0),a=n(3),l=n(4),s=n(54),u=n(44),c=i.forwardRef((function(e,t){var n=e.children,l=e.classes,c=e.className,d=e.disableTypography,f=void 0!==d&&d,p=e.inset,h=void 0!==p&&p,m=e.primary,v=e.primaryTypographyProps,g=e.secondary,b=e.secondaryTypographyProps,y=Object(o.a)(e,["children","classes","className","disableTypography","inset","primary","primaryTypographyProps","secondary","secondaryTypographyProps"]),x=i.useContext(u.a).dense,w=null!=m?m:n;null==w||w.type===s.a||f||(w=i.createElement(s.a,Object(r.a)({variant:x?"body2":"body1",className:l.primary,component:"span",display:"block"},v),w));var O=g;return null==O||O.type===s.a||f||(O=i.createElement(s.a,Object(r.a)({variant:"body2",className:l.secondary,color:"textSecondary",display:"block"},b),O)),i.createElement("div",Object(r.a)({className:Object(a.a)(l.root,c,x&&l.dense,h&&l.inset,w&&O&&l.multiline),ref:t},y),w,O)}));t.a=Object(l.a)({root:{flex:"1 1 auto",minWidth:0,marginTop:4,marginBottom:4},multiline:{marginTop:6,marginBottom:6},dense:{},inset:{paddingLeft:56},primary:{},secondary:{}},{name:"MuiListItemText"})(c)},function(e,t,n){"use strict";var r=n(2),o=n(12),i=n(1),a=n(0),l=n(3),s=n(4),u=n(83),c=n(8),d=a.forwardRef((function(e,t){var n=e.action,o=e.classes,s=e.className,c=e.message,d=e.role,f=void 0===d?"alert":d,p=Object(r.a)(e,["action","classes","className","message","role"]);return a.createElement(u.a,Object(i.a)({role:f,square:!0,elevation:6,className:Object(l.a)(o.root,s),ref:t},p),a.createElement("div",{className:o.message},c),n?a.createElement("div",{className:o.action},n):null)}));t.a=Object(s.a)((function(e){var t="light"===e.palette.type?.8:.98,n=Object(c.c)(e.palette.background.default,t);return{root:Object(i.a)({},e.typography.body2,Object(o.a)({color:e.palette.getContrastText(n),backgroundColor:n,display:"flex",alignItems:"center",flexWrap:"wrap",padding:"6px 16px",borderRadius:e.shape.borderRadius,flexGrow:1},e.breakpoints.up("sm"),{flexGrow:"initial",minWidth:288})),message:{padding:"8px 0"},action:{display:"flex",alignItems:"center",marginLeft:"auto",paddingLeft:16,marginRight:-8}}}),{name:"MuiSnackbarContent"})(d)},function(e,t,n){"use strict";var r=n(1),o=n(2),i=n(0),a=n(3),l=n(4),s=n(6),u=i.forwardRef((function(e,t){var n=e.classes,l=e.className,u=e.color,c=void 0===u?"primary":u,d=e.disableShrink,f=void 0!==d&&d,p=e.size,h=void 0===p?40:p,m=e.style,v=e.thickness,g=void 0===v?3.6:v,b=e.value,y=void 0===b?0:b,x=e.variant,w=void 0===x?"indeterminate":x,O=Object(o.a)(e,["classes","className","color","disableShrink","size","style","thickness","value","variant"]),k={},E={},S={};if("determinate"===w||"static"===w){var j=2*Math.PI*((44-g)/2);k.strokeDasharray=j.toFixed(3),S["aria-valuenow"]=Math.round(y),k.strokeDashoffset="".concat(((100-y)/100*j).toFixed(3),"px"),E.transform="rotate(-90deg)"}return i.createElement("div",Object(r.a)({className:Object(a.a)(n.root,l,"inherit"!==c&&n["color".concat(Object(s.a)(c))],{determinate:n.determinate,indeterminate:n.indeterminate,static:n.static}[w]),style:Object(r.a)({width:h,height:h},E,m),ref:t,role:"progressbar"},S,O),i.createElement("svg",{className:n.svg,viewBox:"".concat(22," ").concat(22," ").concat(44," ").concat(44)},i.createElement("circle",{className:Object(a.a)(n.circle,f&&n.circleDisableShrink,{determinate:n.circleDeterminate,indeterminate:n.circleIndeterminate,static:n.circleStatic}[w]),style:k,cx:44,cy:44,r:(44-g)/2,fill:"none",strokeWidth:g})))}));t.a=Object(l.a)((function(e){return{root:{display:"inline-block"},static:{transition:e.transitions.create("transform")},indeterminate:{animation:"$circular-rotate 1.4s linear infinite"},determinate:{transition:e.transitions.create("transform")},colorPrimary:{color:e.palette.primary.main},colorSecondary:{color:e.palette.secondary.main},svg:{display:"block"},circle:{stroke:"currentColor"},circleStatic:{transition:e.transitions.create("stroke-dashoffset")},circleIndeterminate:{animation:"$circular-dash 1.4s ease-in-out infinite",strokeDasharray:"80px, 200px",strokeDashoffset:"0px"},circleDeterminate:{transition:e.transitions.create("stroke-dashoffset")},"@keyframes circular-rotate":{"0%":{transformOrigin:"50% 50%"},"100%":{transform:"rotate(360deg)"}},"@keyframes circular-dash":{"0%":{strokeDasharray:"1px, 200px",strokeDashoffset:"0px"},"50%":{strokeDasharray:"100px, 200px",strokeDashoffset:"-15px"},"100%":{strokeDasharray:"100px, 200px",strokeDashoffset:"-125px"}},circleDisableShrink:{animation:"none"}}}),{name:"MuiCircularProgress",flip:!1})(u)},function(e,t,n){"use strict";var r=n(1),o=n(2),i=n(0),a=n(13),l=n(50),s=n(3),u=n(19),c=n(68),d=n(30),f=n(4),p=n(175),h=n(333),m=n(83);function v(e,t){var n=0;return"number"===typeof t?n=t:"center"===t?n=e.height/2:"bottom"===t&&(n=e.height),n}function g(e,t){var n=0;return"number"===typeof t?n=t:"center"===t?n=e.width/2:"right"===t&&(n=e.width),n}function b(e){return[e.horizontal,e.vertical].map((function(e){return"number"===typeof e?"".concat(e,"px"):e})).join(" ")}function y(e){return"function"===typeof e?e():e}var x=i.forwardRef((function(e,t){var n=e.action,f=e.anchorEl,x=e.anchorOrigin,w=void 0===x?{vertical:"top",horizontal:"left"}:x,O=e.anchorPosition,k=e.anchorReference,E=void 0===k?"anchorEl":k,S=e.children,j=e.classes,C=e.className,_=e.container,P=e.elevation,T=void 0===P?8:P,M=e.getContentAnchorEl,R=e.marginThreshold,N=void 0===R?16:R,A=e.onEnter,L=e.onEntered,I=e.onEntering,z=e.onExit,D=e.onExited,F=e.onExiting,W=e.open,B=e.PaperProps,U=void 0===B?{}:B,$=e.transformOrigin,V=void 0===$?{vertical:"top",horizontal:"left"}:$,H=e.TransitionComponent,q=void 0===H?h.a:H,Y=e.transitionDuration,X=void 0===Y?"auto":Y,G=e.TransitionProps,K=void 0===G?{}:G,Q=Object(o.a)(e,["action","anchorEl","anchorOrigin","anchorPosition","anchorReference","children","classes","className","container","elevation","getContentAnchorEl","marginThreshold","onEnter","onEntered","onEntering","onExit","onExited","onExiting","open","PaperProps","transformOrigin","TransitionComponent","transitionDuration","TransitionProps"]),Z=i.useRef(),J=i.useCallback((function(e){if("anchorPosition"===E)return O;var t=y(f),n=(t&&1===t.nodeType?t:Object(u.a)(Z.current).body).getBoundingClientRect(),r=0===e?w.vertical:"center";return{top:n.top+v(n,r),left:n.left+g(n,w.horizontal)}}),[f,w.horizontal,w.vertical,O,E]),ee=i.useCallback((function(e){var t=0;if(M&&"anchorEl"===E){var n=M(e);if(n&&e.contains(n)){var r=function(e,t){for(var n=t,r=0;n&&n!==e;)r+=(n=n.parentElement).scrollTop;return r}(e,n);t=n.offsetTop+n.clientHeight/2-r||0}0}return t}),[w.vertical,E,M]),te=i.useCallback((function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return{vertical:v(e,V.vertical)+t,horizontal:g(e,V.horizontal)}}),[V.horizontal,V.vertical]),ne=i.useCallback((function(e){var t=ee(e),n={width:e.offsetWidth,height:e.offsetHeight},r=te(n,t);if("none"===E)return{top:null,left:null,transformOrigin:b(r)};var o=J(t),i=o.top-r.vertical,a=o.left-r.horizontal,l=i+n.height,s=a+n.width,u=Object(c.a)(y(f)),d=u.innerHeight-N,p=u.innerWidth-N;if(id){var m=l-d;i-=m,r.vertical+=m}if(ap){var g=s-p;a-=g,r.horizontal+=g}return{top:"".concat(Math.round(i),"px"),left:"".concat(Math.round(a),"px"),transformOrigin:b(r)}}),[f,E,J,ee,te,N]),re=i.useCallback((function(){var e=Z.current;if(e){var t=ne(e);null!==t.top&&(e.style.top=t.top),null!==t.left&&(e.style.left=t.left),e.style.transformOrigin=t.transformOrigin}}),[ne]),oe=i.useCallback((function(e){Z.current=a.findDOMNode(e)}),[]);i.useEffect((function(){W&&re()})),i.useImperativeHandle(n,(function(){return W?{updatePosition:function(){re()}}:null}),[W,re]),i.useEffect((function(){if(W){var e=Object(l.a)((function(){re()}));return window.addEventListener("resize",e),function(){e.clear(),window.removeEventListener("resize",e)}}}),[W,re]);var ie=X;"auto"!==X||q.muiSupportAuto||(ie=void 0);var ae=_||(f?Object(u.a)(y(f)).body:void 0);return i.createElement(p.a,Object(r.a)({container:ae,open:W,ref:t,BackdropProps:{invisible:!0},className:Object(s.a)(j.root,C)},Q),i.createElement(q,Object(r.a)({appear:!0,in:W,onEnter:A,onEntered:L,onExit:z,onExited:D,onExiting:F,timeout:ie},K,{onEntering:Object(d.a)((function(e,t){I&&I(e,t),re()}),K.onEntering)}),i.createElement(m.a,Object(r.a)({elevation:T,ref:oe},U,{className:Object(s.a)(j.paper,U.className)}),S)))}));t.a=Object(f.a)({root:{},paper:{position:"absolute",overflowY:"auto",overflowX:"hidden",minWidth:16,minHeight:16,maxWidth:"calc(100% - 32px)",maxHeight:"calc(100% - 32px)",outline:0}},{name:"MuiPopover"})(x)},function(e,t,n){"use strict";var r=n(0),o=n(13),i=n(29),a=n(9);var l="undefined"!==typeof window?r.useLayoutEffect:r.useEffect,s=r.forwardRef((function(e,t){var n=e.children,s=e.container,u=e.disablePortal,c=void 0!==u&&u,d=e.onRendered,f=r.useState(null),p=f[0],h=f[1],m=Object(a.a)(r.isValidElement(n)?n.ref:null,t);return l((function(){c||h(function(e){return e="function"===typeof e?e():e,o.findDOMNode(e)}(s)||document.body)}),[s,c]),l((function(){if(p&&!c)return Object(i.a)(t,p),function(){Object(i.a)(t,null)}}),[t,p,c]),l((function(){d&&(p||c)&&d()}),[d,p,c]),c?r.isValidElement(n)?r.cloneElement(n,{ref:m}):n:p?o.createPortal(n,p):p}));t.a=s},function(e,t,n){"use strict";n.d(t,"a",(function(){return d})),n.d(t,"b",(function(){return h}));var r=n(1),o=n(25),i=(n(28),n(0)),a=n(129),l=n(48),s=n(20),u=n(29);function c(e){return"undefined"!==typeof e.normalize?e.normalize("NFD").replace(/[\u0300-\u036f]/g,""):e}function d(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.ignoreAccents,n=void 0===t||t,r=e.ignoreCase,o=void 0===r||r,i=e.limit,a=e.matchFrom,l=void 0===a?"any":a,s=e.stringify,u=e.trim,d=void 0!==u&&u;return function(e,t){var r=t.inputValue,a=t.getOptionLabel,u=d?r.trim():r;o&&(u=u.toLowerCase()),n&&(u=c(u));var f=e.filter((function(e){var t=(s||a)(e);return o&&(t=t.toLowerCase()),n&&(t=c(t)),"start"===l?0===t.indexOf(u):t.indexOf(u)>-1}));return"number"===typeof i?f.slice(0,i):f}}function f(e,t){for(var n=0;nTe.length-1&&(Se(-1),Ye(-1))}),[Te,te,Ee,Ye]);var Xe=Object(s.a)((function(e){var t=e.event,n=e.index,r=e.reason,o=void 0===r?"auto":r;if(Ce.current=n,-1===n?be.current.removeAttribute("aria-activedescendant"):be.current.setAttribute("aria-activedescendant","".concat(he,"-option-").concat(n)),oe&&oe(t,-1===n?null:qe[n],o),ye.current){var i=ye.current.querySelector("[data-focus]");i&&i.removeAttribute("data-focus");var a=ye.current.parentElement.querySelector('[role="listbox"]');if(a)if(-1!==n){var l=ye.current.querySelector('[data-option-index="'.concat(n,'"]'));if(l&&(l.setAttribute("data-focus","true"),a.scrollHeight>a.clientHeight&&"mouse"!==o)){var s=l,u=a.clientHeight+a.scrollTop,c=s.offsetTop+s.offsetHeight;c>u?a.scrollTop=c-a.clientHeight:s.offsetTop-s.offsetHeight*(Y?1.3:0)1?0:e:t>e?t===e+1&&Z?-1:L||Math.abs(r)>1?e:0:t}(),i);if(Xe({index:s,reason:l,event:t}),n&&"reset"!==r)if(-1===s)be.current.value=Ae;else{var u=me(qe[s]);be.current.value=u,0===u.toLowerCase().indexOf(Ae.toLowerCase())&&Ae.length>0&&be.current.setSelectionRange(Ae.length,u.length)}}})),Ke=i.useCallback((function(){if(He){var e=te?Te[0]:Te;if(0!==qe.length&&null!=e){if(ye.current)if(F||null==e)Ce.current>=qe.length-1?Xe({index:qe.length-1}):Xe({index:Ce.current});else{var t=qe[Ce.current];if(te&&t&&-1!==f(Te,(function(e){return q(t,e)})))return;var n=f(qe,(function(t){return q(t,e)}));-1===n?Ge({diff:"reset"}):Xe({index:n})}}else Ge({diff:"reset"})}}),[0===qe.length,!te&&Te,F,Ge,Xe,He,Ae,te]),Qe=Object(s.a)((function(e){Object(u.a)(ye,e),e&&Ke()}));i.useEffect((function(){Ke()}),[Ke]);var Ze=function(e){Ue||($e(!0),ae&&ae(e))},Je=function(e,t){Ue&&($e(!1),re&&re(e,t))},et=function(e,t,n,r){Te!==t&&(ne&&ne(e,t,n,r),Me(t))},tt=i.useRef(!1),nt=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"select-option",r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"options",o=n,i=t;if(te){var a=f(i=Array.isArray(Te)?Te.slice():[],(function(e){return q(t,e)}));-1===a?i.push(t):"freeSolo"!==r&&(i.splice(a,1),o="remove-option")}Fe(e,i),et(e,i,o,{option:t}),M||Je(e,o),(!0===g||"touch"===g&&tt.current||"mouse"===g&&!tt.current)&&be.current.blur()};var rt=function(e,t){if(te){Je(e,"toggleInput");var n=Ee;-1===Ee?""===Ae&&"previous"===t&&(n=Te.length-1):((n+="next"===t?1:-1)<0&&(n=0),n===Te.length&&(n=-1)),n=function(e,t){if(-1===e)return-1;for(var n=e;;){if("next"===t&&n===Te.length||"previous"===t&&-1===n)return-1;var r=we.querySelector('[data-tag-index="'.concat(n,'"]'));if(!r||r.hasAttribute("tabindex")&&!r.disabled&&"true"!==r.getAttribute("aria-disabled"))return n;n+="next"===t?1:-1}}(n,t),Se(n),Ye(n)}},ot=function(e){ve.current=!0,Le(""),ie&&ie(e,"","clear"),et(e,te?[]:null,"clear")},it=function(e){return function(t){switch(-1!==Ee&&-1===["ArrowLeft","ArrowRight"].indexOf(t.key)&&(Se(-1),Ye(-1)),t.key){case"Home":He&&G&&(t.preventDefault(),Ge({diff:"start",direction:"next",reason:"keyboard",event:t}));break;case"End":He&&G&&(t.preventDefault(),Ge({diff:"end",direction:"previous",reason:"keyboard",event:t}));break;case"PageUp":t.preventDefault(),Ge({diff:-5,direction:"previous",reason:"keyboard",event:t}),Ze(t);break;case"PageDown":t.preventDefault(),Ge({diff:5,direction:"next",reason:"keyboard",event:t}),Ze(t);break;case"ArrowDown":t.preventDefault(),Ge({diff:1,direction:"next",reason:"keyboard",event:t}),Ze(t);break;case"ArrowUp":t.preventDefault(),Ge({diff:-1,direction:"previous",reason:"keyboard",event:t}),Ze(t);break;case"ArrowLeft":rt(t,"previous");break;case"ArrowRight":rt(t,"next");break;case"Enter":if(229===t.which)break;if(-1!==Ce.current&&He){var r=qe[Ce.current],o=!!U&&U(r);if(t.preventDefault(),o)return;nt(t,r,"select-option"),n&&be.current.setSelectionRange(be.current.value.length,be.current.value.length)}else B&&""!==Ae&&!1===Ve&&(te&&t.preventDefault(),nt(t,Ae,"create-option","freeSolo"));break;case"Escape":He?(t.preventDefault(),t.stopPropagation(),Je(t,"escape")):w&&(""!==Ae||te&&Te.length>0)&&(t.preventDefault(),t.stopPropagation(),ot(t));break;case"Backspace":if(te&&""===Ae&&Te.length>0){var i=-1===Ee?Te.length-1:Ee,a=Te.slice();a.splice(i,1),et(t,a,"remove-option",{option:Te[i]})}}e.onKeyDown&&e.onKeyDown(t)}},at=function(e){De(!0),ue&&!ve.current&&Ze(e)},lt=function(e){null===ye.current||document.activeElement!==ye.current.parentElement?(De(!1),ge.current=!0,ve.current=!1,S&&""!==Ae||(m&&-1!==Ce.current&&He?nt(e,qe[Ce.current],"blur"):m&&B&&""!==Ae?nt(e,Ae,"blur","freeSolo"):y&&Fe(e,Te),Je(e,"blur"))):be.current.focus()},st=function(e){var t=e.target.value;Ae!==t&&(Le(t),ie&&ie(e,t,"input")),""===t?P||te||et(e,null,"clear"):Ze(e)},ut=function(e){Xe({event:e,index:Number(e.currentTarget.getAttribute("data-option-index")),reason:"mouse"})},ct=function(){tt.current=!0},dt=function(e){var t=Number(e.currentTarget.getAttribute("data-option-index"));nt(e,qe[t],"select-option"),tt.current=!1},ft=function(e){return function(t){var n=Te.slice();n.splice(e,1),et(t,n,"remove-option",{option:Te[e]})}},pt=function(e){Ue?Je(e,"toggleInput"):Ze(e)},ht=function(e){e.target.getAttribute("id")!==he&&e.preventDefault()},mt=function(){be.current.focus(),fe&&ge.current&&be.current.selectionEnd-be.current.selectionStart===0&&be.current.select(),ge.current=!1},vt=function(e){""!==Ae&&Ue||pt(e)},gt=B&&Ae.length>0;gt=gt||(te?Te.length>0:null!==Te);var bt=qe;if(Y){new Map;bt=qe.reduce((function(e,t,n){var r=Y(t);return e.length>0&&e[e.length-1].group===r?e[e.length-1].options.push(t):e.push({key:n,index:n,group:r,options:[t]}),e}),[])}return{getRootProps:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Object(r.a)({"aria-owns":He?"".concat(he,"-popup"):null,role:"combobox","aria-expanded":He},e,{onKeyDown:it(e),onMouseDown:ht,onClick:mt})},getInputLabelProps:function(){return{id:"".concat(he,"-label"),htmlFor:he}},getInputProps:function(){return{id:he,value:Ae,onBlur:lt,onFocus:at,onChange:st,onMouseDown:vt,"aria-activedescendant":He?"":null,"aria-autocomplete":n?"both":"list","aria-controls":He?"".concat(he,"-popup"):null,autoComplete:"off",ref:be,autoCapitalize:"none",spellCheck:"false"}},getClearProps:function(){return{tabIndex:-1,onClick:ot}},getPopupIndicatorProps:function(){return{tabIndex:-1,onClick:pt}},getTagProps:function(e){var t=e.index;return{key:t,"data-tag-index":t,tabIndex:-1,onDelete:ft(t)}},getListboxProps:function(){return{role:"listbox",id:"".concat(he,"-popup"),"aria-labelledby":"".concat(he,"-label"),ref:Qe,onMouseDown:function(e){e.preventDefault()}}},getOptionProps:function(e){var t=e.index,n=e.option,r=(te?Te:[Te]).some((function(e){return null!=e&&q(n,e)})),o=!!U&&U(n);return{key:t,tabIndex:-1,role:"option",id:"".concat(he,"-option-").concat(t),onMouseOver:ut,onClick:dt,onTouchStart:ct,"data-option-index":t,"aria-disabled":o,"aria-selected":r}},id:he,inputValue:Ae,value:Te,dirty:gt,popupOpen:He,focused:ze||-1!==Ee,anchorEl:we,setAnchorEl:Oe,focusedTag:Ee,groupedOptions:bt}}},function(e,t,n){"use strict";var r=n(1),o=n(2),i=n(12),a=n(0),l=n(3),s=n(4),u=n(6),c=n(175),d=n(335),f=n(174),p=n(21),h=n(83),m={enter:p.b.enteringScreen,exit:p.b.leavingScreen},v=a.forwardRef((function(e,t){var n=e.BackdropProps,i=e.children,s=e.classes,p=e.className,v=e.disableBackdropClick,g=void 0!==v&&v,b=e.disableEscapeKeyDown,y=void 0!==b&&b,x=e.fullScreen,w=void 0!==x&&x,O=e.fullWidth,k=void 0!==O&&O,E=e.maxWidth,S=void 0===E?"sm":E,j=e.onBackdropClick,C=e.onClose,_=e.onEnter,P=e.onEntered,T=e.onEntering,M=e.onEscapeKeyDown,R=e.onExit,N=e.onExited,A=e.onExiting,L=e.open,I=e.PaperComponent,z=void 0===I?h.a:I,D=e.PaperProps,F=void 0===D?{}:D,W=e.scroll,B=void 0===W?"paper":W,U=e.TransitionComponent,$=void 0===U?f.a:U,V=e.transitionDuration,H=void 0===V?m:V,q=e.TransitionProps,Y=e["aria-describedby"],X=e["aria-labelledby"],G=Object(o.a)(e,["BackdropProps","children","classes","className","disableBackdropClick","disableEscapeKeyDown","fullScreen","fullWidth","maxWidth","onBackdropClick","onClose","onEnter","onEntered","onEntering","onEscapeKeyDown","onExit","onExited","onExiting","open","PaperComponent","PaperProps","scroll","TransitionComponent","transitionDuration","TransitionProps","aria-describedby","aria-labelledby"]),K=a.useRef();return a.createElement(c.a,Object(r.a)({className:Object(l.a)(s.root,p),BackdropComponent:d.a,BackdropProps:Object(r.a)({transitionDuration:H},n),closeAfterTransition:!0},g?{disableBackdropClick:g}:{},{disableEscapeKeyDown:y,onEscapeKeyDown:M,onClose:C,open:L,ref:t},G),a.createElement($,Object(r.a)({appear:!0,in:L,timeout:H,onEnter:_,onEntering:T,onEntered:P,onExit:R,onExiting:A,onExited:N,role:"none presentation"},q),a.createElement("div",{className:Object(l.a)(s.container,s["scroll".concat(Object(u.a)(B))]),onMouseUp:function(e){e.target===e.currentTarget&&e.target===K.current&&(K.current=null,j&&j(e),!g&&C&&C(e,"backdropClick"))},onMouseDown:function(e){K.current=e.target}},a.createElement(z,Object(r.a)({elevation:24,role:"dialog","aria-describedby":Y,"aria-labelledby":X},F,{className:Object(l.a)(s.paper,s["paperScroll".concat(Object(u.a)(B))],s["paperWidth".concat(Object(u.a)(String(S)))],F.className,w&&s.paperFullScreen,k&&s.paperFullWidth)}),i))))}));t.a=Object(s.a)((function(e){return{root:{"@media print":{position:"absolute !important"}},scrollPaper:{display:"flex",justifyContent:"center",alignItems:"center"},scrollBody:{overflowY:"auto",overflowX:"hidden",textAlign:"center","&:after":{content:'""',display:"inline-block",verticalAlign:"middle",height:"100%",width:"0"}},container:{height:"100%","@media print":{height:"auto"},outline:0},paper:{margin:32,position:"relative",overflowY:"auto","@media print":{overflowY:"visible",boxShadow:"none"}},paperScrollPaper:{display:"flex",flexDirection:"column",maxHeight:"calc(100% - 64px)"},paperScrollBody:{display:"inline-block",verticalAlign:"middle",textAlign:"left"},paperWidthFalse:{maxWidth:"calc(100% - 64px)"},paperWidthXs:{maxWidth:Math.max(e.breakpoints.values.xs,444),"&$paperScrollBody":Object(i.a)({},e.breakpoints.down(Math.max(e.breakpoints.values.xs,444)+64),{maxWidth:"calc(100% - 64px)"})},paperWidthSm:{maxWidth:e.breakpoints.values.sm,"&$paperScrollBody":Object(i.a)({},e.breakpoints.down(e.breakpoints.values.sm+64),{maxWidth:"calc(100% - 64px)"})},paperWidthMd:{maxWidth:e.breakpoints.values.md,"&$paperScrollBody":Object(i.a)({},e.breakpoints.down(e.breakpoints.values.md+64),{maxWidth:"calc(100% - 64px)"})},paperWidthLg:{maxWidth:e.breakpoints.values.lg,"&$paperScrollBody":Object(i.a)({},e.breakpoints.down(e.breakpoints.values.lg+64),{maxWidth:"calc(100% - 64px)"})},paperWidthXl:{maxWidth:e.breakpoints.values.xl,"&$paperScrollBody":Object(i.a)({},e.breakpoints.down(e.breakpoints.values.xl+64),{maxWidth:"calc(100% - 64px)"})},paperFullWidth:{width:"calc(100% - 64px)"},paperFullScreen:{margin:0,width:"100%",maxWidth:"100%",height:"100%",maxHeight:"none",borderRadius:0,"&$paperScrollBody":{margin:0,maxWidth:"100%"}}}}),{name:"MuiDialog"})(v)},function(e,t,n){"use strict";var r=n(1),o=n(2),i=n(0),a=n(3),l=n(4),s=n(54),u=i.forwardRef((function(e,t){var n=e.children,l=e.classes,u=e.className,c=e.disableTypography,d=void 0!==c&&c,f=Object(o.a)(e,["children","classes","className","disableTypography"]);return i.createElement("div",Object(r.a)({className:Object(a.a)(l.root,u),ref:t},f),d?n:i.createElement(s.a,{component:"h2",variant:"h6"},n))}));t.a=Object(l.a)({root:{margin:0,padding:"16px 24px",flex:"0 0 auto"}},{name:"MuiDialogTitle"})(u)},function(e,t,n){"use strict";var r=n(1),o=n(2),i=n(0),a=n(3),l=n(4),s=i.forwardRef((function(e,t){var n=e.classes,l=e.className,s=e.dividers,u=void 0!==s&&s,c=Object(o.a)(e,["classes","className","dividers"]);return i.createElement("div",Object(r.a)({className:Object(a.a)(n.root,l,u&&n.dividers),ref:t},c))}));t.a=Object(l.a)((function(e){return{root:{flex:"1 1 auto",WebkitOverflowScrolling:"touch",overflowY:"auto",padding:"8px 24px","&:first-child":{paddingTop:20}},dividers:{padding:"16px 24px",borderTop:"1px solid ".concat(e.palette.divider),borderBottom:"1px solid ".concat(e.palette.divider)}}}),{name:"MuiDialogContent"})(s)},function(e,t,n){"use strict";var r=n(1),o=n(0),i=n(4),a=n(54),l=o.forwardRef((function(e,t){return o.createElement(a.a,Object(r.a)({component:"p",variant:"body1",color:"textSecondary",ref:t},e))}));t.a=Object(i.a)({root:{marginBottom:12}},{name:"MuiDialogContentText"})(l)},function(e,t,n){"use strict";var r=n(2),o=n(1),i=n(0),a=n(3),l=n(4),s=[0,1,2,3,4,5,6,7,8,9,10],u=["auto",!0,1,2,3,4,5,6,7,8,9,10,11,12];function c(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=parseFloat(e);return"".concat(n/t).concat(String(e).replace(String(n),"")||"px")}var d=i.forwardRef((function(e,t){var n=e.alignContent,l=void 0===n?"stretch":n,s=e.alignItems,u=void 0===s?"stretch":s,c=e.classes,d=e.className,f=e.component,p=void 0===f?"div":f,h=e.container,m=void 0!==h&&h,v=e.direction,g=void 0===v?"row":v,b=e.item,y=void 0!==b&&b,x=e.justify,w=e.justifyContent,O=void 0===w?"flex-start":w,k=e.lg,E=void 0!==k&&k,S=e.md,j=void 0!==S&&S,C=e.sm,_=void 0!==C&&C,P=e.spacing,T=void 0===P?0:P,M=e.wrap,R=void 0===M?"wrap":M,N=e.xl,A=void 0!==N&&N,L=e.xs,I=void 0!==L&&L,z=e.zeroMinWidth,D=void 0!==z&&z,F=Object(r.a)(e,["alignContent","alignItems","classes","className","component","container","direction","item","justify","justifyContent","lg","md","sm","spacing","wrap","xl","xs","zeroMinWidth"]),W=Object(a.a)(c.root,d,m&&[c.container,0!==T&&c["spacing-xs-".concat(String(T))]],y&&c.item,D&&c.zeroMinWidth,"row"!==g&&c["direction-xs-".concat(String(g))],"wrap"!==R&&c["wrap-xs-".concat(String(R))],"stretch"!==u&&c["align-items-xs-".concat(String(u))],"stretch"!==l&&c["align-content-xs-".concat(String(l))],"flex-start"!==(x||O)&&c["justify-content-xs-".concat(String(x||O))],!1!==I&&c["grid-xs-".concat(String(I))],!1!==_&&c["grid-sm-".concat(String(_))],!1!==j&&c["grid-md-".concat(String(j))],!1!==E&&c["grid-lg-".concat(String(E))],!1!==A&&c["grid-xl-".concat(String(A))]);return i.createElement(p,Object(o.a)({className:W,ref:t},F))})),f=Object(l.a)((function(e){return Object(o.a)({root:{},container:{boxSizing:"border-box",display:"flex",flexWrap:"wrap",width:"100%"},item:{boxSizing:"border-box",margin:"0"},zeroMinWidth:{minWidth:0},"direction-xs-column":{flexDirection:"column"},"direction-xs-column-reverse":{flexDirection:"column-reverse"},"direction-xs-row-reverse":{flexDirection:"row-reverse"},"wrap-xs-nowrap":{flexWrap:"nowrap"},"wrap-xs-wrap-reverse":{flexWrap:"wrap-reverse"},"align-items-xs-center":{alignItems:"center"},"align-items-xs-flex-start":{alignItems:"flex-start"},"align-items-xs-flex-end":{alignItems:"flex-end"},"align-items-xs-baseline":{alignItems:"baseline"},"align-content-xs-center":{alignContent:"center"},"align-content-xs-flex-start":{alignContent:"flex-start"},"align-content-xs-flex-end":{alignContent:"flex-end"},"align-content-xs-space-between":{alignContent:"space-between"},"align-content-xs-space-around":{alignContent:"space-around"},"justify-content-xs-center":{justifyContent:"center"},"justify-content-xs-flex-end":{justifyContent:"flex-end"},"justify-content-xs-space-between":{justifyContent:"space-between"},"justify-content-xs-space-around":{justifyContent:"space-around"},"justify-content-xs-space-evenly":{justifyContent:"space-evenly"}},function(e,t){var n={};return s.forEach((function(r){var o=e.spacing(r);0!==o&&(n["spacing-".concat(t,"-").concat(r)]={margin:"-".concat(c(o,2)),width:"calc(100% + ".concat(c(o),")"),"& > $item":{padding:c(o,2)}})})),n}(e,"xs"),e.breakpoints.keys.reduce((function(t,n){return function(e,t,n){var r={};u.forEach((function(e){var t="grid-".concat(n,"-").concat(e);if(!0!==e)if("auto"!==e){var o="".concat(Math.round(e/12*1e8)/1e6,"%");r[t]={flexBasis:o,flexGrow:0,maxWidth:o}}else r[t]={flexBasis:"auto",flexGrow:0,maxWidth:"none"};else r[t]={flexBasis:0,flexGrow:1,maxWidth:"100%"}})),"xs"===n?Object(o.a)(e,r):e[t.breakpoints.up(n)]=r}(t,e,n),t}),{}))}),{name:"MuiGrid"})(d);t.a=f},function(e,t,n){"use strict";var r=n(1),o=n(2),i=n(0),a=n(3),l=n(177),s=n(4),u=i.forwardRef((function(e,t){var n=e.disableUnderline,s=e.classes,u=e.fullWidth,c=void 0!==u&&u,d=e.inputComponent,f=void 0===d?"input":d,p=e.multiline,h=void 0!==p&&p,m=e.type,v=void 0===m?"text":m,g=Object(o.a)(e,["disableUnderline","classes","fullWidth","inputComponent","multiline","type"]);return i.createElement(l.a,Object(r.a)({classes:Object(r.a)({},s,{root:Object(a.a)(s.root,!n&&s.underline),underline:null}),fullWidth:c,inputComponent:f,multiline:h,ref:t,type:v},g))}));u.muiName="Input",t.a=Object(s.a)((function(e){var t="light"===e.palette.type?"rgba(0, 0, 0, 0.42)":"rgba(255, 255, 255, 0.7)";return{root:{position:"relative"},formControl:{"label + &":{marginTop:16}},focused:{},disabled:{},colorSecondary:{"&$underline:after":{borderBottomColor:e.palette.secondary.main}},underline:{"&:after":{borderBottom:"2px solid ".concat(e.palette.primary.main),left:0,bottom:0,content:'""',position:"absolute",right:0,transform:"scaleX(0)",transition:e.transitions.create("transform",{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut}),pointerEvents:"none"},"&$focused:after":{transform:"scaleX(1)"},"&$error:after":{borderBottomColor:e.palette.error.main,transform:"scaleX(1)"},"&:before":{borderBottom:"1px solid ".concat(t),left:0,bottom:0,content:'"\\00a0"',position:"absolute",right:0,transition:e.transitions.create("border-bottom-color",{duration:e.transitions.duration.shorter}),pointerEvents:"none"},"&:hover:not($disabled):before":{borderBottom:"2px solid ".concat(e.palette.text.primary),"@media (hover: none)":{borderBottom:"1px solid ".concat(t)}},"&$disabled:before":{borderBottomStyle:"dotted"}},error:{},marginDense:{},multiline:{},fullWidth:{},input:{},inputMarginDense:{},inputMultiline:{},inputTypeSearch:{}}}),{name:"MuiInput"})(u)},function(e,t,n){"use strict";var r=n(1),o=n(2),i=n(0),a=n(3),l=n(177),s=n(4),u=i.forwardRef((function(e,t){var n=e.disableUnderline,s=e.classes,u=e.fullWidth,c=void 0!==u&&u,d=e.inputComponent,f=void 0===d?"input":d,p=e.multiline,h=void 0!==p&&p,m=e.type,v=void 0===m?"text":m,g=Object(o.a)(e,["disableUnderline","classes","fullWidth","inputComponent","multiline","type"]);return i.createElement(l.a,Object(r.a)({classes:Object(r.a)({},s,{root:Object(a.a)(s.root,!n&&s.underline),underline:null}),fullWidth:c,inputComponent:f,multiline:h,ref:t,type:v},g))}));u.muiName="Input",t.a=Object(s.a)((function(e){var t="light"===e.palette.type,n=t?"rgba(0, 0, 0, 0.42)":"rgba(255, 255, 255, 0.7)",r=t?"rgba(0, 0, 0, 0.09)":"rgba(255, 255, 255, 0.09)";return{root:{position:"relative",backgroundColor:r,borderTopLeftRadius:e.shape.borderRadius,borderTopRightRadius:e.shape.borderRadius,transition:e.transitions.create("background-color",{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut}),"&:hover":{backgroundColor:t?"rgba(0, 0, 0, 0.13)":"rgba(255, 255, 255, 0.13)","@media (hover: none)":{backgroundColor:r}},"&$focused":{backgroundColor:t?"rgba(0, 0, 0, 0.09)":"rgba(255, 255, 255, 0.09)"},"&$disabled":{backgroundColor:t?"rgba(0, 0, 0, 0.12)":"rgba(255, 255, 255, 0.12)"}},colorSecondary:{"&$underline:after":{borderBottomColor:e.palette.secondary.main}},underline:{"&:after":{borderBottom:"2px solid ".concat(e.palette.primary.main),left:0,bottom:0,content:'""',position:"absolute",right:0,transform:"scaleX(0)",transition:e.transitions.create("transform",{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut}),pointerEvents:"none"},"&$focused:after":{transform:"scaleX(1)"},"&$error:after":{borderBottomColor:e.palette.error.main,transform:"scaleX(1)"},"&:before":{borderBottom:"1px solid ".concat(n),left:0,bottom:0,content:'"\\00a0"',position:"absolute",right:0,transition:e.transitions.create("border-bottom-color",{duration:e.transitions.duration.shorter}),pointerEvents:"none"},"&:hover:before":{borderBottom:"1px solid ".concat(e.palette.text.primary)},"&$disabled:before":{borderBottomStyle:"dotted"}},focused:{},disabled:{},adornedStart:{paddingLeft:12},adornedEnd:{paddingRight:12},error:{},marginDense:{},multiline:{padding:"27px 12px 10px","&$marginDense":{paddingTop:23,paddingBottom:6}},input:{padding:"27px 12px 10px","&:-webkit-autofill":{WebkitBoxShadow:"light"===e.palette.type?null:"0 0 0 100px #266798 inset",WebkitTextFillColor:"light"===e.palette.type?null:"#fff",caretColor:"light"===e.palette.type?null:"#fff",borderTopLeftRadius:"inherit",borderTopRightRadius:"inherit"}},inputMarginDense:{paddingTop:23,paddingBottom:6},inputHiddenLabel:{paddingTop:18,paddingBottom:19,"&$inputMarginDense":{paddingTop:10,paddingBottom:11}},inputMultiline:{padding:0},inputAdornedStart:{paddingLeft:0},inputAdornedEnd:{paddingRight:0}}}),{name:"MuiFilledInput"})(u)},function(e,t,n){"use strict";var r=n(1),o=n(2),i=n(0),a=n(3),l=n(60),s=n(4),u=n(6),c=n(51),d=n(45),f=i.forwardRef((function(e,t){var n=e.children,s=e.classes,f=e.className,p=e.color,h=void 0===p?"primary":p,m=e.component,v=void 0===m?"div":m,g=e.disabled,b=void 0!==g&&g,y=e.error,x=void 0!==y&&y,w=e.fullWidth,O=void 0!==w&&w,k=e.focused,E=e.hiddenLabel,S=void 0!==E&&E,j=e.margin,C=void 0===j?"none":j,_=e.required,P=void 0!==_&&_,T=e.size,M=e.variant,R=void 0===M?"standard":M,N=Object(o.a)(e,["children","classes","className","color","component","disabled","error","fullWidth","focused","hiddenLabel","margin","required","size","variant"]),A=i.useState((function(){var e=!1;return n&&i.Children.forEach(n,(function(t){if(Object(c.a)(t,["Input","Select"])){var n=Object(c.a)(t,["Select"])?t.props.input:t;n&&Object(l.a)(n.props)&&(e=!0)}})),e})),L=A[0],I=A[1],z=i.useState((function(){var e=!1;return n&&i.Children.forEach(n,(function(t){Object(c.a)(t,["Input","Select"])&&Object(l.b)(t.props,!0)&&(e=!0)})),e})),D=z[0],F=z[1],W=i.useState(!1),B=W[0],U=W[1],$=void 0!==k?k:B;b&&$&&U(!1);var V=i.useCallback((function(){F(!0)}),[]),H={adornedStart:L,setAdornedStart:I,color:h,disabled:b,error:x,filled:D,focused:$,fullWidth:O,hiddenLabel:S,margin:("small"===T?"dense":void 0)||C,onBlur:function(){U(!1)},onEmpty:i.useCallback((function(){F(!1)}),[]),onFilled:V,onFocus:function(){U(!0)},registerEffect:void 0,required:P,variant:R};return i.createElement(d.a.Provider,{value:H},i.createElement(v,Object(r.a)({className:Object(a.a)(s.root,f,"none"!==C&&s["margin".concat(Object(u.a)(C))],O&&s.fullWidth),ref:t},N),n))}));t.a=Object(s.a)({root:{display:"inline-flex",flexDirection:"column",position:"relative",minWidth:0,padding:0,margin:0,border:0,verticalAlign:"top"},marginNormal:{marginTop:16,marginBottom:8},marginDense:{marginTop:8,marginBottom:4},fullWidth:{width:"100%"}},{name:"MuiFormControl"})(f)},function(e,t,n){"use strict";var r=n(1),o=n(2),i=n(0),a=n(3),l=n(36),s=n(31),u=n(4),c=n(336),d=i.forwardRef((function(e,t){var n=e.classes,u=e.className,d=e.disableAnimation,f=void 0!==d&&d,p=(e.margin,e.shrink),h=(e.variant,Object(o.a)(e,["classes","className","disableAnimation","margin","shrink","variant"])),m=Object(s.a)(),v=p;"undefined"===typeof v&&m&&(v=m.filled||m.focused||m.adornedStart);var g=Object(l.a)({props:e,muiFormControl:m,states:["margin","variant"]});return i.createElement(c.a,Object(r.a)({"data-shrink":v,className:Object(a.a)(n.root,u,m&&n.formControl,!f&&n.animated,v&&n.shrink,"dense"===g.margin&&n.marginDense,{filled:n.filled,outlined:n.outlined}[g.variant]),classes:{focused:n.focused,disabled:n.disabled,error:n.error,required:n.required,asterisk:n.asterisk},ref:t},h))}));t.a=Object(u.a)((function(e){return{root:{display:"block",transformOrigin:"top left"},focused:{},disabled:{},error:{},required:{},asterisk:{},formControl:{position:"absolute",left:0,top:0,transform:"translate(0, 24px) scale(1)"},marginDense:{transform:"translate(0, 21px) scale(1)"},shrink:{transform:"translate(0, 1.5px) scale(0.75)",transformOrigin:"top left"},animated:{transition:e.transitions.create(["color","transform"],{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut})},filled:{zIndex:1,pointerEvents:"none",transform:"translate(12px, 20px) scale(1)","&$marginDense":{transform:"translate(12px, 17px) scale(1)"},"&$shrink":{transform:"translate(12px, 10px) scale(0.75)","&$marginDense":{transform:"translate(12px, 7px) scale(0.75)"}}},outlined:{zIndex:1,pointerEvents:"none",transform:"translate(14px, 20px) scale(1)","&$marginDense":{transform:"translate(14px, 12px) scale(1)"},"&$shrink":{transform:"translate(14px, -6px) scale(0.75)"}}}}),{name:"MuiInputLabel"})(d)},function(e,t,n){"use strict";var r=n(1),o=n(2),i=n(0),a=n(3),l=n(4),s=n(44),u=i.forwardRef((function(e,t){var n=e.children,l=e.classes,u=e.className,c=e.component,d=void 0===c?"ul":c,f=e.dense,p=void 0!==f&&f,h=e.disablePadding,m=void 0!==h&&h,v=e.subheader,g=Object(o.a)(e,["children","classes","className","component","dense","disablePadding","subheader"]),b=i.useMemo((function(){return{dense:p}}),[p]);return i.createElement(s.a.Provider,{value:b},i.createElement(d,Object(r.a)({className:Object(a.a)(l.root,u,p&&l.dense,!m&&l.padding,v&&l.subheader),ref:t},g),v,n))}));t.a=Object(l.a)({root:{listStyle:"none",margin:0,padding:0,position:"relative"},padding:{paddingTop:8,paddingBottom:8},dense:{},subheader:{paddingTop:0}},{name:"MuiList"})(u)},function(e,t,n){"use strict";var r=n(1),o=n(2),i=n(0),a=n(3),l=n(4),s=n(6),u=i.forwardRef((function(e,t){var n=e.classes,l=e.className,u=e.color,c=void 0===u?"default":u,d=e.component,f=void 0===d?"li":d,p=e.disableGutters,h=void 0!==p&&p,m=e.disableSticky,v=void 0!==m&&m,g=e.inset,b=void 0!==g&&g,y=Object(o.a)(e,["classes","className","color","component","disableGutters","disableSticky","inset"]);return i.createElement(f,Object(r.a)({className:Object(a.a)(n.root,l,"default"!==c&&n["color".concat(Object(s.a)(c))],b&&n.inset,!v&&n.sticky,!h&&n.gutters),ref:t},y))}));t.a=Object(l.a)((function(e){return{root:{boxSizing:"border-box",lineHeight:"48px",listStyle:"none",color:e.palette.text.secondary,fontFamily:e.typography.fontFamily,fontWeight:e.typography.fontWeightMedium,fontSize:e.typography.pxToRem(14)},colorPrimary:{color:e.palette.primary.main},colorInherit:{color:"inherit"},gutters:{paddingLeft:16,paddingRight:16},inset:{paddingLeft:72},sticky:{position:"sticky",top:0,zIndex:1,backgroundColor:"inherit"}}}),{name:"MuiListSubheader"})(u)},function(e,t,n){"use strict";var r=n(1),o=n(2),i=n(0),a=n(3),l=n(4),s=n(8),u=n(130),c=n(6),d=i.forwardRef((function(e,t){var n=e.edge,l=void 0!==n&&n,s=e.children,d=e.classes,f=e.className,p=e.color,h=void 0===p?"default":p,m=e.disabled,v=void 0!==m&&m,g=e.disableFocusRipple,b=void 0!==g&&g,y=e.size,x=void 0===y?"medium":y,w=Object(o.a)(e,["edge","children","classes","className","color","disabled","disableFocusRipple","size"]);return i.createElement(u.a,Object(r.a)({className:Object(a.a)(d.root,f,"default"!==h&&d["color".concat(Object(c.a)(h))],v&&d.disabled,"small"===x&&d["size".concat(Object(c.a)(x))],{start:d.edgeStart,end:d.edgeEnd}[l]),centerRipple:!0,focusRipple:!b,disabled:v,ref:t},w),i.createElement("span",{className:d.label},s))}));t.a=Object(l.a)((function(e){return{root:{textAlign:"center",flex:"0 0 auto",fontSize:e.typography.pxToRem(24),padding:12,borderRadius:"50%",overflow:"visible",color:e.palette.action.active,transition:e.transitions.create("background-color",{duration:e.transitions.duration.shortest}),"&:hover":{backgroundColor:Object(s.a)(e.palette.action.active,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},"&$disabled":{backgroundColor:"transparent",color:e.palette.action.disabled}},edgeStart:{marginLeft:-12,"$sizeSmall&":{marginLeft:-3}},edgeEnd:{marginRight:-12,"$sizeSmall&":{marginRight:-3}},colorInherit:{color:"inherit"},colorPrimary:{color:e.palette.primary.main,"&:hover":{backgroundColor:Object(s.a)(e.palette.primary.main,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},colorSecondary:{color:e.palette.secondary.main,"&:hover":{backgroundColor:Object(s.a)(e.palette.secondary.main,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},disabled:{},sizeSmall:{padding:3,fontSize:e.typography.pxToRem(18)},label:{width:"100%",display:"flex",alignItems:"inherit",justifyContent:"inherit"}}}),{name:"MuiIconButton"})(d)},function(e,t,n){"use strict";var r=n(1),o=n(2),i=n(0),a=n(3),l=n(4),s=i.forwardRef((function(e,t){var n=e.disableSpacing,l=void 0!==n&&n,s=e.classes,u=e.className,c=Object(o.a)(e,["disableSpacing","classes","className"]);return i.createElement("div",Object(r.a)({className:Object(a.a)(s.root,u,!l&&s.spacing),ref:t},c))}));t.a=Object(l.a)({root:{display:"flex",alignItems:"center",padding:8,justifyContent:"flex-end",flex:"0 0 auto"},spacing:{"& > :not(:first-child)":{marginLeft:8}}},{name:"MuiDialogActions"})(s)},function(e,t,n){"use strict";var r=n(2),o=n(12),i=n(1),a=n(0),l=n(3),s=n(4),u=n(332),c=a.forwardRef((function(e,t){var n,o=e.classes,s=e.className,c=e.component,d=void 0===c?"li":c,f=e.disableGutters,p=void 0!==f&&f,h=e.ListItemClasses,m=e.role,v=void 0===m?"menuitem":m,g=e.selected,b=e.tabIndex,y=Object(r.a)(e,["classes","className","component","disableGutters","ListItemClasses","role","selected","tabIndex"]);return e.disabled||(n=void 0!==b?b:-1),a.createElement(u.a,Object(i.a)({button:!0,role:v,tabIndex:n,component:d,selected:g,disableGutters:p,classes:Object(i.a)({dense:o.dense},h),className:Object(l.a)(o.root,s,g&&o.selected,!p&&o.gutters),ref:t},y))}));t.a=Object(s.a)((function(e){return{root:Object(i.a)({},e.typography.body1,Object(o.a)({minHeight:48,paddingTop:6,paddingBottom:6,boxSizing:"border-box",width:"auto",overflow:"hidden",whiteSpace:"nowrap"},e.breakpoints.up("sm"),{minHeight:"auto"})),gutters:{},selected:{},dense:Object(i.a)({},e.typography.body2,{minHeight:"auto"})}}),{name:"MuiMenuItem"})(c)},function(e,t,n){"use strict";var r=n(1),o=n(337),i=n(52);t.a=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object(o.a)(e,Object(r.a)({defaultTheme:i.a},t))}},function(e,t,n){"use strict";var r=n(1),o=n(2),i=n(0),a=n(3),l=n(31),s=n(4),u=n(54),c=n(6),d=i.forwardRef((function(e,t){e.checked;var n=e.classes,s=e.className,d=e.control,f=e.disabled,p=(e.inputRef,e.label),h=e.labelPlacement,m=void 0===h?"end":h,v=(e.name,e.onChange,e.value,Object(o.a)(e,["checked","classes","className","control","disabled","inputRef","label","labelPlacement","name","onChange","value"])),g=Object(l.a)(),b=f;"undefined"===typeof b&&"undefined"!==typeof d.props.disabled&&(b=d.props.disabled),"undefined"===typeof b&&g&&(b=g.disabled);var y={disabled:b};return["checked","name","onChange","value","inputRef"].forEach((function(t){"undefined"===typeof d.props[t]&&"undefined"!==typeof e[t]&&(y[t]=e[t])})),i.createElement("label",Object(r.a)({className:Object(a.a)(n.root,s,"end"!==m&&n["labelPlacement".concat(Object(c.a)(m))],b&&n.disabled),ref:t},v),i.cloneElement(d,y),i.createElement(u.a,{component:"span",className:Object(a.a)(n.label,b&&n.disabled)},p))}));t.a=Object(s.a)((function(e){return{root:{display:"inline-flex",alignItems:"center",cursor:"pointer",verticalAlign:"middle",WebkitTapHighlightColor:"transparent",marginLeft:-11,marginRight:16,"&$disabled":{cursor:"default"}},labelPlacementStart:{flexDirection:"row-reverse",marginLeft:16,marginRight:-11},labelPlacementTop:{flexDirection:"column-reverse",marginLeft:16},labelPlacementBottom:{flexDirection:"column",marginLeft:16},disabled:{},label:{"&$disabled":{color:e.palette.text.disabled}}}}),{name:"MuiFormControlLabel"})(d)},function(e,t,n){"use strict";var r=n(1),o=n(2),i=n(0),a=n(3),l=n(83),s=n(4),u=i.forwardRef((function(e,t){var n=e.classes,s=e.className,u=e.raised,c=void 0!==u&&u,d=Object(o.a)(e,["classes","className","raised"]);return i.createElement(l.a,Object(r.a)({className:Object(a.a)(n.root,s),elevation:c?8:1,ref:t},d))}));t.a=Object(s.a)({root:{overflow:"hidden"}},{name:"MuiCard"})(u)},function(e,t,n){"use strict";var r=n(1),o=n(2),i=n(0),a=n(3),l=n(4),s=i.forwardRef((function(e,t){var n=e.classes,l=e.className,s=e.component,u=void 0===s?"div":s,c=Object(o.a)(e,["classes","className","component"]);return i.createElement(u,Object(r.a)({className:Object(a.a)(n.root,l),ref:t},c))}));t.a=Object(l.a)({root:{padding:16,"&:last-child":{paddingBottom:24}}},{name:"MuiCardContent"})(s)},function(e,t,n){"use strict";var r=n(1),o=n(2),i=n(0),a=(n(67),n(3)),l=n(6),s=n(8),u=n(4);n(334).a.styles;var c=i.forwardRef((function(e,t){var n=e.children,s=e.classes,u=e.className,c=e.color,d=void 0===c?"default":c,f=e.component,p=void 0===f?"div":f,h=e.disabled,m=void 0!==h&&h,v=e.disableElevation,g=void 0!==v&&v,b=e.disableFocusRipple,y=void 0!==b&&b,x=e.disableRipple,w=void 0!==x&&x,O=e.fullWidth,k=void 0!==O&&O,E=e.orientation,S=void 0===E?"horizontal":E,j=e.size,C=void 0===j?"medium":j,_=e.variant,P=void 0===_?"outlined":_,T=Object(o.a)(e,["children","classes","className","color","component","disabled","disableElevation","disableFocusRipple","disableRipple","fullWidth","orientation","size","variant"]),M=Object(a.a)(s.grouped,s["grouped".concat(Object(l.a)(S))],s["grouped".concat(Object(l.a)(P))],s["grouped".concat(Object(l.a)(P)).concat(Object(l.a)(S))],s["grouped".concat(Object(l.a)(P)).concat("default"!==d?Object(l.a)(d):"")],m&&s.disabled);return i.createElement(p,Object(r.a)({role:"group",className:Object(a.a)(s.root,u,k&&s.fullWidth,g&&s.disableElevation,"contained"===P&&s.contained,"vertical"===S&&s.vertical),ref:t},T),i.Children.map(n,(function(e){return i.isValidElement(e)?i.cloneElement(e,{className:Object(a.a)(M,e.props.className),color:e.props.color||d,disabled:e.props.disabled||m,disableElevation:e.props.disableElevation||g,disableFocusRipple:y,disableRipple:w,fullWidth:k,size:e.props.size||C,variant:e.props.variant||P}):null})))}));t.a=Object(u.a)((function(e){return{root:{display:"inline-flex",borderRadius:e.shape.borderRadius},contained:{boxShadow:e.shadows[2]},disableElevation:{boxShadow:"none"},disabled:{},fullWidth:{width:"100%"},vertical:{flexDirection:"column"},grouped:{minWidth:40},groupedHorizontal:{"&:not(:first-child)":{borderTopLeftRadius:0,borderBottomLeftRadius:0},"&:not(:last-child)":{borderTopRightRadius:0,borderBottomRightRadius:0}},groupedVertical:{"&:not(:first-child)":{borderTopRightRadius:0,borderTopLeftRadius:0},"&:not(:last-child)":{borderBottomRightRadius:0,borderBottomLeftRadius:0}},groupedText:{},groupedTextHorizontal:{"&:not(:last-child)":{borderRight:"1px solid ".concat("light"===e.palette.type?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)")}},groupedTextVertical:{"&:not(:last-child)":{borderBottom:"1px solid ".concat("light"===e.palette.type?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)")}},groupedTextPrimary:{"&:not(:last-child)":{borderColor:Object(s.a)(e.palette.primary.main,.5)}},groupedTextSecondary:{"&:not(:last-child)":{borderColor:Object(s.a)(e.palette.secondary.main,.5)}},groupedOutlined:{},groupedOutlinedHorizontal:{"&:not(:first-child)":{marginLeft:-1},"&:not(:last-child)":{borderRightColor:"transparent"}},groupedOutlinedVertical:{"&:not(:first-child)":{marginTop:-1},"&:not(:last-child)":{borderBottomColor:"transparent"}},groupedOutlinedPrimary:{"&:hover":{borderColor:e.palette.primary.main}},groupedOutlinedSecondary:{"&:hover":{borderColor:e.palette.secondary.main}},groupedContained:{boxShadow:"none"},groupedContainedHorizontal:{"&:not(:last-child)":{borderRight:"1px solid ".concat(e.palette.grey[400]),"&$disabled":{borderRight:"1px solid ".concat(e.palette.action.disabled)}}},groupedContainedVertical:{"&:not(:last-child)":{borderBottom:"1px solid ".concat(e.palette.grey[400]),"&$disabled":{borderBottom:"1px solid ".concat(e.palette.action.disabled)}}},groupedContainedPrimary:{"&:not(:last-child)":{borderColor:e.palette.primary.dark}},groupedContainedSecondary:{"&:not(:last-child)":{borderColor:e.palette.secondary.dark}}}}),{name:"MuiButtonGroup"})(c)},function(e,t,n){"use strict";var r=n(1),o=n(2),i=n(0),a=n(3),l=n(4),s=n(6),u=i.forwardRef((function(e,t){var n=e.classes,l=e.className,u=e.color,c=void 0===u?"inherit":u,d=e.component,f=void 0===d?"span":d,p=e.fontSize,h=void 0===p?"medium":p,m=Object(o.a)(e,["classes","className","color","component","fontSize"]);return i.createElement(f,Object(r.a)({className:Object(a.a)("material-icons",n.root,l,"inherit"!==c&&n["color".concat(Object(s.a)(c))],"default"!==h&&"medium"!==h&&n["fontSize".concat(Object(s.a)(h))]),"aria-hidden":!0,ref:t},m))}));u.muiName="Icon",t.a=Object(l.a)((function(e){return{root:{userSelect:"none",fontSize:e.typography.pxToRem(24),width:"1em",height:"1em",overflow:"hidden",flexShrink:0},colorPrimary:{color:e.palette.primary.main},colorSecondary:{color:e.palette.secondary.main},colorAction:{color:e.palette.action.active},colorError:{color:e.palette.error.main},colorDisabled:{color:e.palette.action.disabled},fontSizeInherit:{fontSize:"inherit"},fontSizeSmall:{fontSize:e.typography.pxToRem(20)},fontSizeLarge:{fontSize:e.typography.pxToRem(36)}}}),{name:"MuiIcon"})(u)},function(e,t,n){"use strict";var r=n(1),o=n(2),i=n(0),a=n(3),l=n(54),s=n(4),u=n(45),c=i.forwardRef((function(e,t){var n=e.children,s=e.classes,c=e.className,d=e.component,f=void 0===d?"div":d,p=e.disablePointerEvents,h=void 0!==p&&p,m=e.disableTypography,v=void 0!==m&&m,g=e.position,b=e.variant,y=Object(o.a)(e,["children","classes","className","component","disablePointerEvents","disableTypography","position","variant"]),x=Object(u.b)()||{},w=b;return b&&x.variant,x&&!w&&(w=x.variant),i.createElement(u.a.Provider,{value:null},i.createElement(f,Object(r.a)({className:Object(a.a)(s.root,c,"end"===g?s.positionEnd:s.positionStart,h&&s.disablePointerEvents,x.hiddenLabel&&s.hiddenLabel,"filled"===w&&s.filled,"dense"===x.margin&&s.marginDense),ref:t},y),"string"!==typeof n||v?n:i.createElement(l.a,{color:"textSecondary"},n)))}));t.a=Object(s.a)({root:{display:"flex",height:"0.01em",maxHeight:"2em",alignItems:"center",whiteSpace:"nowrap"},filled:{"&$positionStart:not($hiddenLabel)":{marginTop:16}},positionStart:{marginRight:8},positionEnd:{marginLeft:8},disablePointerEvents:{pointerEvents:"none"},hiddenLabel:{},marginDense:{}},{name:"MuiInputAdornment"})(c)},function(e,t,n){"use strict";var r=n(1),o=n(0),i=n(4),a={WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale",boxSizing:"border-box"},l=function(e){return Object(r.a)({color:e.palette.text.primary},e.typography.body2,{backgroundColor:e.palette.background.default,"@media print":{backgroundColor:e.palette.common.white}})};t.a=Object(i.a)((function(e){return{"@global":{html:a,"*, *::before, *::after":{boxSizing:"inherit"},"strong, b":{fontWeight:e.typography.fontWeightBold},body:Object(r.a)({margin:0},l(e),{"&::backdrop":{backgroundColor:e.palette.background.default}})}}}),{name:"MuiCssBaseline"})((function(e){var t=e.children,n=void 0===t?null:t;return e.classes,o.createElement(o.Fragment,null,n)}))},function(e,t,n){"use strict";var r=n(1),o=n(2),i=n(0),a=n(3),l=n(4),s=n(6),u=n(83),c=i.forwardRef((function(e,t){var n=e.classes,l=e.className,c=e.color,d=void 0===c?"primary":c,f=e.position,p=void 0===f?"fixed":f,h=Object(o.a)(e,["classes","className","color","position"]);return i.createElement(u.a,Object(r.a)({square:!0,component:"header",elevation:4,className:Object(a.a)(n.root,n["position".concat(Object(s.a)(p))],n["color".concat(Object(s.a)(d))],l,"fixed"===p&&"mui-fixed"),ref:t},h))}));t.a=Object(l.a)((function(e){var t="light"===e.palette.type?e.palette.grey[100]:e.palette.grey[900];return{root:{display:"flex",flexDirection:"column",width:"100%",boxSizing:"border-box",zIndex:e.zIndex.appBar,flexShrink:0},positionFixed:{position:"fixed",top:0,left:"auto",right:0,"@media print":{position:"absolute"}},positionAbsolute:{position:"absolute",top:0,left:"auto",right:0},positionSticky:{position:"sticky",top:0,left:"auto",right:0},positionStatic:{position:"static"},positionRelative:{position:"relative"},colorDefault:{backgroundColor:t,color:e.palette.getContrastText(t)},colorPrimary:{backgroundColor:e.palette.primary.main,color:e.palette.primary.contrastText},colorSecondary:{backgroundColor:e.palette.secondary.main,color:e.palette.secondary.contrastText},colorInherit:{color:"inherit"},colorTransparent:{backgroundColor:"transparent",color:"inherit"}}}),{name:"MuiAppBar"})(c)},function(e,t,n){"use strict";var r=n(1),o=n(2),i=n(12),a=n(0),l=n(3),s=n(4),u=a.forwardRef((function(e,t){var n=e.classes,i=e.className,s=e.component,u=void 0===s?"div":s,c=e.disableGutters,d=void 0!==c&&c,f=e.variant,p=void 0===f?"regular":f,h=Object(o.a)(e,["classes","className","component","disableGutters","variant"]);return a.createElement(u,Object(r.a)({className:Object(l.a)(n.root,n[p],i,!d&&n.gutters),ref:t},h))}));t.a=Object(s.a)((function(e){return{root:{position:"relative",display:"flex",alignItems:"center"},gutters:Object(i.a)({paddingLeft:e.spacing(2),paddingRight:e.spacing(2)},e.breakpoints.up("sm"),{paddingLeft:e.spacing(3),paddingRight:e.spacing(3)}),regular:e.mixins.toolbar,dense:{minHeight:48}}}),{name:"MuiToolbar"})(u)},function(e,t,n){"use strict";var r=n(0),o=n(49);t.a=Object(o.a)(r.createElement(r.Fragment,null,r.createElement("path",{d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"}),r.createElement("path",{d:"M12 10h-2v2H9v-2H7V9h2V7h1v2h2v1z"})),"ZoomIn")},function(e,t,n){"use strict";var r=n(0),o=n(49);t.a=Object(o.a)(r.createElement("path",{d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14zM7 9h5v1H7z"}),"ZoomOut")},function(e,t,n){"use strict";var r=n(0),o=n(49);t.a=Object(o.a)(r.createElement("path",{d:"M15 3l2.3 2.3-2.89 2.87 1.42 1.42L18.7 6.7 21 9V3h-6zM3 9l2.3-2.3 2.87 2.89 1.42-1.42L6.7 5.3 9 3H3v6zm6 12l-2.3-2.3 2.89-2.87-1.42-1.42L5.3 17.3 3 15v6h6zm12-6l-2.3 2.3-2.87-2.89-1.42 1.42 2.89 2.87L15 21h6v-6z"}),"ZoomOutMap")},function(e,t,n){"use strict";var r=n(1),o=n(2),i=n(0),a=n(3),l=n(4),s=n(8),u=i.forwardRef((function(e,t){var n=e.absolute,l=void 0!==n&&n,s=e.classes,u=e.className,c=e.component,d=void 0===c?"hr":c,f=e.flexItem,p=void 0!==f&&f,h=e.light,m=void 0!==h&&h,v=e.orientation,g=void 0===v?"horizontal":v,b=e.role,y=void 0===b?"hr"!==d?"separator":void 0:b,x=e.variant,w=void 0===x?"fullWidth":x,O=Object(o.a)(e,["absolute","classes","className","component","flexItem","light","orientation","role","variant"]);return i.createElement(d,Object(r.a)({className:Object(a.a)(s.root,u,"fullWidth"!==w&&s[w],l&&s.absolute,p&&s.flexItem,m&&s.light,"vertical"===g&&s.vertical),role:y,ref:t},O))}));t.a=Object(l.a)((function(e){return{root:{height:1,margin:0,border:"none",flexShrink:0,backgroundColor:e.palette.divider},absolute:{position:"absolute",bottom:0,left:0,width:"100%"},inset:{marginLeft:72},light:{backgroundColor:Object(s.a)(e.palette.divider,.08)},middle:{marginLeft:e.spacing(2),marginRight:e.spacing(2)},vertical:{height:"100%",width:1},flexItem:{alignSelf:"stretch",height:"auto"}}}),{name:"MuiDivider"})(u)},function(e,t,n){"use strict";var r=n(1),o=n(2),i=n(0),a=n(370),l=n(25),s=n(28),u=n(173),c=(n(67),n(3)),d=n(19),f=n(6),p=n(4),h=n(377),m=n(13),v=n(389),g=n(96),b=n(9);function y(e,t,n){return e===t?e.firstChild:t&&t.nextElementSibling?t.nextElementSibling:n?null:e.firstChild}function x(e,t,n){return e===t?n?e.firstChild:e.lastChild:t&&t.previousElementSibling?t.previousElementSibling:n?null:e.lastChild}function w(e,t){if(void 0===t)return!0;var n=e.innerText;return void 0===n&&(n=e.textContent),0!==(n=n.trim().toLowerCase()).length&&(t.repeating?n[0]===t.keys[0]:0===n.indexOf(t.keys.join("")))}function O(e,t,n,r,o,i){for(var a=!1,l=o(e,t,!!t&&n);l;){if(l===e.firstChild){if(a)return;a=!0}var s=!r&&(l.disabled||"true"===l.getAttribute("aria-disabled"));if(l.hasAttribute("tabindex")&&w(l,i)&&!s)return void l.focus();l=o(e,l,n)}}var k="undefined"===typeof window?i.useEffect:i.useLayoutEffect,E=i.forwardRef((function(e,t){var n=e.actions,a=e.autoFocus,l=void 0!==a&&a,s=e.autoFocusItem,u=void 0!==s&&s,c=e.children,f=e.className,p=e.disabledItemsFocusable,h=void 0!==p&&p,E=e.disableListWrap,S=void 0!==E&&E,j=e.onKeyDown,C=e.variant,_=void 0===C?"selectedMenu":C,P=Object(o.a)(e,["actions","autoFocus","autoFocusItem","children","className","disabledItemsFocusable","disableListWrap","onKeyDown","variant"]),T=i.useRef(null),M=i.useRef({keys:[],repeating:!0,previousKeyMatched:!0,lastTime:null});k((function(){l&&T.current.focus()}),[l]),i.useImperativeHandle(n,(function(){return{adjustStyleForScrollbar:function(e,t){var n=!T.current.style.width;if(e.clientHeight0&&(a-o.lastTime>500?(o.keys=[],o.repeating=!0,o.previousKeyMatched=!0):o.repeating&&i!==o.keys[0]&&(o.repeating=!1)),o.lastTime=a,o.keys.push(i);var l=r&&!o.repeating&&w(r,o);o.previousKeyMatched&&(l||O(t,r,!1,h,y,o))?e.preventDefault():o.previousKeyMatched=!1}j&&j(e)},tabIndex:l?0:-1},P),L)})),S=n(29),j=n(35),C={vertical:"top",horizontal:"right"},_={vertical:"top",horizontal:"left"},P=i.forwardRef((function(e,t){var n=e.autoFocus,a=void 0===n||n,l=e.children,s=e.classes,u=e.disableAutoFocusItem,d=void 0!==u&&u,f=e.MenuListProps,p=void 0===f?{}:f,v=e.onClose,g=e.onEntering,b=e.open,y=e.PaperProps,x=void 0===y?{}:y,w=e.PopoverClasses,O=e.transitionDuration,k=void 0===O?"auto":O,P=e.TransitionProps,T=(P=void 0===P?{}:P).onEntering,M=Object(o.a)(P,["onEntering"]),R=e.variant,N=void 0===R?"selectedMenu":R,A=Object(o.a)(e,["autoFocus","children","classes","disableAutoFocusItem","MenuListProps","onClose","onEntering","open","PaperProps","PopoverClasses","transitionDuration","TransitionProps","variant"]),L=Object(j.a)(),I=a&&!d&&b,z=i.useRef(null),D=i.useRef(null),F=-1;i.Children.map(l,(function(e,t){i.isValidElement(e)&&(e.props.disabled||("menu"!==N&&e.props.selected||-1===F)&&(F=t))}));var W=i.Children.map(l,(function(e,t){return t===F?i.cloneElement(e,{ref:function(t){D.current=m.findDOMNode(t),Object(S.a)(e.ref,t)}}):e}));return i.createElement(h.a,Object(r.a)({getContentAnchorEl:function(){return D.current},classes:w,onClose:v,TransitionProps:Object(r.a)({onEntering:function(e,t){z.current&&z.current.adjustStyleForScrollbar(e,L),g&&g(e,t),T&&T(e,t)}},M),anchorOrigin:"rtl"===L.direction?C:_,transformOrigin:"rtl"===L.direction?C:_,PaperProps:Object(r.a)({},x,{classes:Object(r.a)({},x.classes,{root:s.paper})}),open:b,ref:t,transitionDuration:k},A),i.createElement(E,Object(r.a)({onKeyDown:function(e){"Tab"===e.key&&(e.preventDefault(),v&&v(e,"tabKeyDown"))},actions:z,autoFocus:a&&(-1===F||d),autoFocusItem:I,variant:N},p,{className:Object(c.a)(s.list,p.className)}),W))})),T=Object(p.a)({paper:{maxHeight:"calc(100% - 96px)",WebkitOverflowScrolling:"touch"},list:{outline:0}},{name:"MuiMenu"})(P),M=n(60),R=n(48);function N(e,t){return"object"===Object(s.a)(t)&&null!==t?e===t:String(e)===String(t)}var A=i.forwardRef((function(e,t){var n=e["aria-label"],a=e.autoFocus,s=e.autoWidth,p=e.children,h=e.classes,m=e.className,v=e.defaultValue,g=e.disabled,y=e.displayEmpty,x=e.IconComponent,w=e.inputRef,O=e.labelId,k=e.MenuProps,E=void 0===k?{}:k,S=e.multiple,j=e.name,C=e.onBlur,_=e.onChange,P=e.onClose,A=e.onFocus,L=e.onOpen,I=e.open,z=e.readOnly,D=e.renderValue,F=e.SelectDisplayProps,W=void 0===F?{}:F,B=e.tabIndex,U=(e.type,e.value),$=e.variant,V=void 0===$?"standard":$,H=Object(o.a)(e,["aria-label","autoFocus","autoWidth","children","classes","className","defaultValue","disabled","displayEmpty","IconComponent","inputRef","labelId","MenuProps","multiple","name","onBlur","onChange","onClose","onFocus","onOpen","open","readOnly","renderValue","SelectDisplayProps","tabIndex","type","value","variant"]),q=Object(R.a)({controlled:U,default:v,name:"Select"}),Y=Object(l.a)(q,2),X=Y[0],G=Y[1],K=i.useRef(null),Q=i.useState(null),Z=Q[0],J=Q[1],ee=i.useRef(null!=I).current,te=i.useState(),ne=te[0],re=te[1],oe=i.useState(!1),ie=oe[0],ae=oe[1],le=Object(b.a)(t,w);i.useImperativeHandle(le,(function(){return{focus:function(){Z.focus()},node:K.current,value:X}}),[Z,X]),i.useEffect((function(){a&&Z&&Z.focus()}),[a,Z]),i.useEffect((function(){if(Z){var e=Object(d.a)(Z).getElementById(O);if(e){var t=function(){getSelection().isCollapsed&&Z.focus()};return e.addEventListener("click",t),function(){e.removeEventListener("click",t)}}}}),[O,Z]);var se,ue,ce=function(e,t){e?L&&L(t):P&&P(t),ee||(re(s?null:Z.clientWidth),ae(e))},de=i.Children.toArray(p),fe=function(e){return function(t){var n;if(S||ce(!1,t),S){n=Array.isArray(X)?X.slice():[];var r=X.indexOf(e.props.value);-1===r?n.push(e.props.value):n.splice(r,1)}else n=e.props.value;e.props.onClick&&e.props.onClick(t),X!==n&&(G(n),_&&(t.persist(),Object.defineProperty(t,"target",{writable:!0,value:{value:n,name:j}}),_(t,e)))}},pe=null!==Z&&(ee?I:ie);delete H["aria-invalid"];var he=[],me=!1;(Object(M.b)({value:X})||y)&&(D?se=D(X):me=!0);var ve=de.map((function(e){if(!i.isValidElement(e))return null;var t;if(S){if(!Array.isArray(X))throw new Error(Object(u.a)(2));(t=X.some((function(t){return N(t,e.props.value)})))&&me&&he.push(e.props.children)}else(t=N(X,e.props.value))&&me&&(ue=e.props.children);return t&&!0,i.cloneElement(e,{"aria-selected":t?"true":void 0,onClick:fe(e),onKeyUp:function(t){" "===t.key&&t.preventDefault(),e.props.onKeyUp&&e.props.onKeyUp(t)},role:"option",selected:t,value:void 0,"data-value":e.props.value})}));me&&(se=S?he.join(", "):ue);var ge,be=ne;!s&&ee&&Z&&(be=Z.clientWidth),ge="undefined"!==typeof B?B:g?null:0;var ye=W.id||(j?"mui-component-select-".concat(j):void 0);return i.createElement(i.Fragment,null,i.createElement("div",Object(r.a)({className:Object(c.a)(h.root,h.select,h.selectMenu,h[V],m,g&&h.disabled),ref:J,tabIndex:ge,role:"button","aria-disabled":g?"true":void 0,"aria-expanded":pe?"true":void 0,"aria-haspopup":"listbox","aria-label":n,"aria-labelledby":[O,ye].filter(Boolean).join(" ")||void 0,onKeyDown:function(e){if(!z){-1!==[" ","ArrowUp","ArrowDown","Enter"].indexOf(e.key)&&(e.preventDefault(),ce(!0,e))}},onMouseDown:g||z?null:function(e){0===e.button&&(e.preventDefault(),Z.focus(),ce(!0,e))},onBlur:function(e){!pe&&C&&(e.persist(),Object.defineProperty(e,"target",{writable:!0,value:{value:X,name:j}}),C(e))},onFocus:A},W,{id:ye}),function(e){return null==e||"string"===typeof e&&!e.trim()}(se)?i.createElement("span",{dangerouslySetInnerHTML:{__html:""}}):se),i.createElement("input",Object(r.a)({value:Array.isArray(X)?X.join(","):X,name:j,ref:K,"aria-hidden":!0,onChange:function(e){var t=de.map((function(e){return e.props.value})).indexOf(e.target.value);if(-1!==t){var n=de[t];G(n.props.value),_&&_(e,n)}},tabIndex:-1,className:h.nativeInput,autoFocus:a},H)),i.createElement(x,{className:Object(c.a)(h.icon,h["icon".concat(Object(f.a)(V))],pe&&h.iconOpen,g&&h.disabled)}),i.createElement(T,Object(r.a)({id:"menu-".concat(j||""),anchorEl:Z,open:pe,onClose:function(e){ce(!1,e)}},E,{MenuListProps:Object(r.a)({"aria-labelledby":O,role:"listbox",disableListWrap:!0},E.MenuListProps),PaperProps:Object(r.a)({},E.PaperProps,{style:Object(r.a)({minWidth:be},null!=E.PaperProps?E.PaperProps.style:null)})}),ve))})),L=n(36),I=n(31),z=n(49),D=Object(z.a)(i.createElement("path",{d:"M7 10l5 5 5-5z"}),"ArrowDropDown"),F=n(385),W=i.forwardRef((function(e,t){var n=e.classes,a=e.className,l=e.disabled,s=e.IconComponent,u=e.inputRef,d=e.variant,p=void 0===d?"standard":d,h=Object(o.a)(e,["classes","className","disabled","IconComponent","inputRef","variant"]);return i.createElement(i.Fragment,null,i.createElement("select",Object(r.a)({className:Object(c.a)(n.root,n.select,n[p],a,l&&n.disabled),disabled:l,ref:u||t},h)),e.multiple?null:i.createElement(s,{className:Object(c.a)(n.icon,n["icon".concat(Object(f.a)(p))],l&&n.disabled)}))})),B=function(e){return{root:{},select:{"-moz-appearance":"none","-webkit-appearance":"none",userSelect:"none",borderRadius:0,minWidth:16,cursor:"pointer","&:focus":{backgroundColor:"light"===e.palette.type?"rgba(0, 0, 0, 0.05)":"rgba(255, 255, 255, 0.05)",borderRadius:0},"&::-ms-expand":{display:"none"},"&$disabled":{cursor:"default"},"&[multiple]":{height:"auto"},"&:not([multiple]) option, &:not([multiple]) optgroup":{backgroundColor:e.palette.background.paper},"&&":{paddingRight:24}},filled:{"&&":{paddingRight:32}},outlined:{borderRadius:e.shape.borderRadius,"&&":{paddingRight:32}},selectMenu:{height:"auto",minHeight:"1.1876em",textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden"},disabled:{},icon:{position:"absolute",right:0,top:"calc(50% - 12px)",pointerEvents:"none",color:e.palette.action.active,"&$disabled":{color:e.palette.action.disabled}},iconOpen:{transform:"rotate(180deg)"},iconFilled:{right:7},iconOutlined:{right:7},nativeInput:{bottom:0,left:0,position:"absolute",opacity:0,pointerEvents:"none",width:"100%"}}},U=i.createElement(F.a,null),$=i.forwardRef((function(e,t){var n=e.children,a=e.classes,l=e.IconComponent,s=void 0===l?D:l,u=e.input,c=void 0===u?U:u,d=e.inputProps,f=(e.variant,Object(o.a)(e,["children","classes","IconComponent","input","inputProps","variant"])),p=Object(I.a)(),h=Object(L.a)({props:e,muiFormControl:p,states:["variant"]});return i.cloneElement(c,Object(r.a)({inputComponent:W,inputProps:Object(r.a)({children:n,classes:a,IconComponent:s,variant:h.variant,type:void 0},d,c?c.props.inputProps:{}),ref:t},f))}));$.muiName="Select";Object(p.a)(B,{name:"MuiNativeSelect"})($);var V=n(386),H=n(415),q=B,Y=i.createElement(F.a,null),X=i.createElement(V.a,null),G=i.forwardRef((function e(t,n){var l=t.autoWidth,s=void 0!==l&&l,u=t.children,c=t.classes,d=t.displayEmpty,f=void 0!==d&&d,p=t.IconComponent,h=void 0===p?D:p,m=t.id,v=t.input,g=t.inputProps,b=t.label,y=t.labelId,x=t.labelWidth,w=void 0===x?0:x,O=t.MenuProps,k=t.multiple,E=void 0!==k&&k,S=t.native,j=void 0!==S&&S,C=t.onClose,_=t.onOpen,P=t.open,T=t.renderValue,M=t.SelectDisplayProps,R=t.variant,N=void 0===R?"standard":R,z=Object(o.a)(t,["autoWidth","children","classes","displayEmpty","IconComponent","id","input","inputProps","label","labelId","labelWidth","MenuProps","multiple","native","onClose","onOpen","open","renderValue","SelectDisplayProps","variant"]),F=j?W:A,B=Object(I.a)(),U=Object(L.a)({props:t,muiFormControl:B,states:["variant"]}).variant||N,$=v||{standard:Y,outlined:i.createElement(H.a,{label:b,labelWidth:w}),filled:X}[U];return i.cloneElement($,Object(r.a)({inputComponent:F,inputProps:Object(r.a)({children:u,IconComponent:h,variant:U,type:void 0,multiple:E},j?{id:m}:{autoWidth:s,displayEmpty:f,labelId:y,MenuProps:O,onClose:C,onOpen:_,open:P,renderValue:T,SelectDisplayProps:Object(r.a)({id:m},M)},g,{classes:g?Object(a.a)({baseClasses:c,newClasses:g.classes,Component:e}):c},v?v.props.inputProps:{}),ref:n},z))}));G.muiName="Select";t.a=Object(p.a)(q,{name:"MuiSelect"})(G)},function(e,t,n){"use strict";var r=n(2),o=n(12),i=n(1),a=n(0),l=n(3),s=n(4),u=n(168),c=n(338),d=n(378),f=n(30),p=n(29),h=n(9);function m(e){return"function"===typeof e?e():e}var v="undefined"!==typeof window?a.useLayoutEffect:a.useEffect,g={},b=a.forwardRef((function(e,t){var n=e.anchorEl,o=e.children,l=e.container,s=e.disablePortal,b=void 0!==s&&s,y=e.keepMounted,x=void 0!==y&&y,w=e.modifiers,O=e.open,k=e.placement,E=void 0===k?"bottom":k,S=e.popperOptions,j=void 0===S?g:S,C=e.popperRef,_=e.style,P=e.transition,T=void 0!==P&&P,M=Object(r.a)(e,["anchorEl","children","container","disablePortal","keepMounted","modifiers","open","placement","popperOptions","popperRef","style","transition"]),R=a.useRef(null),N=Object(h.a)(R,t),A=a.useRef(null),L=Object(h.a)(A,C),I=a.useRef(L);v((function(){I.current=L}),[L]),a.useImperativeHandle(C,(function(){return A.current}),[]);var z=a.useState(!0),D=z[0],F=z[1],W=function(e,t){if("ltr"===(t&&t.direction||"ltr"))return e;switch(e){case"bottom-end":return"bottom-start";case"bottom-start":return"bottom-end";case"top-end":return"top-start";case"top-start":return"top-end";default:return e}}(E,Object(c.a)()),B=a.useState(W),U=B[0],$=B[1];a.useEffect((function(){A.current&&A.current.update()}));var V=a.useCallback((function(){if(R.current&&n&&O){A.current&&(A.current.destroy(),I.current(null));var e=function(e){$(e.placement)},t=(m(n),new u.a(m(n),R.current,Object(i.a)({placement:W},j,{modifiers:Object(i.a)({},b?{}:{preventOverflow:{boundariesElement:"window"}},w,j.modifiers),onCreate:Object(f.a)(e,j.onCreate),onUpdate:Object(f.a)(e,j.onUpdate)})));I.current(t)}}),[n,b,w,O,W,j]),H=a.useCallback((function(e){Object(p.a)(N,e),V()}),[N,V]),q=function(){A.current&&(A.current.destroy(),I.current(null))};if(a.useEffect((function(){return function(){q()}}),[]),a.useEffect((function(){O||T||q()}),[O,T]),!x&&!O&&(!T||D))return null;var Y={placement:U};return T&&(Y.TransitionProps={in:O,onEnter:function(){F(!1)},onExited:function(){F(!0),q()}}),a.createElement(d.a,{disablePortal:b,container:l},a.createElement("div",Object(i.a)({ref:H,role:"tooltip"},M,{style:Object(i.a)({position:"fixed",top:0,left:0,display:O||!x||T?null:"none"},_)}),"function"===typeof o?o(Y):o))})),y=n(390),x=n(83),w=n(391),O=n(413),k=n(49),E=Object(k.a)(a.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}),"Close"),S=Object(k.a)(a.createElement("path",{d:"M7 10l5 5 5-5z"}),"ArrowDropDown"),j=n(379);function C(e){e.anchorEl,e.open;var t=Object(r.a)(e,["anchorEl","open"]);return a.createElement("div",t)}var _=a.createElement(E,{fontSize:"small"}),P=a.createElement(S,null),T=a.forwardRef((function(e,t){e.autoComplete,e.autoHighlight,e.autoSelect,e.blurOnSelect;var n,o=e.ChipProps,s=e.classes,u=e.className,c=e.clearOnBlur,d=(void 0===c&&e.freeSolo,e.clearOnEscape,e.clearText),f=void 0===d?"Clear":d,p=e.closeIcon,h=void 0===p?_:p,m=e.closeText,v=void 0===m?"Close":m,g=(e.debug,e.defaultValue),k=(void 0===g&&e.multiple,e.disableClearable),E=void 0!==k&&k,S=(e.disableCloseOnSelect,e.disabled),T=void 0!==S&&S,M=(e.disabledItemsFocusable,e.disableListWrap,e.disablePortal),R=void 0!==M&&M,N=(e.filterOptions,e.filterSelectedOptions,e.forcePopupIcon),A=void 0===N?"auto":N,L=e.freeSolo,I=void 0!==L&&L,z=e.fullWidth,D=void 0!==z&&z,F=e.getLimitTagsText,W=void 0===F?function(e){return"+".concat(e)}:F,B=(e.getOptionDisabled,e.getOptionLabel),U=void 0===B?function(e){return e}:B,$=(e.getOptionSelected,e.groupBy),V=e.handleHomeEndKeys,H=(void 0===V&&e.freeSolo,e.id,e.includeInputInList,e.inputValue,e.limitTags),q=void 0===H?-1:H,Y=e.ListboxComponent,X=void 0===Y?"ul":Y,G=e.ListboxProps,K=e.loading,Q=void 0!==K&&K,Z=e.loadingText,J=void 0===Z?"Loading\u2026":Z,ee=e.multiple,te=void 0!==ee&&ee,ne=e.noOptionsText,re=void 0===ne?"No options":ne,oe=(e.onChange,e.onClose,e.onHighlightChange,e.onInputChange,e.onOpen,e.open,e.openOnFocus,e.openText),ie=void 0===oe?"Open":oe,ae=(e.options,e.PaperComponent),le=void 0===ae?x.a:ae,se=e.PopperComponent,ue=void 0===se?b:se,ce=e.popupIcon,de=void 0===ce?P:ce,fe=e.renderGroup,pe=e.renderInput,he=e.renderOption,me=e.renderTags,ve=e.selectOnFocus,ge=(void 0===ve&&e.freeSolo,e.size),be=void 0===ge?"medium":ge,ye=(e.value,Object(r.a)(e,["autoComplete","autoHighlight","autoSelect","blurOnSelect","ChipProps","classes","className","clearOnBlur","clearOnEscape","clearText","closeIcon","closeText","debug","defaultValue","disableClearable","disableCloseOnSelect","disabled","disabledItemsFocusable","disableListWrap","disablePortal","filterOptions","filterSelectedOptions","forcePopupIcon","freeSolo","fullWidth","getLimitTagsText","getOptionDisabled","getOptionLabel","getOptionSelected","groupBy","handleHomeEndKeys","id","includeInputInList","inputValue","limitTags","ListboxComponent","ListboxProps","loading","loadingText","multiple","noOptionsText","onChange","onClose","onHighlightChange","onInputChange","onOpen","open","openOnFocus","openText","options","PaperComponent","PopperComponent","popupIcon","renderGroup","renderInput","renderOption","renderTags","selectOnFocus","size","value"])),xe=R?C:ue,we=Object(j.b)(Object(i.a)({},e,{componentName:"Autocomplete"})),Oe=we.getRootProps,ke=we.getInputProps,Ee=we.getInputLabelProps,Se=we.getPopupIndicatorProps,je=we.getClearProps,Ce=we.getTagProps,_e=we.getListboxProps,Pe=we.getOptionProps,Te=we.value,Me=we.dirty,Re=we.id,Ne=we.popupOpen,Ae=we.focused,Le=we.focusedTag,Ie=we.anchorEl,ze=we.setAnchorEl,De=we.inputValue,Fe=we.groupedOptions;if(te&&Te.length>0){var We=function(e){return Object(i.a)({className:Object(l.a)(s.tag,"small"===be&&s.tagSizeSmall),disabled:T},Ce(e))};n=me?me(Te,We):Te.map((function(e,t){return a.createElement(O.a,Object(i.a)({label:U(e),size:be},We({index:t}),o))}))}if(q>-1&&Array.isArray(n)){var Be=n.length-q;!Ae&&Be>0&&(n=n.splice(0,q)).push(a.createElement("span",{className:s.tag,key:n.length},W(Be)))}var Ue=fe||function(e){return a.createElement("li",{key:e.key},a.createElement(y.a,{className:s.groupLabel,component:"div"},e.group),a.createElement("ul",{className:s.groupUl},e.children))},$e=he||U,Ve=function(e,t){var n=Pe({option:e,index:t});return a.createElement("li",Object(i.a)({},n,{className:s.option}),$e(e,{selected:n["aria-selected"],inputValue:De}))},He=!E&&!T,qe=(!I||!0===A)&&!1!==A;return a.createElement(a.Fragment,null,a.createElement("div",Object(i.a)({ref:t,className:Object(l.a)(s.root,u,Ae&&s.focused,D&&s.fullWidth,He&&s.hasClearIcon,qe&&s.hasPopupIcon)},Oe(ye)),pe({id:Re,disabled:T,fullWidth:!0,size:"small"===be?"small":void 0,InputLabelProps:Ee(),InputProps:{ref:ze,className:s.inputRoot,startAdornment:n,endAdornment:a.createElement("div",{className:s.endAdornment},He?a.createElement(w.a,Object(i.a)({},je(),{"aria-label":f,title:f,className:Object(l.a)(s.clearIndicator,Me&&s.clearIndicatorDirty)}),h):null,qe?a.createElement(w.a,Object(i.a)({},Se(),{disabled:T,"aria-label":Ne?v:ie,title:Ne?v:ie,className:Object(l.a)(s.popupIndicator,Ne&&s.popupIndicatorOpen)}),de):null)},inputProps:Object(i.a)({className:Object(l.a)(s.input,-1===Le&&s.inputFocused),disabled:T},ke())})),Ne&&Ie?a.createElement(xe,{className:Object(l.a)(s.popper,R&&s.popperDisablePortal),style:{width:Ie?Ie.clientWidth:null},role:"presentation",anchorEl:Ie,open:!0},a.createElement(le,{className:s.paper},Q&&0===Fe.length?a.createElement("div",{className:s.loading},J):null,0!==Fe.length||I||Q?null:a.createElement("div",{className:s.noOptions},re),Fe.length>0?a.createElement(X,Object(i.a)({className:s.listbox},_e(),G),Fe.map((function(e,t){return $?Ue({key:e.key,group:e.group,children:e.options.map((function(t,n){return Ve(t,e.index+n)}))}):Ve(e,t)}))):null)):null)}));t.a=Object(s.a)((function(e){var t;return{root:{"&$focused $clearIndicatorDirty":{visibility:"visible"},"@media (pointer: fine)":{"&:hover $clearIndicatorDirty":{visibility:"visible"}}},fullWidth:{width:"100%"},focused:{},tag:{margin:3,maxWidth:"calc(100% - 6px)"},tagSizeSmall:{margin:2,maxWidth:"calc(100% - 4px)"},hasPopupIcon:{},hasClearIcon:{},inputRoot:{flexWrap:"wrap","$hasPopupIcon &, $hasClearIcon &":{paddingRight:30},"$hasPopupIcon$hasClearIcon &":{paddingRight:56},"& $input":{width:0,minWidth:30},'&[class*="MuiInput-root"]':{paddingBottom:1,"& $input":{padding:4},"& $input:first-child":{padding:"6px 0"}},'&[class*="MuiInput-root"][class*="MuiInput-marginDense"]':{"& $input":{padding:"4px 4px 5px"},"& $input:first-child":{padding:"3px 0 6px"}},'&[class*="MuiOutlinedInput-root"]':{padding:9,"$hasPopupIcon &, $hasClearIcon &":{paddingRight:39},"$hasPopupIcon$hasClearIcon &":{paddingRight:65},"& $input":{padding:"9.5px 4px"},"& $input:first-child":{paddingLeft:6},"& $endAdornment":{right:9}},'&[class*="MuiOutlinedInput-root"][class*="MuiOutlinedInput-marginDense"]':{padding:6,"& $input":{padding:"4.5px 4px"}},'&[class*="MuiFilledInput-root"]':{paddingTop:19,paddingLeft:8,"$hasPopupIcon &, $hasClearIcon &":{paddingRight:39},"$hasPopupIcon$hasClearIcon &":{paddingRight:65},"& $input":{padding:"9px 4px"},"& $endAdornment":{right:9}},'&[class*="MuiFilledInput-root"][class*="MuiFilledInput-marginDense"]':{paddingBottom:1,"& $input":{padding:"4.5px 4px"}}},input:{flexGrow:1,textOverflow:"ellipsis",opacity:0},inputFocused:{opacity:1},endAdornment:{position:"absolute",right:0,top:"calc(50% - 14px)"},clearIndicator:{marginRight:-2,padding:4,visibility:"hidden"},clearIndicatorDirty:{},popupIndicator:{padding:2,marginRight:-2},popupIndicatorOpen:{transform:"rotate(180deg)"},popper:{zIndex:e.zIndex.modal},popperDisablePortal:{position:"absolute"},paper:Object(i.a)({},e.typography.body1,{overflow:"hidden",margin:"4px 0"}),listbox:{listStyle:"none",margin:0,padding:"8px 0",maxHeight:"40vh",overflow:"auto"},loading:{color:e.palette.text.secondary,padding:"14px 16px"},noOptions:{color:e.palette.text.secondary,padding:"14px 16px"},option:(t={minHeight:48,display:"flex",justifyContent:"flex-start",alignItems:"center",cursor:"pointer",paddingTop:6,boxSizing:"border-box",outline:"0",WebkitTapHighlightColor:"transparent",paddingBottom:6,paddingLeft:16,paddingRight:16},Object(o.a)(t,e.breakpoints.up("sm"),{minHeight:"auto"}),Object(o.a)(t,'&[aria-selected="true"]',{backgroundColor:e.palette.action.selected}),Object(o.a)(t,'&[data-focus="true"]',{backgroundColor:e.palette.action.hover}),Object(o.a)(t,"&:active",{backgroundColor:e.palette.action.selected}),Object(o.a)(t,'&[aria-disabled="true"]',{opacity:e.palette.action.disabledOpacity,pointerEvents:"none"}),t),groupLabel:{backgroundColor:e.palette.background.paper,top:-8},groupUl:{padding:0,"& $option":{paddingLeft:24}}}}),{name:"MuiAutocomplete"})(T)},function(e,t,n){"use strict";var r=n(1),o=n(2),i=n(0),a=n.n(i),l=n(3),s=n(58),u=n.n(s),c=n(337);function d(e,t){var n={};return Object.keys(e).forEach((function(r){-1===t.indexOf(r)&&(n[r]=e[r])})),n}var f=n(52);t.a=function(e){var t=function(e){return function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=n.name,s=Object(o.a)(n,["name"]);var f,p=i,h="function"===typeof t?function(e){return{root:function(n){return t(Object(r.a)({theme:e},n))}}}:{root:t},m=Object(c.a)(h,Object(r.a)({Component:e,name:i||e.displayName,classNamePrefix:p},s));t.filterProps&&(f=t.filterProps,delete t.filterProps),t.propTypes&&(t.propTypes,delete t.propTypes);var v=a.a.forwardRef((function(t,n){var i=t.children,s=t.className,u=t.clone,c=t.component,p=Object(o.a)(t,["children","className","clone","component"]),h=m(t),v=Object(l.a)(h.root,s),g=p;if(f&&(g=d(g,f)),u)return a.a.cloneElement(i,Object(r.a)({className:Object(l.a)(i.props.className,v)},g));if("function"===typeof i)return i(Object(r.a)({className:v},g));var b=c||e;return a.a.createElement(b,Object(r.a)({ref:n,className:v},g),i)}));return u()(v,e),v}}(e);return function(e,n){return t(e,Object(r.a)({defaultTheme:f.a},n))}}},function(e,t,n){"use strict";var r=n(1),o=n(2),i=n(0),a=n(3),l=n(175),s=n(335),u=n(4),c=n(13),d=n(50),f=n(176),p=n(9),h=n(35),m=n(21),v=n(37);function g(e,t){var n=function(e,t){var n,r=t.getBoundingClientRect();if(t.fakeTransform)n=t.fakeTransform;else{var o=window.getComputedStyle(t);n=o.getPropertyValue("-webkit-transform")||o.getPropertyValue("transform")}var i=0,a=0;if(n&&"none"!==n&&"string"===typeof n){var l=n.split("(")[1].split(")")[0].split(",");i=parseInt(l[4],10),a=parseInt(l[5],10)}return"left"===e?"translateX(".concat(window.innerWidth,"px) translateX(").concat(i-r.left,"px)"):"right"===e?"translateX(-".concat(r.left+r.width-i,"px)"):"up"===e?"translateY(".concat(window.innerHeight,"px) translateY(").concat(a-r.top,"px)"):"translateY(-".concat(r.top+r.height-a,"px)")}(e,t);n&&(t.style.webkitTransform=n,t.style.transform=n)}var b={enter:m.b.enteringScreen,exit:m.b.leavingScreen},y=i.forwardRef((function(e,t){var n=e.children,a=e.direction,l=void 0===a?"down":a,s=e.in,u=e.onEnter,m=e.onEntered,y=e.onEntering,x=e.onExit,w=e.onExited,O=e.onExiting,k=e.style,E=e.timeout,S=void 0===E?b:E,j=e.TransitionComponent,C=void 0===j?f.a:j,_=Object(o.a)(e,["children","direction","in","onEnter","onEntered","onEntering","onExit","onExited","onExiting","style","timeout","TransitionComponent"]),P=Object(h.a)(),T=i.useRef(null),M=i.useCallback((function(e){T.current=c.findDOMNode(e)}),[]),R=Object(p.a)(n.ref,M),N=Object(p.a)(R,t),A=function(e){return function(t){e&&(void 0===t?e(T.current):e(T.current,t))}},L=A((function(e,t){g(l,e),Object(v.b)(e),u&&u(e,t)})),I=A((function(e,t){var n=Object(v.a)({timeout:S,style:k},{mode:"enter"});e.style.webkitTransition=P.transitions.create("-webkit-transform",Object(r.a)({},n,{easing:P.transitions.easing.easeOut})),e.style.transition=P.transitions.create("transform",Object(r.a)({},n,{easing:P.transitions.easing.easeOut})),e.style.webkitTransform="none",e.style.transform="none",y&&y(e,t)})),z=A(m),D=A(O),F=A((function(e){var t=Object(v.a)({timeout:S,style:k},{mode:"exit"});e.style.webkitTransition=P.transitions.create("-webkit-transform",Object(r.a)({},t,{easing:P.transitions.easing.sharp})),e.style.transition=P.transitions.create("transform",Object(r.a)({},t,{easing:P.transitions.easing.sharp})),g(l,e),x&&x(e)})),W=A((function(e){e.style.webkitTransition="",e.style.transition="",w&&w(e)})),B=i.useCallback((function(){T.current&&g(l,T.current)}),[l]);return i.useEffect((function(){if(!s&&"down"!==l&&"right"!==l){var e=Object(d.a)((function(){T.current&&g(l,T.current)}));return window.addEventListener("resize",e),function(){e.clear(),window.removeEventListener("resize",e)}}}),[l,s]),i.useEffect((function(){s||B()}),[s,B]),i.createElement(C,Object(r.a)({nodeRef:T,onEnter:L,onEntered:z,onEntering:I,onExit:F,onExited:W,onExiting:D,appear:!0,in:s,timeout:S},_),(function(e,t){return i.cloneElement(n,Object(r.a)({ref:N,style:Object(r.a)({visibility:"exited"!==e||s?void 0:"hidden"},k,n.props.style)},t))}))})),x=n(83),w=n(6),O={left:"right",right:"left",top:"down",bottom:"up"};var k={enter:m.b.enteringScreen,exit:m.b.leavingScreen},E=i.forwardRef((function(e,t){var n=e.anchor,u=void 0===n?"left":n,c=e.BackdropProps,d=e.children,f=e.classes,p=e.className,m=e.elevation,v=void 0===m?16:m,g=e.ModalProps,b=(g=void 0===g?{}:g).BackdropProps,E=Object(o.a)(g,["BackdropProps"]),S=e.onClose,j=e.open,C=void 0!==j&&j,_=e.PaperProps,P=void 0===_?{}:_,T=e.SlideProps,M=e.TransitionComponent,R=void 0===M?y:M,N=e.transitionDuration,A=void 0===N?k:N,L=e.variant,I=void 0===L?"temporary":L,z=Object(o.a)(e,["anchor","BackdropProps","children","classes","className","elevation","ModalProps","onClose","open","PaperProps","SlideProps","TransitionComponent","transitionDuration","variant"]),D=Object(h.a)(),F=i.useRef(!1);i.useEffect((function(){F.current=!0}),[]);var W=function(e,t){return"rtl"===e.direction&&function(e){return-1!==["left","right"].indexOf(e)}(t)?O[t]:t}(D,u),B=i.createElement(x.a,Object(r.a)({elevation:"temporary"===I?v:0,square:!0},P,{className:Object(a.a)(f.paper,f["paperAnchor".concat(Object(w.a)(W))],P.className,"temporary"!==I&&f["paperAnchorDocked".concat(Object(w.a)(W))])}),d);if("permanent"===I)return i.createElement("div",Object(r.a)({className:Object(a.a)(f.root,f.docked,p),ref:t},z),B);var U=i.createElement(R,Object(r.a)({in:C,direction:O[W],timeout:A,appear:F.current},T),B);return"persistent"===I?i.createElement("div",Object(r.a)({className:Object(a.a)(f.root,f.docked,p),ref:t},z),U):i.createElement(l.a,Object(r.a)({BackdropProps:Object(r.a)({},c,b,{transitionDuration:A}),BackdropComponent:s.a,className:Object(a.a)(f.root,f.modal,p),open:C,onClose:S,ref:t},z,E),U)}));t.a=Object(u.a)((function(e){return{root:{},docked:{flex:"0 0 auto"},paper:{overflowY:"auto",display:"flex",flexDirection:"column",height:"100%",flex:"1 0 auto",zIndex:e.zIndex.drawer,WebkitOverflowScrolling:"touch",position:"fixed",top:0,outline:0},paperAnchorLeft:{left:0,right:"auto"},paperAnchorRight:{left:"auto",right:0},paperAnchorTop:{top:0,left:0,bottom:"auto",right:0,height:"auto",maxHeight:"100%"},paperAnchorBottom:{top:"auto",left:0,bottom:0,right:0,height:"auto",maxHeight:"100%"},paperAnchorDockedLeft:{borderRight:"1px solid ".concat(e.palette.divider)},paperAnchorDockedTop:{borderBottom:"1px solid ".concat(e.palette.divider)},paperAnchorDockedRight:{borderLeft:"1px solid ".concat(e.palette.divider)},paperAnchorDockedBottom:{borderTop:"1px solid ".concat(e.palette.divider)},modal:{}}}),{name:"MuiDrawer",flip:!1})(E)},function(e,t,n){"use strict";var r=n(2),o=n(12),i=n(1),a=n(0),l=n(3),s=n(4),u=n(21),c=n(13),d=n(19),f=n(9),p=n(20);function h(e){return e.substring(2).toLowerCase()}var m=function(e){var t=e.children,n=e.disableReactTree,r=void 0!==n&&n,o=e.mouseEvent,i=void 0===o?"onClick":o,l=e.onClickAway,s=e.touchEvent,u=void 0===s?"onTouchEnd":s,m=a.useRef(!1),v=a.useRef(null),g=a.useRef(!1),b=a.useRef(!1);a.useEffect((function(){return setTimeout((function(){g.current=!0}),0),function(){g.current=!1}}),[]);var y=a.useCallback((function(e){v.current=c.findDOMNode(e)}),[]),x=Object(f.a)(t.ref,y),w=Object(p.a)((function(e){var t=b.current;if(b.current=!1,g.current&&v.current&&!function(e){return document.documentElement.clientWidth-1;else n=!Object(d.a)(v.current).documentElement.contains(e.target)||v.current.contains(e.target);n||!r&&t||l(e)}})),O=function(e){return function(n){b.current=!0;var r=t.props[e];r&&r(n)}},k={ref:x};return!1!==u&&(k[u]=O(u)),a.useEffect((function(){if(!1!==u){var e=h(u),t=Object(d.a)(v.current),n=function(){m.current=!0};return t.addEventListener(e,w),t.addEventListener("touchmove",n),function(){t.removeEventListener(e,w),t.removeEventListener("touchmove",n)}}}),[w,u]),!1!==i&&(k[i]=O(i)),a.useEffect((function(){if(!1!==i){var e=h(i),t=Object(d.a)(v.current);return t.addEventListener(e,w),function(){t.removeEventListener(e,w)}}}),[w,i]),a.createElement(a.Fragment,null,a.cloneElement(t,k))},v=n(6),g=n(30),b=n(333),y=n(375),x=a.forwardRef((function(e,t){var n=e.action,o=e.anchorOrigin,s=(o=void 0===o?{vertical:"bottom",horizontal:"center"}:o).vertical,c=o.horizontal,d=e.autoHideDuration,f=void 0===d?null:d,h=e.children,x=e.classes,w=e.className,O=e.ClickAwayListenerProps,k=e.ContentProps,E=e.disableWindowBlurListener,S=void 0!==E&&E,j=e.message,C=e.onClose,_=e.onEnter,P=e.onEntered,T=e.onEntering,M=e.onExit,R=e.onExited,N=e.onExiting,A=e.onMouseEnter,L=e.onMouseLeave,I=e.open,z=e.resumeHideDuration,D=e.TransitionComponent,F=void 0===D?b.a:D,W=e.transitionDuration,B=void 0===W?{enter:u.b.enteringScreen,exit:u.b.leavingScreen}:W,U=e.TransitionProps,$=Object(r.a)(e,["action","anchorOrigin","autoHideDuration","children","classes","className","ClickAwayListenerProps","ContentProps","disableWindowBlurListener","message","onClose","onEnter","onEntered","onEntering","onExit","onExited","onExiting","onMouseEnter","onMouseLeave","open","resumeHideDuration","TransitionComponent","transitionDuration","TransitionProps"]),V=a.useRef(),H=a.useState(!0),q=H[0],Y=H[1],X=Object(p.a)((function(){C&&C.apply(void 0,arguments)})),G=Object(p.a)((function(e){C&&null!=e&&(clearTimeout(V.current),V.current=setTimeout((function(){X(null,"timeout")}),e))}));a.useEffect((function(){return I&&G(f),function(){clearTimeout(V.current)}}),[I,f,G]);var K=function(){clearTimeout(V.current)},Q=a.useCallback((function(){null!=f&&G(null!=z?z:.5*f)}),[f,z,G]);return a.useEffect((function(){if(!S&&I)return window.addEventListener("focus",Q),window.addEventListener("blur",K),function(){window.removeEventListener("focus",Q),window.removeEventListener("blur",K)}}),[S,Q,I]),!I&&q?null:a.createElement(m,Object(i.a)({onClickAway:function(e){C&&C(e,"clickaway")}},O),a.createElement("div",Object(i.a)({className:Object(l.a)(x.root,x["anchorOrigin".concat(Object(v.a)(s)).concat(Object(v.a)(c))],w),onMouseEnter:function(e){A&&A(e),K()},onMouseLeave:function(e){L&&L(e),Q()},ref:t},$),a.createElement(F,Object(i.a)({appear:!0,in:I,onEnter:Object(g.a)((function(){Y(!1)}),_),onEntered:P,onEntering:T,onExit:M,onExited:Object(g.a)((function(){Y(!0)}),R),onExiting:N,timeout:B,direction:"top"===s?"down":"up"},U),h||a.createElement(y.a,Object(i.a)({message:j,action:n},k)))))}));t.a=Object(s.a)((function(e){var t={top:8},n={bottom:8},r={justifyContent:"flex-end"},a={justifyContent:"flex-start"},l={top:24},s={bottom:24},u={right:24},c={left:24},d={left:"50%",right:"auto",transform:"translateX(-50%)"};return{root:{zIndex:e.zIndex.snackbar,position:"fixed",display:"flex",left:8,right:8,justifyContent:"center",alignItems:"center"},anchorOriginTopCenter:Object(i.a)({},t,Object(o.a)({},e.breakpoints.up("sm"),Object(i.a)({},l,d))),anchorOriginBottomCenter:Object(i.a)({},n,Object(o.a)({},e.breakpoints.up("sm"),Object(i.a)({},s,d))),anchorOriginTopRight:Object(i.a)({},t,r,Object(o.a)({},e.breakpoints.up("sm"),Object(i.a)({left:"auto"},l,u))),anchorOriginBottomRight:Object(i.a)({},n,r,Object(o.a)({},e.breakpoints.up("sm"),Object(i.a)({left:"auto"},s,u))),anchorOriginTopLeft:Object(i.a)({},t,a,Object(o.a)({},e.breakpoints.up("sm"),Object(i.a)({right:"auto"},l,c))),anchorOriginBottomLeft:Object(i.a)({},n,a,Object(o.a)({},e.breakpoints.up("sm"),Object(i.a)({right:"auto"},s,c)))}}),{flip:!1,name:"MuiSnackbar"})(x)},function(e,t,n){"use strict";var r=n(1),o=n(2),i=n(0),a=n(3),l=n(49),s=Object(l.a)(i.createElement("path",{d:"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12 17 15.59z"}),"Cancel"),u=n(4),c=n(8),d=n(9),f=n(6),p=n(130);function h(e){return"Backspace"===e.key||"Delete"===e.key}var m=i.forwardRef((function(e,t){var n=e.avatar,l=e.classes,u=e.className,c=e.clickable,m=e.color,v=void 0===m?"default":m,g=e.component,b=e.deleteIcon,y=e.disabled,x=void 0!==y&&y,w=e.icon,O=e.label,k=e.onClick,E=e.onDelete,S=e.onKeyDown,j=e.onKeyUp,C=e.size,_=void 0===C?"medium":C,P=e.variant,T=void 0===P?"default":P,M=Object(o.a)(e,["avatar","classes","className","clickable","color","component","deleteIcon","disabled","icon","label","onClick","onDelete","onKeyDown","onKeyUp","size","variant"]),R=i.useRef(null),N=Object(d.a)(R,t),A=function(e){e.stopPropagation(),E&&E(e)},L=!(!1===c||!k)||c,I="small"===_,z=g||(L?p.a:"div"),D=z===p.a?{component:"div"}:{},F=null;if(E){var W=Object(a.a)("default"!==v&&("default"===T?l["deleteIconColor".concat(Object(f.a)(v))]:l["deleteIconOutlinedColor".concat(Object(f.a)(v))]),I&&l.deleteIconSmall);F=b&&i.isValidElement(b)?i.cloneElement(b,{className:Object(a.a)(b.props.className,l.deleteIcon,W),onClick:A}):i.createElement(s,{className:Object(a.a)(l.deleteIcon,W),onClick:A})}var B=null;n&&i.isValidElement(n)&&(B=i.cloneElement(n,{className:Object(a.a)(l.avatar,n.props.className,I&&l.avatarSmall,"default"!==v&&l["avatarColor".concat(Object(f.a)(v))])}));var U=null;return w&&i.isValidElement(w)&&(U=i.cloneElement(w,{className:Object(a.a)(l.icon,w.props.className,I&&l.iconSmall,"default"!==v&&l["iconColor".concat(Object(f.a)(v))])})),i.createElement(z,Object(r.a)({role:L||E?"button":void 0,className:Object(a.a)(l.root,u,"default"!==v&&[l["color".concat(Object(f.a)(v))],L&&l["clickableColor".concat(Object(f.a)(v))],E&&l["deletableColor".concat(Object(f.a)(v))]],"default"!==T&&[l.outlined,{primary:l.outlinedPrimary,secondary:l.outlinedSecondary}[v]],x&&l.disabled,I&&l.sizeSmall,L&&l.clickable,E&&l.deletable),"aria-disabled":!!x||void 0,tabIndex:L||E?0:void 0,onClick:k,onKeyDown:function(e){e.currentTarget===e.target&&h(e)&&e.preventDefault(),S&&S(e)},onKeyUp:function(e){e.currentTarget===e.target&&(E&&h(e)?E(e):"Escape"===e.key&&R.current&&R.current.blur()),j&&j(e)},ref:N},D,M),B||U,i.createElement("span",{className:Object(a.a)(l.label,I&&l.labelSmall)},O),F)}));t.a=Object(u.a)((function(e){var t="light"===e.palette.type?e.palette.grey[300]:e.palette.grey[700],n=Object(c.a)(e.palette.text.primary,.26);return{root:{fontFamily:e.typography.fontFamily,fontSize:e.typography.pxToRem(13),display:"inline-flex",alignItems:"center",justifyContent:"center",height:32,color:e.palette.getContrastText(t),backgroundColor:t,borderRadius:16,whiteSpace:"nowrap",transition:e.transitions.create(["background-color","box-shadow"]),cursor:"default",outline:0,textDecoration:"none",border:"none",padding:0,verticalAlign:"middle",boxSizing:"border-box","&$disabled":{opacity:.5,pointerEvents:"none"},"& $avatar":{marginLeft:5,marginRight:-6,width:24,height:24,color:"light"===e.palette.type?e.palette.grey[700]:e.palette.grey[300],fontSize:e.typography.pxToRem(12)},"& $avatarColorPrimary":{color:e.palette.primary.contrastText,backgroundColor:e.palette.primary.dark},"& $avatarColorSecondary":{color:e.palette.secondary.contrastText,backgroundColor:e.palette.secondary.dark},"& $avatarSmall":{marginLeft:4,marginRight:-4,width:18,height:18,fontSize:e.typography.pxToRem(10)}},sizeSmall:{height:24},colorPrimary:{backgroundColor:e.palette.primary.main,color:e.palette.primary.contrastText},colorSecondary:{backgroundColor:e.palette.secondary.main,color:e.palette.secondary.contrastText},disabled:{},clickable:{userSelect:"none",WebkitTapHighlightColor:"transparent",cursor:"pointer","&:hover, &:focus":{backgroundColor:Object(c.c)(t,.08)},"&:active":{boxShadow:e.shadows[1]}},clickableColorPrimary:{"&:hover, &:focus":{backgroundColor:Object(c.c)(e.palette.primary.main,.08)}},clickableColorSecondary:{"&:hover, &:focus":{backgroundColor:Object(c.c)(e.palette.secondary.main,.08)}},deletable:{"&:focus":{backgroundColor:Object(c.c)(t,.08)}},deletableColorPrimary:{"&:focus":{backgroundColor:Object(c.c)(e.palette.primary.main,.2)}},deletableColorSecondary:{"&:focus":{backgroundColor:Object(c.c)(e.palette.secondary.main,.2)}},outlined:{backgroundColor:"transparent",border:"1px solid ".concat("light"===e.palette.type?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)"),"$clickable&:hover, $clickable&:focus, $deletable&:focus":{backgroundColor:Object(c.a)(e.palette.text.primary,e.palette.action.hoverOpacity)},"& $avatar":{marginLeft:4},"& $avatarSmall":{marginLeft:2},"& $icon":{marginLeft:4},"& $iconSmall":{marginLeft:2},"& $deleteIcon":{marginRight:5},"& $deleteIconSmall":{marginRight:3}},outlinedPrimary:{color:e.palette.primary.main,border:"1px solid ".concat(e.palette.primary.main),"$clickable&:hover, $clickable&:focus, $deletable&:focus":{backgroundColor:Object(c.a)(e.palette.primary.main,e.palette.action.hoverOpacity)}},outlinedSecondary:{color:e.palette.secondary.main,border:"1px solid ".concat(e.palette.secondary.main),"$clickable&:hover, $clickable&:focus, $deletable&:focus":{backgroundColor:Object(c.a)(e.palette.secondary.main,e.palette.action.hoverOpacity)}},avatar:{},avatarSmall:{},avatarColorPrimary:{},avatarColorSecondary:{},icon:{color:"light"===e.palette.type?e.palette.grey[700]:e.palette.grey[300],marginLeft:5,marginRight:-6},iconSmall:{width:18,height:18,marginLeft:4,marginRight:-4},iconColorPrimary:{color:"inherit"},iconColorSecondary:{color:"inherit"},label:{overflow:"hidden",textOverflow:"ellipsis",paddingLeft:12,paddingRight:12,whiteSpace:"nowrap"},labelSmall:{paddingLeft:8,paddingRight:8},deleteIcon:{WebkitTapHighlightColor:"transparent",color:n,height:22,width:22,cursor:"pointer",margin:"0 5px 0 -6px","&:hover":{color:Object(c.a)(n,.4)}},deleteIconSmall:{height:16,width:16,marginRight:4,marginLeft:-4},deleteIconColorPrimary:{color:Object(c.a)(e.palette.primary.contrastText,.7),"&:hover, &:active":{color:e.palette.primary.contrastText}},deleteIconColorSecondary:{color:Object(c.a)(e.palette.secondary.contrastText,.7),"&:hover, &:active":{color:e.palette.secondary.contrastText}},deleteIconOutlinedColorPrimary:{color:Object(c.a)(e.palette.primary.main,.7),"&:hover, &:active":{color:e.palette.primary.main}},deleteIconOutlinedColorSecondary:{color:Object(c.a)(e.palette.secondary.main,.7),"&:hover, &:active":{color:e.palette.secondary.main}}}}),{name:"MuiChip"})(m)},function(e,t,n){"use strict";var r=n(1),o=n(2),i=n(0),a=n(3),l=n(385),s=n(386),u=n(415),c=n(388),d=n(387),f=n(36),p=n(31),h=n(4),m=i.forwardRef((function(e,t){var n=e.children,l=e.classes,s=e.className,u=e.component,c=void 0===u?"p":u,d=(e.disabled,e.error,e.filled,e.focused,e.margin,e.required,e.variant,Object(o.a)(e,["children","classes","className","component","disabled","error","filled","focused","margin","required","variant"])),h=Object(p.a)(),m=Object(f.a)({props:e,muiFormControl:h,states:["variant","margin","disabled","error","filled","focused","required"]});return i.createElement(c,Object(r.a)({className:Object(a.a)(l.root,("filled"===m.variant||"outlined"===m.variant)&&l.contained,s,m.disabled&&l.disabled,m.error&&l.error,m.filled&&l.filled,m.focused&&l.focused,m.required&&l.required,"dense"===m.margin&&l.marginDense),ref:t},d)," "===n?i.createElement("span",{dangerouslySetInnerHTML:{__html:""}}):n)})),v=Object(h.a)((function(e){return{root:Object(r.a)({color:e.palette.text.secondary},e.typography.caption,{textAlign:"left",marginTop:3,margin:0,"&$disabled":{color:e.palette.text.disabled},"&$error":{color:e.palette.error.main}}),error:{},disabled:{},marginDense:{marginTop:4},contained:{marginLeft:14,marginRight:14},focused:{},filled:{},required:{}}}),{name:"MuiFormHelperText"})(m),g=n(408),b={standard:l.a,filled:s.a,outlined:u.a},y=i.forwardRef((function(e,t){var n=e.autoComplete,l=e.autoFocus,s=void 0!==l&&l,u=e.children,f=e.classes,p=e.className,h=e.color,m=void 0===h?"primary":h,y=e.defaultValue,x=e.disabled,w=void 0!==x&&x,O=e.error,k=void 0!==O&&O,E=e.FormHelperTextProps,S=e.fullWidth,j=void 0!==S&&S,C=e.helperText,_=e.hiddenLabel,P=e.id,T=e.InputLabelProps,M=e.inputProps,R=e.InputProps,N=e.inputRef,A=e.label,L=e.multiline,I=void 0!==L&&L,z=e.name,D=e.onBlur,F=e.onChange,W=e.onFocus,B=e.placeholder,U=e.required,$=void 0!==U&&U,V=e.rows,H=e.rowsMax,q=e.maxRows,Y=e.minRows,X=e.select,G=void 0!==X&&X,K=e.SelectProps,Q=e.type,Z=e.value,J=e.variant,ee=void 0===J?"standard":J,te=Object(o.a)(e,["autoComplete","autoFocus","children","classes","className","color","defaultValue","disabled","error","FormHelperTextProps","fullWidth","helperText","hiddenLabel","id","InputLabelProps","inputProps","InputProps","inputRef","label","multiline","name","onBlur","onChange","onFocus","placeholder","required","rows","rowsMax","maxRows","minRows","select","SelectProps","type","value","variant"]);var ne={};if("outlined"===ee&&(T&&"undefined"!==typeof T.shrink&&(ne.notched=T.shrink),A)){var re,oe=null!==(re=null===T||void 0===T?void 0:T.required)&&void 0!==re?re:$;ne.label=i.createElement(i.Fragment,null,A,oe&&"\xa0*")}G&&(K&&K.native||(ne.id=void 0),ne["aria-describedby"]=void 0);var ie=C&&P?"".concat(P,"-helper-text"):void 0,ae=A&&P?"".concat(P,"-label"):void 0,le=b[ee],se=i.createElement(le,Object(r.a)({"aria-describedby":ie,autoComplete:n,autoFocus:s,defaultValue:y,fullWidth:j,multiline:I,name:z,rows:V,rowsMax:H,maxRows:q,minRows:Y,type:Q,value:Z,id:P,inputRef:N,onBlur:D,onChange:F,onFocus:W,placeholder:B,inputProps:M},ne,R));return i.createElement(d.a,Object(r.a)({className:Object(a.a)(f.root,p),disabled:w,error:k,fullWidth:j,hiddenLabel:_,ref:t,required:$,color:m,variant:ee},te),A&&i.createElement(c.a,Object(r.a)({htmlFor:P,id:ae},T),A),G?i.createElement(g.a,Object(r.a)({"aria-describedby":ie,id:P,labelId:ae,value:Z,input:se},K),u):se,C&&i.createElement(v,Object(r.a)({id:ie},E),C))}));t.a=Object(h.a)({root:{}},{name:"MuiTextField"})(y)},function(e,t,n){"use strict";var r=n(1),o=n(2),i=n(0),a=n(3),l=n(177),s=n(12),u=n(4),c=n(35),d=n(6),f=i.forwardRef((function(e,t){e.children;var n=e.classes,l=e.className,u=e.label,f=e.labelWidth,p=e.notched,h=e.style,m=Object(o.a)(e,["children","classes","className","label","labelWidth","notched","style"]),v="rtl"===Object(c.a)().direction?"right":"left";if(void 0!==u)return i.createElement("fieldset",Object(r.a)({"aria-hidden":!0,className:Object(a.a)(n.root,l),ref:t,style:h},m),i.createElement("legend",{className:Object(a.a)(n.legendLabelled,p&&n.legendNotched)},u?i.createElement("span",null,u):i.createElement("span",{dangerouslySetInnerHTML:{__html:""}})));var g=f>0?.75*f+8:.01;return i.createElement("fieldset",Object(r.a)({"aria-hidden":!0,style:Object(r.a)(Object(s.a)({},"padding".concat(Object(d.a)(v)),8),h),className:Object(a.a)(n.root,l),ref:t},m),i.createElement("legend",{className:n.legend,style:{width:p?g:.01}},i.createElement("span",{dangerouslySetInnerHTML:{__html:""}})))})),p=Object(u.a)((function(e){return{root:{position:"absolute",bottom:0,right:0,top:-5,left:0,margin:0,padding:"0 8px",pointerEvents:"none",borderRadius:"inherit",borderStyle:"solid",borderWidth:1,overflow:"hidden"},legend:{textAlign:"left",padding:0,lineHeight:"11px",transition:e.transitions.create("width",{duration:150,easing:e.transitions.easing.easeOut})},legendLabelled:{display:"block",width:"auto",textAlign:"left",padding:0,height:11,fontSize:"0.75em",visibility:"hidden",maxWidth:.01,transition:e.transitions.create("max-width",{duration:50,easing:e.transitions.easing.easeOut}),"& > span":{paddingLeft:5,paddingRight:5,display:"inline-block"}},legendNotched:{maxWidth:1e3,transition:e.transitions.create("max-width",{duration:100,easing:e.transitions.easing.easeOut,delay:50})}}}),{name:"PrivateNotchedOutline"})(f),h=i.forwardRef((function(e,t){var n=e.classes,s=e.fullWidth,u=void 0!==s&&s,c=e.inputComponent,d=void 0===c?"input":c,f=e.label,h=e.labelWidth,m=void 0===h?0:h,v=e.multiline,g=void 0!==v&&v,b=e.notched,y=e.type,x=void 0===y?"text":y,w=Object(o.a)(e,["classes","fullWidth","inputComponent","label","labelWidth","multiline","notched","type"]);return i.createElement(l.a,Object(r.a)({renderSuffix:function(e){return i.createElement(p,{className:n.notchedOutline,label:f,labelWidth:m,notched:"undefined"!==typeof b?b:Boolean(e.startAdornment||e.filled||e.focused)})},classes:Object(r.a)({},n,{root:Object(a.a)(n.root,n.underline),notchedOutline:null}),fullWidth:u,inputComponent:d,multiline:g,ref:t,type:x},w))}));h.muiName="Input";t.a=Object(u.a)((function(e){var t="light"===e.palette.type?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)";return{root:{position:"relative",borderRadius:e.shape.borderRadius,"&:hover $notchedOutline":{borderColor:e.palette.text.primary},"@media (hover: none)":{"&:hover $notchedOutline":{borderColor:t}},"&$focused $notchedOutline":{borderColor:e.palette.primary.main,borderWidth:2},"&$error $notchedOutline":{borderColor:e.palette.error.main},"&$disabled $notchedOutline":{borderColor:e.palette.action.disabled}},colorSecondary:{"&$focused $notchedOutline":{borderColor:e.palette.secondary.main}},focused:{},disabled:{},adornedStart:{paddingLeft:14},adornedEnd:{paddingRight:14},error:{},marginDense:{},multiline:{padding:"18.5px 14px","&$marginDense":{paddingTop:10.5,paddingBottom:10.5}},notchedOutline:{borderColor:t},input:{padding:"18.5px 14px","&:-webkit-autofill":{WebkitBoxShadow:"light"===e.palette.type?null:"0 0 0 100px #266798 inset",WebkitTextFillColor:"light"===e.palette.type?null:"#fff",caretColor:"light"===e.palette.type?null:"#fff",borderRadius:"inherit"}},inputMarginDense:{paddingTop:10.5,paddingBottom:10.5},inputMultiline:{padding:0},inputAdornedStart:{paddingLeft:0},inputAdornedEnd:{paddingRight:0}}}),{name:"MuiOutlinedInput"})(h)},function(e,t,n){"use strict";var r=n(1),o=n(2),i=n(0),a=n(3),l=n(4),s=n(8),u=n(6),c=n(25),d=n(48),f=n(31),p=n(391),h=i.forwardRef((function(e,t){var n=e.autoFocus,l=e.checked,s=e.checkedIcon,u=e.classes,h=e.className,m=e.defaultChecked,v=e.disabled,g=e.icon,b=e.id,y=e.inputProps,x=e.inputRef,w=e.name,O=e.onBlur,k=e.onChange,E=e.onFocus,S=e.readOnly,j=e.required,C=e.tabIndex,_=e.type,P=e.value,T=Object(o.a)(e,["autoFocus","checked","checkedIcon","classes","className","defaultChecked","disabled","icon","id","inputProps","inputRef","name","onBlur","onChange","onFocus","readOnly","required","tabIndex","type","value"]),M=Object(d.a)({controlled:l,default:Boolean(m),name:"SwitchBase",state:"checked"}),R=Object(c.a)(M,2),N=R[0],A=R[1],L=Object(f.a)(),I=v;L&&"undefined"===typeof I&&(I=L.disabled);var z="checkbox"===_||"radio"===_;return i.createElement(p.a,Object(r.a)({component:"span",className:Object(a.a)(u.root,h,N&&u.checked,I&&u.disabled),disabled:I,tabIndex:null,role:void 0,onFocus:function(e){E&&E(e),L&&L.onFocus&&L.onFocus(e)},onBlur:function(e){O&&O(e),L&&L.onBlur&&L.onBlur(e)},ref:t},T),i.createElement("input",Object(r.a)({autoFocus:n,checked:l,defaultChecked:m,className:u.input,disabled:I,id:z&&b,name:w,onChange:function(e){var t=e.target.checked;A(t),k&&k(e,t)},readOnly:S,ref:x,required:j,tabIndex:C,type:_,value:P},y)),N?s:g)})),m=Object(l.a)({root:{padding:9},checked:{},disabled:{},input:{cursor:"inherit",position:"absolute",opacity:0,width:"100%",height:"100%",top:0,left:0,margin:0,padding:0,zIndex:1}},{name:"PrivateSwitchBase"})(h),v=i.forwardRef((function(e,t){var n=e.classes,l=e.className,s=e.color,c=void 0===s?"secondary":s,d=e.edge,f=void 0!==d&&d,p=e.size,h=void 0===p?"medium":p,v=Object(o.a)(e,["classes","className","color","edge","size"]),g=i.createElement("span",{className:n.thumb});return i.createElement("span",{className:Object(a.a)(n.root,l,{start:n.edgeStart,end:n.edgeEnd}[f],"small"===h&&n["size".concat(Object(u.a)(h))])},i.createElement(m,Object(r.a)({type:"checkbox",icon:g,checkedIcon:g,classes:{root:Object(a.a)(n.switchBase,n["color".concat(Object(u.a)(c))]),input:n.input,checked:n.checked,disabled:n.disabled},ref:t},v)),i.createElement("span",{className:n.track}))}));t.a=Object(l.a)((function(e){return{root:{display:"inline-flex",width:58,height:38,overflow:"hidden",padding:12,boxSizing:"border-box",position:"relative",flexShrink:0,zIndex:0,verticalAlign:"middle","@media print":{colorAdjust:"exact"}},edgeStart:{marginLeft:-8},edgeEnd:{marginRight:-8},switchBase:{position:"absolute",top:0,left:0,zIndex:1,color:"light"===e.palette.type?e.palette.grey[50]:e.palette.grey[400],transition:e.transitions.create(["left","transform"],{duration:e.transitions.duration.shortest}),"&$checked":{transform:"translateX(20px)"},"&$disabled":{color:"light"===e.palette.type?e.palette.grey[400]:e.palette.grey[800]},"&$checked + $track":{opacity:.5},"&$disabled + $track":{opacity:"light"===e.palette.type?.12:.1}},colorPrimary:{"&$checked":{color:e.palette.primary.main,"&:hover":{backgroundColor:Object(s.a)(e.palette.primary.main,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},"&$disabled":{color:"light"===e.palette.type?e.palette.grey[400]:e.palette.grey[800]},"&$checked + $track":{backgroundColor:e.palette.primary.main},"&$disabled + $track":{backgroundColor:"light"===e.palette.type?e.palette.common.black:e.palette.common.white}},colorSecondary:{"&$checked":{color:e.palette.secondary.main,"&:hover":{backgroundColor:Object(s.a)(e.palette.secondary.main,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},"&$disabled":{color:"light"===e.palette.type?e.palette.grey[400]:e.palette.grey[800]},"&$checked + $track":{backgroundColor:e.palette.secondary.main},"&$disabled + $track":{backgroundColor:"light"===e.palette.type?e.palette.common.black:e.palette.common.white}},sizeSmall:{width:40,height:24,padding:7,"& $thumb":{width:16,height:16},"& $switchBase":{padding:4,"&$checked":{transform:"translateX(16px)"}}},checked:{},disabled:{},input:{left:"-100%",width:"300%"},thumb:{boxShadow:e.shadows[1],backgroundColor:"currentColor",width:20,height:20,borderRadius:"50%"},track:{height:"100%",width:"100%",borderRadius:7,zIndex:-1,transition:e.transitions.create(["opacity","background-color"],{duration:e.transitions.duration.shortest}),backgroundColor:"light"===e.palette.type?e.palette.common.black:e.palette.common.white,opacity:"light"===e.palette.type?.38:.3}}}),{name:"MuiSwitch"})(v)}]]);
\ No newline at end of file
diff --git a/src/assets/scenariobuilder/js/2.cffd56c7.chunk.js.LICENSE.txt b/src/assets/scenariobuilder/js/2.cffd56c7.chunk.js.LICENSE.txt
deleted file mode 100644
index d9f3842..0000000
--- a/src/assets/scenariobuilder/js/2.cffd56c7.chunk.js.LICENSE.txt
+++ /dev/null
@@ -1,101 +0,0 @@
-/*
-object-assign
-(c) Sindre Sorhus
-@license MIT
-*/
-
-/*!
- * Determine if an object is a Buffer
- *
- * @author Feross Aboukhadijeh
- * @license MIT
- */
-
-/**
- * @license
- * Lodash
- * Copyright OpenJS Foundation and other contributors
- * Released under MIT license
- * Based on Underscore.js 1.8.3
- * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
- */
-
-/**
- * A better abstraction over CSS.
- *
- * @copyright Oleg Isonen (Slobodskoi) / Isonen 2014-present
- * @website https://github.com/cssinjs/jss
- * @license MIT
- */
-
-/** @license React v0.19.1
- * scheduler.production.min.js
- *
- * Copyright (c) Facebook, Inc. and its affiliates.
- *
- * This source code is licensed under the MIT license found in the
- * LICENSE file in the root directory of this source tree.
- */
-
-/** @license React v16.13.1
- * react-is.production.min.js
- *
- * Copyright (c) Facebook, Inc. and its affiliates.
- *
- * This source code is licensed under the MIT license found in the
- * LICENSE file in the root directory of this source tree.
- */
-
-/** @license React v16.14.0
- * react-dom.production.min.js
- *
- * Copyright (c) Facebook, Inc. and its affiliates.
- *
- * This source code is licensed under the MIT license found in the
- * LICENSE file in the root directory of this source tree.
- */
-
-/** @license React v16.14.0
- * react.production.min.js
- *
- * Copyright (c) Facebook, Inc. and its affiliates.
- *
- * This source code is licensed under the MIT license found in the
- * LICENSE file in the root directory of this source tree.
- */
-
-/** @license React v17.0.2
- * react-is.production.min.js
- *
- * Copyright (c) Facebook, Inc. and its affiliates.
- *
- * This source code is licensed under the MIT license found in the
- * LICENSE file in the root directory of this source tree.
- */
-
-/**!
- * @fileOverview Kickass library to create and place poppers near their reference elements.
- * @version 1.16.1-lts
- * @license
- * Copyright (c) 2016 Federico Zivolo and contributors
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-//!-------------- FACTORIES ------------
diff --git a/src/assets/scenariobuilder/js/main.0696bb32.chunk.js b/src/assets/scenariobuilder/js/main.0696bb32.chunk.js
deleted file mode 100644
index 329cf91..0000000
--- a/src/assets/scenariobuilder/js/main.0696bb32.chunk.js
+++ /dev/null
@@ -1 +0,0 @@
-(this["webpackJsonpremp-scenario-builder"]=this["webpackJsonpremp-scenario-builder"]||[]).push([[0],{194:function(e,t,a){e.exports=a(331)},243:function(e,t,a){},331:function(e,t,a){"use strict";a.r(t);var n={};a.r(n),a.d(n,"NodeModel",(function(){return ct})),a.d(n,"NodeFactory",(function(){return Dt})),a.d(n,"PortModel",(function(){return lt}));var i={};a.r(i),a.d(i,"NodeModel",(function(){return At})),a.d(i,"NodeFactory",(function(){return jt})),a.d(i,"PortModel",(function(){return It}));var s={};a.r(s),a.d(s,"NodeModel",(function(){return Vt})),a.d(s,"NodeFactory",(function(){return ba})),a.d(s,"PortModel",(function(){return Gt}));var o={};a.r(o),a.d(o,"NodeModel",(function(){return fa})),a.d(o,"NodeFactory",(function(){return La})),a.d(o,"PortModel",(function(){return ya}));var r={};a.r(r),a.d(r,"NodeModel",(function(){return Wa})),a.d(r,"NodeFactory",(function(){return Ga})),a.d(r,"PortModel",(function(){return za}));var l={};a.r(l),a.d(l,"NodeModel",(function(){return Ha})),a.d(l,"NodeFactory",(function(){return Za})),a.d(l,"PortModel",(function(){return Va}));var c={};a.r(c),a.d(c,"NodeModel",(function(){return Ja})),a.d(c,"NodeFactory",(function(){return $a})),a.d(c,"PortModel",(function(){return Ya}));var d={};a.r(d),a.d(d,"NodeModel",(function(){return tn})),a.d(d,"NodeFactory",(function(){return rn})),a.d(d,"PortModel",(function(){return en}));var m={};a.r(m),a.d(m,"NodeModel",(function(){return cn})),a.d(m,"NodeFactory",(function(){return Pn})),a.d(m,"PortModel",(function(){return ln}));var p={};a.r(p),a.d(p,"NodeModel",(function(){return In})),a.d(p,"NodeFactory",(function(){return Un})),a.d(p,"PortModel",(function(){return Dn}));var h={};a.r(h),a.d(h,"NodeModel",(function(){return zn})),a.d(h,"NodeFactory",(function(){return Xn})),a.d(h,"PortModel",(function(){return Ln}));var u=a(0),g=a.n(u),E=a(13),v=a(11),b=a(73),y=a(172),f=a(15),N=a.n(f);const T={avalaibleSegments:[]};const C={criteria:[]};const S={avalaibleTriggers:[]};const _={availableBeforeTriggers:[]};const w={pannable:!0,zoomable:!0,notification:{open:!1,variant:"success",text:""}};const k={id:null,name:"",loading:0,payload:null};const x={availableMails:[]};const M={generics:[]};const F={availableGoals:[]};const O={availableBanners:[]};const P={availableTemplates:[],availableApplications:[]};const D={statistics:[]};var I=Object(b.b)({segments:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:T,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"segments_changed":return{...e,avalaibleSegments:t.payload};default:return e}},triggers:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:S,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"triggers_changed":return{...e,avalaibleTriggers:t.payload};default:return e}},beforeTriggers:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:_,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"before_triggers_changed":return{...e,availableBeforeTriggers:t.payload};default:return e}},canvas:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:w,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"canvas_pannable":return{...e,pannable:t.payload};case"canvas_zoomable":return{...e,zoomable:t.payload};case"canvas_zoomable_pannable":return{...e,zoomable:t.payload,pannable:t.payload};case"canvas_notification":return{...e,notification:{...e.notification,...t.payload}};default:return e}},criteria:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:C,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"criteria_changed":return{...e,criteria:t.payload};default:return e}},scenario:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:k,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"set_scenario_id":return{...e,id:t.payload};case"set_scenario_name":return{...e,name:t.payload};case"set_scenario_loading":let a=e.loading;return t.payload?++a:--a,{...e,loading:a};case"set_scenario_payload":return{...e,payload:t.payload};default:return e}},mails:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:x,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"mails_changed":return{...e,availableMails:t.payload};default:return e}},generics:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:M,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"generics_changed":return{...e,generics:t.payload};default:return e}},goals:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:F,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"goals_changed":return{...e,availableGoals:t.payload};default:return e}},banners:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:O,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"banners_changed":return{...e,availableBanners:t.payload};default:return e}},pushNotifications:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:P,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"push_notifications_changed":return{...e,availableTemplates:t.payload.templates,availableApplications:t.payload.applications};default:return e}},statistics:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:D,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"statistics_changed":return{...e,statistics:t.payload.statistics};default:return e}}}),A=a(159),B=a.n(A),U=a(7),L=a(334),z=a(411),W=a(402),R=a(401),j=a(403),G=a(389),V=a(390),H=a(54),K=a(384),q=a(4),Z=a(376),Y=a(82),J=a.n(Y),X=a(98),Q=a.n(X),$=a(97),ee=a.n($),te=a(101),ae=a.n(te),ne=a(103),ie=a.n(ne),se=a(99),oe=a.n(se),re=a(106),le=a.n(re),ce=a(104),de=a.n(ce),me=a(102),pe=a.n(me),he=a(107),ue=a.n(he),ge=a(108),Ee=a.n(ge);const{AUTH_TOKEN:ve,CRM_HOST:be,SCENARIO_ID:ye,BANNER_ENABLED:fe,PUSH_NOTIFICATION_ENABLED:Ne}=window.Scenario.config,Te="".concat(be,"/api/v1/scenarios/info?id="),Ce="".concat(be,"/api/v1/scenarios/create"),Se="".concat(be,"/api/v1/scenarios/criteria"),_e="".concat(be,"/api/v1/segments/list"),we="".concat(be,"/api/v1/events/list"),ke="".concat(be,"/api/v1/event-generators/list"),xe="".concat(be,"/api/v1/mail-template/list"),Me="".concat(be,"/api/v1/scenarios/generics"),Fe="".concat(be,"/api/v1/onboarding-goals/list"),Oe="".concat(be,"/api/v1/remp/list-banners"),Pe="".concat(be,"/api/v1/onesignal-templates/list"),De="".concat(be,"/api/v1/onesignal-applications/list"),Ie="".concat(be,"/api/v1/scenarios/stats?id="),Ae="".concat(be,"/segment/stored-segments/new"),Be="".concat(be,"/segment/stored-segments/show/");var Ue=a(332),Le=a(373),ze=a(374);class We extends u.Component{constructor(e){super(e),this.state={}}render(){return u.createElement(Ue.a,{key:this.props.name,draggable:!0,onDragStart:e=>{e.dataTransfer.setData("storm-diagram-node",JSON.stringify(this.props.model))},className:"tray-item"},u.createElement(Le.a,null,this.props.icon),u.createElement(ze.a,{primary:this.props.name}))}}function Re(e,t){switch(t){case"minutes":return parseInt(e);case"hours":return 60*e;case"days":return 60*e*24;default:return parseInt(e)}}class je{constructor(e){this.formatDescendant=function(e,t){let a={uuid:e.id};return"segment"===t.type||"goal"===t.type||"condition"===t.type?a.direction="right"===e.portName?"positive":"negative":"ab_test"===t.type&&(a.direction="positive",a.position=e.portName.split(".")[1]),a},this.model=e}exportPayload(){const e={},t=this.model.serializeDiagram(),a=["trigger","before_trigger"];return e.triggers={},e.elements={},e.visual={},t.nodes.filter(e=>a.includes(e.type)).map(t=>e.triggers[t.id]=this.formatNode(t)),Object.entries(this.model.getNodes()).forEach(t=>{e.visual[t[0]]={x:t[1].x,y:t[1].y}}),Object.entries(this.model.getNodes()).forEach(t=>{a.includes(t[1].type)||(e.elements[t[0]]=this.formatNode(t[1].serialize()))}),e}getAllChildrenNodes(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"right";return e.ports.find(e=>e.name===t).links.map(a=>{let n=null;return n=this.model.links[a].targetPort.parent.id!==e.id?this.model.links[a].targetPort.parent:this.model.links[a].sourcePort.parent,{...n.serialize(),portName:t}})}getPositiveAndNegativeDescendants(e){return[...this.getAllChildrenNodes(e,"right").map(t=>this.formatDescendant(t,e)),...this.getAllChildrenNodes(e,"bottom").map(t=>this.formatDescendant(t,e))]}formatNode(e){if("email"===e.type)return{id:e.id,name:e.name?e.name:"",type:"email",email:{code:e.selectedMail,descendants:this.getAllChildrenNodes(e).map(t=>this.formatDescendant(t,e))}};if("banner"===e.type)return{id:e.id,name:e.name?e.name:"",type:"banner",banner:{id:e.selectedBanner,expiresInMinutes:Re(e.expiresInTime,e.expiresInUnit),descendants:this.getAllChildrenNodes(e).map(t=>this.formatDescendant(t,e))}};if("generic"===e.type)return{id:e.id,name:e.name?e.name:"",type:"generic",generic:{code:e.selectedGeneric,options:e.options,descendants:this.getAllChildrenNodes(e).map(t=>this.formatDescendant(t,e))}};if("condition"===e.type)return{id:e.id,name:e.name?e.name:"",type:"condition",condition:{conditions:e.conditions,descendants:this.getPositiveAndNegativeDescendants(e)}};var t,a,n;if("segment"===e.type)return{id:e.id,name:e.name?e.name:"",type:"segment",segment:{code:null!==(t=e.selectedSegment)&&void 0!==t?t:null,descendants:this.getPositiveAndNegativeDescendants(e)}};if("trigger"===e.type)return{id:e.id,name:e.name?e.name:"",type:"event",event:{code:null!==(a=e.selectedTrigger)&&void 0!==a?a:null},elements:this.getAllChildrenNodes(e).map(e=>e.id)};if("before_trigger"===e.type)return{id:e.id,name:e.name?e.name:"",type:"before_event",event:{code:null!==(n=e.selectedTrigger)&&void 0!==n?n:null},elements:this.getAllChildrenNodes(e).map(e=>e.id),options:{minutes:Re(e.time,e.timeUnit)}};if("wait"===e.type)return{id:e.id,name:e.name?e.name:"",type:"wait",wait:{minutes:Re(e.waitingTime,e.waitingUnit),descendants:this.getAllChildrenNodes(e).map(t=>this.formatDescendant(t,e))}};if("goal"===e.type){let t={codes:e.selectedGoals?e.selectedGoals:[],descendants:this.getPositiveAndNegativeDescendants(e),recheckPeriodMinutes:Re(e.recheckPeriodTime,e.recheckPeriodUnit)};return e.timeoutTime&&e.timeoutUnit&&(t.timeoutMinutes=Re(e.timeoutTime,e.timeoutUnit)),{id:e.id,name:e.name?e.name:"",type:"goal",goal:t}}if("push_notification"===e.type)return{id:e.id,name:e.name?e.name:"",type:"push_notification",push_notification:{template:e.selectedTemplate,application:e.selectedApplication,descendants:this.getAllChildrenNodes(e).map(t=>this.formatDescendant(t,e))}};if("ab_test"===e.type){let t=e.ports.filter(e=>e.name.startsWith("right.")).flatMap(t=>this.getAllChildrenNodes(e,t.name).map(t=>this.formatDescendant(t,e)));return{id:e.id,name:e.name?e.name:"",type:"ab_test",ab_test:{variants:e.variants,descendants:t}}}}}var Ge=a(412),Ve=a(375),He=a(164),Ke=a.n(He),qe=a(166),Ze=a.n(qe),Ye=a(167),Je=a.n(Ye),Xe=a(165),Qe=a.n(Xe);const $e={success:Ke.a,warning:Qe.a,error:Ze.a,info:Je.a};class et extends g.a.Component{render(){const e=$e[this.props.variant];return g.a.createElement(Ge.a,{anchorOrigin:{vertical:"bottom",horizontal:"right"},open:this.props.open,autoHideDuration:3e3,onClose:this.props.handleClose},g.a.createElement(Ve.a,{className:"toast-"+this.props.variant,message:g.a.createElement("span",{id:"client-snackbar",className:"toast__message"},g.a.createElement(e,{className:"toast__icon toast__icon-variant"}),this.props.text)}))}}var tt=et;class at extends U.AbstractPortFactory{constructor(e,t){super(e),this.cb=t}getNewInstance(e){return this.cb(e)}}var nt=a(14);class it extends U.DefaultLinkModel{constructor(){super("custom"),this.width=2,this.curvyness=50,this.color="rgba(0,0,0,0.3)"}}class st extends U.DefaultLinkFactory{constructor(){super(),this.type="custom"}getNewInstance(e){return new it}generateLinkSegment(e,t,a,n){return u.createElement("path",{className:a?t.bem("--path-selected"):"",strokeWidth:e.width,stroke:e.color,d:n})}}class ot extends U.PortModel{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"left";super(e,arguments.length>1?arguments[1]:void 0),this.position=e,this.in="left"===this.position}link(e){let t=this.createLinkModel();return t.setSourcePort(this),t.setTargetPort(e),t}canLinkToPort(e){return this.in!==e.in}serialize(){return nt.merge(super.serialize(),{position:this.position})}deSerialize(e,t){super.deSerialize(e,t),this.position=e.position}createLinkModel(){return new it}}class rt extends U.PortModel{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"left";super(e,arguments.length>1?arguments[1]:void 0),this.position=e,this.in="left"===this.position}link(e){let t=this.createLinkModel();return t.setSourcePort(this),t.setTargetPort(e),t}serialize(){return nt.merge(super.serialize(),{position:this.position})}canLinkToPort(e){return this.in!==e.in}deSerialize(e,t){super.deSerialize(e,t),this.position=e.position}createLinkModel(){return new it}}class lt extends ot{constructor(){super(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"left","email")}}class ct extends U.NodeModel{constructor(e){super("email",e.id),this.name=e.name,this.selectedMail=e.selectedMail,this.addPort(new lt("left")),this.addPort(new lt("right"))}deSerialize(e,t){super.deSerialize(e,t),this.name=e.name,this.selectedMail=e.selectedMail}serialize(){return nt.merge(super.serialize(),{name:this.name,selectedMail:this.selectedMail})}}var dt=a(414),mt=a(380),pt=a(392),ht=a(382),ut=a(383),gt=a(381),Et=a(410);class vt extends U.PortWidget{constructor(e){super(e),this.state={selected:!1}}getClassName(){return"port "+super.getClassName()+(this.state.selected?this.bem("--selected"):"")}render(){return u.createElement("div",Object.assign({},this.getProps(),{onMouseEnter:()=>{this.setState({selected:!0})},onMouseLeave:()=>{this.setState({selected:!1})},"data-name":this.props.name,"data-nodeid":this.props.node.getID()}),this.props.children)}}function bt(e){return{type:"canvas_zoomable_pannable",payload:e}}function yt(e){return{type:"canvas_notification",payload:e}}function ft(e){return{type:"set_scenario_id",payload:e}}function Nt(e){return{type:"set_scenario_name",payload:e}}function Tt(e){return{type:"set_scenario_loading",payload:e}}var Ct=a(413);var St=function(e){var t;const a=Object(v.c)(e=>e.statistics.statistics),n=null!==(t=a[e.elementId])&&void 0!==t?t:null;let i=null;if(0===a.length)i=g.a.createElement("div",{sx:{color:"white"}},g.a.createElement(Z.a,{size:8,color:"inherit"}));else{if(n&&(n.hasOwnProperty("finished")&&(i=n.finished["24h"]),"right"===e.position&&n.hasOwnProperty("matched")&&(i=n.matched["24h"]),"right"===e.position&&n.hasOwnProperty("completed")&&(i=n.completed["24h"]),"bottom"===e.position&&n.hasOwnProperty("notMatched")&&(i=n.notMatched["24h"]),"bottom"===e.position&&n.hasOwnProperty("timeout")&&(i=n.timeout["24h"]),e.hasOwnProperty("index")&&(i=n[e.index]?n[e.index]["24h"]:0)),null===i)return null;i=(s=i)<1e3?s:s<1e6?Number(s/1e3).toFixed(s>1e5?0:1)+"K":Number(s/1e6).toFixed(1)+"M"}var s;return g.a.createElement("div",{className:"statistic-badge-container-"+e.position},g.a.createElement(Ct.a,{label:i,color:"primary",size:"small",style:{backgroundColor:e.color,height:"16px",borderRadius:"4px",fontSize:"0.7rem"},className:"statistic-badge statistic-badge-"+e.position}))},_t=a(377);class wt extends g.a.Component{render(){var e,t;const{anchorElement:a}=this.props,n=null!==(e=this.props.statistics[this.props.id])&&void 0!==e?e:null,i=null!==(t=this.props.variants)&&void 0!==t?t:[];return null===n?null:g.a.createElement(_t.a,{open:Boolean(a),anchorEl:a,style:{pointerEvents:"none"},anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"}},g.a.createElement("div",{className:"node-tooltip-wrapper"},n?g.a.createElement("div",{className:"scenario-tooltip",style:{padding:"10px"}},g.a.createElement("strong",{style:{color:"red"}},"Statistics"),g.a.createElement("hr",null),n.hasOwnProperty("waiting")?g.a.createElement("div",{style:{marginBottom:"10px"}},"Waiting: ",n.waiting):null,n.hasOwnProperty("recheck")?g.a.createElement("div",{style:{marginBottom:"10px"}},"Waiting to re-check: ",n.recheck):null,g.a.createElement("strong",null,"Last 24 hours"),g.a.createElement("br",null),g.a.createElement("table",null,g.a.createElement("tbody",null,n.hasOwnProperty("finished")?g.a.createElement("tr",null,g.a.createElement("td",null,"Finished:"),g.a.createElement("td",null,n.finished["24h"])):null,n.hasOwnProperty("matched")?g.a.createElement("tr",null,g.a.createElement("td",null,"Matched:"),g.a.createElement("td",null,n.matched["24h"])):null,n.hasOwnProperty("notMatched")?g.a.createElement("tr",null,g.a.createElement("td",null,"Not matched:"),g.a.createElement("td",null,n.notMatched["24h"])):null,n.hasOwnProperty("completed")?g.a.createElement("tr",null,g.a.createElement("td",null,"Completed:"),g.a.createElement("td",null,n.completed["24h"])):null,n.hasOwnProperty("timeout")?g.a.createElement("tr",null,g.a.createElement("td",null,"Timed out:"),g.a.createElement("td",null,n.timeout["24h"])):null,i.flatMap(e=>g.a.createElement("tr",{key:e.code},g.a.createElement("td",null,e.name,":"),g.a.createElement("td",null,n[e.code]?n[e.code]["24h"]:0))))),g.a.createElement("strong",null,"Last 30 days"),g.a.createElement("br",null),g.a.createElement("table",null,g.a.createElement("tbody",null,n.hasOwnProperty("finished")?g.a.createElement("tr",null,g.a.createElement("td",null,"Finished:"),g.a.createElement("td",null,n.finished["30d"])):null,n.hasOwnProperty("matched")?g.a.createElement("tr",null,g.a.createElement("td",null,"Matched:"),g.a.createElement("td",null,n.matched["30d"])):null,n.hasOwnProperty("notMatched")?g.a.createElement("tr",null,g.a.createElement("td",null,"Not matched:"),g.a.createElement("td",null,n.notMatched["30d"])):null,n.hasOwnProperty("completed")?g.a.createElement("tr",null,g.a.createElement("td",null,"Completed:"),g.a.createElement("td",null,n.completed["30d"])):null,n.hasOwnProperty("timeout")?g.a.createElement("tr",null,g.a.createElement("td",null,"Timed out:"),g.a.createElement("td",null,n.timeout["30d"])):null,i.flatMap(e=>g.a.createElement("tr",{key:e.code},g.a.createElement("td",null,e.name,":"),g.a.createElement("td",null,n[e.code]?n[e.code]["30d"]:0)))))):""))}}var kt=Object(v.b)((function(e){return{statistics:e.statistics.statistics}}))(wt),xt=a(409),Mt=a(379);const Ft=Object(Et.a)(L.a)({marginRight:"auto"});class Ot extends u.Component{constructor(e){super(e),this.openDialog=()=>{this.setState({dialogOpened:!0,nodeFormName:this.props.node.name,selectedMail:this.props.node.selectedMail,anchorElementForTooltip:null}),this.props.dispatch(bt(!1))},this.closeDialog=()=>{this.setState({dialogOpened:!1}),this.props.dispatch(bt(!0))},this.handleNodeMouseEnter=e=>{this.state.dialogOpened||this.setState({anchorElementForTooltip:e.currentTarget})},this.handleNodeMouseLeave=()=>{this.setState({anchorElementForTooltip:null})},this.getSelectedMail=()=>{const e=this.props.mails.find(e=>e.code===this.state.selectedMail);return e||null},this.getSelectedMailValue=()=>{const e=this.props.mails.find(e=>e.code===this.props.node.selectedMail);return e?" - ".concat(e.name):""},this.filterOptions=()=>Object(Mt.a)({matchFrom:"any",trim:!0,ignoreAccents:!0,ignoreCase:!0,stringify:e=>e.name+" "+e.code}),this.state={nodeFormName:this.props.node.name,selectedMail:this.props.node.selectedMail,dialogOpened:!1,anchorElementForTooltip:null}}bem(e){return this.props.classBaseName+e+" "+this.props.className+e+" "}getClassName(){return this.props.classBaseName+" "+this.props.className}render(){const{classes:e}=this.props;return u.createElement("div",{className:this.getClassName(),style:{background:this.props.node.color},onDoubleClick:()=>{this.openDialog()},onMouseEnter:this.handleNodeMouseEnter,onMouseLeave:this.handleNodeMouseLeave},u.createElement("div",{className:"node-container"},u.createElement("div",{className:this.bem("__icon")},u.createElement(J.a,null)),u.createElement("div",{className:this.bem("__ports")},u.createElement("div",{className:this.bem("__left")},u.createElement(vt,{name:"left",node:this.props.node})),u.createElement("div",{className:this.bem("__right")},u.createElement(vt,{name:"right",node:this.props.node}),u.createElement(St,{elementId:this.props.node.id,color:"#a291fb",position:"right"})))),u.createElement("div",{className:this.bem("__title")},u.createElement("div",{className:this.bem("__name")},this.props.node.name?this.props.node.name:"Mail ".concat(this.getSelectedMailValue()))),u.createElement(kt,{id:this.props.node.id,anchorElement:this.state.anchorElementForTooltip}),u.createElement(mt.a,{open:this.state.dialogOpened,onClose:this.closeDialog,"aria-labelledby":"form-dialog-title",onKeyUp:e=>{if(46===e.keyCode||8===e.keyCode)return e.preventDefault(),e.stopPropagation(),!1},fullWidth:!0},u.createElement(gt.a,{id:"form-dialog-title"},"Email node"),u.createElement(ht.a,null,u.createElement(ut.a,null,"Sends an email to user."),u.createElement(K.a,{container:!0},u.createElement(K.a,{item:!0,xs:6},u.createElement(dt.a,{margin:"normal",id:"action-name",label:"Node name",fullWidth:!0,value:this.state.nodeFormName,onChange:e=>{this.setState({nodeFormName:e.target.value})}}))),u.createElement(K.a,{container:!0,alignItems:"center",alignContent:"space-between"},u.createElement(K.a,{item:!0,xs:12},u.createElement(xt.a,{value:this.getSelectedMail(),options:this.props.mails,getOptionLabel:e=>e.name,disableClearable:!0,filterOptions:this.filterOptions(),groupBy:e=>e.mail_type.code,onChange:(e,t)=>{null!==t&&this.setState({selectedMail:t.code})},renderInput:e=>u.createElement(dt.a,Object.assign({},e,{variant:"standard",label:"Selected Mail",fullWidth:!0})),renderOption:(t,a)=>{let{selected:n}=a;return u.createElement("div",null,u.createElement("span",{className:e.title},t.name),u.createElement("small",{className:e.subtitle},"(",t.code,")"))}})))),u.createElement(pt.a,null,this.props.mails.filter(e=>e.link&&e.code===this.state.selectedMail).map(e=>u.createElement(Ft,{color:"primary",href:e.link,target:"_blank"},u.createElement(J.a,{style:{marginRight:"5px"}}),"Preview")),u.createElement(L.a,{color:"secondary",onClick:()=>{this.closeDialog()}},"Cancel"),u.createElement(L.a,{color:"primary",onClick:()=>{this.props.node.name=this.state.nodeFormName,this.props.node.selectedMail=this.state.selectedMail,this.props.diagramEngine.repaintCanvas(),this.closeDialog()}},"Save changes"))))}}var Pt=Object(v.b)((function(e){return{mails:e.mails.availableMails}}))(Object(q.a)(e=>({autocomplete:{margin:e.spacing(1)},subtitle:{paddingLeft:"6px",color:e.palette.grey[600]}}))(Ot));class Dt extends U.AbstractNodeFactory{constructor(){super("email")}generateReactWidget(e,t){return u.createElement(Pt,{diagramEngine:e,node:t,classBaseName:"square-node",className:"email-node"})}getNewInstance(){return new ct}}class It extends ot{constructor(){super(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"left","banner")}}class At extends U.NodeModel{constructor(e){super("banner",e.id),this.name=e.name,this.selectedBanner=e.selectedBanner,this.expiresInTime=e.expiresInTime,this.expiresInUnit=e.expiresInUnit,this.addPort(new It("left")),this.addPort(new It("right"))}deSerialize(e,t){super.deSerialize(e,t),this.name=e.name,this.selectedBanner=e.selectedBanner,this.expiresInTime=e.expiresInTime||"1",this.expiresInUnit=e.expiresInUnit||"days"}serialize(){return nt.merge(super.serialize(),{name:this.name,selectedBanner:this.selectedBanner,expiresInTime:this.expiresInTime,expiresInUnit:this.expiresInUnit})}}var Bt=a(387),Ut=a(388),Lt=a(408),zt=a(393);class Wt extends u.Component{constructor(e){super(e),this.openDialog=()=>{this.setState({dialogOpened:!0,nodeFormName:this.props.node.name,anchorElementForTooltip:null}),this.props.dispatch(bt(!1))},this.closeDialog=()=>{this.setState({dialogOpened:!1}),this.props.dispatch(bt(!0))},this.handleNodeMouseEnter=e=>{this.state.dialogOpened||this.setState({anchorElementForTooltip:e.currentTarget})},this.handleNodeMouseLeave=()=>{this.setState({anchorElementForTooltip:null})},this.getSelectedBanner=()=>{const e=this.props.banners.find(e=>e.id===this.state.selectedBanner);return e||null},this.getSelectedBannerValue=()=>{const e=this.props.banners.find(e=>e.id===this.props.node.selectedBanner);return e?" - ".concat(e.name):""},this.state={nodeFormName:this.props.node.name,selectedBanner:this.props.node.selectedBanner,dialogOpened:!1,anchorElementForTooltip:null,expiresInTime:this.props.node.expiresInTime,expiresInUnit:this.props.node.expiresInUnit}}bem(e){return this.props.classBaseName+e+" "+this.props.className+e+" "}getClassName(){return this.props.classBaseName+" "+this.props.className}render(){return u.createElement("div",{className:this.getClassName(),style:{background:this.props.node.color},onDoubleClick:()=>{this.openDialog()},onMouseEnter:this.handleNodeMouseEnter,onMouseLeave:this.handleNodeMouseLeave},u.createElement("div",{className:"node-container"},u.createElement("div",{className:this.bem("__icon")},u.createElement(ee.a,null)),u.createElement("div",{className:this.bem("__ports")},u.createElement("div",{className:this.bem("__left")},u.createElement(vt,{name:"left",node:this.props.node})),u.createElement("div",{className:this.bem("__right")},u.createElement(vt,{name:"right",node:this.props.node}),u.createElement(St,{elementId:this.props.node.id,color:"#6435c9",position:"right"})))),u.createElement("div",{className:this.bem("__title")},u.createElement("div",{className:this.bem("__name")},this.props.node.name?this.props.node.name:"Banner ".concat(this.getSelectedBannerValue()))),u.createElement(kt,{id:this.props.node.id,anchorElement:this.state.anchorElementForTooltip}),u.createElement(mt.a,{open:this.state.dialogOpened,onClose:this.closeDialog,"aria-labelledby":"form-dialog-title",onKeyUp:e=>{if(46===e.keyCode||8===e.keyCode)return e.preventDefault(),e.stopPropagation(),!1},fullWidth:!0},u.createElement(gt.a,{id:"form-dialog-title"},"Banner node"),u.createElement(ht.a,null,u.createElement(ut.a,null,"Shows a one-time banner to user."),u.createElement(K.a,{container:!0},u.createElement(K.a,{item:!0,xs:6},u.createElement(dt.a,{margin:"normal",id:"action-name",label:"Node name",fullWidth:!0,value:this.state.nodeFormName,onChange:e=>{this.setState({nodeFormName:e.target.value})}}))),u.createElement(K.a,{container:!0,style:{marginBottom:"10px"}},u.createElement(K.a,{item:!0,xs:12},u.createElement(xt.a,{value:this.getSelectedBanner(),options:this.props.banners,getOptionLabel:e=>e.name,disableClearable:!0,onChange:(e,t)=>{null!==t&&this.setState({selectedBanner:t.id})},renderInput:e=>u.createElement(dt.a,Object.assign({},e,{variant:"standard",label:"Selected Banner",fullWidth:!0}))}))),u.createElement(K.a,{container:!0,spacing:1},u.createElement(K.a,{item:!0,xs:6},u.createElement(dt.a,{id:"expires-in-time",label:"Expires in",type:"number",helperText:"Banner is not shown after given period",fullWidth:!0,value:this.state.expiresInTime,onChange:e=>{this.setState({expiresInTime:e.target.value})}})),u.createElement(K.a,{item:!0,xs:6},u.createElement(Bt.a,{fullWidth:!0},u.createElement(Ut.a,{htmlFor:"time-unit"},"Time unit"),u.createElement(Lt.a,{value:this.state.expiresInUnit,onChange:e=>{this.setState({expiresInUnit:e.target.value})},inputProps:{name:"expires-in-unit",id:"expires-in-unit"}},u.createElement(zt.a,{value:"minutes"},"Minutes"),u.createElement(zt.a,{value:"hours"},"Hours"),u.createElement(zt.a,{value:"days"},"Days")))))),u.createElement(pt.a,null,u.createElement(L.a,{color:"secondary",onClick:()=>{this.closeDialog()}},"Cancel"),u.createElement(L.a,{color:"primary",onClick:()=>{this.props.node.name=this.state.nodeFormName,this.props.node.selectedBanner=this.state.selectedBanner,this.props.node.expiresInTime=this.state.expiresInTime,this.props.node.expiresInUnit=this.state.expiresInUnit,this.props.diagramEngine.repaintCanvas(),this.closeDialog()}},"Save changes"))))}}var Rt=Object(v.b)((function(e){return{banners:e.banners.availableBanners}}))(Wt);class jt extends U.AbstractNodeFactory{constructor(){super("banner")}generateReactWidget(e,t){return u.createElement(Rt,{diagramEngine:e,node:t,classBaseName:"square-node",className:"banner-node"})}getNewInstance(){return new At}}class Gt extends ot{constructor(){super(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"left","generic")}}class Vt extends U.NodeModel{constructor(e){super("generic",e.id),this.name=e.name,this.selectedGeneric=e.selectedGeneric,this.options=e.options,this.addPort(new Gt("left")),this.addPort(new Gt("right"))}deSerialize(e,t){super.deSerialize(e,t),this.name=e.name,this.selectedGeneric=e.selectedGeneric,this.options=e.options}serialize(){return nt.merge(super.serialize(),{name:this.name,selectedGeneric:this.selectedGeneric,options:this.options})}}function Ht(e,t){switch(t.type){case"CREATE_OPTION":return{...e,options:[...e.options,{key:t.payload.optionKey,values:{selection:t.payload.values}}]};case"DELETE_OPTION":return{...e,options:e.options.filter(e=>e.key!==t.payload.optionKey)};case"SET_PARAM_VALUES":return{...e,options:e.options.map(e=>e.key===t.payload.name?{...e,values:t.payload.values}:e)};case"UPDATE_PARAM_VALUES":return{...e,options:e.options.map(e=>e.key===t.payload.name?{...e,values:Object.assign(e.values,t.payload.values)}:e)};default:throw new Error("unsupported action type "+t.type)}}var Kt=a(396),qt=a(397),Zt=a(394),Yt=a(416),Jt=a(395);function Xt(e,t){return{type:"SET_PARAM_VALUES",payload:{name:e,values:t}}}function Qt(e,t){return{type:"UPDATE_PARAM_VALUES",payload:{name:e,values:t}}}const $t=Object(Zt.a)(e=>({formControl:{marginBottom:e.spacing(1)}}));function ea(e){const t=$t();void 0===e.values.selection&&e.dispatch(Xt(e.name,{selection:!0}));return g.a.createElement(Jt.a,{onChange:t=>{e.dispatch(Xt(e.name,{selection:t.target.checked}))},control:g.a.createElement(Yt.a,null),checked:void 0!==e.values.selection&&e.values.selection,label:e.blueprint.label,className:t.formControl})}var ta=a(336);const aa=Object(Zt.a)(e=>({formControl:{marginRight:e.spacing(1),marginBottom:e.spacing(1),minWidth:100},formLabel:{display:"block",marginBottom:e.spacing(1)},numberInput:{marginRight:e.spacing(1),marginBottom:e.spacing(1)}}));function na(e){var t,a,n;const i=aa();void 0===e.values.operator&&e.blueprint.operators&&1===e.blueprint.operators.length&&e.dispatch(Xt(e.name,{operator:e.blueprint.operators[0]}));return g.a.createElement(g.a.Fragment,null,!e.hideLabel&&g.a.createElement(ta.a,{className:i.formLabel},e.blueprint.label),e.blueprint.operators&&e.blueprint.operators.length&&g.a.createElement(Bt.a,{className:i.formControl,disabled:1===e.blueprint.operators.length},g.a.createElement(Ut.a,null,"Operator"),g.a.createElement(Lt.a,{autoWidth:!0,value:null!==(t=e.values.operator)&&void 0!==t?t:"",onChange:t=>{e.dispatch(Qt(e.name,{operator:t.target.value}))}},e.blueprint.operators.map(e=>g.a.createElement(zt.a,{key:e,value:e},e)))),g.a.createElement(dt.a,{className:i.numberInput,label:e.blueprint.unit,type:"number",onChange:t=>{e.dispatch(Qt(e.name,{selection:t.target.value}))},value:null!==(a=e.values.selection)&&void 0!==a?a:"",inputProps:null!==(n=e.blueprint.numberInputAttributes)&&void 0!==n?n:{}}))}const ia=Object(Zt.a)(e=>({chipRoot:e=>({"&:not(:first-child)":{"&::before":{content:"'"+e.operator+"'",textTransform:"uppercase",position:"absolute",left:"-20px"},marginLeft:"20px"},position:"relative"}),subtitle:{paddingLeft:"6px",color:e.palette.grey[600]},autocomplete:{marginBottom:e.spacing(1)}}));function sa(e,t){const a=new Set(e);return t.filter(e=>{let t=a.has(e.value);return t&&a.delete(e.value),t}).concat([...a])}function oa(e){return"string"===typeof e?e:e.label}function ra(e){return"string"===typeof e?"":void 0!==e.subtitle?e.subtitle:""}function la(e){return"string"===typeof e?"":e.hasOwnProperty("group")?e.group:""}const ca=Object(Mt.a)({matchFrom:"any",trim:!0,ignoreAccents:!0,ignoreCase:!0,stringify:e=>oa(e)+" "+ra(e)});function da(e){const t=ia({operator:e.blueprint.operator});return g.a.createElement(xt.a,{multiple:!0,disableCloseOnSelect:!0,ChipProps:{classes:{root:t.chipRoot}},options:e.blueprint.options,getOptionLabel:oa,onChange:(t,a)=>{e.dispatch(Xt(e.name,{operator:e.blueprint.operator,selection:a.map(e=>"string"===typeof e?e:e.value)}))},value:sa(e.values.selection,e.blueprint.options),freeSolo:e.blueprint.freeSolo,groupBy:la,filterOptions:ca,renderInput:a=>g.a.createElement(dt.a,Object.assign({},a,{variant:"standard",label:e.blueprint.label,placeholder:"",className:t.autocomplete,fullWidth:!0})),renderOption:(e,a)=>{let{selected:n}=a;return g.a.createElement(g.a.Fragment,null,oa(e),g.a.createElement("small",{className:t.subtitle},ra(e)))}})}const ma=g.a.createContext(null);function pa(e){const t=Object(u.useContext)(ma);switch(e.blueprint.type){case"boolean":return g.a.createElement(ea,{name:e.blueprint.key,values:e.option.values,blueprint:e.blueprint,dispatch:t});case"number":return g.a.createElement(na,{name:e.blueprint.key,values:e.option.values,blueprint:e.blueprint,dispatch:t});case"string_labeled_array":return g.a.createElement(da,{name:e.blueprint.key,values:e.option.values,blueprint:e.blueprint,dispatch:t});default:throw new Error("unsupported option type "+e.blueprint.type)}}const ha=Object(Zt.a)(e=>({option:{flex:"0 0 100%",borderBottom:"1px solid #dfdfdf",marginBottom:e.spacing(2),paddingBottom:e.spacing(1),"&:last-child":{borderBottom:"none",marginBottom:0,paddingBottom:0}}}));var ua=Object(u.forwardRef)((function(e,t){var a;const n=ha(),[i,s]=Object(u.useReducer)(Ht,{version:1,options:null!==(a=e.options)&&void 0!==a?a:[]});return Object(u.useImperativeHandle)(t,()=>({state:i})),i.options.forEach(t=>{void 0===e.blueprints.find(e=>e.key===t.key)&&s({type:"DELETE_OPTION",payload:{optionKey:t.key}})}),e.blueprints.forEach(e=>{var t,a;void 0===i.options.find(t=>e.key===t.key)&&s((t=e.key,{type:"CREATE_OPTION",payload:{values:a,optionKey:t}}))}),g.a.createElement(ma.Provider,{value:s},g.a.createElement(Kt.a,null,g.a.createElement(qt.a,{className:n.cardContent},e.blueprints.map(e=>{var t;let a=null!==(t=i.options.find(t=>t.key===e.key))&&void 0!==t?t:{key:e.key,values:{selection:null}};return g.a.createElement("div",{className:n.option},g.a.createElement(pa,{key:e.key,option:a,blueprint:e.blueprint}))}))))}));const ga=Object(Mt.a)({matchFrom:"any",trim:!0,ignoreAccents:!0,ignoreCase:!0,stringify:e=>e.label+" "+e.value});class Ea extends u.Component{constructor(e){super(e),this.openDialog=()=>{this.setState({dialogOpened:!0,nodeFormName:this.props.node.name,anchorElementForTooltip:null}),this.props.dispatch(bt(!1))},this.closeDialog=()=>{this.setState({dialogOpened:!1}),this.props.dispatch(bt(!0))},this.handleNodeMouseEnter=e=>{this.state.dialogOpened||this.setState({anchorElementForTooltip:e.currentTarget})},this.handleNodeMouseLeave=()=>{this.setState({anchorElementForTooltip:null})},this.getSelectedGeneric=()=>{const e=this.props.generics.find(e=>e.code===this.state.selectedGeneric);return e||null},this.getSelectedGenericOptionBlueprints=()=>{const e=this.getSelectedGeneric();let t=[];return null!==e&&null!==e.options&&nt.forOwn(e.options,(function(e,a){t.push({key:a,blueprint:e})})),t},this.transformOptionsForSelect=()=>{const e=[];return Object.keys(this.props.generics).forEach(t=>{e.push({value:this.props.generics[t].code,label:this.props.generics[t].label})}),e},this.getSelectedGenericDefaultLabel=()=>{const e=this.getSelectedGeneric();return e?" - ".concat(e.label):""},this.optionsFormRef=u.createRef(),this.state={nodeFormName:this.props.node.name,selectedGeneric:this.props.node.selectedGeneric,dialogOpened:!1,anchorElementForTooltip:null}}bem(e){return this.props.classBaseName+e+" "+this.props.className+e+" "}getClassName(){return this.props.classBaseName+" "+this.props.className}render(){const{classes:e}=this.props;return u.createElement("div",{className:this.getClassName(),style:{background:this.props.node.color},onDoubleClick:()=>{this.openDialog()},onMouseEnter:this.handleNodeMouseEnter,onMouseLeave:this.handleNodeMouseLeave},u.createElement("div",{className:"node-container"},u.createElement("div",{className:this.bem("__icon")},u.createElement(Q.a,null)),u.createElement("div",{className:this.bem("__ports")},u.createElement("div",{className:this.bem("__left")},u.createElement(vt,{name:"left",node:this.props.node})),u.createElement("div",{className:this.bem("__right")},u.createElement(vt,{name:"right",node:this.props.node}),u.createElement(St,{elementId:this.props.node.id,color:"#a291fb",position:"right"})))),u.createElement("div",{className:this.bem("__title")},u.createElement("div",{className:this.bem("__name")},this.props.node.name?this.props.node.name:"Generic ".concat(this.getSelectedGenericDefaultLabel()))),u.createElement(kt,{id:this.props.node.id,anchorElement:this.state.anchorElementForTooltip}),u.createElement(mt.a,{open:this.state.dialogOpened,onClose:this.closeDialog,"aria-labelledby":"form-dialog-title",onKeyUp:e=>{if(46===e.keyCode||8===e.keyCode)return e.preventDefault(),e.stopPropagation(),!1},fullWidth:!0},u.createElement(gt.a,{id:"form-dialog-title"},"Generic action node"),u.createElement(ht.a,null,u.createElement(ut.a,null,"Runs defined generic action."),u.createElement(K.a,{container:!0},u.createElement(K.a,{item:!0,xs:6},u.createElement(dt.a,{margin:"normal",id:"action-name",label:"Node name",fullWidth:!0,value:this.state.nodeFormName,onChange:e=>{this.setState({nodeFormName:e.target.value})}}))),u.createElement(K.a,{container:!0,alignItems:"center",alignContent:"space-between"},u.createElement(K.a,{item:!0,xs:12},u.createElement(xt.a,{value:this.getSelectedGeneric(),options:this.transformOptionsForSelect(),getOptionLabel:e=>e.label,getOptionSelected:(e,t)=>e.key===t.key,disableClearable:!0,filterOptions:ga,onChange:(e,t)=>{null!==t&&this.setState({selectedGeneric:t.value})},renderInput:e=>u.createElement(dt.a,Object.assign({},e,{variant:"standard",label:"Action",fullWidth:!0})),renderOption:(t,a)=>{let{selected:n}=a;return u.createElement("div",null,u.createElement("span",{className:e.title},t.label),u.createElement("small",{className:e.subtitle},"(",t.value,")"))}}))),this.state.selectedGeneric&&this.getSelectedGenericOptionBlueprints().length>0&&u.createElement(K.a,{container:!0,alignItems:"center",alignContent:"space-between"},u.createElement(K.a,{item:!0,xs:12},u.createElement("p",null,"Options"),u.createElement(ua,{options:this.props.node.options,blueprints:this.getSelectedGenericOptionBlueprints(),ref:this.optionsFormRef})))),u.createElement(pt.a,null,u.createElement(L.a,{color:"secondary",onClick:()=>{this.closeDialog()}},"Cancel"),u.createElement(L.a,{color:"primary",onClick:()=>{this.props.node.name=this.state.nodeFormName,this.props.node.selectedGeneric=this.state.selectedGeneric,this.props.node.options=this.optionsFormRef.current?this.optionsFormRef.current.state.options:[],this.props.diagramEngine.repaintCanvas(),this.closeDialog()}},"Save changes"))))}}var va=Object(v.b)((function(e){return{generics:e.generics.generics}}))(Object(q.a)(e=>({autocomplete:{margin:e.spacing(1)},subtitle:{paddingLeft:"6px",color:e.palette.grey[600]}}))(Ea));class ba extends U.AbstractNodeFactory{constructor(){super("generic")}generateReactWidget(e,t){return u.createElement(va,{diagramEngine:e,node:t,classBaseName:"square-node",className:"generic-node"})}getNewInstance(){return new Vt}}class ya extends rt{constructor(){super(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"top","segment")}}class fa extends U.NodeModel{constructor(e){super("segment",e.id),this.name=e.name,this.selectedSegment=e.selectedSegment,this.addPort(new ya("left")),this.addPort(new ya("bottom")),this.addPort(new ya("right"))}deSerialize(e,t){super.deSerialize(e,t),this.name=e.name,this.selectedSegment=e.selectedSegment}serialize(){return nt.merge(super.serialize(),{name:this.name,selectedSegment:this.selectedSegment})}}var Na=a(399),Ta=a(398);const Ca=Object(Zt.a)(e=>({autocomplete:{margin:e.spacing(1)},subtitle:{paddingLeft:"6px",color:e.palette.grey[600]}}));function Sa(e){return"string"===typeof e?e:e.name}function _a(e,t){return!(!t||!t.hasOwnProperty("code"))&&e.code===t.code}function wa(e,t){const a=t.filter(t=>t.code===e)[0];return a||null}const ka=Object(Mt.a)({matchFrom:"any",trim:!0,ignoreAccents:!0,ignoreCase:!0,stringify:e=>e.name+" "+e.code});function xa(e){const t=Ca(),a=Object(v.c)(t=>t.segments.avalaibleSegments.filter(t=>t.table===e.selectedSegmentSourceTable))[0].segments.sort((e,t)=>e.group.sorting-t.group.sorting===0?e.group.id-t.group.id:e.group.sorting-t.group.sorting);return g.a.createElement(xt.a,{fullWidth:!0,className:t.autocomplete,value:wa(e.selectedSegment,a),options:a,getOptionSelected:_a,getOptionLabel:Sa,groupBy:e=>e.group.name,filterOptions:ka,onChange:(t,a)=>{e.onSegmentSelectedChange(a)},renderInput:e=>g.a.createElement(dt.a,Object.assign({},e,{variant:"standard",label:"Segment",fullWidth:!0})),renderOption:(e,a)=>{let{selected:n}=a;return g.a.createElement("div",null,g.a.createElement("span",{className:t.title},Sa(e)),g.a.createElement("small",{className:t.subtitle},"(",e.code,")"))}})}const Ma=Object(Zt.a)({selectedButton:{backgroundColor:"#E4E4E4"},deselectedButton:{color:"#A6A6A6"}});function Fa(e){const t=Ma(),a=Object(v.c)(e=>e.segments.avalaibleSegments),n=function(e,t,a){if(e)return e;if(t){const e=a.filter(e=>e.segments.filter(e=>e.code===t).length>0);return e[0]&&e[0].hasOwnProperty("table")?e[0].table:"users"}return"users"}(e.selectedSegmentSourceTable,e.selectedSegment,a);return g.a.createElement(K.a,{container:!0,item:!0,xs:12,spacing:2},g.a.createElement(K.a,{item:!0,xs:12},g.a.createElement(Ta.a,{"aria-label":"outlined button group"},a.map(a=>g.a.createElement(L.a,{onClick:()=>e.onSegmentTypeButtonClick(a.table),className:n===a.table?t.selectedButton:t.deselectedButton,key:a.table},a.table)))),g.a.createElement(xa,{selectedSegment:e.selectedSegment,selectedSegmentSourceTable:n,onSegmentSelectedChange:e.onSegmentSelectedChange}))}var Oa=a(69),Pa=a.n(Oa),Da=a(100),Ia=a.n(Da);const Aa=Object(Et.a)(L.a)({marginRight:"auto"});class Ba extends u.Component{constructor(e){super(e),this.openDialog=()=>{this.setState({dialogOpened:!0,nodeFormName:this.props.node.name,selectedSegment:this.props.node.selectedSegment,anchorElementForTooltip:null}),this.props.dispatch(bt(!1))},this.closeDialog=()=>{this.setState({dialogOpened:!1}),this.props.dispatch(bt(!0))},this.handleNodeMouseEnter=e=>{this.state.dialogOpened||this.setState({anchorElementForTooltip:e.currentTarget})},this.handleNodeMouseLeave=()=>{this.setState({anchorElementForTooltip:null})},this.actionSetTable=e=>{this.state.selectedSegmentSourceTable!==e&&(this.setState({selectedSegment:null}),this.setState({selectedSegmentSourceTable:e}))},this.segmentSelectedChange=e=>{let t=null;e&&e.hasOwnProperty("code")&&(t=e.code),this.setState({selectedSegment:t})},this.getSelectedSegmentValue=()=>{const e=this.props.segments.flatMap(e=>e.segments).find(e=>e.code===this.props.node.selectedSegment);return e?" - ".concat(e.name):""},this.handleNewSegmentClick=()=>{window.open(Ae)},this.state={nodeFormName:this.props.node.name,selectedSegment:this.props.node.selectedSegment,dialogOpened:!1,anchorElementForTooltip:null,creatingNewSegment:!1,selectedSegmentSourceTable:null}}bem(e){return this.props.classBaseName+e+" "+this.props.className+e+" "}getClassName(){return this.props.classBaseName+" "+this.props.className}render(){let e=!1;return(0===this.props.statistics.length||this.props.statistics[this.props.node.id])&&(e=!0),u.createElement("div",{className:this.getClassName(),onDoubleClick:()=>{this.openDialog()},onMouseEnter:this.handleNodeMouseEnter,onMouseLeave:this.handleNodeMouseLeave},u.createElement("div",{className:this.bem("__title")},u.createElement("div",{className:this.bem("__name")},this.props.node.name?this.props.node.name:"Segment ".concat(this.getSelectedSegmentValue()))),u.createElement("div",{className:"node-container"},u.createElement("div",{className:this.bem("__icon")},u.createElement(oe.a,null)),u.createElement("div",{className:this.bem("__ports")},u.createElement("div",{className:this.bem("__left")},u.createElement(vt,{name:"left",node:this.props.node})),u.createElement("div",{className:this.bem("__right")},u.createElement(vt,{name:"right",node:this.props.node}),e?u.createElement(St,{elementId:this.props.node.id,color:"#21ba45",position:"right"}):u.createElement(Pa.a,{style:{position:"absolute",top:"-5px",right:"-30px",color:"#2ECC40"}})),u.createElement("div",{className:this.bem("__bottom")},u.createElement(vt,{name:"bottom",node:this.props.node}),e?u.createElement(St,{elementId:this.props.node.id,color:"#db2828",position:"bottom"}):u.createElement(Ia.a,{style:{position:"absolute",top:"15px",right:"-5px",color:"#FF695E"}})))),u.createElement(kt,{id:this.props.node.id,anchorElement:this.state.anchorElementForTooltip}),u.createElement(mt.a,{fullWidth:!0,maxWidth:"md",open:this.state.dialogOpened,onClose:this.closeDialog,"aria-labelledby":"form-dialog-title",onKeyUp:e=>{if(46===e.keyCode||8===e.keyCode)return e.preventDefault(),e.stopPropagation(),!1}},u.createElement(gt.a,{id:"form-dialog-title"},"Segment node"),u.createElement(ht.a,null,u.createElement(ut.a,null,"Segments evaluate user's presence in a group of users defined by system-provided conditions. Execution flow can be directed based on presence/absence of user within the selected segment. You can either pick one of the existing segments or create a new one."),u.createElement(K.a,{container:!0,spacing:3},u.createElement(K.a,{item:!0,xs:6},u.createElement(dt.a,{margin:"normal",id:"segment-name",label:"Node name",fullWidth:!0,value:this.state.nodeFormName,onChange:e=>{this.setState({nodeFormName:e.target.value})}}))),u.createElement(K.a,{container:!0,spacing:3,alignItems:"flex-end"},u.createElement(K.a,{item:!0,xs:12},u.createElement(Fa,{selectedSegment:this.state.selectedSegment,selectedSegmentSourceTable:this.state.selectedSegmentSourceTable,onSegmentTypeButtonClick:this.actionSetTable,onSegmentSelectedChange:this.segmentSelectedChange})))),u.createElement(pt.a,null,u.createElement(Aa,{color:"primary",onClick:this.handleNewSegmentClick},u.createElement(Na.a,{style:{marginRight:"5px"}},"add_circle"),"New segment"),u.createElement(L.a,{color:"secondary",onClick:()=>{this.closeDialog()}},"Cancel"),u.createElement(L.a,{color:"primary",onClick:()=>{this.props.node.name=this.state.nodeFormName,this.props.node.selectedSegment=this.state.selectedSegment,this.props.diagramEngine.repaintCanvas(),this.closeDialog()}},"Save changes"))))}}var Ua=Object(v.b)((function(e){const{segments:t,dispatch:a}=e;return{segments:t.avalaibleSegments,statistics:e.statistics.statistics,dispatch:a}}))(Ba);class La extends U.AbstractNodeFactory{constructor(){super("segment")}generateReactWidget(e,t){return u.createElement(Ua,{diagramEngine:e,node:t,classBaseName:"diamond-node",className:"segment-node"})}getNewInstance(){return new fa}}class za extends ot{constructor(){super(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"left","trigger")}}class Wa extends U.NodeModel{constructor(e){super("trigger",e.id),this.name=e.name,this.selectedTrigger=e.selectedTrigger,this.addPort(new za("right"))}deSerialize(e,t){super.deSerialize(e,t),this.name=e.name,this.selectedTrigger=e.selectedTrigger}serialize(){return nt.merge(super.serialize(),{name:this.name,selectedTrigger:this.selectedTrigger})}}class Ra extends u.Component{constructor(e){super(e),this.openDialog=()=>{this.setState({dialogOpened:!0,nodeFormName:this.props.node.name,anchorElementForTooltip:null}),this.props.dispatch(bt(!1))},this.closeDialog=()=>{this.setState({dialogOpened:!1}),this.props.dispatch(bt(!0))},this.handleNodeMouseEnter=e=>{this.state.dialogOpened||this.setState({anchorElementForTooltip:e.currentTarget})},this.handleNodeMouseLeave=()=>{this.setState({anchorElementForTooltip:null})},this.getTriggersInSelectableFormat=()=>this.props.triggers.map(e=>({value:e.code,label:e.name})),this.getSelectedTriggerValue=()=>{const e=this.getTriggersInSelectableFormat().find(e=>e.value===this.props.node.selectedTrigger);return e?" - ".concat(e.label):""},this.state={nodeFormName:this.props.node.name,selectedTrigger:this.props.node.selectedTrigger,dialogOpened:!1,anchorElementForTooltip:null}}bem(e){return this.props.classBaseName+e+" "+this.props.className+e+" "}getClassName(){return this.props.classBaseName+" "+this.props.className}render(){return u.createElement("div",{className:this.getClassName(),style:{background:this.props.node.color}},u.createElement("div",{className:"node-container",onDoubleClick:()=>{this.openDialog()},onMouseEnter:this.handleNodeMouseEnter,onMouseLeave:this.handleNodeMouseLeave},u.createElement("div",{className:this.bem("__icon")},u.createElement(ae.a,null)),u.createElement("div",{className:this.bem("__ports")},u.createElement("div",{className:this.bem("__right")},u.createElement(vt,{name:"right",node:this.props.node}),u.createElement(St,{elementId:this.props.node.id,color:"#21ba45",position:"right"})))),u.createElement("div",{className:this.bem("__title")},u.createElement("div",{className:this.bem("__name")},this.props.node.name?this.props.node.name:"Event ".concat(this.getSelectedTriggerValue()))),u.createElement(kt,{id:this.props.node.id,isTrigger:!0,anchorElement:this.state.anchorElementForTooltip}),u.createElement(mt.a,{open:this.state.dialogOpened,onClose:this.closeDialog,"aria-labelledby":"form-dialog-title",onKeyUp:e=>{if(46===e.keyCode||8===e.keyCode)return e.preventDefault(),e.stopPropagation(),!1}},u.createElement(gt.a,{id:"form-dialog-title"},"Event node"),u.createElement(ht.a,null,u.createElement(ut.a,null,'Events are emitted on any change related to user. We recommend to combine "before" events with "Wait" operations to achieve execution at any desired time.'),u.createElement(K.a,{container:!0},u.createElement(K.a,{item:!0,xs:6},u.createElement(dt.a,{margin:"normal",id:"trigger-name",label:"Node name",fullWidth:!0,value:this.state.nodeFormName,onChange:e=>{this.setState({nodeFormName:e.target.value})}}))),u.createElement(K.a,{container:!0},u.createElement(K.a,{item:!0,xs:12},u.createElement(xt.a,{value:this.getTriggersInSelectableFormat().find(e=>e.value===this.state.selectedTrigger),options:this.getTriggersInSelectableFormat(),getOptionLabel:e=>e.label,style:{marginTop:16},onChange:(e,t)=>{null!==t&&this.setState({selectedTrigger:t.value})},renderInput:e=>u.createElement(dt.a,Object.assign({},e,{variant:"standard",label:"Trigger",fullWidth:!0}))})))),u.createElement(pt.a,null,u.createElement(L.a,{color:"secondary",onClick:()=>{this.closeDialog()}},"Cancel"),u.createElement(L.a,{color:"primary",onClick:()=>{this.props.node.name=this.state.nodeFormName,this.props.node.selectedTrigger=this.state.selectedTrigger,this.props.diagramEngine.repaintCanvas(),this.closeDialog()}},"Save changes"))))}}var ja=Object(v.b)((function(e){const{triggers:t}=e;return{triggers:t.avalaibleTriggers}}))(Ra);class Ga extends U.AbstractNodeFactory{constructor(){super("trigger")}generateReactWidget(e,t){return u.createElement(ja,{diagramEngine:e,node:t,classBaseName:"square-node",className:"trigger-node"})}getNewInstance(){return new Wa}}class Va extends ot{constructor(){super(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"left","trigger_before")}}class Ha extends U.NodeModel{constructor(e){super("before_trigger",e.id),this.name=e.name,this.selectedTrigger=e.selectedTrigger,this.time=void 0!==e.time?e.time:10,this.timeUnit=void 0!==e.timeUnit?e.timeUnit:"hours",this.addPort(new Va("right"))}deSerialize(e,t){super.deSerialize(e,t),this.name=e.name,this.selectedTrigger=e.selectedTrigger,this.time=e.time,this.timeUnit=e.timeUnit}serialize(){return nt.merge(super.serialize(),{name:this.name,selectedTrigger:this.selectedTrigger,time:this.time,timeUnit:this.timeUnit})}}class Ka extends u.Component{constructor(e){super(e),this.openDialog=()=>{this.setState({dialogOpened:!0,nodeFormName:this.props.node.name,nodeFormBeforeTime:this.props.node.time,timeUnit:this.props.node.timeUnit,anchorElementForTooltip:null}),this.props.dispatch(bt(!1))},this.closeDialog=()=>{this.setState({dialogOpened:!1}),this.props.dispatch(bt(!0))},this.handleNodeMouseEnter=e=>{this.state.dialogOpened||this.setState({anchorElementForTooltip:e.currentTarget})},this.handleNodeMouseLeave=()=>{this.setState({anchorElementForTooltip:null})},this.getTriggersInSelectableFormat=()=>this.props.beforeTriggers.map(e=>({value:e.code,label:e.name})),this.getSelectedTriggerValue=()=>{const e=this.getTriggersInSelectableFormat().find(e=>e.value===this.props.node.selectedTrigger);return e?"".concat(this.props.node.time," ").concat(this.props.node.timeUnit," before - ").concat(e.label," event"):"Before Event"},this.state={nodeFormName:this.props.node.name,selectedTrigger:this.props.node.selectedTrigger,nodeFormBeforeTime:this.props.node.time,timeUnit:this.props.node.timeUnit,dialogOpened:!1,anchorElementForTooltip:null}}bem(e){return this.props.classBaseName+e+" "+this.props.className+e+" "}getClassName(){return this.props.classBaseName+" "+this.props.className}render(){return u.createElement("div",{className:this.getClassName(),style:{background:this.props.node.color},onDoubleClick:()=>{this.openDialog()},onMouseEnter:this.handleNodeMouseEnter,onMouseLeave:this.handleNodeMouseLeave},u.createElement("div",{className:"node-container"},u.createElement("div",{className:this.bem("__icon")},u.createElement(pe.a,null)),u.createElement("div",{className:this.bem("__ports")},u.createElement("div",{className:this.bem("__right")},u.createElement(vt,{name:"right",node:this.props.node}),u.createElement(St,{elementId:this.props.node.id,color:"#00b5ad",position:"right"})))),u.createElement("div",{className:this.bem("__title")},u.createElement("div",{className:this.bem("__name")},this.props.node.name?this.props.node.name:this.getSelectedTriggerValue())),u.createElement(kt,{id:this.props.node.id,isTrigger:!0,anchorElement:this.state.anchorElementForTooltip}),u.createElement(mt.a,{open:this.state.dialogOpened,onClose:this.closeDialog,"aria-labelledby":"form-dialog-title",onKeyUp:e=>{if(46===e.keyCode||8===e.keyCode)return e.preventDefault(),e.stopPropagation(),!1}},u.createElement(gt.a,{id:"form-dialog-title"},"Before event node"),u.createElement(ht.a,null,u.createElement(ut.a,null,"Events are emitted in advanced of trigger according to selected time period."),u.createElement(K.a,{container:!0},u.createElement(K.a,{item:!0,xs:6},u.createElement(dt.a,{margin:"normal",id:"trigger-name",label:"Node name",fullWidth:!0,value:this.state.nodeFormName,onChange:e=>{this.setState({nodeFormName:e.target.value})}}))),u.createElement(K.a,{container:!0},u.createElement(K.a,{item:!0,xs:12},u.createElement(xt.a,{value:this.getTriggersInSelectableFormat().find(e=>e.value===this.state.selectedTrigger),options:this.getTriggersInSelectableFormat(),getOptionLabel:e=>e.label,style:{marginBottom:16},onChange:(e,t)=>{null!==t&&this.setState({selectedTrigger:t.value})},renderInput:e=>u.createElement(dt.a,Object.assign({},e,{variant:"standard",label:"Trigger",fullWidth:!0}))}))),u.createElement(K.a,{container:!0},u.createElement(K.a,{item:!0,xs:6},u.createElement(dt.a,{id:"waiting-time",label:"Before time",type:"number",fullWidth:!0,value:this.state.nodeFormBeforeTime,onChange:e=>{this.setState({nodeFormBeforeTime:e.target.value})}})),u.createElement(K.a,{item:!0,xs:6},u.createElement(Bt.a,{fullWidth:!0},u.createElement(Ut.a,{htmlFor:"time-unit"},"Time unit"),u.createElement(Lt.a,{value:this.state.timeUnit,onChange:e=>{this.setState({timeUnit:e.target.value})},inputProps:{name:"time-unit",id:"time-unit"}},u.createElement(zt.a,{value:"minutes"},"Minutes"),u.createElement(zt.a,{value:"hours"},"Hours"),u.createElement(zt.a,{value:"days"},"Days")))))),u.createElement(pt.a,null,u.createElement(L.a,{color:"secondary",onClick:()=>{this.closeDialog()}},"Cancel"),u.createElement(L.a,{color:"primary",onClick:()=>{this.props.node.name=this.state.nodeFormName,this.props.node.selectedTrigger=this.state.selectedTrigger,this.props.node.time=this.state.nodeFormBeforeTime,this.props.node.timeUnit=this.state.timeUnit,this.props.diagramEngine.repaintCanvas(),this.closeDialog()}},"Save changes"))))}}var qa=Object(v.b)((function(e){const{beforeTriggers:t}=e;return{beforeTriggers:t.availableBeforeTriggers}}))(Ka);class Za extends U.AbstractNodeFactory{constructor(){super("before_trigger")}generateReactWidget(e,t){return u.createElement(qa,{diagramEngine:e,node:t,classBaseName:"square-node",className:"before-trigger-node"})}getNewInstance(){return new Ha}}class Ya extends ot{constructor(){super(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"left","wait")}}class Ja extends U.NodeModel{constructor(e){super("wait",e.id),this.name=e.name,this.waitingTime=void 0!==e.waitingTime?e.waitingTime:10,this.waitingUnit=void 0!==e.waitingUnit?e.waitingUnit:"minutes",this.addPort(new Ya("left")),this.addPort(new Ya("right"))}deSerialize(e,t){super.deSerialize(e,t),this.name=e.name,this.waitingTime=e.waitingTime,this.waitingUnit=e.waitingUnit}serialize(){return nt.merge(super.serialize(),{name:this.name,waitingTime:this.waitingTime,waitingUnit:this.waitingUnit})}}class Xa extends u.Component{constructor(e){super(e),this.openDialog=()=>{this.setState({dialogOpened:!0,nodeFormWaitingTime:this.props.node.waitingTime,nodeFormName:this.props.node.name,timeUnit:this.props.node.waitingUnit,anchorElementForTooltip:null}),this.props.dispatch(bt(!1))},this.closeDialog=()=>{this.setState({dialogOpened:!1}),this.props.dispatch(bt(!0))},this.handleNodeMouseEnter=e=>{this.state.dialogOpened||this.setState({anchorElementForTooltip:e.currentTarget})},this.handleNodeMouseLeave=()=>{this.setState({anchorElementForTooltip:null})},this.state={nodeFormWaitingTime:this.props.node.waitingTime,nodeFormName:this.props.node.name,timeUnit:this.props.node.waitingUnit,dialogOpened:!1,anchorElementForTooltip:null}}bem(e){return this.props.classBaseName+e+" "+this.props.className+e+" "}getClassName(){return this.props.classBaseName+" "+this.props.className}render(){return u.createElement("div",{className:this.getClassName(),style:{background:this.props.node.color},onDoubleClick:()=>{this.openDialog()},onMouseEnter:this.handleNodeMouseEnter,onMouseLeave:this.handleNodeMouseLeave},u.createElement("div",{className:"node-container"},u.createElement("div",{className:this.bem("__icon")},u.createElement(ie.a,null)),u.createElement("div",{className:this.bem("__ports")},u.createElement("div",{className:this.bem("__left")},u.createElement(vt,{name:"left",node:this.props.node})),u.createElement("div",{className:this.bem("__right")},u.createElement(vt,{name:"right",node:this.props.node}),u.createElement(St,{elementId:this.props.node.id,color:"#ff851b",position:"right"})))),u.createElement("div",{className:this.bem("__title")},u.createElement("div",{className:this.bem("__name")},this.props.node.name?this.props.node.name:"Wait - ".concat(this.props.node.waitingTime," ").concat(this.props.node.waitingUnit))),u.createElement(kt,{id:this.props.node.id,anchorElement:this.state.anchorElementForTooltip}),u.createElement(mt.a,{open:this.state.dialogOpened,onClose:this.closeDialog,"aria-labelledby":"form-dialog-title",onKeyUp:e=>{if(46===e.keyCode||8===e.keyCode)return e.preventDefault(),e.stopPropagation(),!1}},u.createElement(gt.a,{id:"form-dialog-title"},"Wait node"),u.createElement(ht.a,null,u.createElement(ut.a,null,"Postpones the execution of next node in flow by selected amount of time."),u.createElement(K.a,{container:!0},u.createElement(K.a,{item:!0,xs:6},u.createElement(dt.a,{margin:"normal",id:"waiting-time",label:"Node name",fullWidth:!0,value:this.state.nodeFormName,onChange:e=>{this.setState({nodeFormName:e.target.value})}}))),u.createElement(K.a,{container:!0},u.createElement(K.a,{item:!0,xs:6},u.createElement(dt.a,{id:"waiting-time",label:"Waiting time",type:"number",fullWidth:!0,value:this.state.nodeFormWaitingTime,onChange:e=>{this.setState({nodeFormWaitingTime:e.target.value})}})),u.createElement(K.a,{item:!0,xs:6},u.createElement(Bt.a,{fullWidth:!0},u.createElement(Ut.a,{htmlFor:"time-unit"},"Time unit"),u.createElement(Lt.a,{value:this.state.timeUnit,onChange:e=>{this.setState({timeUnit:e.target.value})},inputProps:{name:"time-unit",id:"time-unit"}},u.createElement(zt.a,{value:"minutes"},"Minutes"),u.createElement(zt.a,{value:"hours"},"Hours"),u.createElement(zt.a,{value:"days"},"Days")))))),u.createElement(pt.a,null,u.createElement(L.a,{color:"secondary",onClick:()=>{this.closeDialog()}},"Cancel"),u.createElement(L.a,{color:"primary",onClick:()=>{this.props.node.waitingTime=this.state.nodeFormWaitingTime,this.props.node.name=this.state.nodeFormName,this.props.node.waitingUnit=this.state.timeUnit,this.props.diagramEngine.repaintCanvas(),this.closeDialog()}},"Save changes"))))}}var Qa=Object(v.b)((function(e){const{segments:t}=e;return{segments:t.avalaibleSegments}}))(Xa);class $a extends U.AbstractNodeFactory{constructor(){super("wait")}generateReactWidget(e,t){return u.createElement(Qa,{diagramEngine:e,node:t,classBaseName:"round-node",className:"wait-node"})}getNewInstance(){return new Ja}}class en extends rt{constructor(){super(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"top","goal")}}class tn extends U.NodeModel{constructor(e){super("goal",e.id),this.name=e.name,this.selectedGoals=e.selectedGoals,this.timeoutTime=e.timeoutTime,this.timeoutUnit=e.timeoutUnit,this.recheckPeriodTime=e.recheckPeriodTime,this.recheckPeriodUnit=e.recheckPeriodUnit,this.addPort(new en("left")),this.addPort(new en("bottom")),this.addPort(new en("right"))}deSerialize(e,t){super.deSerialize(e,t),this.name=e.name,this.selectedGoals=e.selectedGoals,this.timeoutTime=null!==e.timeoutTime&&void 0!==e.timeoutTime?e.timeoutTime:"",this.timeoutUnit=null!==e.timeoutUnit&&void 0!==e.timeoutUnit?e.timeoutUnit:"days",this.recheckPeriodTime=null!==e.recheckPeriodTime&&void 0!==e.recheckPeriodTime?e.recheckPeriodTime:"1",this.recheckPeriodUnit=null!==e.recheckPeriodUnit&&void 0!==e.recheckPeriodUnit?e.recheckPeriodUnit:"hours"}serialize(){return nt.merge(super.serialize(),{name:this.name,selectedGoals:this.selectedGoals,timeoutTime:this.timeoutTime,timeoutUnit:this.timeoutUnit,recheckPeriodTime:this.recheckPeriodTime,recheckPeriodUnit:this.recheckPeriodUnit})}}var an=a(169),nn=a.n(an);class sn extends u.Component{constructor(e){super(e),this.openDialog=()=>{this.setState({dialogOpened:!0,nodeFormName:this.props.node.name,selectedGoals:this.props.node.selectedGoals,timeoutTime:this.props.node.timeoutTime,timeoutUnit:this.props.node.timeoutUnit,recheckPeriodTime:this.props.node.recheckPeriodTime,recheckPeriodUnit:this.props.node.recheckPeriodUnit,anchorElementForTooltip:null}),this.props.dispatch(bt(!1))},this.closeDialog=()=>{this.setState({dialogOpened:!1}),this.props.dispatch(bt(!0))},this.transformOptionsForSelect=()=>this.props.goals.map(e=>({value:e.code,label:e.name})),this.handleNodeMouseEnter=e=>{this.state.dialogOpened||this.setState({anchorElementForTooltip:e.currentTarget})},this.handleNodeMouseLeave=()=>{this.setState({anchorElementForTooltip:null})},this.getSelectedGoals=()=>void 0===this.state.selectedGoals?[]:this.props.goals.filter(e=>this.state.selectedGoals.includes(e.code),this.state.selectedGoals),this.state={nodeFormName:this.props.node.name,selectedGoals:this.props.node.selectedGoals,timeoutTime:this.props.node.timeoutTime,timeoutUnit:this.props.node.timeoutUnit,recheckPeriodTime:this.props.node.recheckPeriodTime,recheckPeriodUnit:this.props.node.recheckPeriodUnit,dialogOpened:!1,anchorElementForTooltip:null}}bem(e){return this.props.classBaseName+e+" "+this.props.className+e+" "}getClassName(){return this.props.classBaseName+" "+this.props.className}render(){return u.createElement("div",{className:this.getClassName(),onDoubleClick:()=>{this.openDialog()},onMouseEnter:this.handleNodeMouseEnter,onMouseLeave:this.handleNodeMouseLeave},u.createElement("div",{className:this.bem("__title")},u.createElement("div",{className:this.bem("__name")},this.props.node.name?this.props.node.name:"Goal")),u.createElement("div",{className:"node-container"},u.createElement("div",{className:this.bem("__icon")},u.createElement(de.a,null)),u.createElement("div",{className:this.bem("__ports")},u.createElement("div",{className:this.bem("__left")},u.createElement(vt,{name:"left",node:this.props.node})),u.createElement("div",{className:this.bem("__right")},u.createElement(vt,{name:"right",node:this.props.node}),this.props.statistics[this.props.node.id]?u.createElement(St,{elementId:this.props.node.id,color:"#21ba45",position:"right"}):u.createElement(Pa.a,{style:{position:"absolute",top:"-5px",right:"-30px",color:"#2ECC40"}})),u.createElement("div",{className:this.bem("__bottom")},u.createElement(vt,{name:"bottom",node:this.props.node}),this.props.statistics[this.props.node.id]?u.createElement(St,{elementId:this.props.node.id,color:"#db2828",position:"bottom"}):u.createElement(nn.a,{style:{position:"absolute",top:"15px",right:"-5px",color:"#FF695E"}})))),u.createElement(kt,{id:this.props.node.id,anchorElement:this.state.anchorElementForTooltip}),u.createElement(mt.a,{open:this.state.dialogOpened,onClose:this.closeDialog,"aria-labelledby":"form-dialog-title",onKeyUp:e=>{if(46===e.keyCode||8===e.keyCode)return e.preventDefault(),e.stopPropagation(),!1}},u.createElement(gt.a,{id:"form-dialog-title"},"Goal node"),u.createElement(ht.a,null,u.createElement(ut.a,null,"Goal node evaluates whether user has completed selected onboarding goals. Timeout value can be optionally specified, defining a point in time when evalution of completed goals is stopped. Execution flow can be directed two ways from the node - a positive direction, when all goals are completed, or a negative one, when timeout threshold is reached."),u.createElement(K.a,{container:!0},u.createElement(K.a,{item:!0,xs:6},u.createElement(dt.a,{margin:"normal",id:"goal-name",label:"Node name",fullWidth:!0,value:this.state.nodeFormName,onChange:e=>{this.setState({nodeFormName:e.target.value})}}))),u.createElement(K.a,{container:!0,style:{marginBottom:"10px"}},u.createElement(K.a,{item:!0,xs:12},u.createElement(xt.a,{multiple:!0,value:this.getSelectedGoals(),options:this.props.goals,getOptionLabel:e=>e.name,disableClearable:!0,onChange:(e,t)=>{null!==t&&this.setState({selectedGoals:t.map(e=>e.code)})},renderInput:e=>u.createElement(dt.a,Object.assign({},e,{variant:"standard",label:"Selected Goal(s)",fullWidth:!0}))}))),u.createElement(K.a,{container:!0,spacing:1},u.createElement(K.a,{item:!0,xs:6},u.createElement(dt.a,{id:"recheck-period-time",label:"Recheck period time",type:"number",helperText:"How often goals completition should be checked",fullWidth:!0,value:this.state.recheckPeriodTime,onChange:e=>{this.setState({recheckPeriodTime:e.target.value})}})),u.createElement(K.a,{item:!0,xs:6},u.createElement(Bt.a,{fullWidth:!0},u.createElement(Ut.a,{htmlFor:"time-unit"},"Time unit"),u.createElement(Lt.a,{value:this.state.recheckPeriodUnit,onChange:e=>{this.setState({recheckPeriodUnit:e.target.value})},inputProps:{name:"recheck-period-unit",id:"recheck-period-unit"}},u.createElement(zt.a,{value:"minutes"},"Minutes"),u.createElement(zt.a,{value:"hours"},"Hours"),u.createElement(zt.a,{value:"days"},"Days"))))),u.createElement(K.a,{container:!0,spacing:1},u.createElement(K.a,{item:!0,xs:6},u.createElement(dt.a,{id:"timeout-time",label:"Timeout time",type:"number",placeholder:"No timeout",helperText:"Optionally select a timeout",fullWidth:!0,value:this.state.timeoutTime,onChange:e=>{this.setState({timeoutTime:e.target.value})}})),u.createElement(K.a,{item:!0,xs:6},u.createElement(Bt.a,{fullWidth:!0},u.createElement(Ut.a,{htmlFor:"time-unit"},"Time unit"),u.createElement(Lt.a,{value:this.state.timeoutUnit,onChange:e=>{this.setState({timeoutUnit:e.target.value})},inputProps:{name:"time-unit",id:"time-unit"}},u.createElement(zt.a,{value:"minutes"},"Minutes"),u.createElement(zt.a,{value:"hours"},"Hours"),u.createElement(zt.a,{value:"days"},"Days")))))),u.createElement(pt.a,null,u.createElement(L.a,{color:"secondary",onClick:()=>{this.closeDialog()}},"Cancel"),u.createElement(L.a,{color:"primary",onClick:()=>{this.props.node.name=this.state.nodeFormName,this.props.node.selectedGoals=this.state.selectedGoals,this.props.node.timeoutTime=this.state.timeoutTime,this.props.node.timeoutUnit=this.state.timeoutUnit,this.props.node.recheckPeriodTime=this.state.recheckPeriodTime,this.props.node.recheckPeriodUnit=this.state.recheckPeriodUnit,this.props.diagramEngine.repaintCanvas(),this.closeDialog()}},"Save changes"))))}}var on=Object(v.b)((function(e){const{goals:t,dispatch:a}=e;return{goals:t.availableGoals,dispatch:a,statistics:e.statistics.statistics}}))(sn);class rn extends U.AbstractNodeFactory{constructor(){super("goal")}generateReactWidget(e,t){return u.createElement(on,{diagramEngine:e,node:t,classBaseName:"diamond-node",className:"goal-node"})}getNewInstance(){return new tn}}class ln extends rt{constructor(){super(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"top","condition")}}class cn extends U.NodeModel{constructor(e){super("condition",e.id),this.name=e.name,this.conditions=e.conditions,this.addPort(new ln("left")),this.addPort(new ln("bottom")),this.addPort(new ln("right"))}deSerialize(e,t){super.deSerialize(e,t),this.name=e.name,this.conditions=e.conditions}serialize(){return nt.merge(super.serialize(),{name:this.name,conditions:this.conditions})}}var dn=a(105),mn=a.n(dn),pn=a(70),hn=a.n(pn),un=a(391);const gn=Object(Zt.a)(e=>({formControl:{marginRight:e.spacing(1),marginBottom:e.spacing(1),minWidth:150},formLabel:{display:"block",marginBottom:e.spacing(1)},amountInput:{marginRight:e.spacing(1),marginBottom:e.spacing(1)}}));function En(e){var t,a,n,i;const s=gn();void 0===e.values.operator&&e.blueprint.operators&&1===e.blueprint.operators.length&&e.dispatch(Xt(e.name,{operator:e.blueprint.operators[0]})),void 0===e.values.unit&&e.blueprint.units&&1===e.blueprint.units.length&&e.dispatch(Qt(e.name,{unit:e.blueprint.units[0]}));return g.a.createElement(g.a.Fragment,null,!e.hideLabel&&g.a.createElement(ta.a,{className:s.formLabel},e.blueprint.label),e.blueprint.operators&&e.blueprint.operators.length&&g.a.createElement(Bt.a,{className:s.formControl,disabled:1===e.blueprint.operators.length},g.a.createElement(Ut.a,null,"Operator"),g.a.createElement(Lt.a,{autoWidth:!0,value:null!==(t=e.values.operator)&&void 0!==t?t:"",onChange:t=>{e.dispatch(Qt(e.name,{operator:t.target.value}))}},e.blueprint.operators.map(e=>g.a.createElement(zt.a,{key:e,value:e},e)))),g.a.createElement(dt.a,{className:s.amountInput,label:e.blueprint.amountLabel,type:"number",onChange:t=>{e.dispatch(Qt(e.name,{selection:t.target.value}))},value:null!==(a=e.values.selection)&&void 0!==a?a:"",inputProps:null!==(n=e.blueprint.amountInputAttributes)&&void 0!==n?n:{}}),e.blueprint.units&&e.blueprint.units.length&&g.a.createElement(Bt.a,{className:s.formControl,disabled:1===e.blueprint.units.length},g.a.createElement(Ut.a,null,e.blueprint.unitsLabel),g.a.createElement(Lt.a,{autoWidth:!0,value:null!==(i=e.values.unit)&&void 0!==i?i:"",onChange:t=>{e.dispatch(Qt(e.name,{unit:t.target.value}))}},e.blueprint.units.map(e=>g.a.createElement(zt.a,{key:e,value:e},e)))))}var vn=a(61),bn=a.n(vn);function yn(){return{id:bn()(),key:"",params:[]}}function fn(e,t){switch(t.type){case"UPDATE_PARAM_VALUES":{let[a,n]=t.payload.name;return{...e,nodes:e.nodes.map(e=>e.id===a?{...e,params:e.params.map(e=>e.key===n?{...e,values:Object.assign(e.values,t.payload.values)}:e)}:e)}}case"SET_PARAM_VALUES":{let[a,n]=t.payload.name;return{...e,nodes:e.nodes.map(e=>e.id===a?{...e,params:e.params.map(e=>e.key===n?{...e,values:t.payload.values}:e)}:e)}}case"SET_EVENT":return{...e,nodes:[yn()],event:t.payload};case"ADD_CRITERION":return{...e,nodes:[...e.nodes,yn()]};case"DELETE_NODE":return{...e,nodes:e.nodes.filter(e=>e.id!==t.payload.nodeId)};case"SET_KEY_FOR_NODE":{let a=e.nodes.map(e=>t.payload.nodeId===e.id?{id:e.id,key:t.payload.key,params:t.payload.params}:e);return{...e,nodes:a}}default:throw new Error("unsupported action type "+t.type)}}const Nn=g.a.createContext(null);function Tn(e){const t=Object(u.useContext)(Nn);let a=e.node.params.filter(t=>t.key===e.blueprint.key)[0],n=[e.node.id,a.key];switch(e.blueprint.type){case"string_labeled_array":return g.a.createElement(da,{name:n,values:a.values,blueprint:e.blueprint,dispatch:t});case"boolean":return g.a.createElement(ea,{name:n,values:a.values,blueprint:e.blueprint,dispatch:t});case"number":return g.a.createElement(na,{name:n,values:a.values,blueprint:e.blueprint,dispatch:t,hideLabel:!0});case"timeframe":return g.a.createElement(En,{name:n,values:a.values,blueprint:e.blueprint,dispatch:t});default:throw new Error("unsupported node type "+e.blueprint.type)}}function Cn(e){return g.a.createElement(g.a.Fragment,null,e.blueprint.map(t=>g.a.createElement(Tn,{key:t.key,node:e.node,blueprint:t})))}const Sn=Object(Zt.a)({cardContent:{display:"flex",justifyContent:"space-between",alignItems:"flex-end",backgroundColor:"#F2F2F2"},formControl:{minWidth:"180px"}});function _n(e){const t=Sn(),a=Object(u.useContext)(Nn);return g.a.createElement(Kt.a,null,g.a.createElement(qt.a,{className:t.cardContent},g.a.createElement(Bt.a,{className:t.formControl},g.a.createElement(Ut.a,{id:"select-criteria-label"},"Criterion"),g.a.createElement(Lt.a,{labelId:"select-criteria-label",id:"select-criteria",placeholder:"Select criteria",value:e.node.key,onChange:t=>{let n=e.criteriaBlueprint.filter(e=>e.key===t.target.value)[0].params.map(e=>({key:e.key,values:{}}));var i;a((i=e.node.id,{type:"SET_KEY_FOR_NODE",payload:{key:t.target.value,nodeId:i,params:n}}))}},e.criteriaBlueprint.map(e=>g.a.createElement(zt.a,{key:e.key,value:e.key},e.label)))),g.a.createElement(un.a,{onClick:()=>a({type:"DELETE_NODE",payload:{nodeId:e.node.id}}),size:"small",className:t.icon,"aria-label":"delete"},g.a.createElement(mn.a,null))),e.node.key&&g.a.createElement(qt.a,null,g.a.createElement(Cn,{node:e.node,blueprint:e.criteriaBlueprint.filter(t=>t.key===e.node.key)[0].params})))}const wn=Object(Zt.a)({andContainer:{display:"flex",justifyContent:"center",flexGrow:0,maxWidth:"100%",flexBasis:"100%"}});function kn(e){const t=wn(),a=Object(u.useContext)(Nn);return g.a.createElement(g.a.Fragment,null,e.nodes.map((a,n)=>g.a.createElement(g.a.Fragment,{key:a.id},n>=1&&g.a.createElement("div",{className:t.andContainer},"AND"),g.a.createElement(K.a,{item:!0,xs:12},g.a.createElement(_n,{node:a,criteriaBlueprint:e.criteriaBlueprint})))),g.a.createElement(K.a,{item:!0,xs:12},g.a.createElement(L.a,{onClick:()=>a({type:"ADD_CRITERION"}),className:t.button,startIcon:g.a.createElement(hn.a,null)},"Add criterion")))}const xn=Object(Zt.a)({selectedButton:{backgroundColor:"#E4E4E4"},deselectedButton:{color:"#A6A6A6"}});var Mn=Object(u.forwardRef)((function(e,t){const a=xn(),n=Object(v.c)(e=>e.criteria.criteria),[i,s]=Object(u.useReducer)(fn,{version:1,event:n[0].event,nodes:[yn()],...e.conditions});return Object(u.useImperativeHandle)(t,()=>({state:i})),g.a.createElement(Nn.Provider,{value:s},g.a.createElement(K.a,{container:!0,item:!0,xs:12,spacing:3},g.a.createElement(K.a,{item:!0,xs:12},g.a.createElement(Ta.a,{"aria-label":"outlined button group"},n.map(e=>g.a.createElement(L.a,{onClick:()=>s({type:"SET_EVENT",payload:e.event}),className:i.event===e.event?a.selectedButton:a.deselectedButton,key:e.event},e.event)))),n.filter(e=>e.event===i.event).map(e=>g.a.createElement(kn,{key:e.event,criteriaBlueprint:e.criteria,nodes:i.nodes}))))}));class Fn extends u.Component{constructor(e){super(e),this.openDialog=()=>{this.setState({dialogOpened:!0,nodeFormName:this.props.node.name,anchorElementForTooltip:null}),this.props.dispatch(bt(!1))},this.closeDialog=()=>{this.setState({dialogOpened:!1}),this.props.dispatch(bt(!0))},this.handleNodeMouseEnter=e=>{this.state.dialogOpened||this.setState({anchorElementForTooltip:e.currentTarget})},this.handleNodeMouseLeave=()=>{this.setState({anchorElementForTooltip:null})},this.builderRef=u.createRef(),this.state={nodeFormName:this.props.node.name,dialogOpened:!1,anchorElementForTooltip:null}}bem(e){return this.props.classBaseName+e+" "+this.props.className+e+" "}getClassName(){return this.props.classBaseName+" "+this.props.className}render(){let e=!1;return(0===this.props.statistics.length||this.props.statistics[this.props.node.id])&&(e=!0),u.createElement("div",{className:this.getClassName(),style:{background:this.props.node.color},onDoubleClick:()=>{this.openDialog()},onMouseEnter:this.handleNodeMouseEnter,onMouseLeave:this.handleNodeMouseLeave},u.createElement("div",{className:this.bem("__title")},u.createElement("div",{className:this.bem("__name")},this.props.node.name?this.props.node.name:"Condition")),u.createElement("div",{className:"node-container"},u.createElement("div",{className:this.bem("__icon")},u.createElement(le.a,null)),u.createElement("div",{className:this.bem("__ports")},u.createElement("div",{className:this.bem("__left")},u.createElement(vt,{name:"left",node:this.props.node})),u.createElement("div",{className:this.bem("__right")},u.createElement(vt,{name:"right",node:this.props.node}),e?u.createElement(St,{elementId:this.props.node.id,color:"#21ba45",position:"right"}):u.createElement(Pa.a,{style:{position:"absolute",top:"-5px",right:"-30px",color:"#2ECC40"}})),u.createElement("div",{className:this.bem("__bottom")},u.createElement(vt,{name:"bottom",node:this.props.node}),e?u.createElement(St,{elementId:this.props.node.id,color:"#db2828",position:"bottom"}):u.createElement(Ia.a,{style:{position:"absolute",top:"15px",right:"-5px",color:"#FF695E"}})))),u.createElement(kt,{id:this.props.node.id,anchorElement:this.state.anchorElementForTooltip}),u.createElement(mt.a,{fullWidth:!0,maxWidth:"md",open:this.state.dialogOpened,onClose:this.closeDialog,"aria-labelledby":"form-dialog-title",onKeyUp:e=>{if(46===e.keyCode||8===e.keyCode)return e.preventDefault(),e.stopPropagation(),!1}},u.createElement(gt.a,{id:"form-dialog-title"},"Event Condition"),u.createElement(ht.a,null,u.createElement(K.a,{container:!0},u.createElement(K.a,{style:{marginBottom:"10px"},item:!0,xs:6},u.createElement(dt.a,{margin:"normal",id:"trigger-name",label:"Node name",fullWidth:!0,value:this.state.nodeFormName,onChange:e=>{this.setState({nodeFormName:e.target.value})}})),u.createElement(Mn,{conditions:this.props.node.conditions,ref:this.builderRef}))),u.createElement(pt.a,null,u.createElement(L.a,{color:"secondary",onClick:()=>{this.closeDialog()}},"Cancel"),u.createElement(L.a,{color:"primary",onClick:()=>{this.props.node.name=this.state.nodeFormName,this.props.node.conditions=this.builderRef.current.state,this.props.diagramEngine.repaintCanvas(),this.closeDialog()}},"Save changes"))))}}var On=Object(v.b)((function(e){const{dispatch:t}=e;return{dispatch:t,statistics:e.statistics.statistics}}))(Fn);class Pn extends U.AbstractNodeFactory{constructor(){super("condition")}generateReactWidget(e,t){return u.createElement(On,{diagramEngine:e,node:t,classBaseName:"diamond-node",className:"condition-node"})}getNewInstance(){return new cn}}class Dn extends ot{constructor(){super(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"left","push_notification")}}class In extends U.NodeModel{constructor(e){super("push_notification",e.id),this.name=e.name,this.selectedTemplate=e.selectedTemplate,this.selectedApplication=e.selectedApplication,this.addPort(new Dn("left")),this.addPort(new Dn("right"))}deSerialize(e,t){super.deSerialize(e,t),this.name=e.name,this.selectedTemplate=e.selectedTemplate,this.selectedApplication=e.selectedApplication}serialize(){return nt.merge(super.serialize(),{name:this.name,selectedTemplate:this.selectedTemplate,selectedApplication:this.selectedApplication})}}class An extends u.Component{constructor(e){super(e),this.openDialog=()=>{this.setState({dialogOpened:!0,nodeFormName:this.props.node.name,anchorElementForTooltip:null}),this.props.dispatch(bt(!1))},this.closeDialog=()=>{this.setState({dialogOpened:!1}),this.props.dispatch(bt(!0))},this.handleNodeMouseEnter=e=>{this.state.dialogOpened||this.setState({anchorElementForTooltip:e.currentTarget})},this.handleNodeMouseLeave=()=>{this.setState({anchorElementForTooltip:null})},this.getTemplatesInSelectableFormat=()=>this.props.templates.map(e=>({value:e.code,label:e.name})),this.getApplicationsInSelectableFormat=()=>this.props.applications.map(e=>({value:e.code,label:e.name})),this.getSelectedTemplateValue=()=>{const e=this.props.templates.find(e=>e.code===this.props.node.selectedTemplate);return e?" - ".concat(e.name):""},this.state={nodeFormName:this.props.node.name,selectedTemplate:this.props.node.selectedTemplate,selectedApplication:this.props.node.selectedApplication,dialogOpened:!1,anchorElementForTooltip:null}}bem(e){return this.props.classBaseName+e+" "+this.props.className+e+" "}getClassName(){return this.props.classBaseName+" "+this.props.className}render(){return u.createElement("div",{className:this.getClassName(),style:{background:this.props.node.color},onDoubleClick:()=>{this.openDialog()},onMouseEnter:this.handleNodeMouseEnter,onMouseLeave:this.handleNodeMouseLeave},u.createElement("div",{className:"node-container"},u.createElement("div",{className:this.bem("__icon")},u.createElement(ue.a,null)),u.createElement("div",{className:this.bem("__ports")},u.createElement("div",{className:this.bem("__left")},u.createElement(vt,{name:"left",node:this.props.node})),u.createElement("div",{className:this.bem("__right")},u.createElement(vt,{name:"right",node:this.props.node}),u.createElement(St,{elementId:this.props.node.id,color:"#dc73ff",position:"right"})))),u.createElement("div",{className:this.bem("__title")},u.createElement("div",{className:this.bem("__name")},this.props.node.name?this.props.node.name:"Notification ".concat(this.getSelectedTemplateValue()))),u.createElement(kt,{id:this.props.node.id,anchorElement:this.state.anchorElementForTooltip}),u.createElement(mt.a,{open:this.state.dialogOpened,onClose:this.closeDialog,"aria-labelledby":"form-dialog-title",onKeyUp:e=>{if(46===e.keyCode||8===e.keyCode)return e.preventDefault(),e.stopPropagation(),!1},fullWidth:!0},u.createElement(gt.a,{id:"form-dialog-title"},"Notification node"),u.createElement(ht.a,null,u.createElement(ut.a,null,"Sends a push notification to user."),u.createElement(K.a,{container:!0},u.createElement(K.a,{item:!0,xs:6},u.createElement(dt.a,{margin:"normal",id:"action-name",label:"Node name",fullWidth:!0,value:this.state.nodeFormName,onChange:e=>{this.setState({nodeFormName:e.target.value})}}))),u.createElement(K.a,{container:!0,alignItems:"center",alignContent:"space-between"},u.createElement(K.a,{item:!0,xs:12},u.createElement(xt.a,{value:this.getTemplatesInSelectableFormat().find(e=>e.value===this.state.selectedTemplate),options:this.getTemplatesInSelectableFormat(),getOptionLabel:e=>e.label,style:{marginBottom:16},onChange:(e,t)=>{null!==t&&this.setState({selectedTemplate:t.value})},renderInput:e=>u.createElement(dt.a,Object.assign({},e,{variant:"standard",label:"Notification template",fullWidth:!0}))}))),u.createElement(K.a,{container:!0,alignItems:"center",alignContent:"space-between"},u.createElement(K.a,{item:!0,xs:12},u.createElement(xt.a,{value:this.getApplicationsInSelectableFormat().find(e=>e.value===this.state.selectedApplication),options:this.getApplicationsInSelectableFormat(),getOptionLabel:e=>e.label,style:{marginBottom:16},onChange:(e,t)=>{null!==t&&this.setState({selectedApplication:t.value})},renderInput:e=>u.createElement(dt.a,Object.assign({},e,{variant:"standard",label:"Application",fullWidth:!0}))})))),u.createElement(pt.a,null,u.createElement(L.a,{color:"secondary",onClick:()=>{this.closeDialog()}},"Cancel"),u.createElement(L.a,{color:"primary",onClick:()=>{this.props.node.name=this.state.nodeFormName,this.props.node.selectedTemplate=this.state.selectedTemplate,this.props.node.selectedApplication=this.state.selectedApplication,this.props.diagramEngine.repaintCanvas(),this.closeDialog()}},"Save changes"))))}}var Bn=Object(v.b)((function(e){return{templates:e.pushNotifications.availableTemplates,applications:e.pushNotifications.availableApplications}}))(An);class Un extends U.AbstractNodeFactory{constructor(){super("push_notification")}generateReactWidget(e,t){return u.createElement(Bn,{diagramEngine:e,node:t,classBaseName:"square-node",className:"push-notification-node"})}getNewInstance(){return new In}}class Ln extends rt{constructor(){super(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"right","ab_test")}}class zn extends U.NodeModel{constructor(e){super("ab_test",e.id),this.name=e.name,this.scenarioName=e.scenarioName,e.variants?this.variants=e.variants:this.variants=[{code:bn()().slice(0,6),name:"Variant A",distribution:50},{code:bn()().slice(0,6),name:"Variant B",distribution:50}],this.addPort(new Ln("left")),this.variants.forEach((e,t)=>this.addPort(new Ln("right."+t)))}deSerialize(e,t){super.deSerialize(e,t),this.name=e.name,this.variants=e.variants}serialize(){return nt.merge(super.serialize(),{name:this.name,variants:this.variants})}}var Wn=a(385),Rn=a(400),jn=a(170),Gn=a.n(jn),Vn=a(171),Hn=a.n(Vn);function Kn(e,t){let a=!1;switch(t.type){case"ADD_VARIANT":return{...e,variants:[...e.variants,{code:bn()().slice(0,6),name:"Variant "+String.fromCharCode(65+e.variants.length),distribution:0}]};case"DELETE_VARIANT":let n=e.variants.filter((e,a)=>a!==t.payload.index);return 100!==n.reduce((e,t)=>e+parseInt(t.distribution),0)&&(a=!0),{...e,variants:n,isError:a};case"UPDATE_VARIANT_DISTRIBUTION":return a=e.variants.filter((e,a)=>a!==t.payload.index).reduce((e,t)=>e+parseInt(t.distribution),0)+parseInt(t.payload.value)!==100,{...e,variants:e.variants.map((e,a)=>a===t.payload.index?{...e,distribution:t.payload.value}:e),isError:a};case"UPDATE_VARIANT_NAME":return{...e,variants:e.variants.map((e,a)=>a===t.payload.index?{...e,name:t.payload.value}:e)};case"UPDATE_SEGMENT_NAME":return{...e,variants:e.variants.map((e,a)=>a===t.payload.index?{...e,segment:{name:t.payload.name}}:e)};default:throw new Error("unsupported action type "+t.type)}}function qn(e){var t;const a="Scenario variant: "+e.scenarioName+" - "+e.nodeName+" - "+e.variantName+" ("+e.variantCode+")",[n,i]=g.a.useState(!1),[s,o]=g.a.useState(null!==(t=e.segment.name)&&void 0!==t?t:a);return g.a.createElement(Bt.a,null,g.a.createElement(L.a,{size:"small",variant:"outlined",color:"secondary",disableElevation:!0,onClick:()=>{i(!0)},startIcon:e.segment.name?g.a.createElement(Gn.a,null):g.a.createElement(hn.a,null)},e.segment.name?"Edit segment":"Create segment"),g.a.createElement(mt.a,{open:n,fullWidth:!0,maxWidth:"md"},g.a.createElement(gt.a,{id:"form-dialog-title"},e.segment.name?"Edit segment":"Create segment"),g.a.createElement(ht.a,null,g.a.createElement(ut.a,null,"To create associated segment to variant, please enter segment name."),g.a.createElement(dt.a,{autoFocus:!0,margin:"dense",label:"Segment name",type:"string",value:s,onChange:e=>{o(e.target.value)},fullWidth:!0}),e.segment.code?g.a.createElement("div",null,g.a.createElement(dt.a,{fullWidth:!0,margin:"dense",label:"Segment code",type:"string",value:e.segment.code,disabled:!0}),g.a.createElement(L.a,{size:"small",variant:"outlined",color:"secondary",disableElevation:!0,startIcon:g.a.createElement(Hn.a,null),onClick:()=>{window.open(Be+e.segment.id)}},"View segment")):""),g.a.createElement(pt.a,null,g.a.createElement(L.a,{onClick:()=>{var t;o(null!==(t=e.segment.name)&&void 0!==t?t:a),i(!1)},color:"secondary"},"Cancel"),g.a.createElement(L.a,{onClick:()=>{e.dispatch({type:"UPDATE_SEGMENT_NAME",payload:{index:e.index,name:s}}),i(!1)},color:"primary"},e.segment.name?"Save":"Create"))))}var Zn=Object(u.forwardRef)((function(e,t){const[a,n]=Object(u.useReducer)(Kn,{...e});return void 0!==a.isError&&e.onEnableSave(!a.isError),Object(u.useImperativeHandle)(t,()=>({state:a})),g.a.createElement("form",{autoComplete:"off",noValidate:!0},a.variants.flatMap((t,i)=>{var s;return g.a.createElement(K.a,{container:!0,spacing:1,key:"grid-index-"+i},g.a.createElement(K.a,{item:!0,xs:1},g.a.createElement(dt.a,{disabled:!0,label:"ID",value:t.code})),g.a.createElement(K.a,{item:!0,xs:5},g.a.createElement(Bt.a,{fullWidth:!0},g.a.createElement(dt.a,{label:"Variant name",value:t.name,required:!0,onChange:e=>n({type:"UPDATE_VARIANT_NAME",payload:{index:i,value:e.target.value}})}))),g.a.createElement(K.a,{item:!0,xs:2},g.a.createElement(Bt.a,null,g.a.createElement(Ut.a,{error:a.isError},"Distribution"),g.a.createElement(Wn.a,{error:a.isError,required:!0,type:"number",value:t.distribution,onChange:e=>n({type:"UPDATE_VARIANT_DISTRIBUTION",payload:{index:i,value:e.target.value}}),endAdornment:g.a.createElement(Rn.a,{position:"end"},"%")}))),g.a.createElement(K.a,{item:!0,xs:1,style:{display:"flex",alignItems:"center",justifyContent:"space-evenly"}},i>1&&g.a.createElement(un.a,{onClick:()=>{n({type:"DELETE_VARIANT",payload:{index:i}})},size:"small","aria-label":"delete"},g.a.createElement(mn.a,null))),g.a.createElement(K.a,{item:!0,xs:3,style:{display:"flex",alignItems:"center"}},g.a.createElement(qn,{index:i,variantCode:t.code,segment:null!==(s=t.segment)&&void 0!==s?s:{},dispatch:n,variantName:t.name,nodeName:e.node.name,scenarioName:e.node.scenarioName})))}),g.a.createElement(K.a,{container:!0},g.a.createElement(K.a,{item:!0,xs:12},g.a.createElement(L.a,{startIcon:g.a.createElement(hn.a,null),onClick:()=>{n({type:"ADD_VARIANT"})}},"Add variant"))))}));class Yn extends u.Component{constructor(e){super(e),this.openDialog=()=>{this.setState({dialogOpened:!0,nodeFormName:this.props.node.name,anchorElementForTooltip:null}),this.props.dispatch(bt(!1))},this.closeDialog=()=>{this.setState({dialogOpened:!1}),this.props.dispatch(bt(!0))},this.handleNodeMouseEnter=e=>{this.state.dialogOpened||this.setState({anchorElementForTooltip:e.currentTarget})},this.handleNodeMouseLeave=()=>{this.setState({anchorElementForTooltip:null})},this.enableSave=e=>{this.state.enabledSave!==e&&this.setState({enabledSave:e})},this.syncNodeModel=()=>{this.props.node.variants.forEach((e,t)=>{this.props.node.getPort("right."+t)||this.props.node.addPort(new Ln("right."+t))});for(const e in this.props.node.getPorts())if(e.startsWith("right.")){let t=e.split(".")[1];if(!this.props.node.variants[t]){let t=this.props.node.getPort(e);for(const[e]of Object.entries(t.getLinks()))this.props.diagramEngine.diagramModel.removeLink(e);this.props.node.removePort(t)}}},this.builderRef=u.createRef(),this.state={nodeFormName:this.props.node.name,enabledSave:!0,dialogOpened:!1,anchorElementForTooltip:null}}bem(e){return this.props.classBaseName+e+" "+this.props.className+e+" "}getClassName(){return this.props.classBaseName+" "+this.props.className}render(){return u.createElement("div",{className:this.getClassName(),style:{background:this.props.node.color},onDoubleClick:()=>{this.openDialog()},onMouseEnter:this.handleNodeMouseEnter,onMouseLeave:this.handleNodeMouseLeave},u.createElement("div",{className:this.bem("__title")},u.createElement("div",{className:this.bem("__name")},this.props.node.name?this.props.node.name:"AB Test")),u.createElement("div",{className:"node-container"},u.createElement("div",{className:this.bem("__icon")},u.createElement(Ee.a,null)),u.createElement("div",{className:this.bem("__ports")},u.createElement("div",{className:this.bem("__left")},u.createElement(vt,{name:"left",node:this.props.node}))),u.createElement("div",{className:this.bem("__ports")},this.props.node.variants.flatMap((e,t)=>u.createElement("div",{className:this.bem("__right"),key:"right-port-"+t,style:{position:"relative"}},u.createElement(vt,{name:"right."+t,node:this.props.node}),u.createElement("div",{className:this.bem("__description")},u.createElement(St,{elementId:this.props.node.id,index:e.code,color:"#767676",position:"right-condensed"}),u.createElement(H.a,{style:{fontSize:"0.8rem",marginLeft:"5px"},noWrap:!0},e.name," (",e.distribution,"%)")))))),u.createElement(kt,{id:this.props.node.id,anchorElement:this.state.anchorElementForTooltip,variants:this.props.node.variants}),u.createElement(mt.a,{open:this.state.dialogOpened,onClose:this.closeDialog,maxWidth:"md","aria-labelledby":"form-dialog-title",onKeyUp:e=>{if(46===e.keyCode||8===e.keyCode)return e.preventDefault(),e.stopPropagation(),!1}},u.createElement(gt.a,{id:"form-dialog-title"},"AB Test"),u.createElement(ht.a,null,u.createElement(ut.a,null,"A/B testing is comparing two versions of either a webpage, email campaign or an aspect in a scenario to evaluate which performs best. With the different variants shown to your customers, you can determine which version is the most effective."),u.createElement(K.a,{container:!0},u.createElement(K.a,{style:{marginBottom:"10px"},item:!0,xs:6},u.createElement(dt.a,{margin:"normal",label:"Node name",fullWidth:!0,value:this.state.nodeFormName,onChange:e=>{this.setState({nodeFormName:e.target.value})}}))),u.createElement(Zn,{variants:this.props.node.variants,node:this.props.node,onEnableSave:this.enableSave,ref:this.builderRef})),u.createElement(pt.a,null,u.createElement(L.a,{color:"secondary",onClick:()=>{this.closeDialog()}},"Cancel"),u.createElement(L.a,{color:"primary",disabled:!this.state.enabledSave,onClick:()=>{this.props.node.name=this.state.nodeFormName,this.props.node.variants=this.builderRef.current.state.variants,this.syncNodeModel(),this.props.diagramEngine.repaintCanvas(),this.closeDialog()}},"Save changes"))))}}var Jn=Object(v.b)((function(e){const{dispatch:t}=e;return{dispatch:t}}))(Yn);class Xn extends U.AbstractNodeFactory{constructor(){super("ab_test")}generateReactWidget(e,t){return u.createElement(Jn,{diagramEngine:e,node:t,classBaseName:"diamond-node",className:"abtest-node"})}getNewInstance(){return new zn}}var Qn=a(404),$n=a(405),ei=a(406),ti=a(407);class ai extends u.Component{constructor(e){super(e),this.saveChanges=()=>{const{dispatch:e}=this.props;if(this.props.app.isCorruptedPayload())return void e(yt({open:!0,variant:"error",text:"Cannot modify corrupted scenario."}));const t=new je(this.props.app.getDiagramEngine().getDiagramModel()),a={name:this.props.scenario.name,...t.exportPayload()},n=this.props.scenario.id;n&&(a.id=n),e(Tt(!0)),N.a.post("".concat(Ce),a).then(t=>{e(ft(t.data.id)),e(Tt(!1)),e(yt({open:!0,variant:"success",text:"Scenario saving succeeded."}))}).catch(t=>{e(Tt(!1));let a="Scenario saving failed.";t.response.data&&t.response.data.message&&(a=t.response.data.message),e(yt({open:!0,variant:"error",text:a})),console.log(t)})},this.startEditingName=()=>{this.setState({editedName:this.props.scenario.name,editingName:!0})},this.cancelEditingName=()=>{this.setState({editedName:"",editingName:!1})},this.submitEditingName=()=>{0!==this.state.editedName.trim().length?(this.props.dispatch(Nt(this.state.editedName)),this.setState({editedName:"",editingName:!1})):this.cancelEditingName()},this.handleCloseAndSaveDuringChangingName=e=>{27===e.keyCode?this.cancelEditingName():13===e.keyCode&&this.submitEditingName()},this.handleNameTyping=e=>{this.setState({editedName:e.target.value})},this.closeNotification=()=>{this.props.dispatch(yt({open:!1}))},this.zoomOut=()=>{let e=this.props.app.diagramEngine.getDiagramModel().getZoomLevel();this.props.app.diagramEngine.getDiagramModel().setZoomLevel(e-5),this.props.app.diagramEngine.repaintCanvas()},this.zoomIn=()=>{let e=this.props.app.diagramEngine.getDiagramModel().getZoomLevel();this.props.app.diagramEngine.getDiagramModel().setZoomLevel(e+5),this.props.app.diagramEngine.repaintCanvas()},this.zoomToFit=()=>{this.props.app.diagramEngine.zoomToFit()},this.state={editingName:!1,editedName:""},this.ctrlDown=!1,this.nodesToCopy=[],this.keydownHandler=this.keydownHandler.bind(this),this.keyupHandler=this.keyupHandler.bind(this),this.copyNode=this.copyNode.bind(this)}copyNode(e){let t=75,a=75,n=this.props.app.getDiagramEngine().getDiagramModel(),i=n.getNodes();if(void 0!==i[e]){let s=i[e].clone({});s.setPosition(s.x+t,s.y+a),s.selected=!1,n.addNode(s),this.forceUpdate()}else console.warn("Unable to copy node with ID "+e)}keydownHandler(e){if(17!==e.keyCode&&91!==e.keyCode||(this.ctrlDown=!0),this.ctrlDown&&67===e.keyCode){let e=this.props.app.getDiagramEngine().getDiagramModel();this.nodesToCopy=[];for(const t of e.getSelectedItems())t.selected&&t instanceof U.NodeModel&&this.nodesToCopy.push(t.id)}if(this.ctrlDown&&86===e.keyCode){for(const e of this.nodesToCopy)this.copyNode(e);this.nodesToCopy=[]}}keyupHandler(e){17!==e.keyCode&&91!==e.keyCode||(this.ctrlDown=!1)}componentDidMount(){document.addEventListener("keydown",this.keydownHandler),document.addEventListener("keyup",this.keyupHandler)}componentWillUnmount(){document.removeEventListener("keydown",this.keydownHandler),document.removeEventListener("keyup",this.keyupHandler)}componentDidUpdate(e){!0===this.props.app.isCorruptedPayload()&&!1===e.app.isCorruptedPayload()&&this.props.dispatch(yt({open:!0,variant:"error",text:"Unable to load corrupted scenario."}))}render(){const{classes:e,canvas:t}=this.props,a={className:"srd-demo-canvas",diagramEngine:this.props.app.getDiagramEngine(),maxNumberPointsPerLink:0,allowLooseLinks:!1,allowCanvasTranslation:t.pannable,allowCanvasZoom:t.zoomable};return u.createElement("div",{className:"body"},u.createElement("div",{className:e.root},u.createElement(R.a,null),u.createElement(W.a,{position:"fixed",className:e.appBar},u.createElement(j.a,null,u.createElement(K.a,{container:!0},u.createElement(K.a,{item:!0,xs:4},u.createElement(H.a,{variant:"h6",color:"inherit",noWrap:!0},this.state.editingName?u.createElement("input",{autoFocus:!0,type:"text",value:this.state.editedName,onChange:this.handleNameTyping,onKeyDown:this.handleCloseAndSaveDuringChangingName,onBlur:this.submitEditingName,className:"changing-name-input"}):u.createElement("span",{onClick:this.startEditingName,className:"scenario-name"},this.props.scenario.name))),u.createElement(K.a,{item:!0,xs:8},u.createElement(K.a,{container:!0,direction:"row",justify:"flex-end"},!!this.props.scenario.loading&&u.createElement(Z.a,{className:"circular-loading",size:19,color:"inherit"}),u.createElement(L.a,{title:"Zoom in",size:"small",variant:"contained",color:"primary",onClick:()=>this.zoomIn()},u.createElement(Qn.a,null)),u.createElement(L.a,{title:"Zoom out",size:"small",variant:"contained",color:"primary",onClick:()=>this.zoomOut()},u.createElement($n.a,{titleAccess:"Test"})),u.createElement(L.a,{title:"Zoom to fit",size:"small",variant:"contained",color:"primary",onClick:()=>this.zoomToFit()},u.createElement(ei.a,null)),u.createElement(ti.a,{orientation:"vertical",variant:"middle",flexItem:!0}),u.createElement(L.a,{size:"small",variant:"contained",color:"secondary",onClick:()=>this.saveChanges()},this.props.scenario.id?"Update":"Save")))))),u.createElement(z.a,{className:e.drawer,variant:"permanent",classes:{paper:e.drawerPaper}},u.createElement("div",{className:e.toolbar}),u.createElement(G.a,{component:"nav",subheader:u.createElement(V.a,{component:"div"},"Triggers")},u.createElement(We,{model:{type:"trigger"},name:"Event",icon:u.createElement(ae.a,null)}),u.createElement(We,{model:{type:"before_trigger"},name:"Before Event",icon:u.createElement(pe.a,null)})),u.createElement(G.a,{component:"nav",subheader:u.createElement(V.a,{component:"div"},"Actions")},u.createElement(We,{model:{type:"email"},name:"Send email",icon:u.createElement(J.a,null)}),u.createElement(We,{model:{type:"generic"},name:"Run generic action",icon:u.createElement(Q.a,null)}),fe&&u.createElement(We,{model:{type:"banner"},name:"Show banner",icon:u.createElement(ee.a,null)}),Ne&&u.createElement(We,{model:{type:"push_notification"},name:"Send notification",icon:u.createElement(ue.a,null)})),u.createElement(G.a,{component:"nav",subheader:u.createElement(V.a,{component:"div"},"Operations")},u.createElement(We,{model:{type:"segment"},name:"Segment",icon:u.createElement(oe.a,null)}),u.createElement(We,{model:{type:"condition"},name:"Condition",icon:u.createElement(le.a,null)}),u.createElement(We,{model:{type:"wait"},name:"Wait",icon:u.createElement(ie.a,null)}),u.createElement(We,{model:{type:"goal"},name:"Goal",icon:u.createElement(de.a,null)}),u.createElement(We,{model:{type:"ab_test"},name:"AB Test",icon:u.createElement(Ee.a,null)}))),u.createElement(tt,{variant:this.props.canvas.notification.variant,text:this.props.canvas.notification.text,open:this.props.canvas.notification.open,handleClose:this.closeNotification}),u.createElement("main",{className:e.content},u.createElement("div",{className:"diagram-layer",onDrop:e=>{const t=e.dataTransfer.getData("storm-diagram-node");if(t){var a=JSON.parse(t),u=null;"email"===a.type?u=new n.NodeModel({}):"generic"===a.type?u=new s.NodeModel({}):"banner"===a.type?u=new i.NodeModel({expiresInUnit:"days",expiresInTime:1}):"push_notification"===a.type?u=new p.NodeModel({}):"segment"===a.type?u=new o.NodeModel({}):"condition"===a.type?u=new m.NodeModel({}):"trigger"===a.type?u=new r.NodeModel({}):"before_trigger"===a.type?u=new l.NodeModel({}):"wait"===a.type?u=new c.NodeModel({}):"goal"===a.type?u=new d.NodeModel({recheckPeriodUnit:"hours",recheckPeriodTime:1}):"ab_test"===a.type&&(u=new h.NodeModel({name:"AB Test",scenarioName:this.props.scenario.name}));var g=this.props.app.getDiagramEngine().getRelativeMousePoint(e);u.x=g.x,u.y=g.y,this.props.app.getDiagramEngine().getDiagramModel().addNode(u),this.forceUpdate()}},onDragOver:e=>{e.preventDefault()}},u.createElement(U.DiagramWidget,a)))))}}var ni=B()(Object(q.a)(e=>({root:{display:"flex"},appBar:{zIndex:e.zIndex.drawer+1},drawer:{width:240,flexShrink:0},drawerPaper:{width:240},content:{flexGrow:1,padding:0},toolbar:e.mixins.toolbar}),{name:"BodyWidget"}),Object(v.b)((function(e){return{canvas:e.canvas,scenario:e.scenario}}),null))(ai),ii=(a(243),a(110)),si=a.n(ii);function oi(e){return 0===e?{unit:"minutes",time:e}:e%1440===0?{unit:"days",time:e/1440}:e%60===0?{unit:"hours",time:e/60}:{unit:"minutes",time:e}}class ri{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.activeModel=e,this.payload=t}renderPayload(e){this.payload=e;const t=this.payload.visual;si()(e.elements,e=>{let a=null;if("segment"===e.type)e.selectedSegment=e.segment.code,a=new o.NodeModel(e);else if("condition"===e.type)a=new m.NodeModel({id:e.id,name:e.name,conditions:e.condition.conditions});else if("email"===e.type)e.selectedMail=e.email.code,a=new n.NodeModel(e);else if("generic"===e.type)e.selectedGeneric=e.generic.code,e.options=e.generic.options,a=new s.NodeModel(e);else if("wait"===e.type){const t=oi(e.wait.minutes);e.waitingUnit=t.unit,e.waitingTime=t.time,a=new c.NodeModel(e)}else if("banner"===e.type){if(!fe)throw Error("BANNER_ENABLED configuration is false, but loaded scenario contains banner element.");const t=oi(e.banner.expiresInMinutes);e.expiresInUnit=t.unit,e.expiresInTime=t.time,e.selectedBanner=e.banner.id,a=new i.NodeModel(e)}else if("goal"===e.type){if(e.goal.hasOwnProperty("timeoutMinutes")){const t=oi(e.goal.timeoutMinutes);e.timeoutUnit=t.unit,e.timeoutTime=t.time}const t=oi(e.goal.recheckPeriodMinutes);e.recheckPeriodUnit=t.unit,e.recheckPeriodTime=t.time,e.selectedGoals=e.goal.codes,a=new d.NodeModel(e)}else"push_notification"===e.type?(e.selectedTemplate=e.push_notification.template,e.selectedApplication=e.push_notification.application,a=new p.NodeModel(e)):"ab_test"===e.type&&(a=new h.NodeModel({id:e.id,name:e.name,variants:e.ab_test.variants,scenarioName:this.payload.name}));this.activeModel.addNode(a),a.setPosition(t[e.id].x,t[e.id].y)}),si()(e.elements,e=>{let t=this.activeModel.getNode(e.id);e[e.type].descendants.forEach(e=>{this.linkNodes(t,this.activeModel.getNode(e.uuid),e.direction,e.position)})}),si()(e.triggers,e=>{let a=null;if("event"===e.type)e.selectedTrigger=e.event.code,a=new r.NodeModel(e);else if("before_event"===e.type){const t=oi(e.options.minutes);e.timeUnit=t.unit,e.time=t.time,e.selectedTrigger=e.event.code,a=new l.NodeModel(e)}this.activeModel.addNode(a),a.setPosition(t[e.id].x,t[e.id].y),e.elements.forEach(e=>{this.linkNodes(a,this.activeModel.getNode(e))})})}linkNodes(e,t,a){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;if(a){if("positive"===a){let a;return a="ab_test"===e.type?e.getPort("right."+n).link(t.getPort("left")):e.getPort("right").link(t.getPort("left")),void this.activeModel.addLink(a)}if("negative"===a){const a=e.getPort("bottom").link(t.getPort("left"));return void this.activeModel.addLink(a)}}const i=e.getPort("right").link(t.getPort("left"));this.activeModel.addLink(i)}}class li{constructor(e){this.diagramEngine=new U.DiagramEngine,this.diagramEngine.installDefaultFactories(),this.activeModel=new U.DiagramModel,this.renderService=new ri(this.activeModel),this.payload=e,this.corruptedPayload=!1,e?this.renderPayload():this.registerCustomModels()}renderPayload(){this.registerCustomModels();try{this.renderService.renderPayload(this.payload)}catch(e){console.log(e.message),this.corruptedPayload=!0,this.activeModel=new U.DiagramModel}this.diagramEngine.setDiagramModel(this.activeModel),this.diagramEngine.repaintCanvas()}registerCustomModels(){this.diagramEngine.registerLinkFactory(new st),this.diagramEngine.registerPortFactory(new at("email",e=>new n.PortModel)),this.diagramEngine.registerNodeFactory(new n.NodeFactory),this.diagramEngine.registerPortFactory(new at("generic",e=>new s.PortModel)),this.diagramEngine.registerNodeFactory(new s.NodeFactory),this.diagramEngine.registerPortFactory(new at("segment",e=>new o.PortModel)),this.diagramEngine.registerNodeFactory(new o.NodeFactory),this.diagramEngine.registerPortFactory(new at("trigger",e=>new r.PortModel)),this.diagramEngine.registerNodeFactory(new r.NodeFactory),this.diagramEngine.registerPortFactory(new at("before_trigger",e=>new l.PortModel)),this.diagramEngine.registerNodeFactory(new l.NodeFactory),this.diagramEngine.registerPortFactory(new at("wait",e=>new c.PortModel)),this.diagramEngine.registerNodeFactory(new c.NodeFactory),this.diagramEngine.registerPortFactory(new at("goal",e=>new d.PortModel)),this.diagramEngine.registerNodeFactory(new d.NodeFactory),this.diagramEngine.registerPortFactory(new at("banner",e=>new i.PortModel)),this.diagramEngine.registerNodeFactory(new i.NodeFactory),this.diagramEngine.registerPortFactory(new at("condition",e=>new m.PortModel)),this.diagramEngine.registerNodeFactory(new m.NodeFactory),this.diagramEngine.registerPortFactory(new at("push_notification",e=>new p.PortModel)),this.diagramEngine.registerNodeFactory(new p.NodeFactory),this.diagramEngine.registerPortFactory(new at("ab_test",e=>new h.PortModel)),this.diagramEngine.registerNodeFactory(new h.NodeFactory)}getActiveDiagram(){return this.activeModel}getDiagramEngine(){return this.diagramEngine}isCorruptedPayload(){return this.corruptedPayload}}class ci extends u.Component{componentDidMount(){const{dispatch:e}=this.props;var t;e(e=>(e(Tt(!0)),N.a.get("".concat(_e)).then(t=>{e({type:"segments_changed",payload:t.data.result}),e(Tt(!1))}).catch(t=>{console.log(t),e(Tt(!1)),e(yt({open:!0,variant:"error",text:"Segments fetching failed."}))}))),e(e=>(e(Tt(!0)),N.a.get(Se).then(t=>{e({type:"criteria_changed",payload:t.data.blueprint}),e(Tt(!1))}).catch(t=>{console.log(t),e(Tt(!1)),e(yt({open:!0,variant:"error",text:"Criteria fetching failed."}))}))),e(e=>(e(Tt(!0)),N.a.get(Fe).then(t=>{e({type:"goals_changed",payload:t.data.goals}),e(Tt(!1))}).catch(t=>{e(Tt(!1)),console.log(t),e(yt({open:!0,variant:"error",text:"Goals fetching failed."}))}))),e(e=>(e(Tt(!0)),N.a.get("".concat(we)).then(t=>{e({type:"triggers_changed",payload:t.data.events}),e(Tt(!1))}).catch(t=>{e(Tt(!1)),console.log(t),e(yt({open:!0,variant:"error",text:"Triggers fetching failed."}))}))),e(e=>(e(Tt(!0)),N.a.get("".concat(ke)).then(t=>{e({type:"before_triggers_changed",payload:t.data.events}),e(Tt(!1))}).catch(t=>{e(Tt(!1)),console.log(t),e(yt({open:!0,variant:"error",text:"Triggers fetching failed."}))}))),e(e=>(e(Tt(!0)),N.a.get("".concat(xe)).then(t=>{e({type:"mails_changed",payload:t.data.mail_templates}),e(Tt(!1))}).catch(t=>{e(Tt(!1)),console.log(t),e(yt({open:!0,variant:"error",text:"Mails fetching failed."}))}))),e(e=>(e(Tt(!0)),N.a.get("".concat(Me)).then(t=>{e({type:"generics_changed",payload:t.data}),e(Tt(!1))}).catch(t=>{e(Tt(!1)),console.log(t),e(yt({open:!0,variant:"error",text:"Generics fetching failed."}))}))),fe&&e(e=>(e(Tt(!0)),N.a.get(Oe).then(t=>{e({type:"banners_changed",payload:t.data.banners}),e(Tt(!1))}).catch(t=>{e(Tt(!1)),console.log(t),e(yt({open:!0,variant:"error",text:"Banners fetching failed."}))}))),Ne&&e(e=>{e(Tt(!0));let t=N.a.get("".concat(Pe)),a=N.a.get("".concat(De));return N.a.all([t,a]).then(t=>{var a,n;e((a=t[0].data.templates,n=t[1].data.applications,{type:"push_notifications_changed",payload:{templates:a,applications:n}})),e(Tt(!1))}).catch(t=>{e(Tt(!1)),console.log(t),e(yt({open:!0,variant:"error",text:"Notifications fetching failed."}))})}),ye?(e((t=ye,e=>(e(Tt(!0)),N.a.get(Te+t).then(t=>{e({type:"set_scenario_payload",payload:t.data}),e(Nt(t.data.name)),e(ft(t.data.id)),e(Tt(!1))}).catch(t=>{e(Tt(!1)),e(yt({open:!0,variant:"error",text:"Scenario fetching failed."})),console.log(t)})))),e(function(e){return t=>N.a.get(Ie+e).then(e=>{t({type:"statistics_changed",payload:e.data})}).catch(e=>{console.log(e)})}(ye))):e(Nt("Unnamed scenario"))}render(){var e=new li(this.props.scenarioPayload);return g.a.createElement(ni,{app:e})}}var di=Object(v.b)((function(e){return{scenarioPayload:e.scenario.payload}}))(ci);window.__MUI_USE_NEXT_TYPOGRAPHY_VARIANTS__=!0,N.a.defaults.headers.common.Authorization=ve;const mi=window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__||b.c,pi=Object(b.d)(I,{},mi(Object(b.a)(y.a)));Object(E.render)(g.a.createElement(v.a,{store:pi},g.a.createElement(di,null)),document.getElementById("root"))}},[[194,1,2]]]);
\ No newline at end of file
diff --git a/src/assets/scenariobuilder/js/runtime-main.a03da98f.js b/src/assets/scenariobuilder/js/runtime-main.a03da98f.js
deleted file mode 100644
index b403592..0000000
--- a/src/assets/scenariobuilder/js/runtime-main.a03da98f.js
+++ /dev/null
@@ -1 +0,0 @@
-!function(e){function r(r){for(var n,i,l=r[0],a=r[1],p=r[2],c=0,s=[];c
Scenario Builder
-
-
@@ -24,8 +22,6 @@
}
};
-
-
-
+