diff --git a/.circleci/config.yml b/.circleci/config.yml index 072b75ed35..63e3db2308 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -13,7 +13,7 @@ jobs: artifacts: docker: - - image: circleci/python:3.7.6-stretch-node-browsers + - image: circleci/python:3.7.9-stretch-node-browsers auth: username: dashautomation password: $DASH_PAT_DOCKERHUB @@ -33,7 +33,7 @@ jobs: lint-unit-37: &lint-unit working_directory: ~/dash docker: - - image: circleci/python:3.7.6-stretch-node-browsers + - image: circleci/python:3.7.9-stretch-node-browsers auth: username: dashautomation password: $DASH_PAT_DOCKERHUB @@ -73,7 +73,7 @@ jobs: lint-unit-36: <<: *lint-unit docker: - - image: circleci/python:3.6.9-stretch-node-browsers + - image: circleci/python:3.6.12-stretch-node-browsers auth: username: dashautomation password: $DASH_PAT_DOCKERHUB @@ -95,7 +95,7 @@ jobs: build-core-37: &build-core working_directory: ~/dash docker: - - image: circleci/python:3.7.6-stretch-node-browsers + - image: circleci/python:3.7.9-stretch-node-browsers auth: username: dashautomation password: $DASH_PAT_DOCKERHUB @@ -133,7 +133,7 @@ jobs: build-core-36: <<: *build-core docker: - - image: circleci/python:3.6.9-stretch-node-browsers + - image: circleci/python:3.6.12-stretch-node-browsers auth: username: dashautomation password: $DASH_PAT_DOCKERHUB @@ -153,7 +153,7 @@ jobs: build-misc-37: &build-misc working_directory: ~/dash docker: - - image: circleci/python:3.7.6-stretch-node-browsers + - image: circleci/python:3.7.9-stretch-node-browsers auth: username: dashautomation password: $DASH_PAT_DOCKERHUB @@ -192,7 +192,7 @@ jobs: build-misc-36: <<: *build-misc docker: - - image: circleci/python:3.6.9-stretch-node-browsers + - image: circleci/python:3.6.12-stretch-node-browsers auth: username: dashautomation password: $DASH_PAT_DOCKERHUB @@ -341,7 +341,7 @@ jobs: test-37: &test working_directory: ~/dash docker: - - image: circleci/python:3.7.6-stretch-node-browsers + - image: circleci/python:3.7.9-stretch-node-browsers auth: username: dashautomation password: $DASH_PAT_DOCKERHUB @@ -386,7 +386,7 @@ jobs: test-36: <<: *test docker: - - image: circleci/python:3.6.9-stretch-node-browsers + - image: circleci/python:3.6.12-stretch-node-browsers auth: username: dashautomation password: $DASH_PAT_DOCKERHUB diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 1a66a491bc..c685706a69 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -11,6 +11,6 @@ ### optionals - [ ] I have added entry in the `CHANGELOG.md` -- [ ] If this PR needs a follow-up in **dash docs**, **community thread**, I have mentioned the relevant URLS as follow - - [ ] this github [#PR number]() updates the dash docs - - [ ] here is the show and tell thread in plotly dash community +- [ ] If this PR needs a follow-up in **dash docs**, **community thread**, I have mentioned the relevant URLS as follows + - [ ] this GitHub [#PR number]() updates the dash docs + - [ ] here is the show and tell thread in Plotly Dash community diff --git a/.pylintrc b/.pylintrc index cb11ae92f9..9c2666774a 100644 --- a/.pylintrc +++ b/.pylintrc @@ -61,7 +61,8 @@ disable=fixme, old-style-class, superfluous-parens, bad-continuation, - line-too-long + line-too-long, + bad-option-value # Enable the message, report, category or checker with the given id(s). You can diff --git a/.pylintrc37 b/.pylintrc37 index ea4f5abf4e..fe16015636 100644 --- a/.pylintrc37 +++ b/.pylintrc37 @@ -149,7 +149,10 @@ disable=invalid-name, too-many-lines, too-many-statements, bad-continuation, - line-too-long + line-too-long, + super-with-arguments, + raise-missing-from, + bad-option-value # Enable the message, report, category or checker with the given id(s). You can # either give multiple identifier separated by comma (,) or put this option diff --git a/CHANGELOG.md b/CHANGELOG.md index ed58be33f6..6cba6cbe3a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,46 @@ All notable changes to `dash` will be documented in this file. This project adheres to [Semantic Versioning](https://semver.org/). +## [1.19.0] - 2021-01-19 + +## Dash and Dash Renderer +### Added +- [#1508](https://github.com/plotly/dash/pull/1508) Fix [#1403](https://github.com/plotly/dash/issues/1403): Adds an x button +to close the error messages box. +- [#1525](https://github.com/plotly/dash/pull/1525) Adds support for callbacks which have overlapping inputs and outputs. Combined with `dash.callback_context` this addresses many use cases which require circular callbacks. + +### Changed +- [#1503](https://github.com/plotly/dash/pull/1506) Fix [#1466](https://github.com/plotly/dash/issues/1466): loosen `dash[testing]` requirements for easier integration in external projects. This PR also bumps many `dash[dev]` requirements. + +### Fixed +- [#1530](https://github.com/plotly/dash/pull/1530) Dedent error messages more carefully. +- [#1527](https://github.com/plotly/dash/issues/1527)🐛 `get_asset_url` now pulls from an external source if `assets_external_path` is set. + - updated `_add_assets_resource` to build asset urls the same way as `get_asset_url`. + - updated doc string for `assets_external_path` Dash argument to be more clear that it will allways be joined with the `assets_url_path` argument when determining the url to an external asset. +- [#1493](https://github.com/plotly/dash/pull/1493) Fix [#1143](https://github.com/plotly/dash/issues/1143), a bug where having a file with one of several common names (test.py, code.py, org.py, etc) that imports a dash component package would make `import dash` fail with a cryptic error message asking whether you have a file named "dash.py" + +## Dash Core Components +### Fixed +- [#905](https://github.com/plotly/dash-core-components/pull/905) Make sure the `figure` prop of `dcc.Graph` receives updates from user interactions in the graph, by using the same `layout` object as provided in the prop rather than cloning it. Fixes [#879](https://github.com/plotly/dash-core-components/issues/879). +- [#903](https://github.com/plotly/dash-core-components/pull/903) Part of fixing dash import bug https://github.com/plotly/dash/issues/1143 + +### Updated +- [#911](https://github.com/plotly/dash-core-components/pull/911), [#906](https://github.com/plotly/dash-core-components/pull/906) + - Upgraded Plotly.js to [1.58.4](https://github.com/plotly/plotly.js/releases/tag/v1.58.4) + - Patch Release [1.58.4](https://github.com/plotly/plotly.js/releases/tag/v1.58.4) + - Patch Release [1.58.3](https://github.com/plotly/plotly.js/releases/tag/v1.58.3) + +### Added +- [#888](https://github.com/plotly/dash-core-components/pull/888) Adds a `drag_value` prop to `dcc.Slider`to be able to fire callbacks from dragging and releasing the slider. + +## Dash HTML Components +### Fixed +- [#169](https://github.com/plotly/dash-html-components/pull/169) - part of fixing dash import bug https://github.com/plotly/dash/issues/1143 + +## Dash Table +### Fixed +- [#854](https://github.com/plotly/dash-table/pull/854) - part of fixing dash import bug https://github.com/plotly/dash/issues/1143 + ## [1.18.1] - 2020-12-09 ## [1.18.0] - 2020-12-07 diff --git a/dash-renderer/dash_renderer/__init__.py b/dash-renderer/dash_renderer/__init__.py index 642ca1c10f..dc9037b76a 100644 --- a/dash-renderer/dash_renderer/__init__.py +++ b/dash-renderer/dash_renderer/__init__.py @@ -1,7 +1,7 @@ import sys __file__ -__version__ = "1.8.3" +__version__ = "1.9.0" _js_dist_dependencies = [ { @@ -42,7 +42,7 @@ { "relative_package_path": "{}.min.js".format(__name__), "dev_package_path": "{}.dev.js".format(__name__), - "external_url": "https://unpkg.com/dash-renderer@1.8.3" + "external_url": "https://unpkg.com/dash-renderer@1.9.0" "/dash_renderer/dash_renderer.min.js", "namespace": "dash_renderer", }, diff --git a/dash-renderer/dash_renderer/dash_renderer.dev.js b/dash-renderer/dash_renderer/dash_renderer.dev.js index ef471fb591..c75dd3a28a 100644 --- a/dash-renderer/dash_renderer/dash_renderer.dev.js +++ b/dash-renderer/dash_renderer/dash_renderer.dev.js @@ -6439,7 +6439,7 @@ module.exports = exports; var ___CSS_LOADER_API_IMPORT___ = __webpack_require__(/*! ../../../../node_modules/css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js"); exports = ___CSS_LOADER_API_IMPORT___(false); // Module -exports.push([module.i, ".error-container {\n margin-top: 10px;\n}\n\n.dash-fe-errors {\n min-width: 386px;\n max-width: 650px;\n max-height: 450px;\n display: inline-block;\n}\n\n.dash-fe-error__icon-error {\n width: 20px;\n height: 20px;\n display: inline-block;\n margin-right: 16px;\n}\n.dash-fe-error__icon-close {\n width: 10px;\n height: 10px;\n position: absolute;\n right: 12px;\n top: 12px;\n display: inline-block;\n}\n.dash-fe-error__icon-arrow {\n width: 8px;\n height: 28px;\n margin: 0px 8px;\n}\n.dash-fe-error-top {\n height: 20px;\n display: flex;\n justify-content: space-between;\n width: 100%;\n cursor: pointer;\n}\n.dash-fe-error-top__group:first-child {\n /*\n * 77% is the maximum space allowed based off of the other elements\n * in the top part of the error container (timestamp & collapse arrow).\n * this was manually determined */\n width: 77%;\n}\n.dash-fe-error-top__group {\n display: inline-flex;\n align-items: center;\n}\n.dash-fe-error__title {\n text-align: left;\n margin: 0px;\n margin-left: 5px;\n padding: 0px;\n font-size: 14px;\n display: inline-block;\n text-overflow: ellipsis;\n white-space: nowrap;\n overflow: hidden;\n}\n.dash-fe-error__timestamp {\n margin-right: 20px;\n}\n.dash-fe-error__collapse--flipped {\n -webkit-transform: rotate(180deg);\n -ms-transform: rotate(180deg);\n transform: rotate(180deg);\n}\n\n.dash-fe-error__info_title {\n margin: 0;\n color: #506784;\n font-size: 16px;\n background-color: #f3f6fa;\n border: 2px solid #dfe8f3;\n box-sizing: border-box;\n border-top-left-radius: 4px;\n border-top-right-radius: 4px;\n padding: 10px;\n}\n\n.dash-fe-error__info {\n border: 1px solid #dfe8f3;\n margin: 0 0 1em 0;\n padding: 10px;\n\n background-color: white;\n border: 2px solid #dfe8f3;\n color: #506784;\n overflow: auto;\n white-space: pre-wrap;\n}\n\n.dash-fe-error__curved {\n border-radius: 4px;\n}\n\n.dash-fe-error__curved-top {\n border-top-left-radius: 4px;\n border-top-right-radius: 4px;\n border-bottom-width: 0px;\n}\n\n.dash-fe-error__curved-bottom {\n border-radius-bottom-left: 4px;\n border-radius-bottom-right: 4px;\n background-color: #FFEFEF;\n}\n\n.dash-be-error__st {\n background-color: #fdf3f4;\n min-width: 386px;\n max-width: 650px;\n /* iframe container handles the scrolling */\n overflow: hidden;\n display: inline-block;\n}\n\n.dash-be-error__str {\n background-color: #fdf3f4;\n min-width: 386px;\n max-width: 650px;\n overflow: auto;\n display: inline-block;\n white-space: pre-wrap;\n}\n", ""]); +exports.push([module.i, ".error-container {\n margin-top: 10px;\n}\n\n.dash-fe-error__icon-x {\n position: absolute;\n right: 0;\n top: 0;\n color: #B9C2CE;\n font-size: 20px;\n cursor: pointer;\n margin-right: 10px\n}\n\n.dash-fe-error__icon-x:hover\n{\n color:#a1a9b5;\n}\n\n\n.dash-fe-errors {\n min-width: 386px;\n max-width: 650px;\n max-height: 450px;\n display: inline-block;\n}\n\n.dash-fe-error__icon-error {\n width: 20px;\n height: 20px;\n display: inline-block;\n margin-right: 16px;\n}\n.dash-fe-error__icon-close {\n width: 10px;\n height: 10px;\n position: absolute;\n right: 12px;\n top: 12px;\n display: inline-block;\n}\n.dash-fe-error__icon-arrow {\n width: 8px;\n height: 28px;\n margin: 0px 8px;\n}\n.dash-fe-error-top {\n height: 20px;\n display: flex;\n justify-content: space-between;\n width: 100%;\n cursor: pointer;\n}\n.dash-fe-error-top__group:first-child {\n /*\n * 77% is the maximum space allowed based off of the other elements\n * in the top part of the error container (timestamp & collapse arrow).\n * this was manually determined */\n width: 77%;\n}\n.dash-fe-error-top__group {\n display: inline-flex;\n align-items: center;\n}\n.dash-fe-error__title {\n text-align: left;\n margin: 0px;\n margin-left: 5px;\n padding: 0px;\n font-size: 14px;\n display: inline-block;\n text-overflow: ellipsis;\n white-space: nowrap;\n overflow: hidden;\n}\n.dash-fe-error__timestamp {\n margin-right: 20px;\n}\n.dash-fe-error__collapse--flipped {\n -webkit-transform: rotate(180deg);\n -ms-transform: rotate(180deg);\n transform: rotate(180deg);\n}\n\n.dash-fe-error__info_title {\n margin: 0;\n color: #506784;\n font-size: 16px;\n background-color: #f3f6fa;\n border: 2px solid #dfe8f3;\n box-sizing: border-box;\n border-top-left-radius: 4px;\n border-top-right-radius: 4px;\n padding: 10px;\n}\n\n.dash-fe-error__info {\n border: 1px solid #dfe8f3;\n margin: 0 0 1em 0;\n padding: 10px;\n\n background-color: white;\n border: 2px solid #dfe8f3;\n color: #506784;\n overflow: auto;\n white-space: pre-wrap;\n}\n\n.dash-fe-error__curved {\n border-radius: 4px;\n}\n\n.dash-fe-error__curved-top {\n border-top-left-radius: 4px;\n border-top-right-radius: 4px;\n border-bottom-width: 0px;\n}\n\n.dash-fe-error__curved-bottom {\n border-radius-bottom-left: 4px;\n border-radius-bottom-right: 4px;\n background-color: #FFEFEF;\n}\n\n.dash-be-error__st {\n background-color: #fdf3f4;\n min-width: 386px;\n max-width: 650px;\n /* iframe container handles the scrolling */\n overflow: hidden;\n display: inline-block;\n}\n\n.dash-be-error__str {\n background-color: #fdf3f4;\n min-width: 386px;\n max-width: 650px;\n overflow: auto;\n display: inline-block;\n white-space: pre-wrap;\n}\n", ""]); // Exports module.exports = exports; @@ -6457,7 +6457,7 @@ module.exports = exports; var ___CSS_LOADER_API_IMPORT___ = __webpack_require__(/*! ../../../node_modules/css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js"); exports = ___CSS_LOADER_API_IMPORT___(false); // Module -exports.push([module.i, ".dash-error-menu {\n max-width: 50%;\n max-height: 60%;\n display: contents;\n font-family: monospace;\n font-size: 14px;\n font-variant-ligatures: common-ligatures;\n}\n\n.dash-error-card {\n box-sizing: border-box;\n background: #ffffff;\n display: inline-block;\n /* shadow-1 */\n box-shadow: 0px 6px 16px rgba(80, 103, 132, 0.165),\n 0px 2px 6px rgba(80, 103, 132, 0.12),\n 0px 0px 1px rgba(80, 103, 132, 0.32);\n border-radius: 4px;\n position: fixed;\n top: 16px;\n right: 16px;\n animation: dash-error-card-animation 0.5s;\n padding: 24px;\n text-align: left;\n background-color: white;\n\n}\n.dash-error-card--alerts-tray {\n position: absolute;\n top: -300px;\n left: -1px;\n animation: none;\n box-shadow: none;\n border: 1px solid #ececec;\n border-bottom: 0;\n border-bottom-left-radius: 0px;\n border-bottom-right-radius: 0px;\n width: 422px;\n}\n.dash-error-card--container {\n padding: 10px 10px;\n width: 600px;\n max-width: 800px;\n max-height: calc(100vh - 50px);\n margin: 10px;\n overflow: auto;\n z-index: 1001; /* above the plotly.js toolbar */\n}\n\n.dash-error-card__topbar {\n width: 100%;\n height: 32px;\n display: flex;\n justify-content: center;\n align-items: center;\n}\n.dash-error-card__message {\n font-size: 14px;\n}\n\n.dash-error-card__message > strong {\n color: #ff4500;\n}\n\n.dash-error-card__content {\n box-sizing: border-box;\n padding: 10px 10px;\n background-color: white;\n box-shadow: 0px 0px 1px rgba(0, 0, 0, 0.25),\n 0px 1px 3px rgba(162, 177, 198, 0.32);\n border-radius: 2px;\n margin-bottom: 8px;\n}\n\n.dash-error-card__list-item {\n background: #ffffff;\n box-shadow: 0px 0px 1px rgba(0, 0, 0, 0.25),\n 0px 1px 3px rgba(162, 177, 198, 0.32);\n border-radius: 2px;\n padding: 10px 10px;\n margin-bottom: 10px;\n display: flex;\n align-items: center;\n}\n\n@keyframes dash-error-card-animation {\n from {\n opacity: 0;\n -webkit-transform: scale(1.1);\n -moz-transform: scale(1.1);\n -ms-transform: scale(1.1);\n transform: scale(1.1);\n }\n to {\n opacity: 1;\n -webkit-transform: scale(1);\n -moz-transform: scale(1);\n -ms-transform: scale(1);\n transform: scale(1);\n }\n}\n", ""]); +exports.push([module.i, ".dash-error-menu {\n max-width: 50%;\n max-height: 60%;\n display: contents;\n font-family: monospace;\n font-size: 14px;\n font-variant-ligatures: common-ligatures;\n}\n\n.dash-error-card {\n box-sizing: border-box;\n background: #ffffff;\n display: inline-block;\n /* shadow-1 */\n box-shadow: 0px 6px 16px rgba(80, 103, 132, 0.165),\n 0px 2px 6px rgba(80, 103, 132, 0.12),\n 0px 0px 1px rgba(80, 103, 132, 0.32);\n border-radius: 4px;\n position: fixed;\n top: 16px;\n right: 16px;\n animation: dash-error-card-animation 0.5s;\n padding: 24px;\n text-align: left;\n background-color: white;\n\n}\n.dash-error-card--alerts-tray {\n position: absolute;\n top: -300px;\n left: -1px;\n animation: none;\n box-shadow: none;\n border: 1px solid #ececec;\n border-bottom: 0;\n border-bottom-left-radius: 0px;\n border-bottom-right-radius: 0px;\n width: 422px;\n}\n.dash-error-card--container {\n padding: 10px 10px;\n width: 600px;\n max-width: 800px;\n max-height: calc(100vh - 50px);\n margin: 10px;\n overflow: auto;\n z-index: 1001; /* above the plotly.js toolbar */\n}\n\n.dash-error-card__topbar {\n width: 100%;\n height: 32px;\n display: flex;\n justify-content: center;\n align-items: center;\n position: relative;\n}\n.dash-error-card__message {\n font-size: 14px;\n}\n\n.dash-error-card__message > strong {\n color: #ff4500;\n}\n\n.dash-error-card__content {\n box-sizing: border-box;\n padding: 10px 10px;\n background-color: white;\n box-shadow: 0px 0px 1px rgba(0, 0, 0, 0.25),\n 0px 1px 3px rgba(162, 177, 198, 0.32);\n border-radius: 2px;\n margin-bottom: 8px;\n}\n\n.dash-error-card__list-item {\n background: #ffffff;\n box-shadow: 0px 0px 1px rgba(0, 0, 0, 0.25),\n 0px 1px 3px rgba(162, 177, 198, 0.32);\n border-radius: 2px;\n padding: 10px 10px;\n margin-bottom: 10px;\n display: flex;\n align-items: center;\n}\n\n@keyframes dash-error-card-animation {\n from {\n opacity: 0;\n -webkit-transform: scale(1.1);\n -moz-transform: scale(1.1);\n -ms-transform: scale(1.1);\n transform: scale(1.1);\n }\n to {\n opacity: 1;\n -webkit-transform: scale(1);\n -moz-transform: scale(1);\n -ms-transform: scale(1);\n transform: scale(1);\n }\n}\n", ""]); // Exports module.exports = exports; @@ -93887,7 +93887,6 @@ function validateDependencies(parsedDependencies, dispatchError) { }); }); findDuplicateOutputs(outputs, head, dispatchError, outStrs, outObjs); - findInOutOverlap(outputs, inputs, head, dispatchError); findMismatchedWildcards(outputs, inputs, state, head, dispatchError); }); } @@ -93981,26 +93980,26 @@ function findDuplicateOutputs(outputs, head, dispatchError, outStrs, outObjs) { }); } -function findInOutOverlap(outputs, inputs, head, dispatchError) { - outputs.forEach(function (out, outi) { - var outId = out.id, - outProp = out.property; - inputs.forEach(function (in_, ini) { - var inId = in_.id, - inProp = in_.property; +function checkInOutOverlap(out, inputs) { + var outId = out.id, + outProp = out.property; + return inputs.some(function (in_) { + var inId = in_.id, + inProp = in_.property; - if (outProp !== inProp || _typeof(outId) !== _typeof(inId)) { - return; - } + if (outProp !== inProp || _typeof(outId) !== _typeof(inId)) { + return false; + } - if (typeof outId === 'string') { - if (outId === inId) { - dispatchError('Same `Input` and `Output`', [head, "Input ".concat(ini, " (").concat(Object(_dependencies_ts__WEBPACK_IMPORTED_MODULE_3__["combineIdAndProp"])(in_), ")"), "matches Output ".concat(outi, " (").concat(Object(_dependencies_ts__WEBPACK_IMPORTED_MODULE_3__["combineIdAndProp"])(out), ")")]); - } - } else if (wildcardOverlap(in_, [out])) { - dispatchError('Same `Input` and `Output`', [head, "Input ".concat(ini, " (").concat(Object(_dependencies_ts__WEBPACK_IMPORTED_MODULE_3__["combineIdAndProp"])(in_), ")"), 'can match the same component(s) as', "Output ".concat(outi, " (").concat(Object(_dependencies_ts__WEBPACK_IMPORTED_MODULE_3__["combineIdAndProp"])(out), ")")]); + if (typeof outId === 'string') { + if (outId === inId) { + return true; } - }); + } else if (wildcardOverlap(in_, [out])) { + return true; + } + + return false; }); } @@ -94376,15 +94375,54 @@ function computeGraphs(dependencies, dispatchError) { }, idSpec); return idList; } + /* multiGraph is used only for testing circularity + * + * Each component+property that is used as an input or output is added as a node + * to a directed graph with a dependency from each input to each output. The + * function triggerDefaultState in index.js then checks this graph for circularity. + * + * In order to allow the same component+property to be both an input and output + * of the same callback, a two pass approach is used. + * + * In the first pass, the graph is built up normally with the exception that + * in cases where an output is also an input to the same callback a special + * "output" node is added and the dependencies target this output node instead. + * For example, if `slider.value` is both an input and an output, then the a new + * node `slider.value__output` will be added with a dependency from `slider.value` + * to `slider.value__output`. Splitting the input and output into separate nodes + * removes the circularity. + * + * In order to still detect other forms of circularity, it is necessary to do a + * second pass and add the new output nodes as a dependency in any *other* callbacks + * where the original node was an input. Continuing the example, any other callback + * that had `slider.value` as an input dependency also needs to have + * `slider.value__output` as a dependency. To make this efficient, all the inputs + * and outputs for each callback are stored during the first pass. + */ + + + var outputTag = '__output'; + var duplicateOutputs = []; + var cbIn = []; + var cbOut = []; + + function addInputToMulti(inIdProp, outIdProp) { + var firstPass = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true; + multiGraph.addNode(inIdProp); + multiGraph.addDependency(inIdProp, outIdProp); // only store callback inputs and outputs during the first pass + + if (firstPass) { + cbIn[cbIn.length - 1].push(inIdProp); + cbOut[cbOut.length - 1].push(outIdProp); + } + } parsedDependencies.forEach(function registerDependency(dependency) { var outputs = dependency.outputs, - inputs = dependency.inputs; // multiGraph - just for testing circularity + inputs = dependency.inputs; // new callback, add an empty array for its inputs and outputs - function addInputToMulti(inIdProp, outIdProp) { - multiGraph.addNode(inIdProp); - multiGraph.addDependency(inIdProp, outIdProp); - } + cbIn.push([]); + cbOut.push([]); function addOutputToMulti(outIdFinal, outIdProp) { multiGraph.addNode(outIdProp); @@ -94424,19 +94462,36 @@ function computeGraphs(dependencies, dispatchError) { }, dependency); outputs.forEach(function (outIdProp) { var outId = outIdProp.id, - property = outIdProp.property; + property = outIdProp.property; // check if this output is also an input to the same callback + + var alsoInput = checkInOutOverlap(outIdProp, inputs); if (_typeof(outId) === 'object') { var outIdList = makeAllIds(outId, {}); outIdList.forEach(function (id) { - addOutputToMulti(id, Object(_dependencies_ts__WEBPACK_IMPORTED_MODULE_3__["combineIdAndProp"])({ + var tempOutIdProp = { id: id, property: property - })); + }; + var outIdName = Object(_dependencies_ts__WEBPACK_IMPORTED_MODULE_3__["combineIdAndProp"])(tempOutIdProp); // if this output is also an input, add `outputTag` to the name + + if (alsoInput) { + duplicateOutputs.push(tempOutIdProp); + outIdName += outputTag; + } + + addOutputToMulti(id, outIdName); }); addPattern(outputPatterns, outId, property, finalDependency); } else { - addOutputToMulti({}, Object(_dependencies_ts__WEBPACK_IMPORTED_MODULE_3__["combineIdAndProp"])(outIdProp)); + var outIdName = Object(_dependencies_ts__WEBPACK_IMPORTED_MODULE_3__["combineIdAndProp"])(outIdProp); // if this output is also an input, add `outputTag` to the name + + if (alsoInput) { + duplicateOutputs.push(outIdProp); + outIdName += outputTag; + } + + addOutputToMulti({}, outIdName); addMap(outputMap, outId, property, finalDependency); } }); @@ -94450,6 +94505,29 @@ function computeGraphs(dependencies, dispatchError) { addMap(inputMap, inId, inProp, finalDependency); } }); + }); // second pass for adding new output nodes as dependencies where needed + + duplicateOutputs.forEach(function (dupeOutIdProp) { + var originalName = Object(_dependencies_ts__WEBPACK_IMPORTED_MODULE_3__["combineIdAndProp"])(dupeOutIdProp); + var newName = originalName.concat(outputTag); + + for (var cnt = 0; cnt < cbIn.length; cnt++) { + // check if input to the callback + if (cbIn[cnt].some(function (inName) { + return inName === originalName; + })) { + /* make sure it's not also an output of the callback + * (this will be the original callback) + */ + if (!cbOut[cnt].some(function (outName) { + return outName === newName; + })) { + cbOut[cnt].forEach(function (outName) { + addInputToMulti(newName, outName, false); + }); + } + } + } }); return finalGraphs; } @@ -94999,11 +95077,12 @@ var getReadyCallbacks = function getReadyCallbacks(paths, candidates) { Object(ramda__WEBPACK_IMPORTED_MODULE_0__["forEach"])(function (output) { return outputsMap[output] = true; }, outputs); // Find `requested` callbacks that do not depend on a outstanding output (as either input or state) + // Outputs which overlap an input do not count as an outstanding output return Object(ramda__WEBPACK_IMPORTED_MODULE_0__["filter"])(function (cb) { return Object(ramda__WEBPACK_IMPORTED_MODULE_0__["all"])(function (cbp) { return !outputsMap[combineIdAndProp(cbp)]; - }, Object(ramda__WEBPACK_IMPORTED_MODULE_0__["flatten"])(cb.getInputs(paths))); + }, Object(ramda__WEBPACK_IMPORTED_MODULE_0__["difference"])(Object(ramda__WEBPACK_IMPORTED_MODULE_0__["flatten"])(cb.getInputs(paths)), Object(ramda__WEBPACK_IMPORTED_MODULE_0__["flatten"])(cb.getOutputs(paths)))); }, candidates); }; var getLayoutCallbacks = function getLayoutCallbacks(graphs, paths, layout, options) { @@ -96296,7 +96375,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi cytoscape__WEBPACK_IMPORTED_MODULE_3___default.a.use(cytoscape_dagre__WEBPACK_IMPORTED_MODULE_5___default.a); cytoscape__WEBPACK_IMPORTED_MODULE_3___default.a.use(cytoscape_fcose__WEBPACK_IMPORTED_MODULE_6___default.a); /* - * Generates all the elements (nodes, edeges) for the dependency graph. + * Generates all the elements (nodes, edges) for the dependency graph. */ function generateElements(graphs, profile, extraLinks) { @@ -96533,7 +96612,7 @@ function CallbackGraph() { pan: cy.pan(), _chosenType: (_layoutSelector$curre = layoutSelector.current) === null || _layoutSelector$curre === void 0 ? void 0 : _layoutSelector$curre.value }; - } // Adds callbacks once cyctoscape is intialized. + } // Adds callbacks once cyctoscape is initialized. useCytoscapeEffect(function (cy) { @@ -96944,7 +97023,7 @@ __webpack_require__.r(__webpack_exports__); * Finds all edges connected to a node and splits them by type. * * @param {Object} node - Cytoscape node. - * @returns {Object} - Object contaiing the edges, sorted by type. + * @returns {Object} - Object containing the edges, sorted by type. */ function getEdgeTypes(node) { @@ -97005,7 +97084,7 @@ function updateSelectedNode(cy, id) { }); }; - var node = cy.getElementById(id); // Highlght the selected node. + var node = cy.getElementById(id); // Highlight the selected node. node.addClass('selected-node'); var subtree = cy.collection(); @@ -97052,7 +97131,7 @@ function updateChangedProps(cy, id, props) { * * @param {Object} cy - Reference to the cytoscape instance. * @param {String} id - The id of the callback (i.e., it's output identifier) - * @param {Object} profile - The callback profiling infomration. + * @param {Object} profile - The callback profiling information. * @param {Number} flashTime - The time to flash classes for in ms. * @returns {undefined} */ @@ -97505,10 +97584,12 @@ var FrontEndErrorContainer = /*#__PURE__*/function (_Component) { value: function render() { var _this$props = this.props, errors = _this$props.errors, - connected = _this$props.connected; + connected = _this$props.connected, + errorsOpened = _this$props.errorsOpened, + clickHandler = _this$props.clickHandler; var errorsLength = errors.length; - if (errorsLength === 0) { + if (errorsLength === 0 || !errorsOpened) { return null; } @@ -97534,7 +97615,12 @@ var FrontEndErrorContainer = /*#__PURE__*/function (_Component) { className: "dash-error-card__message" }, "\uD83D\uDED1 Errors (", /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("strong", { className: "test-devtools-error-count" - }, errorsLength), ")", connected ? null : "\xA0 \uD83D\uDEAB Server Unavailable")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", { + }, errorsLength), ")", connected ? null : "\xA0 \uD83D\uDEAB Server Unavailable"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", { + className: "dash-fe-error__icon-x", + onClick: function onClick() { + return clickHandler(); + } + }, "\xD7")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", { className: "dash-error-card__list" }, errorElements)); } @@ -97544,9 +97630,12 @@ var FrontEndErrorContainer = /*#__PURE__*/function (_Component) { }(react__WEBPACK_IMPORTED_MODULE_0__["Component"]); FrontEndErrorContainer.propTypes = { + id: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.string, errors: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.array, connected: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.bool, - inAlertsTray: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.any + inAlertsTray: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.any, + errorsOpened: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.any, + clickHandler: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.func }; FrontEndErrorContainer.propTypes = { inAlertsTray: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.any @@ -97740,14 +97829,17 @@ var GlobalErrorOverlay = /*#__PURE__*/function (_Component) { var _this$props = this.props, visible = _this$props.visible, error = _this$props.error, - errorsOpened = _this$props.errorsOpened; + errorsOpened = _this$props.errorsOpened, + clickHandler = _this$props.clickHandler; var frontEndErrors; if (errorsOpened) { var errors = Object(ramda__WEBPACK_IMPORTED_MODULE_2__["concat"])(error.frontEnd, error.backEnd); frontEndErrors = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_FrontEnd_FrontEndErrorContainer_react__WEBPACK_IMPORTED_MODULE_4__["FrontEndErrorContainer"], { errors: errors, - connected: error.backEndConnected + connected: error.backEndConnected, + errorsOpened: errorsOpened, + clickHandler: clickHandler }); } @@ -97767,7 +97859,8 @@ GlobalErrorOverlay.propTypes = { children: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.object, visible: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool, error: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.object, - errorsOpened: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.any + errorsOpened: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.any, + clickHandler: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func }; /***/ }), @@ -98237,7 +98330,8 @@ var DebugMenu = /*#__PURE__*/function (_Component) { })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_GlobalErrorOverlay_react__WEBPACK_IMPORTED_MODULE_9__["default"], { error: error, visible: errCount > 0, - errorsOpened: errorsOpened + errorsOpened: errorsOpened, + clickHandler: toggleErrors }, this.props.children)); } }]); @@ -99055,7 +99149,7 @@ var getIds = function getIds(cb, paths) { var observer = { observer: function () { var _observer = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2(_ref2) { - var dispatch, getState, _getState, _getState$callbacks, executing, watched, config, hooks, layout, paths, _getState2, prioritized, available, _partition, _partition2, syncCallbacks, asyncCallbacks, pickedSyncCallbacks, pickedAsyncCallbacks, deffered; + var dispatch, getState, _getState, _getState$callbacks, executing, watched, config, hooks, layout, paths, _getState2, prioritized, available, _partition, _partition2, syncCallbacks, asyncCallbacks, pickedSyncCallbacks, pickedAsyncCallbacks, deferred; return regeneratorRuntime.wrap(function _callee2$(_context2) { while (1) { @@ -99081,12 +99175,12 @@ var observer = { } if (pickedAsyncCallbacks.length) { - deffered = Object(ramda__WEBPACK_IMPORTED_MODULE_0__["map"])(function (cb) { + deferred = Object(ramda__WEBPACK_IMPORTED_MODULE_0__["map"])(function (cb) { return _objectSpread(_objectSpread(_objectSpread({}, cb), getStash(cb, paths)), {}, { isReady: Object(_actions_isAppReady__WEBPACK_IMPORTED_MODULE_4__["default"])(layout, paths, getIds(cb, paths)) }); }, pickedAsyncCallbacks); - dispatch(Object(_actions_callbacks__WEBPACK_IMPORTED_MODULE_1__["aggregateCallbacks"])([Object(_actions_callbacks__WEBPACK_IMPORTED_MODULE_1__["removePrioritizedCallbacks"])(pickedAsyncCallbacks), Object(_actions_callbacks__WEBPACK_IMPORTED_MODULE_1__["addBlockedCallbacks"])(deffered)])); + dispatch(Object(_actions_callbacks__WEBPACK_IMPORTED_MODULE_1__["aggregateCallbacks"])([Object(_actions_callbacks__WEBPACK_IMPORTED_MODULE_1__["removePrioritizedCallbacks"])(pickedAsyncCallbacks), Object(_actions_callbacks__WEBPACK_IMPORTED_MODULE_1__["addBlockedCallbacks"])(deferred)])); Object(ramda__WEBPACK_IMPORTED_MODULE_0__["forEach"])( /*#__PURE__*/function () { var _ref3 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(cb) { var _getState3, blocked, currentCb, executingCallback; @@ -99130,7 +99224,7 @@ var observer = { return function (_x2) { return _ref3.apply(this, arguments); }; - }(), deffered); + }(), deferred); } case 10: @@ -100719,7 +100813,7 @@ var profile = function profile() { if (action.type === 'UPDATE_RESOURCE_USAGE') { // Keep a record of the most recent change. This - // is subtly different from history.present becasue + // is subtly different from history.present because // it watches all props, not just inputs. var _action$payload = action.payload, id = _action$payload.id, diff --git a/dash-renderer/dash_renderer/dash_renderer.min.js b/dash-renderer/dash_renderer/dash_renderer.min.js index ae6f574047..83ffbc95b0 100644 --- a/dash-renderer/dash_renderer/dash_renderer.min.js +++ b/dash-renderer/dash_renderer/dash_renderer.min.js @@ -17,4 +17,4 @@ window.dash_renderer=function(e){var t={};function r(n){if(t[n])return t[n].expo * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */Object.defineProperty(t,"__esModule",{value:!0});var n="function"==typeof Symbol&&Symbol.for,o=n?Symbol.for("react.element"):60103,i=n?Symbol.for("react.portal"):60106,a=n?Symbol.for("react.fragment"):60107,u=n?Symbol.for("react.strict_mode"):60108,s=n?Symbol.for("react.profiler"):60114,c=n?Symbol.for("react.provider"):60109,l=n?Symbol.for("react.context"):60110,f=n?Symbol.for("react.async_mode"):60111,p=n?Symbol.for("react.concurrent_mode"):60111,d=n?Symbol.for("react.forward_ref"):60112,y=n?Symbol.for("react.suspense"):60113,h=n?Symbol.for("react.suspense_list"):60120,m=n?Symbol.for("react.memo"):60115,v=n?Symbol.for("react.lazy"):60116,b=n?Symbol.for("react.fundamental"):60117,g=n?Symbol.for("react.responder"):60118,w=n?Symbol.for("react.scope"):60119;function O(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case o:switch(e=e.type){case f:case p:case a:case s:case u:case y:return e;default:switch(e=e&&e.$$typeof){case l:case d:case c:return e;default:return t}}case v:case m:case i:return t}}}function S(e){return O(e)===p}t.typeOf=O,t.AsyncMode=f,t.ConcurrentMode=p,t.ContextConsumer=l,t.ContextProvider=c,t.Element=o,t.ForwardRef=d,t.Fragment=a,t.Lazy=v,t.Memo=m,t.Portal=i,t.Profiler=s,t.StrictMode=u,t.Suspense=y,t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===a||e===p||e===s||e===u||e===y||e===h||"object"==typeof e&&null!==e&&(e.$$typeof===v||e.$$typeof===m||e.$$typeof===c||e.$$typeof===l||e.$$typeof===d||e.$$typeof===b||e.$$typeof===g||e.$$typeof===w)},t.isAsyncMode=function(e){return S(e)||O(e)===f},t.isConcurrentMode=S,t.isContextConsumer=function(e){return O(e)===l},t.isContextProvider=function(e){return O(e)===c},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===o},t.isForwardRef=function(e){return O(e)===d},t.isFragment=function(e){return O(e)===a},t.isLazy=function(e){return O(e)===v},t.isMemo=function(e){return O(e)===m},t.isPortal=function(e){return O(e)===i},t.isProfiler=function(e){return O(e)===s},t.isStrictMode=function(e){return O(e)===u},t.isSuspense=function(e){return O(e)===y}},function(e,t){e.exports=function(e){if(!e.webpackPolyfill){var t=Object.create(e);t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),Object.defineProperty(t,"exports",{enumerable:!0}),t.webpackPolyfill=1}return t}},function(e,t,r){"use strict";e.exports=function(e){for(var t,r=e.length,n=0;n13)&&32!==t&&133!==t&&160!==t&&5760!==t&&6158!==t&&(t<8192||t>8205)&&8232!==t&&8233!==t&&8239!==t&&8287!==t&&8288!==t&&12288!==t&&65279!==t)return!1;return!0}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,r){if(e.hasOwnProperty(t)){for(var n={},o=e[t],a=(0,i.default)(t),u=Object.keys(r),s=0;st.osVersion&&(t.browserVersion=t.osVersion);"android"===t.browserName&&t.chrome&&t.browserVersion>37&&(t.browserName="and_chr");"android"===t.browserName&&t.osVersion<5&&(t.browserVersion=t.osVersion);"android"===t.browserName&&t.samsungBrowser&&(t.browserName="and_chr",t.browserVersion=44);return t};var n,o=r(61),i=(n=o)&&n.__esModule?n:{default:n};var a={chrome:"Webkit",safari:"Webkit",ios:"Webkit",android:"Webkit",phantom:"Webkit",opera:"Webkit",webos:"Webkit",blackberry:"Webkit",bada:"Webkit",tizen:"Webkit",chromium:"Webkit",vivaldi:"Webkit",firefox:"Moz",seamoney:"Moz",sailfish:"Moz",msie:"ms",msedge:"ms"},u={chrome:"chrome",chromium:"chrome",safari:"safari",firfox:"firefox",msedge:"edge",opera:"opera",vivaldi:"opera",msie:"ie"};e.exports=t.default},function(e,t,r){var n;n=function(){var e=!0;function t(t){function r(e){var r=t.match(e);return r&&r.length>1&&r[1]||""}function n(e){var r=t.match(e);return r&&r.length>1&&r[2]||""}var o,a=r(/(ipod|iphone|ipad)/i).toLowerCase(),u=!/like android/i.test(t)&&/android/i.test(t),s=/nexus\s*[0-6]\s*/i.test(t),c=!s&&/nexus\s*[0-9]+/i.test(t),l=/CrOS/.test(t),f=/silk/i.test(t),p=/sailfish/i.test(t),d=/tizen/i.test(t),y=/(web|hpw)(o|0)s/i.test(t),h=/windows phone/i.test(t),m=(/SamsungBrowser/i.test(t),!h&&/windows/i.test(t)),v=!a&&!f&&/macintosh/i.test(t),b=!u&&!p&&!d&&!y&&/linux/i.test(t),g=n(/edg([ea]|ios)\/(\d+(\.\d+)?)/i),w=r(/version\/(\d+(\.\d+)?)/i),O=/tablet/i.test(t)&&!/tablet pc/i.test(t),S=!O&&/[^-]mobi/i.test(t),_=/xbox/i.test(t);/opera/i.test(t)?o={name:"Opera",opera:e,version:w||r(/(?:opera|opr|opios)[\s\/](\d+(\.\d+)?)/i)}:/opr\/|opios/i.test(t)?o={name:"Opera",opera:e,version:r(/(?:opr|opios)[\s\/](\d+(\.\d+)?)/i)||w}:/SamsungBrowser/i.test(t)?o={name:"Samsung Internet for Android",samsungBrowser:e,version:w||r(/(?:SamsungBrowser)[\s\/](\d+(\.\d+)?)/i)}:/Whale/i.test(t)?o={name:"NAVER Whale browser",whale:e,version:r(/(?:whale)[\s\/](\d+(?:\.\d+)+)/i)}:/MZBrowser/i.test(t)?o={name:"MZ Browser",mzbrowser:e,version:r(/(?:MZBrowser)[\s\/](\d+(?:\.\d+)+)/i)}:/coast/i.test(t)?o={name:"Opera Coast",coast:e,version:w||r(/(?:coast)[\s\/](\d+(\.\d+)?)/i)}:/focus/i.test(t)?o={name:"Focus",focus:e,version:r(/(?:focus)[\s\/](\d+(?:\.\d+)+)/i)}:/yabrowser/i.test(t)?o={name:"Yandex Browser",yandexbrowser:e,version:w||r(/(?:yabrowser)[\s\/](\d+(\.\d+)?)/i)}:/ucbrowser/i.test(t)?o={name:"UC Browser",ucbrowser:e,version:r(/(?:ucbrowser)[\s\/](\d+(?:\.\d+)+)/i)}:/mxios/i.test(t)?o={name:"Maxthon",maxthon:e,version:r(/(?:mxios)[\s\/](\d+(?:\.\d+)+)/i)}:/epiphany/i.test(t)?o={name:"Epiphany",epiphany:e,version:r(/(?:epiphany)[\s\/](\d+(?:\.\d+)+)/i)}:/puffin/i.test(t)?o={name:"Puffin",puffin:e,version:r(/(?:puffin)[\s\/](\d+(?:\.\d+)?)/i)}:/sleipnir/i.test(t)?o={name:"Sleipnir",sleipnir:e,version:r(/(?:sleipnir)[\s\/](\d+(?:\.\d+)+)/i)}:/k-meleon/i.test(t)?o={name:"K-Meleon",kMeleon:e,version:r(/(?:k-meleon)[\s\/](\d+(?:\.\d+)+)/i)}:h?(o={name:"Windows Phone",osname:"Windows Phone",windowsphone:e},g?(o.msedge=e,o.version=g):(o.msie=e,o.version=r(/iemobile\/(\d+(\.\d+)?)/i))):/msie|trident/i.test(t)?o={name:"Internet Explorer",msie:e,version:r(/(?:msie |rv:)(\d+(\.\d+)?)/i)}:l?o={name:"Chrome",osname:"Chrome OS",chromeos:e,chromeBook:e,chrome:e,version:r(/(?:chrome|crios|crmo)\/(\d+(\.\d+)?)/i)}:/edg([ea]|ios)/i.test(t)?o={name:"Microsoft Edge",msedge:e,version:g}:/vivaldi/i.test(t)?o={name:"Vivaldi",vivaldi:e,version:r(/vivaldi\/(\d+(\.\d+)?)/i)||w}:p?o={name:"Sailfish",osname:"Sailfish OS",sailfish:e,version:r(/sailfish\s?browser\/(\d+(\.\d+)?)/i)}:/seamonkey\//i.test(t)?o={name:"SeaMonkey",seamonkey:e,version:r(/seamonkey\/(\d+(\.\d+)?)/i)}:/firefox|iceweasel|fxios/i.test(t)?(o={name:"Firefox",firefox:e,version:r(/(?:firefox|iceweasel|fxios)[ \/](\d+(\.\d+)?)/i)},/\((mobile|tablet);[^\)]*rv:[\d\.]+\)/i.test(t)&&(o.firefoxos=e,o.osname="Firefox OS")):f?o={name:"Amazon Silk",silk:e,version:r(/silk\/(\d+(\.\d+)?)/i)}:/phantom/i.test(t)?o={name:"PhantomJS",phantom:e,version:r(/phantomjs\/(\d+(\.\d+)?)/i)}:/slimerjs/i.test(t)?o={name:"SlimerJS",slimer:e,version:r(/slimerjs\/(\d+(\.\d+)?)/i)}:/blackberry|\bbb\d+/i.test(t)||/rim\stablet/i.test(t)?o={name:"BlackBerry",osname:"BlackBerry OS",blackberry:e,version:w||r(/blackberry[\d]+\/(\d+(\.\d+)?)/i)}:y?(o={name:"WebOS",osname:"WebOS",webos:e,version:w||r(/w(?:eb)?osbrowser\/(\d+(\.\d+)?)/i)},/touchpad\//i.test(t)&&(o.touchpad=e)):/bada/i.test(t)?o={name:"Bada",osname:"Bada",bada:e,version:r(/dolfin\/(\d+(\.\d+)?)/i)}:d?o={name:"Tizen",osname:"Tizen",tizen:e,version:r(/(?:tizen\s?)?browser\/(\d+(\.\d+)?)/i)||w}:/qupzilla/i.test(t)?o={name:"QupZilla",qupzilla:e,version:r(/(?:qupzilla)[\s\/](\d+(?:\.\d+)+)/i)||w}:/chromium/i.test(t)?o={name:"Chromium",chromium:e,version:r(/(?:chromium)[\s\/](\d+(?:\.\d+)?)/i)||w}:/chrome|crios|crmo/i.test(t)?o={name:"Chrome",chrome:e,version:r(/(?:chrome|crios|crmo)\/(\d+(\.\d+)?)/i)}:u?o={name:"Android",version:w}:/safari|applewebkit/i.test(t)?(o={name:"Safari",safari:e},w&&(o.version=w)):a?(o={name:"iphone"==a?"iPhone":"ipad"==a?"iPad":"iPod"},w&&(o.version=w)):o=/googlebot/i.test(t)?{name:"Googlebot",googlebot:e,version:r(/googlebot\/(\d+(\.\d+))/i)||w}:{name:r(/^(.*)\/(.*) /),version:n(/^(.*)\/(.*) /)},!o.msedge&&/(apple)?webkit/i.test(t)?(/(apple)?webkit\/537\.36/i.test(t)?(o.name=o.name||"Blink",o.blink=e):(o.name=o.name||"Webkit",o.webkit=e),!o.version&&w&&(o.version=w)):!o.opera&&/gecko\//i.test(t)&&(o.name=o.name||"Gecko",o.gecko=e,o.version=o.version||r(/gecko\/(\d+(\.\d+)?)/i)),o.windowsphone||!u&&!o.silk?!o.windowsphone&&a?(o[a]=e,o.ios=e,o.osname="iOS"):v?(o.mac=e,o.osname="macOS"):_?(o.xbox=e,o.osname="Xbox"):m?(o.windows=e,o.osname="Windows"):b&&(o.linux=e,o.osname="Linux"):(o.android=e,o.osname="Android");var x="";o.windows?x=function(e){switch(e){case"NT":return"NT";case"XP":return"XP";case"NT 5.0":return"2000";case"NT 5.1":return"XP";case"NT 5.2":return"2003";case"NT 6.0":return"Vista";case"NT 6.1":return"7";case"NT 6.2":return"8";case"NT 6.3":return"8.1";case"NT 10.0":return"10";default:return}}(r(/Windows ((NT|XP)( \d\d?.\d)?)/i)):o.windowsphone?x=r(/windows phone (?:os)?\s?(\d+(\.\d+)*)/i):o.mac?x=(x=r(/Mac OS X (\d+([_\.\s]\d+)*)/i)).replace(/[_\s]/g,"."):a?x=(x=r(/os (\d+([_\s]\d+)*) like mac os x/i)).replace(/[_\s]/g,"."):u?x=r(/android[ \/-](\d+(\.\d+)*)/i):o.webos?x=r(/(?:web|hpw)os\/(\d+(\.\d+)*)/i):o.blackberry?x=r(/rim\stablet\sos\s(\d+(\.\d+)*)/i):o.bada?x=r(/bada\/(\d+(\.\d+)*)/i):o.tizen&&(x=r(/tizen[\/\s](\d+(\.\d+)*)/i)),x&&(o.osversion=x);var k=!o.windows&&x.split(".")[0];return O||c||"ipad"==a||u&&(3==k||k>=4&&!S)||o.silk?o.tablet=e:(S||"iphone"==a||"ipod"==a||u||s||o.blackberry||o.webos||o.bada)&&(o.mobile=e),o.msedge||o.msie&&o.version>=10||o.yandexbrowser&&o.version>=15||o.vivaldi&&o.version>=1||o.chrome&&o.version>=20||o.samsungBrowser&&o.version>=4||o.whale&&1===i([o.version,"1.0"])||o.mzbrowser&&1===i([o.version,"6.0"])||o.focus&&1===i([o.version,"1.0"])||o.firefox&&o.version>=20||o.safari&&o.version>=6||o.opera&&o.version>=10||o.ios&&o.osversion&&o.osversion.split(".")[0]>=6||o.blackberry&&o.version>=10.1||o.chromium&&o.version>=20?o.a=e:o.msie&&o.version<10||o.chrome&&o.version<20||o.firefox&&o.version<20||o.safari&&o.version<6||o.opera&&o.version<10||o.ios&&o.osversion&&o.osversion.split(".")[0]<6||o.chromium&&o.version<20?o.c=e:o.x=e,o}var r=t("undefined"!=typeof navigator&&navigator.userAgent||"");function n(e){return e.split(".").length}function o(e,t){var r,n=[];if(Array.prototype.map)return Array.prototype.map.call(e,t);for(r=0;r=0;){if(r[0][t]>r[1][t])return 1;if(r[0][t]!==r[1][t])return-1;if(0===t)return 0}}function a(e,n,o){var a=r;"string"==typeof n&&(o=n,n=void 0),void 0===n&&(n=!1),o&&(a=t(o));var u=""+a.version;for(var s in e)if(e.hasOwnProperty(s)&&a[s]){if("string"!=typeof e[s])throw new Error("Browser version in the minVersion map should be a string: "+s+": "+String(e));return i([u,e[s]])<0}return n}return r.test=function(e){for(var t=0;t=0||(o[r]=e[r]);return o}var v=r(4),b=r.n(v),g=r(13),w="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?n.useLayoutEffect:n.useEffect,O=[],S=[null,null];function _(e,t){var r=e[1];return[t.payload,r+1]}function x(e,t,r){w((function(){return e.apply(void 0,t)}),r)}function k(e,t,r,n,o,i,a){e.current=n,t.current=o,r.current=!1,i.current&&(i.current=null,a())}function j(e,t,r,n,o,i,a,u,s,c){if(e){var l=!1,f=null,p=function(){if(!l){var e,r,p=t.getState();try{e=n(p,o.current)}catch(e){r=e,f=e}r||(f=null),e===i.current?a.current||s():(i.current=e,u.current=e,a.current=!0,c({type:"STORE_UPDATED",payload:{error:r}}))}};r.onStateChange=p,r.trySubscribe(),p();return function(){if(l=!0,r.tryUnsubscribe(),r.onStateChange=null,f)throw f}}}var P=function(){return[null,0]};function E(e,t){void 0===t&&(t={});var r=t,i=r.getDisplayName,a=void 0===i?function(e){return"ConnectAdvanced("+e+")"}:i,u=r.methodName,s=void 0===u?"connectAdvanced":u,l=r.renderCountProp,f=void 0===l?void 0:l,p=r.shouldHandleStateChanges,y=void 0===p||p,v=r.storeKey,w=void 0===v?"store":v,E=(r.withRef,r.forwardRef),A=void 0!==E&&E,C=r.context,R=void 0===C?c:C,T=m(r,["getDisplayName","methodName","renderCountProp","shouldHandleStateChanges","storeKey","withRef","forwardRef","context"]),I=R;return function(t){var r=t.displayName||t.name||"Component",i=a(r),u=h({},T,{getDisplayName:a,methodName:s,renderCountProp:f,shouldHandleStateChanges:y,storeKey:w,displayName:i,wrappedComponentName:r,WrappedComponent:t}),c=T.pure;var l=c?n.useMemo:function(e){return e()};function p(r){var i=Object(n.useMemo)((function(){var e=r.forwardedRef,t=m(r,["forwardedRef"]);return[r.context,e,t]}),[r]),a=i[0],s=i[1],c=i[2],f=Object(n.useMemo)((function(){return a&&a.Consumer&&Object(g.isContextConsumer)(o.a.createElement(a.Consumer,null))?a:I}),[a,I]),p=Object(n.useContext)(f),v=Boolean(r.store)&&Boolean(r.store.getState)&&Boolean(r.store.dispatch);Boolean(p)&&Boolean(p.store);var b=v?r.store:p.store,w=Object(n.useMemo)((function(){return function(t){return e(t.dispatch,u)}(b)}),[b]),E=Object(n.useMemo)((function(){if(!y)return S;var e=new d(b,v?null:p.subscription),t=e.notifyNestedSubs.bind(e);return[e,t]}),[b,v,p]),A=E[0],C=E[1],R=Object(n.useMemo)((function(){return v?p:h({},p,{subscription:A})}),[v,p,A]),T=Object(n.useReducer)(_,O,P),M=T[0][0],D=T[1];if(M&&M.error)throw M.error;var N=Object(n.useRef)(),B=Object(n.useRef)(c),F=Object(n.useRef)(),U=Object(n.useRef)(!1),L=l((function(){return F.current&&c===B.current?F.current:w(b.getState(),c)}),[b,M,c]);x(k,[B,N,U,c,L,F,C]),x(j,[y,b,A,w,B,N,U,F,C,D],[b,A,w]);var W=Object(n.useMemo)((function(){return o.a.createElement(t,h({},L,{ref:s}))}),[s,t,L]);return Object(n.useMemo)((function(){return y?o.a.createElement(f.Provider,{value:R},W):W}),[f,W,R])}var v=c?o.a.memo(p):p;if(v.WrappedComponent=t,v.displayName=i,A){var E=o.a.forwardRef((function(e,t){return o.a.createElement(v,h({},e,{forwardedRef:t}))}));return E.displayName=i,E.WrappedComponent=t,b()(E,t)}return b()(v,t)}}function A(e,t){return e===t?0!==e||0!==t||1/e==1/t:e!=e&&t!=t}function C(e,t){if(A(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;var r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;for(var o=0;o=0;n--){var o=t[n](e);if(o)return o}return function(t,n){throw new Error("Invalid value of type "+typeof e+" for "+r+" argument when connecting component "+n.wrappedComponentName+".")}}function ee(e,t){return e===t}function te(e){var t=void 0===e?{}:e,r=t.connectHOC,n=void 0===r?E:r,o=t.mapStateToPropsFactories,i=void 0===o?V:o,a=t.mapDispatchToPropsFactories,u=void 0===a?H:a,s=t.mergePropsFactories,c=void 0===s?Q:s,l=t.selectorFactory,f=void 0===l?X:l;return function(e,t,r,o){void 0===o&&(o={});var a=o,s=a.pure,l=void 0===s||s,p=a.areStatesEqual,d=void 0===p?ee:p,y=a.areOwnPropsEqual,v=void 0===y?C:y,b=a.areStatePropsEqual,g=void 0===b?C:b,w=a.areMergedPropsEqual,O=void 0===w?C:w,S=m(a,["pure","areStatesEqual","areOwnPropsEqual","areStatePropsEqual","areMergedPropsEqual"]),_=Z(e,i,"mapStateToProps"),x=Z(t,u,"mapDispatchToProps"),k=Z(r,c,"mergeProps");return n(f,h({methodName:"connect",getDisplayName:function(e){return"Connect("+e+")"},shouldHandleStateChanges:Boolean(e),initMapStateToProps:_,initMapDispatchToProps:x,initMergeProps:k,pure:l,areStatesEqual:d,areOwnPropsEqual:v,areStatePropsEqual:g,areMergedPropsEqual:O},S))}}var re=te();var ne;function oe(e,t){switch(e){case 0:return function(){return t.apply(this,arguments)};case 1:return function(e){return t.apply(this,arguments)};case 2:return function(e,r){return t.apply(this,arguments)};case 3:return function(e,r,n){return t.apply(this,arguments)};case 4:return function(e,r,n,o){return t.apply(this,arguments)};case 5:return function(e,r,n,o,i){return t.apply(this,arguments)};case 6:return function(e,r,n,o,i,a){return t.apply(this,arguments)};case 7:return function(e,r,n,o,i,a,u){return t.apply(this,arguments)};case 8:return function(e,r,n,o,i,a,u,s){return t.apply(this,arguments)};case 9:return function(e,r,n,o,i,a,u,s,c){return t.apply(this,arguments)};case 10:return function(e,r,n,o,i,a,u,s,c,l){return t.apply(this,arguments)};default:throw new Error("First argument to _arity must be a non-negative integer no greater than ten")}}function ie(e){return null!=e&&"object"==typeof e&&!0===e["@@functional/placeholder"]}function ae(e){return function t(r){return 0===arguments.length||ie(r)?t:e.apply(this,arguments)}}ne=i.unstable_batchedUpdates,l=ne;var ue=ae((function(e){var t,r=!1;return oe(e.length,(function(){return r?t:(r=!0,t=e.apply(this,arguments))}))}));function se(e){return function(t){var r=t.dispatch,n=t.getState;return function(t){return function(o){return"function"==typeof o?o(r,n,e):t(o)}}}}var ce=se();ce.withExtraArgument=se;var le=ce,fe=Array.isArray||function(e){return null!=e&&e.length>=0&&"[object Array]"===Object.prototype.toString.call(e)};function pe(e,t){return function(){var r=arguments.length;if(0===r)return t();var n=arguments[r-1];return fe(n)||"function"!=typeof n[e]?t.apply(this,arguments):n[e].apply(n,Array.prototype.slice.call(arguments,0,r-1))}}function de(e){return function t(r,n){switch(arguments.length){case 0:return t;case 1:return ie(r)?t:ae((function(t){return e(r,t)}));default:return ie(r)&&ie(n)?t:ie(r)?ae((function(t){return e(t,n)})):ie(n)?ae((function(t){return e(r,t)})):e(r,n)}}}var ye=de(pe("forEach",(function(e,t){for(var r=t.length,n=0;n=0;)we(t=xe[r],e)&&!je(n,t)&&(n[n.length]=t),r-=1;return n})):ae((function(e){return Object(e)!==e?[]:Object.keys(e)}));function Ee(e){return"[object Object]"===Object.prototype.toString.call(e)}var Ae=ae((function(e){return null!=e&&"function"==typeof e["fantasy-land/empty"]?e["fantasy-land/empty"]():null!=e&&null!=e.constructor&&"function"==typeof e.constructor["fantasy-land/empty"]?e.constructor["fantasy-land/empty"]():null!=e&&"function"==typeof e.empty?e.empty():null!=e&&null!=e.constructor&&"function"==typeof e.constructor.empty?e.constructor.empty():fe(e)?[]:me(e)?"":Ee(e)?{}:Se(e)?function(){return arguments}():void 0}));function Ce(e){for(var t,r=[];!(t=e.next()).done;)r.push(t.value);return r}function Re(e,t,r){for(var n=0,o=r.length;n=0;){if(r[i]===e)return n[i]===t;i-=1}switch(o){case"Map":return e.size===t.size&&Me(e.entries(),t.entries(),r.concat([e]),n.concat([t]));case"Set":return e.size===t.size&&Me(e.values(),t.values(),r.concat([e]),n.concat([t]));case"Arguments":case"Array":case"Object":case"Boolean":case"Number":case"String":case"Date":case"Error":case"RegExp":case"Int8Array":case"Uint8Array":case"Uint8ClampedArray":case"Int16Array":case"Uint16Array":case"Int32Array":case"Uint32Array":case"Float32Array":case"Float64Array":case"ArrayBuffer":break;default:return!1}var a=Pe(e);if(a.length!==Pe(t).length)return!1;var u=r.concat([e]),s=n.concat([t]);for(i=a.length-1;i>=0;){var c=a[i];if(!we(c,t)||!De(t[c],e[c],u,s))return!1;i-=1}return!0}var Ne=de((function(e,t){return De(e,t,[],[])})),Be=ae((function(e){return null!=e&&Ne(e,Ae(e))}));function Fe(e){return function t(r,n,o){switch(arguments.length){case 0:return t;case 1:return ie(r)?t:de((function(t,n){return e(r,t,n)}));case 2:return ie(r)&&ie(n)?t:ie(r)?de((function(t,r){return e(t,n,r)})):ie(n)?de((function(t,n){return e(r,t,n)})):ae((function(t){return e(r,n,t)}));default:return ie(r)&&ie(n)&&ie(o)?t:ie(r)&&ie(n)?de((function(t,r){return e(t,r,o)})):ie(r)&&ie(o)?de((function(t,r){return e(t,n,r)})):ie(n)&&ie(o)?de((function(t,n){return e(r,t,n)})):ie(r)?ae((function(t){return e(t,n,o)})):ie(n)?ae((function(t){return e(r,t,o)})):ie(o)?ae((function(t){return e(r,n,t)})):e(r,n,o)}}}var Ue=Fe((function(e,t,r){var n,o={};for(n in t)we(n,t)&&(o[n]=we(n,r)?e(n,t[n],r[n]):t[n]);for(n in r)we(n,r)&&!we(n,o)&&(o[n]=r[n]);return o})),Le=Fe((function(e,t,r){return Ue((function(t,r,n){return e(r,n)}),t,r)})),We=de((function(e,t){return e.map((function(e){return ge([e],t)}))}));function qe(e){return null!=e&&"function"==typeof e["@@transducer/step"]}function ze(e,t,r){return function(){if(0===arguments.length)return r();var n=Array.prototype.slice.call(arguments,0),o=n.pop();if(!fe(o)){for(var i=0;i0&&(e.hasOwnProperty(0)&&e.hasOwnProperty(e.length-1)))))})),He=function(){function e(e){this.f=e}return e.prototype["@@transducer/init"]=function(){throw new Error("init not implemented on XWrap")},e.prototype["@@transducer/result"]=function(e){return e},e.prototype["@@transducer/step"]=function(e,t){return this.f(e,t)},e}();var Ve=de((function(e,t){return oe(e.length,(function(){return e.apply(t,arguments)}))}));function $e(e,t,r){for(var n=r.next();!n.done;){if((t=e["@@transducer/step"](t,n.value))&&t["@@transducer/reduced"]){t=t["@@transducer/value"];break}n=r.next()}return e["@@transducer/result"](t)}function Qe(e,t,r,n){return e["@@transducer/result"](r[n](Ve(e["@@transducer/step"],e),t))}var Ye="undefined"!=typeof Symbol?Symbol.iterator:"@@iterator";function Je(e,t,r){if("function"==typeof e&&(e=function(e){return new He(e)}(e)),Ke(r))return function(e,t,r){for(var n=0,o=r.length;n=arguments.length)?u=t[a]:(u=arguments[o],o+=1),n[a]=u,ie(u)||(i-=1),a+=1}return i<=0?r.apply(this,n):oe(i,ut(e,n,r))}}var st=de((function(e,t){return 1===e?ae(t):oe(e,ut(e,[],t))})),ct=de(ze(["fantasy-land/map","map"],at,(function(e,t){switch(Object.prototype.toString.call(t)){case"[object Function]":return st(t.length,(function(){return e.call(this,t.apply(this,arguments))}));case"[object Object]":return Je((function(r,n){return r[n]=e(t[n]),r}),{},Pe(t));default:return ot(e,t)}}))),lt=Fe(Je),ft=Fe((function(e,t,r){var n={};for(var o in r)n[o]=r[o];return n[e]=t,n}));function pt(e){var t=Object.prototype.toString.call(e);return"[object Function]"===t||"[object AsyncFunction]"===t||"[object GeneratorFunction]"===t||"[object AsyncGeneratorFunction]"===t}function dt(e,t){return function(e,t,r){var n,o;if("function"==typeof e.indexOf)switch(typeof t){case"number":if(0===t){for(n=1/t;r=0}function yt(e){return'"'+e.replace(/\\/g,"\\\\").replace(/[\b]/g,"\\b").replace(/\f/g,"\\f").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t").replace(/\v/g,"\\v").replace(/\0/g,"\\0").replace(/"/g,'\\"')+'"'}var ht=function(e){return(e<10?"0":"")+e},mt="function"==typeof Date.prototype.toISOString?function(e){return e.toISOString()}:function(e){return e.getUTCFullYear()+"-"+ht(e.getUTCMonth()+1)+"-"+ht(e.getUTCDate())+"T"+ht(e.getUTCHours())+":"+ht(e.getUTCMinutes())+":"+ht(e.getUTCSeconds())+"."+(e.getUTCMilliseconds()/1e3).toFixed(3).slice(2,5)+"Z"};var vt=de((function(e,t){return tt((r=e,function(){return!r.apply(this,arguments)}),t);var r}));var bt=ae((function(e){return function e(t,r){var n=function(n){var o=r.concat([t]);return dt(n,o)?"":e(n,o)},o=function(e,t){return ot((function(t){return yt(t)+": "+n(e[t])}),t.slice().sort())};switch(Object.prototype.toString.call(t)){case"[object Arguments]":return"(function() { return arguments; }("+ot(n,t).join(", ")+"))";case"[object Array]":return"["+ot(n,t).concat(o(t,vt((function(e){return/^\d+$/.test(e)}),Pe(t)))).join(", ")+"]";case"[object Boolean]":return"object"==typeof t?"new Boolean("+n(t.valueOf())+")":t.toString();case"[object Date]":return"new Date("+(isNaN(t.valueOf())?n(NaN):yt(mt(t)))+")";case"[object Null]":return"null";case"[object Number]":return"object"==typeof t?"new Number("+n(t.valueOf())+")":1/t==-1/0?"-0":t.toString(10);case"[object String]":return"object"==typeof t?"new String("+n(t.valueOf())+")":yt(t);case"[object Undefined]":return"undefined";default:if("function"==typeof t.toString){var i=t.toString();if("[object Object]"!==i)return i}return"{"+o(t,Pe(t)).join(", ")+"}"}}(e,[])})),gt=de((function(e,t){if(fe(e)){if(fe(t))return e.concat(t);throw new TypeError(bt(t)+" is not an array")}if(me(e)){if(me(t))return e+t;throw new TypeError(bt(t)+" is not a string")}if(null!=e&&pt(e["fantasy-land/concat"]))return e["fantasy-land/concat"](t);if(null!=e&&pt(e.concat))return e.concat(t);throw new TypeError(bt(e)+' does not have a method named "concat" or "fantasy-land/concat"')}));function wt(e){return e&&e["@@transducer/reduced"]?e:{"@@transducer/value":e,"@@transducer/reduced":!0}}var Ot=function(){function e(e,t){this.xf=t,this.f=e,this.all=!0}return e.prototype["@@transducer/init"]=Xe,e.prototype["@@transducer/result"]=function(e){return this.all&&(e=this.xf["@@transducer/step"](e,!0)),this.xf["@@transducer/result"](e)},e.prototype["@@transducer/step"]=function(e,t){return this.f(t)||(this.all=!1,e=wt(this.xf["@@transducer/step"](e,!1))),e},e}(),St=de(ze(["all"],de((function(e,t){return new Ot(e,t)})),(function(e,t){for(var r=0;re?t:e})),xt=de((function(e,t){return ge([e],t)})),kt=de((function(e,t){return ct(xt(e),t)})),jt=de((function(e,t){return st(lt(_t,0,kt("length",t)),(function(){var r=arguments,n=this;return e.apply(n,ot((function(e){return e.apply(n,r)}),t))}))})),Pt=ae((function(e){return jt((function(){return Array.prototype.slice.call(arguments,0)}),e)}))([tt,vt]);function Et(e,t,r){var n,o=typeof e;switch(o){case"string":case"number":return 0===e&&1/e==-1/0?!!r._items["-0"]||(t&&(r._items["-0"]=!0),!1):null!==r._nativeSet?t?(n=r._nativeSet.size,r._nativeSet.add(e),r._nativeSet.size===n):r._nativeSet.has(e):o in r._items?e in r._items[o]||(t&&(r._items[o][e]=!0),!1):(t&&(r._items[o]={},r._items[o][e]=!0),!1);case"boolean":if(o in r._items){var i=e?1:0;return!!r._items[o][i]||(t&&(r._items[o][i]=!0),!1)}return t&&(r._items[o]=e?[!1,!0]:[!0,!1]),!1;case"function":return null!==r._nativeSet?t?(n=r._nativeSet.size,r._nativeSet.add(e),r._nativeSet.size===n):r._nativeSet.has(e):o in r._items?!!dt(e,r._items[o])||(t&&r._items[o].push(e),!1):(t&&(r._items[o]=[e]),!1);case"undefined":return!!r._items[o]||(t&&(r._items[o]=!0),!1);case"object":if(null===e)return!!r._items.null||(t&&(r._items.null=!0),!1);default:return(o=Object.prototype.toString.call(e))in r._items?!!dt(e,r._items[o])||(t&&r._items[o].push(e),!1):(t&&(r._items[o]=[e]),!1)}}var At=function(){function e(){this._nativeSet="function"==typeof Set?new Set:null,this._items={}}return e.prototype.add=function(e){return!Et(e,!0,this)},e.prototype.has=function(e){return Et(e,!1,this)},e}(),Ct=de((function(e,t){for(var r=[],n=0,o=e.length,i=t.length,a=new At,u=0;ut.length?(r=e,n=t):(r=t,n=e),qt(Ge(Ut(dt)(r),n))})),Gt=ae((function(e){for(var t=Pe(e),r=t.length,n=[],o=0;o=0&&this.i>=this.n?wt(r):r},e}(),tr=de((function(e,t){return new er(e,t)})),rr=Fe(pe("slice",(function(e,t,r){return Array.prototype.slice.call(r,e,t)}))),nr=de(ze(["take"],tr,(function(e,t){return rr(0,e<0?1/0:e,t)}))),or=de((function(e,t){return Ne(nr(e.length,t),e)})),ir=function(){function e(e,t){this.xf=t,this.f=e,this.found=!1}return e.prototype["@@transducer/init"]=Xe,e.prototype["@@transducer/result"]=function(e){return this.found||(e=this.xf["@@transducer/step"](e,void 0)),this.xf["@@transducer/result"](e)},e.prototype["@@transducer/step"]=function(e,t){return this.f(t)&&(this.found=!0,e=wt(this.xf["@@transducer/step"](e,t))),e},e}(),ar=de(ze(["find"],de((function(e,t){return new ir(e,t)})),(function(e,t){for(var r=0,n=t.length;r2&&void 0!==arguments[2]?arguments[2]:[];if(Array.isArray(t))t.forEach((function(t,o){e(t,r,fr(o,n))}));else if("Object"===Ie(t)){r(t,n);var o=ge(yr,t);if(o){var i=gt(n,yr);e(o,r,i)}}},mr=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._ev={}}var t,r,n;return t=e,(r=[{key:"on",value:function(e,t){var r=this;return(this._ev[e]=this._ev[e]||[]).push(t),function(){return r.removeListener(e,t)}}},{key:"removeListener",value:function(e,t){var r=this._ev[e];if(r){var n=r.indexOf(t);n>-1&&r.splice(n,1)}}},{key:"emit",value:function(e){for(var t=this,r=arguments.length,n=new Array(r>1?r-1:0),o=1;oe.length)&&(t=e.length);for(var r=0,n=new Array(t);ro?1:nt?1:e=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){r=e[Symbol.iterator]()},n:function(){var e=r.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}(t);try{for(u.s();!(r=u.n()).done;){var s=r.value,c=s.id;if(s.property===o&&"string"!=typeof c&&Ne(Pe(c).sort(),i)&&St(Gr,Ft(a,We(i,c))))return s}}catch(e){u.e(e)}finally{u.f()}return!1}function Hr(e){var t=[],r=[];return"object"===Pr(e)&&(Nt((function(e,n){e===Cr?t.push(n):e===Rr&&r.push(n)}),e),t.sort(),r.sort()),{matchKeys:t,allsmallerKeys:r}}function Vr(e,t,r,n,o,i){for(var a=0;ae.length)&&(t=e.length);for(var r=0,n=new Array(t);r5&&void 0!==arguments[5])||arguments[5],a=[],u=ln({id:r,property:n});if("string"==typeof r){var s=(e.inputMap[r]||{})[n];if(!s)return[];s.forEach(Xr(gn(),t,a))}else{var c=Object.keys(r).sort(),l=We(c,r),f=c.join(","),p=(e.inputPatterns[f]||{})[n];if(!p)return[];p.forEach((function(e){Vr(c,l,e.values)&&e.callbacks.forEach(Xr(gn(c,l,e.values),t,a))}))}return a.forEach((function(r){r.changedPropIds[u]=o||2,i&&(r.priority=pn(e,t,r))})),a}function pn(e,t,r){for(var n=[r],o={},i=[];n.length;){var a=tt((function(e){return!o[ln(e)]}),nt(ct((function(e){return nt(e.getOutputs(t))}),n)));o=lt((function(e,t){return ft(ln(t),!0,e)}),o,a),(n=nt(ct((function(r){var n=r.id,o=r.property;return fn(e,t,n,o,sn,!1)}),a))).length&&i.push(n.length)}return i.unshift(i.length),ct((function(e){return Math.min(e,35).toString(36)}),i).join("")}var dn=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t;if(!t.length)return[];var n=ct(ln,lt((function(t,r){return gt(t,nt(r.getOutputs(e)))}),[],r)),o={};return ye((function(e){return o[e]=!0}),n),tt((function(t){return St((function(e){return!o[ln(e)]}),nt(t.getInputs(e)))}),t)},yn=function(e,t,r,n){for(var o=[],i=Zr(e,t,r,n);;){var a=on(Pt((function(e){var r=e.callback.inputs,n=e.getInputs;return St(Qr,r)||!Be(Ct(ct(ln,nt(n(t))),o))}),i),2),u=a[0],s=a[1];if(!s.length)break;i=u,o=gt(o,ct(ln,nt(ct((function(e){return(0,e.getOutputs)(t)}),s))))}var c=Math.random().toString(16);return ct((function(e){return rn(rn({},e),{},{executionGroup:c})}),i)},hn=function(e){var t=e.anyVals,r=e.callback,n=r.inputs,o=r.outputs,i=r.state;return gt(ct(ln,[].concat(en(n),en(o),en(i))),Array.isArray(t)?t:""===t?[]:[t]).join(",")};function mn(e,t,r,n){return nt(ct((function(t){return fn(r,n,e,t)}),Pe(t)))}var vn=function(e,t,r){return{callback:e,anyVals:r,resolvedId:e.output+r,getOutputs:function(r){return e.outputs.map(t(r))},getInputs:function(r){return e.inputs.map(t(r))},getState:function(r){return e.state.map(t(r))},changedPropIds:{},initialCall:!1}};function bn(e,t){var r=on(Pt((function(e){var r=e.getOutputs,n=e.callback.outputs;return nt(r(t)).length===n.length}),e),2)[1],n=on(Pt((function(e){var r=e.getOutputs;return!nt(r(t)).length}),r),2)[1];return{added:ct((function(e){return ft("changedPropIds",Rt((function(e,r){return gr(t,Nr(r).id)}),e.changedPropIds),e)}),n),removed:r}}function gn(e,t,r){return function(n){return function(o){var i=o.id,a=o.property;if("string"==typeof i){var u=gr(n,i);return u?[{id:i,property:a,path:u}]:[]}var s=Object.keys(i).sort(),c=We(s,i),l=s.join(","),f=n.objs[l];if(!f)return[];var p=[];return f.forEach((function(n){var o=n.values,i=n.path;Vr(s,o,c,e,t,r)&&p.push({id:Tt(s,o),property:a,path:i})})),p}}}var wn=Fe((function e(t,r,n){if(0===t.length)return r;var o=t[0];if(t.length>1){var i=!sr(n)&&we(o,n)?n[o]:he(t[1])?[]:{};r=e(Array.prototype.slice.call(t,1),r,i)}if(he(o)&&fe(n)){var a=[].concat(n);return a[o]=r,a}return ft(o,r,n)}));var On={ON_PROP_CHANGE:1,SET_REQUEST_QUEUE:1,SET_GRAPHS:1,SET_PATHS:1,SET_LAYOUT:1,SET_APP_LIFECYCLE:1,SET_CONFIG:1,ON_ERROR:1,SET_HOOKS:1},Sn=function(e){if(On[e])return e;throw new Error("".concat(e," is not defined."))};function _n(e){var t={STARTED:"STARTED",HYDRATED:"HYDRATED"};if(t[e])return t[e];throw new Error("".concat(e," is not a valid app state."))}var xn,kn,jn,Pn,En=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:_n("STARTED"),t=arguments.length>1?arguments[1]:void 0;switch(t.type){case Sn("SET_APP_LIFECYCLE"):return _n(t.payload);default:return e}};function An(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Cn(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:Tn,t=arguments.length>1?arguments[1]:void 0;return lt((function(e,t){return null===t?e:t.type===Pn.AddCompleted?Dn(e,t):Nn(e,t)}),e,t.type===Pn.Aggregate?t.payload:[t])};function Fn(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1?arguments[1]:void 0;return t.type===Sn("SET_CONFIG")?t.payload:e}var Un={},Ln=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Un,t=arguments.length>1?arguments[1]:void 0;return"SET_GRAPHS"===t.type?t.payload:e};function Wn(e){return function(e){if(Array.isArray(e))return qn(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return qn(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return qn(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function qn(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r0&&void 0!==arguments[0]?arguments[0]:zn,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"ON_ERROR":var r=e.frontEnd,n=e.backEnd,o=e.backEndConnected;return console.error(t.payload.error),"frontEnd"===t.payload.type?{frontEnd:[Jt(t.payload,{timestamp:new Date})].concat(Wn(r)),backEnd:n,backEndConnected:o}:"backEnd"===t.payload.type?{frontEnd:r,backEnd:[Jt(t.payload,{timestamp:new Date})].concat(Wn(n)),backEndConnected:o}:e;case"SET_CONNECTION_STATUS":return Jt(e,{backEndConnected:t.payload});default:return e}}function Kn(e){return function(e){if(Array.isArray(e))return Hn(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return Hn(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Hn(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Hn(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r0&&void 0!==arguments[0]?arguments[0]:Vn,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"UNDO":var r=e.past,n=e.present,o=e.future,i=r[r.length-1],a=r.slice(0,r.length-1);return{past:a,present:i,future:[n].concat(Kn(o))};case"REDO":var u=e.past,s=e.present,c=e.future,l=c[0],f=c.slice(1);return{past:[].concat(Kn(u),[s]),present:l,future:f};case"REVERT":var p=e.past,d=e.future,y=p[p.length-1],h=p.slice(0,p.length-1);return{past:h,present:y,future:Kn(d)};default:return e}},Qn=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{request_pre:null,request_post:null,bear:!1},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SET_HOOKS":return t.payload;default:return e}};function Yn(e,t,r,n){var o,i=function(o){for(var i=t.length,a=0;a=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}var ao={count:0,total:0,compute:0,network:{time:0,upload:0,download:0},resources:{},status:{latest:null},result:{}},uo={updated:[],resources:{},callbacks:{},graphLayout:null},so=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:uo,t=arguments.length>1?arguments[1]:void 0;if("UPDATE_RESOURCE_USAGE"===t.type){var r=t.payload,n=r.id,o=r.usage,i=r.status,a=oo[i]||i,u={updated:[n],resources:e.resources,callbacks:e.callbacks,graphLayout:e.graphLayout};u.callbacks[n]=u.callbacks[n]||Xn(ao);var s=u.callbacks[n],c=s.resources,l=u.resources;if(s.count+=1,s.status.latest=a,s.status[a]=(s.status[a]||0)+1,s.result=t.payload.result,s.inputs=t.payload.inputs,s.state=t.payload.state,o){var f=o.__dash_client,p=o.__dash_server,d=o.__dash_upload,y=o.__dash_download,h=io(o,["__dash_client","__dash_server","__dash_upload","__dash_download"]);for(var m in s.total+=f,s.compute+=p,s.network.time+=f-p,s.network.upload+=d,s.network.download+=y,h)h.hasOwnProperty(m)&&(c[m]=(c[m]||0)+h[m],l[m]=(l[m]||0)+h[m])}return u}return e},co={id:null,props:{}};var lo,fo=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:co;return e};!function(e){e.Set="IsLoading.Set"}(lo||(lo={}));var po,yo=function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=arguments.length>1?arguments[1]:void 0;return t.type===lo.Set?t.payload:e},ho=function(e){return{value:e,"fantasy-land/map":function(){return this}}},mo=de((function(e,t){return e(ho)(t).value})),vo=de((function(e,t){return function(r){return function(n){return ct((function(e){return t(e,n)}),r(e(n)))}}})),bo=ae((function(e){return vo(ge(e),wn(e))})),go=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;if(t.type===Sn("SET_LAYOUT"))return t.payload;if(Bt(t.type,["UNDO_PROP_CHANGE","REDO_PROP_CHANGE",Sn("ON_PROP_CHANGE")])){var r=fr("props",t.payload.itempath),n=mo(bo(r),e),o=Jt(n,t.payload.props);return wn(r,o,e)}return e};!function(e){e.Set="LoadingMap.Set"}(po||(po={}));var wo={},Oo=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:wo,t=arguments.length>1?arguments[1]:void 0;return t.type===po.Set?t.payload:e},So={strs:{},objs:{}},_o=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:So,t=arguments.length>1?arguments[1]:void 0;return t.type===Sn("SET_PATHS")?t.payload:e};function xo(e){return function(e){if(Array.isArray(e))return ko(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return ko(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return ko(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ko(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,n=e;if(t.type===r){var o=t.payload,i=o.id,a=o.status,u=o.content,s={status:a,content:u};n=Array.isArray(i)?wn(i,s,e):i?ft(i,s,e):Jt(e,s)}return n})}),jo),B(e)}function Eo(e,t,r){var n,o=t.graphs,i=t.paths,a=t.layout,u=e.itempath,s=e.props,c=ge(u.concat(["props"]),a)||{},l=c.id;return l&&(r&&(t.changed={id:l,props:s}),n={id:l,props:{}},Pe(s).forEach((function(e){fn(o,i,l,e).length&&(n.props[e]=c[e])}))),n}function Ao(){return function(e){return function(t,r){var n=t||{},o=n.history,i=n.config,a=n.hooks,u=t;return"RELOAD"===r.type?u={history:o,config:i,hooks:a}:"SET_CONFIG"===r.type&&(u={hooks:a}),e(u,r)}}((e=Po(),function(t,r){var n=r.type,o=r.payload;if("ON_PROP_CHANGE"===n){var i=Eo(o,t,!0);i&&!Be(i.props)&&(t.history.present=i)}var a=e(t,r);if("ON_PROP_CHANGE"===n&&"response"!==o.source){var u=Eo(o,a);u&&!Be(u.props)&&(a.history={past:[].concat(xo(a.history.past),[t.history.present]),present:u,future:[]})}return a}));var e}var Co=function e(t){var r=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._observers=[],this.observe=function(e,t){if("function"==typeof e){if(!Array.isArray(t))throw new Error("inputs must be an array");return r.add(e,t),function(){return r.remove(e)}}return r.add(e.observer,e.inputs),function(){return r.remove(e.observer)}},this.setStore=function(e){r.__finalize__(),r.__init__(e)},this.__finalize__=function(){var e;return null===(e=r._unsubscribe)||void 0===e?void 0:e.call(r)},this.__init__=function(e){r._store=e,e&&(r._unsubscribe=e.subscribe(r.notify)),ye((function(e){return e.lastState=null}),r._observers)},this.add=function(e,t){return r._observers.push({inputPaths:ct((function(e){return e.split(".")}),t),lastState:null,observer:e,triggered:!1})},this.notify=function(){var e=r._store;if(e){var t=e.getState(),n=tt((function(e){return!e.triggered&&Zt((function(r){return ge(r,t)!==ge(r,e.lastState)}),e.inputPaths)}),r._observers);ye((function(e){return e.triggered=!0}),n),ye((function(t){t.lastState=e.getState(),t.observer(e),t.triggered=!1}),n)}},this.remove=function(e){return r._observers.splice(r._observers.findIndex((function(t){return e===t.observer}),r._observers),1)},this.__init__(t)},Ro=function(e){var t=e(),r=t.config,n=t.isLoading,o=null==r?void 0:r.update_title;o&&(n?document.title!==o&&(To.title=document.title,document.title=o):document.title===o?document.title=To.title:To.title=document.title)},To={inputs:["isLoading"],mutationObserver:void 0,observer:function(e){var t=e.getState,r=t().config;if(To.config!==r){var n;To.config=r,null===(n=To.mutationObserver)||void 0===n||n.disconnect(),To.mutationObserver=new MutationObserver((function(){return Ro(t)}));var o=document.querySelector("title");o&&To.mutationObserver.observe(o,{subtree:!0,childList:!0,attributes:!0,characterData:!0})}Ro(t)}},Io=To,Mo=ae((function(e){var t=[];for(var r in e)we(r,e)&&(t[t.length]=[r,e[r]]);return t})),Do=de((function(e,t){for(var r={},n=0;n1?r-1:0),o=1;oe.length)&&(t=e.length);for(var r=0,n=new Array(t);r5&&void 0!==arguments[5]&&arguments[5],a="Input"===o?r.getInputs:r.getState,u=[],s=0,c=a(e).map((function(i,a){var c=hi(Di(e,i.map((function(e){var r=e.id,n=e.property,o=e.path;return{id:r,property:n,value:ge(o,t).props[n]}})),n[a],r.anyVals,o),2),l=c[0],f=c[1];return Qr(n[a])&&!l.length&&s++,f&&u.push(f),l}));if(u.length){if(i&&u.length+s===c.length)return null;Bi(u,e)}return c}function Bi(e,t){var r=e[0];throw-1!==r.indexOf("logged above")&&console.error(t.objs),new ReferenceError(r)}var Fi=function(e){return Array.isArray(e)?kt("value",e):e.value},Ui=function(e,t){return Array.isArray(e)?Ft(e,t):[[e,t]]};function Li(e,t,r,n){var o=window.dash_clientside=window.dash_clientside||{};o.no_update||(Object.defineProperty(o,"no_update",{value:{description:"Return to prevent updating an Output."},writable:!1}),Object.defineProperty(o,"PreventUpdate",{value:{description:"Throw to prevent updating all Outputs."},writable:!1}));var i=n.inputs,a=n.outputs,u=n.state,s=Date.now(),c=Wi(i),l=Wi(u),f={},p=eo;try{var d,y=t.namespace,h=t.function_name,m=i.map(Fi);u&&(m=gt(m,u.map(Fi))),o.callback_context={},o.callback_context.triggered=n.changedPropIds.map((function(e){return{prop_id:e,value:c[e]}})),o.callback_context.inputs_list=i,o.callback_context.inputs=c,o.callback_context.states_list=u,o.callback_context.states=l;var v=(d=o[y])[h].apply(d,yi(m));if("function"==typeof(null==v?void 0:v.then))throw new Error("The clientside function returned a Promise. Promises are not supported in Dash clientside right now, but may be in the future.");Ui(a,v).forEach((function(e){var t=hi(e,2),r=t[0],n=t[1];Ui(r,n).forEach((function(e){var t=hi(e,2),r=t[0],n=t[1],i=r.id,a=r.property,u=Fr(i),s=f[u]=f[u]||{};n!==o.no_update&&(s[a]=n)}))}))}catch(e){if(e!==o.PreventUpdate)throw p=ro,e;p=to}finally{delete o.callback_context;var b=Date.now()-s,g={__dash_server:b,__dash_client:b,__dash_upload:0,__dash_download:0};r.ui&&e(Mi({id:n.output,usage:g,status:p,result:f,inputs:i,state:u}))}return f}function Wi(e){if(!e)return{};for(var t={},r=0;re.length)&&(t=e.length);for(var r=0,n=new Array(t);re.length)&&(t=e.length);for(var r=0,n=new Array(t);re.length)&&(t=e.length);for(var r=0,n=new Array(t);re.length)&&(t=e.length);for(var r=0,n=new Array(t);re.length)&&(t=e.length);for(var r=0,n=new Array(t);re.length)&&(t=e.length);for(var r=0,n=new Array(t);r(null!==(n=t.priority)&&void 0!==n?n:"")?-1:1},Ya=function(e,t){var r=(0,e.getOutputs)(t),n=nt(r),o=[],i={};return n.forEach((function(e){var t=e.id,r=e.property,n=Fr(t);(i[n]=i[n]||[]).push(r),o.push(ln({id:n,property:r}))})),{allOutputs:r,allPropIds:o}},Ja=function(e,t){return qt(kt("id",[].concat(Ka(nt(e.getInputs(t))),Ka(nt(e.getState(t))))))},Xa={observer:($a=Ga(regeneratorRuntime.mark((function e(t){var r,n,o,i,a,u,s,c,l,f,p,d,y,h,m,v,b,g,w,O;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=t.dispatch,n=t.getState,o=n(),i=o.callbacks,a=i.executing,u=i.watched,s=o.config,c=o.hooks,l=o.layout,f=o.paths,p=n(),d=p.callbacks.prioritized,y=Math.max(0,12-a.length-u.length),d=Na(Qa,d),h=Pt((function(e){return!0===Fa(l,f,Ja(e,f))}),d),m=qa(h,2),v=m[0],b=m[1],g=v.slice(0,y),w=b.slice(0,y-g.length),g.length&&r(Ii([Ai(g),Oi(ct((function(e){return qi(e,s,c,f,l,Ya(e,f),r)}),g))])),w.length&&(O=ct((function(e){return La(La(La({},e),Ya(e,f)),{},{isReady:Fa(l,f,Ja(e,f))})}),w),r(Ii([Ai(w),bi(O)])),ye(function(){var e=Ga(regeneratorRuntime.mark((function e(t){var o,i,a;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.isReady;case 2:if(o=n(),i=o.callbacks.blocked,ar((function(e){return e===t||e.isReady===t.isReady}),i)){e.next=6;break}return e.abrupt("return");case 6:a=qi(t,s,c,f,l,t,r),r(Ii([Pi([t]),Oi([a])]));case 8:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),O));case 10:case"end":return e.stop()}}),e)}))),function(e){return $a.apply(this,arguments)}),inputs:["callbacks.prioritized","callbacks.completed"]},Za=de((function(e,t){return Yt({},t,e)})),eu=function(){function e(e,t,r,n){this.valueFn=e,this.valueAcc=t,this.keyFn=r,this.xf=n,this.inputs={}}return e.prototype["@@transducer/init"]=Xe,e.prototype["@@transducer/result"]=function(e){var t;for(t in this.inputs)if(we(t,this.inputs)&&(e=this.xf["@@transducer/step"](e,this.inputs[t]))["@@transducer/reduced"]){e=e["@@transducer/value"];break}return this.inputs=null,this.xf["@@transducer/result"](e)},e.prototype["@@transducer/step"]=function(e,t){var r=this.keyFn(t);return this.inputs[r]=this.inputs[r]||[r,this.valueAcc],this.inputs[r][1]=this.valueFn(this.inputs[r][1],t),e},e}(),tu=de(pe("groupBy",ut(4,[],ze([],ut(4,[],(function(e,t,r,n){return new eu(e,t,r,n)})),(function(e,t,r,n){return Je((function(n,o){var i=r(o);return n[i]=e(we(i,n)?n[i]:Yn(t,[],[],!1),o),n}),{},n)})))((function(e,t){return null==e&&(e=[]),e.push(t),e}),null)));function ru(e,t,r,n,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void r(e)}u.done?t(s):Promise.resolve(s).then(n,o)}var nu=function(){var e,t=(e=regeneratorRuntime.mark((function e(t){var r,n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=new Promise((function(e){return r=e})),setTimeout(r,t),e.abrupt("return",n);case 3:case"end":return e.stop()}}),e)})),function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function a(e){ru(i,n,o,a,u,"next",e)}function u(e){ru(i,n,o,a,u,"throw",e)}a(void 0)}))});return function(e){return t.apply(this,arguments)}}();function ou(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function iu(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);re.length)&&(t=e.length);for(var r=0,n=new Array(t);r4&&void 0!==arguments[4]?arguments[4]:null,i=[];for(var a in e)if(e.hasOwnProperty(a)){var u=void 0;try{"function"!=typeof e[a]?(u=Error((n||"React class")+": "+r+" type `"+a+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+Ru(e[a])+"`.")).name="Invariant Violation":u=e[a](t,a,n,r,null,Cu.a)}catch(e){u=e}if(!u||u instanceof Error||i.push((n||"React class")+": type specification of "+r+" `"+a+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+Ru(u)+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),u instanceof Error){var s=o&&o()||"";i.push("Failed "+r+" type: "+u.message+s)}}return i.join("\n\n")}(t.propTypes,n,"component prop",t);return a&&function(e,t,r){var n,o=e.split("`");if(Bt("is marked as required",e)){var i=o[1];n="".concat(i," in ").concat(r),t.id&&(n+=' with ID "'.concat(t.id,'"')),n+=" is required but it was not provided."}else if(Bt("Bad object",e))n=e.split("supplied to ")[0]+"supplied to ".concat(r)+".\nBad"+e.split(".\nBad")[1];else{if(!Bt("Invalid ",e)||!Bt(" supplied to ",e))throw new Error(e);var a=o[1];if(n="Invalid argument `".concat(a,"` passed into ").concat(r),t.id&&(n+=' with ID "'.concat(t.id,'"')),n+=".",Bt(", expected ",e)){var u=e.split(", expected ")[1];n+="\nExpected ".concat(u)}if(Bt(" of type `",e)){var s=e.split(" of type `")[1].split("`")[0];n+="\nWas supplied type `".concat(s,"`.")}if(lr(a,t)){var c=JSON.stringify(t[a],null,2);c&&(Bt("\n",c)?n+="\nValue provided: \n".concat(c):n+="\nValue provided: ".concat(c))}}throw new Error(n)}(a,n,i),Yu(t,n,r,o)}function Yu(e,t,r,n){var i=Jt(t,r);return Array.isArray(n)?o.a.createElement.apply(o.a,[e,i].concat(Hu(n))):o.a.createElement(e,i,n)}Qu.propTypes={children:s.a.any,element:s.a.any,layout:s.a.any,props:s.a.any,extraProps:s.a.any,id:s.a.string};var Ju=Object(n.memo)((function(e){return o.a.createElement(ys.Consumer,null,(function(t){return o.a.createElement(Xu,Ku({},t.fn(),e,{_dashprivate_path:JSON.parse(e._dashprivate_path)}))}))})),Xu=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Lu(e,t)}(a,e);var t,r,n,i=Wu(a);function a(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(t=i.call(this,e)).setProps=t.setProps.bind(zu(t)),t}return t=a,(r=[{key:"createContainer",value:function(e,t,r){return wu(t)?t:o.a.createElement(Ju,{key:t&&t.props&&Fr(t.props.id),_dashprivate_error:e._dashprivate_error,_dashprivate_layout:t,_dashprivate_loadingState:Tu(t,r,e._dashprivate_loadingMap),_dashprivate_loadingStateHash:Iu(r,e._dashprivate_loadingMap),_dashprivate_path:JSON.stringify(r)})}},{key:"setProps",value:function(e){var t=this.props,r=t._dashprivate_graphs,n=t._dashprivate_dispatch,o=t._dashprivate_path,i=t._dashprivate_layout,a=this.getLayoutProps(),u=a.id,s=Rt((function(e,t){return!Ne(e,a[t])}),e);if(!Be(s)){var c=function(e,t,r){if(!(e&&r&&t.length))return[];if("string"==typeof e){var n=r.inputMap[e];return n?t.filter((function(e){return n[e]})):[]}var o=Object.keys(e).sort(),i=We(o,e),a=o.join(","),u=r.inputPatterns[a];return u?t.filter((function(e){var t=u[e];return t&&t.some((function(e){return Vr(o,i,e.values)}))})):[]}(u,Pe(s),r);!function(e,t,r){var n=la(e),o=n.canPersist,i=n.id,a=n.props,u=n.element,s=n.persistence,c=n.persisted_props,l=n.persistence_type;o&&s&&ye((function(e){var n=Vi(e.split("."),2),o=n[0],c=n[1];if(void 0!==t[o]){var f=aa(l,r),p=sa(u,o,c).extract,d=ca(i,e,s),y=p(a[o]),h=p(t[o]);if(y!==h){f.hasItem(d)&&(y=f.getItem(d)[1]);var m=void 0===y?[h]:[h,y];f.setItem(d,m,r)}}}),c)}(i,e,n),c.length&&n(ci({id:u,props:Do(c,s)})),n(ei({props:s,itempath:o}))}}},{key:"getChildren",value:function(e,t){var r=this;return sr(e)?null:Array.isArray(e)?yu(ct)((function(e,n){return r.createContainer(r.props,e,gt(t,["props","children",n]))}),e):this.createContainer(this.props,e,gt(t,["props","children"]))}},{key:"getComponent",value:function(e,t,r,n){var i=this.props,a=i._dashprivate_config,u=i._dashprivate_dispatch,s=i._dashprivate_error;if(Be(e))return null;if(wu(e))return e;Mu(e);var c=wr(e),l=hu("children",e.props);"Object"===Ie(l.id)&&(l.id=Fr(l.id));var f={loading_state:r||$u,setProps:n};return(o.a.createElement(Eu,{componentType:e.type,componentId:l.id,key:l.id,dispatch:u,error:s},a.props_check?o.a.createElement(Qu,{children:t,element:c,props:l,extraProps:f,type:e.type}):Yu(c,l,f,t)))}},{key:"getLayoutProps",value:function(){return bu({},"props",this.props._dashprivate_layout)}},{key:"render",value:function(){var e=this.props,t=e._dashprivate_layout,r=e._dashprivate_loadingState,n=e._dashprivate_path,o=this.getLayoutProps(),i=this.getChildren(o.children,n);return this.getComponent(t,i,r,this.setProps)}}])&&Uu(t.prototype,r),n&&Uu(t,n),a}(n.Component);Ju.propTypes={_dashprivate_error:s.a.any,_dashprivate_layout:s.a.object,_dashprivate_loadingState:s.a.oneOfType([s.a.object,s.a.bool]),_dashprivate_loadingStateHash:s.a.string,_dashprivate_path:s.a.string},Xu.propTypes=Nu(Nu({},Ju.propTypes),{},{_dashprivate_config:s.a.object,_dashprivate_dispatch:s.a.func,_dashprivate_graphs:s.a.any,_dashprivate_loadingMap:s.a.any,_dashprivate_path:s.a.array});var Zu=Ju;function es(e){return(es="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)}function ts(e,t){for(var r=0;r2&&void 0!==arguments[2]?arguments[2]:{};return fetch(e,Bo(t,{method:"POST",headers:oi(),body:r?JSON.stringify(r):null}))}};function ls(e,t,r,n,o){return function(i,a){var u=a().config,s="".concat(dr(u)).concat(e);function c(e){a().error.backEndConnected!==e&&i({type:"SET_CONNECTION_STATUS",payload:e})}return i({type:r,payload:{id:n,status:"loading"}}),cs[t](s,u.fetch,o).then((function(e){c(!0);var t=e.headers.get("content-type");return t&&-1!==t.indexOf("application/json")?e.json().then((function(t){return i({type:r,payload:{status:e.status,content:t,id:n}}),t})):(ss("Response is missing header: content-type: application/json"),i({type:r,payload:{id:n,status:e.status}}))}),(function(){c(!1)})).catch((function(t){li(t,"Error from API call: "+e,i)}))}}function fs(e,t,r,n,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void r(e)}u.done?t(s):Promise.resolve(s).then(n,o)}function ps(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var r=[],n=!0,o=!1,i=void 0;try{for(var a,u=e[Symbol.iterator]();!(n=(a=u.next()).done)&&(r.push(a.value),!t||r.length!==t);n=!0);}catch(e){o=!0,i=e}finally{try{n||null==u.return||u.return()}finally{if(o)throw i}}return r}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return ds(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return ds(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ds(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r0?i.slice(0,a):[]:-1===a||e===Ar?i:[t[o]]),r=Vt(Vt([ft(o)],u),r)}),e),r}return i.forEach((function(e){var t=e.outputs,r=e.inputs;t.concat(r).forEach((function(e){var t=e.id;"object"===Pr(t)&&Nt((function(e,t){n[t]||(n[t]={exact:[],expand:0});var r=n[t];e&&e.wild?e.expand&&(r.expand+=1):-1===r.exact.indexOf(e)&&r.exact.push(e)}),t)}))})),Nt((function(e){var t,r=e.exact,n=e.expand,o=r.slice().sort(Ur);if(n)for(var i=0;i>>0).toString(16)}function Ts(e){return(Ts="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)}function Is(e){return e&&e.constructor===Object&&e.toString===Object.prototype.toString}function Ms(e){var t={};return e.forEach((function(e){e&&"object"===Ts(e)&&(Array.isArray(e)&&(e=Ms(e)),Object.keys(e).forEach((function(r){if(Is(e[r])&&Is(t[r])){if(0===r.indexOf("@media"))for(var n=r;;)if(!t[n+=" "])return void(t[n]=e[r]);t[r]=Ms([t[r],e[r]])}else t[r]=e[r]})))})),t}var Ds=[],Ns=!1;function Bs(){Ds.forEach((function(e){e()}))}var Fs,Us=function(e){return-1===Ds.indexOf(e)&&Ds.push(e),Ns||(window.addEventListener("mouseup",Bs),Ns=!0),{remove:function(){var t=Ds.indexOf(e);Ds.splice(t,1),0===Ds.length&&Ns&&(window.removeEventListener("mouseup",Bs),Ns=!1)}}},Ls=function(e){return":hover"===e||":active"===e||":focus"===e};function Ws(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function qs(e,t){return Object.keys(e).filter((function(r){return t(e[r],r)})).reduce((function(t,r){return t[r]=e[r],t}),{})}var zs={checkProps:function(){},keyframes:function(e){var t=e.addCSS,r=e.config,n=e.style,o=function(e){var n=e.__process(r.userAgent),o=n.animationName,i=n.css;return t(i),o};return{style:Object.keys(n).reduce((function(e,t){var r=n[t],i=Array.isArray(r);return"animationName"===t&&r&&(r.__radiumKeyframes||i)&&(r=i?r.map(o).join(", "):o(r)),e[t]=r,e}),{})}},mergeStyleArray:function(e){var t=e.style,r=e.mergeStyles;return{style:Array.isArray(t)?r(t):t}},prefix:function(e){var t=e.config,r=e.style;return{style:Object(ks.b)(r,t.userAgent)}},removeNestedStyles:function(e){var t=e.isNestedStyle,r=e.style;return{style:Object.keys(r).reduce((function(e,n){var o=r[n];return t(o)||(e[n]=o),e}),{})}},resolveInteractionStyles:function(e){var t=e.ExecutionEnvironment,r=e.getComponentField,n=e.getState,o=e.mergeStyles,i=e.props,a=e.setState,u=e.style,s={},c={};if(u[":hover"]){var l=i.onMouseEnter;c.onMouseEnter=function(e){l&&l(e),a(":hover",!0)};var f=i.onMouseLeave;c.onMouseLeave=function(e){f&&f(e),a(":hover",!1)}}if(u[":active"]){var p=i.onMouseDown;c.onMouseDown=function(e){p&&p(e),s._lastMouseDown=Date.now(),a(":active","viamousedown")};var d=i.onKeyDown;c.onKeyDown=function(e){d&&d(e)," "!==e.key&&"Enter"!==e.key||a(":active","viakeydown")};var y=i.onKeyUp;c.onKeyUp=function(e){y&&y(e)," "!==e.key&&"Enter"!==e.key||a(":active",!1)}}if(u[":focus"]){var h=i.onFocus;c.onFocus=function(e){h&&h(e),a(":focus",!0)};var m=i.onBlur;c.onBlur=function(e){m&&m(e),a(":focus",!1)}}u[":active"]&&!r("_radiumMouseUpListener")&&t.canUseEventListeners&&(s._radiumMouseUpListener=Us((function(){Object.keys(r("state")._radiumStyleState).forEach((function(e){"viamousedown"===n(":active",e)&&a(":active",!1,e)}))})));var v=i.disabled?[u[":disabled"]]:Object.keys(u).filter((function(e){return Ls(e)&&n(e)})).map((function(e){return u[e]})),b=o([u].concat(v));return b=Object.keys(b).reduce((function(e,t){return Ls(t)||":disabled"===t||(e[t]=b[t]),e}),{}),{componentFields:s,props:c,style:b}},resolveMediaQueries:function(e){var t=e.ExecutionEnvironment,r=e.addCSS,n=e.appendImportantToEachValue,o=e.config,i=e.cssRuleSetToString,a=e.getComponentField,u=e.getGlobalState,s=e.hash,c=e.isNestedStyle,l=e.mergeStyles,f=e.props,p=e.setState,d=e.style,y=function(e){return Object.keys(e).reduce((function(t,r){return 0!==r.indexOf("@media")&&(t[r]=e[r]),t}),{})}(d),h=function(e){var t=e.addCSS,r=e.appendImportantToEachValue,n=e.cssRuleSetToString,o=e.hash,i=e.isNestedStyle,a=e.style,u=e.userAgent,s="";return Object.keys(a).filter((function(e){return 0===e.indexOf("@media")})).map((function(e){var c=r(qs(a[e],(function(e){return!i(e)})));if(Object.keys(c).length){var l=n("",c,u),f="rmq-"+o(e+l);t(e+"{ ."+f+l+"}"),s+=(s?" ":"")+f}})),s}({addCSS:r,appendImportantToEachValue:n,cssRuleSetToString:i,hash:s,isNestedStyle:c,style:d,userAgent:o.userAgent}),m=h?{className:h+(f.className?" "+f.className:"")}:null,v=o.matchMedia||function(e){return void 0===Fs&&(Fs=!!e.canUseDOM&&!!window&&!!window.matchMedia&&function(e){return window.matchMedia(e)}||null),Fs}(t);if(!v)return{props:m,style:y};var b=function(e){for(var t=1;t2&&void 0!==arguments[2]?arguments[2]:Qs,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=arguments.length>4&&void 0!==arguments[4]&&arguments[4],i=arguments.length>5?arguments[5]:void 0;if(!i){var a=Cs(e);i=Object.keys(a).reduce((function(e,t){return"main"!==t&&(e[t]=!0),e}),{})}if(Array.isArray(t)&&!t.props){var u=t.map((function(t){if(i){var a=As(t);delete i[a]}return Js(e,t,r,n,o,i).element}));return{extraStateKeyMap:i,element:u}}if(!t||t.props&&t.props["data-radium"]||o&&!Xs(t))return{extraStateKeyMap:i,element:t};var s=t.props.children,c=Zs({children:s,component:e,config:r,existingKeyMap:n,extraStateKeyMap:i}),l=ec({component:e,config:r,existingKeyMap:n,extraStateKeyMap:i,props:t.props});if(l=tc({component:e,config:r,existingKeyMap:n,props:l,renderedElement:t}),c===s&&l===t.props)return{extraStateKeyMap:i,element:t};var f=rc(t,l!==t.props?l:{},c);return{extraStateKeyMap:i,element:f}};function oc(){return(oc=Object.assign||function(e){for(var t=1;t=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}function Oc(e){var t=function(e,t){if("object"!==sc(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!==sc(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===sc(t)?t:String(t)}var Sc,_c,xc=["arguments","callee","caller","length","name","prototype","type"];function kc(e){var t=e.prototype||{};return!(e.isReactComponent||t.isReactComponent||e.render||t.render)}function jc(e){return"function"==typeof e&&/^\s*class\s+/.test(e.toString())}function Pc(e,t){_c.forEach((function(r){var n=Object.getOwnPropertyDescriptor(e,r),o=(n||{}).value;if(o){var i=(Object.getOwnPropertyDescriptor(Sc,r)||{}).value;t.prototype[r]||o===i||(n&&Object.defineProperty(t.prototype,r,n),delete e[r])}}))}function Ec(e){if(e._extraRadiumStateKeys&&e._extraRadiumStateKeys.length>0){var t=e._extraRadiumStateKeys.reduce((function(e,t){e[t];return wc(e,[t].map(Oc))}),Cs(e));e._lastRadiumState=t,e.setState({_radiumStyleState:t})}}function Ac(e){var t=e._radiumMouseUpListener,r=e._radiumMediaQueryListenersByQuery;e._radiumIsMounted=!1,t&&t.remove(),r&&Object.keys(r).forEach((function(e){r[e].remove()}),e)}function Cc(e,t,r){var n=e||t||r;return r&&n!==r&&(n=bc({},r,n)),n}function Rc(e,t,r,n){var i=nc(e,t,r),a=i.extraStateKeyMap,u=i.element;return e._extraRadiumStateKeys=Object.keys(a),n?o.a.createElement(ac.Provider,{value:n},u):u}function Tc(e,t){var r=o.a.forwardRef((function(r,o){var i=r.radiumConfig,a=wc(r,["radiumConfig"]),u=Object(n.useContext)(ac),s=Object(n.useContext)(ic),c=vc(Object(n.useState)({}),2),l=c[0],f=c[1],p=Object(n.useRef)({state:l,setState:f,_radiumMediaQueryListenersByQuery:void 0,_radiumMouseUpListener:void 0,_radiumIsMounted:!0,_lastRadiumState:void 0,_extraRadiumStateKeys:void 0,_radiumStyleKeeper:s}).current;p.state=l,Object(n.useEffect)((function(){return function(){Ac(p)}}),[p]);var d=p._extraRadiumStateKeys&&p._extraRadiumStateKeys.length>0;Object(n.useEffect)((function(){Ec(p)}),[d,p]);var y=e(a,o),h=Cc(i,u,t);return Rc(p,y,h,i)}));return r._isRadiumEnhanced=!0,r.defaultProps=e.defaultProps,b()(r,e)}function Ic(e,t,r){var n,o,i=function(e){function n(){var e;cc(this,n),(e=fc(this,yc(n).apply(this,arguments))).state=e.state||{},e._radiumStyleKeeper=e.props.styleKeeperContext,e._radiumMediaQueryListenersByQuery=e._radiumMediaQueryListenersByQuery,e._radiumMouseUpListener=e._radiumMouseUpListener,e._radiumIsMounted=!0,e._lastRadiumState=void 0,e._extraRadiumStateKeys=void 0,e.state._radiumStyleState={};var r=pc(e);return Pc(r,t),e}var o,i,a;return hc(n,e),o=n,(i=[{key:"componentDidUpdate",value:function(e,t,r){dc(yc(n.prototype),"componentDidUpdate",this)&&dc(yc(n.prototype),"componentDidUpdate",this).call(this,e,t,r),Ec(this)}},{key:"componentWillUnmount",value:function(){dc(yc(n.prototype),"componentWillUnmount",this)&&dc(yc(n.prototype),"componentWillUnmount",this).call(this),Ac(this)}},{key:"render",value:function(){return Rc(this,dc(yc(n.prototype),"render",this).call(this),Cc(this.props.radiumConfig,this.props.radiumConfigContext,r),this.props.radiumConfig)}}])&&lc(o.prototype,i),a&&lc(o,a),n}(t);return i._isRadiumEnhanced=!0,Sc=i.prototype,_c=Object.getOwnPropertyNames(Sc).filter((function(e){return"constructor"!==e&&"function"==typeof Sc[e]})),n=e,o=i,Object.getOwnPropertyNames(n).forEach((function(e){if(xc.indexOf(e)<0&&!o.hasOwnProperty(e)){var t=Object.getOwnPropertyDescriptor(n,e);t&&Object.defineProperty(o,e,t)}})),i.propTypes&&i.propTypes.style&&(i.propTypes=bc({},i.propTypes,{style:s.a.oneOfType([s.a.array,s.a.object])})),i.displayName=e.displayName||e.name||"Component",uc(i)}function Mc(e){return e=function(e){function t(){var t=Reflect.construct(e,arguments,this.constructor);return t}return Reflect.setPrototypeOf(t.prototype,e.prototype),Reflect.setPrototypeOf(t,e),t}(e)}var Dc=Object(n.forwardRef)((function(){return null})).$$typeof;function Nc(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(Dc&&e.$$typeof===Dc)return Tc(e.render,t);if("function"!=typeof e)return Bc(t,e);var r=e;if(kc(r))return Tc(r,t);var n=r;return jc(n)&&(n=Mc(n)),n===r&&(n=function(e){function t(){return cc(this,t),fc(this,yc(t).apply(this,arguments))}return hc(t,e),t}(n)),Ic(r,n,t)}function Bc(e,t){var r=bc({},e,t);return function(e){return Nc(e,r)}}function Fc(e){return(Fc="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)}function Uc(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Lc(e,t){for(var r=0;r-1&&t._listeners.splice(r,1)}}}},{key:"addCSS",value:function(e){var t=this;return this._cssSet[e]||(this._cssSet[e]=!0,this._emitChange()),{remove:function(){delete t._cssSet[e],t._emitChange()}}}},{key:"getCSS",value:function(){return Object.keys(this._cssSet).join("\n")}},{key:"_emitChange",value:function(){this._listeners.forEach((function(e){return e()}))}}])&&Hc(t.prototype,r),n&&Hc(t,n),e}();function $c(e){return($c="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)}function Qc(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Yc(e,t){for(var r=0;r=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}var rl=Nc((function(e){var t=e.children,r=tl(e,["children"]);return o.a.createElement("div",r,t,o.a.createElement(el,null))})),nl=function(e){var t=e.radiumConfig,r=Object(n.useContext)(ac),i=Object(n.useRef)(function(e,t){var r=e&&e.userAgent||t&&t.userAgent;return new Vc(r)}(t,r));return o.a.createElement(ic.Provider,{value:i.current},o.a.createElement(rl,e))};function ol(e){return Nc(e)}ol.Plugins=zs,ol.Style=Kc,ol.StyleRoot=nl,ol.getState=Es,ol.keyframes=function(e,t){return{__radiumKeyframes:!0,__process:function(r){var n=Object(ks.a)(r),o=Object.keys(e).map((function(t){return js(t,e[t],r)})).join("\n"),i=(t?t+"-":"")+"radium-animation-"+Rs(o);return{css:"@"+n+" "+i+" {\n"+o+"\n}\n",animationName:i}}}};var il=ol;function al(e){var t=e.dispatch,r=e.history,n={parentSpanStyle:{display:"inline-block",opacity:"0.2",":hover":{opacity:1}},iconStyle:{fontSize:20},labelStyle:{fontSize:15}},i=o.a.createElement("span",{key:"undoLink",style:Jt({color:r.past.length?"#0074D9":"grey",cursor:r.past.length?"pointer":"default"},n.parentSpanStyle),onClick:function(){return t(ai)}},o.a.createElement("div",{style:Jt({transform:"rotate(270deg)"},n.iconStyle)},"↺"),o.a.createElement("div",{style:n.labelStyle},"undo")),a=o.a.createElement("span",{key:"redoLink",style:Jt({color:r.future.length?"#0074D9":"grey",cursor:r.future.length?"pointer":"default",marginLeft:10},n.parentSpanStyle),onClick:function(){return t(ii)}},o.a.createElement("div",{style:Jt({transform:"rotate(90deg)"},n.iconStyle)},"↻"),o.a.createElement("div",{style:n.labelStyle},"redo"));return o.a.createElement("div",{className:"_dash-undo-redo",style:{position:"fixed",bottom:"30px",left:"30px",fontSize:"20px",textAlign:"center",zIndex:"9999",backgroundColor:"rgba(255, 255, 255, 0.9)"}},o.a.createElement("div",{style:{position:"relative"}},r.past.length>0?i:null,r.future.length>0?a:null))}al.propTypes={history:s.a.object,dispatch:s.a.func};var ul=re((function(e){return{history:e.history}}),(function(e){return{dispatch:e}}))(il(al)),sl=ae((function(e){return function(t,r){return e(t,r)?-1:e(r,t)?1:0}})),cl=de((function(e,t){return e=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){r=e[Symbol.iterator]()},n:function(){var e=r.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}function pl(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r0){var f=document.createElement("link");f.href="".concat(u.url,"?m=").concat(u.modified),f.type="text/css",f.rel="stylesheet",this._head.appendChild(f)}}}catch(e){a.e(e)}finally{a.f()}i||window.location.reload()}else 500===r.status&&(this._retry>this.state.max_retry&&(this.clearInterval(),window.alert("\n Reloader failed after ".concat(this._retry," times.\n Please check your application for errors.\n "))),this._retry++)}},{key:"componentDidMount",value:function(){var e=this.props,t=e.dispatch,r=e.reloadRequest,n=this.state,o=n.disabled,i=n.interval;if(!o&&!this.state.intervalId){var a=window.setInterval((function(){"loading"!==r.status&&t(ls("_reload-hash","GET","reloadRequest"))}),i);this.setState({intervalId:a})}}},{key:"componentWillUnmount",value:function(){!this.state.disabled&&this.state.intervalId&&this.clearInterval()}},{key:"render",value:function(){return null}}])&&dl(t.prototype,r),n&&dl(t,n),i}(o.a.Component);gl.defaultProps={},gl.propTypes={id:s.a.string,config:s.a.object,reloadRequest:s.a.object,dispatch:s.a.func,interval:s.a.number};var wl=re((function(e){return{config:e.config,reloadRequest:e.reloadRequest}}),(function(e){return{dispatch:e}}))(gl);function Ol(e){return(Ol="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)}function Sl(e,t){for(var r=0;re.length)&&(t=e.length);for(var r=0,n=new Array(t);r13)&&32!==t&&133!==t&&160!==t&&5760!==t&&6158!==t&&(t<8192||t>8205)&&8232!==t&&8233!==t&&8239!==t&&8287!==t&&8288!==t&&12288!==t&&65279!==t)return!1;return!0}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,r){if(e.hasOwnProperty(t)){for(var n={},o=e[t],a=(0,i.default)(t),u=Object.keys(r),s=0;st.osVersion&&(t.browserVersion=t.osVersion);"android"===t.browserName&&t.chrome&&t.browserVersion>37&&(t.browserName="and_chr");"android"===t.browserName&&t.osVersion<5&&(t.browserVersion=t.osVersion);"android"===t.browserName&&t.samsungBrowser&&(t.browserName="and_chr",t.browserVersion=44);return t};var n,o=r(61),i=(n=o)&&n.__esModule?n:{default:n};var a={chrome:"Webkit",safari:"Webkit",ios:"Webkit",android:"Webkit",phantom:"Webkit",opera:"Webkit",webos:"Webkit",blackberry:"Webkit",bada:"Webkit",tizen:"Webkit",chromium:"Webkit",vivaldi:"Webkit",firefox:"Moz",seamoney:"Moz",sailfish:"Moz",msie:"ms",msedge:"ms"},u={chrome:"chrome",chromium:"chrome",safari:"safari",firfox:"firefox",msedge:"edge",opera:"opera",vivaldi:"opera",msie:"ie"};e.exports=t.default},function(e,t,r){var n;n=function(){var e=!0;function t(t){function r(e){var r=t.match(e);return r&&r.length>1&&r[1]||""}function n(e){var r=t.match(e);return r&&r.length>1&&r[2]||""}var o,a=r(/(ipod|iphone|ipad)/i).toLowerCase(),u=!/like android/i.test(t)&&/android/i.test(t),s=/nexus\s*[0-6]\s*/i.test(t),c=!s&&/nexus\s*[0-9]+/i.test(t),l=/CrOS/.test(t),f=/silk/i.test(t),p=/sailfish/i.test(t),d=/tizen/i.test(t),y=/(web|hpw)(o|0)s/i.test(t),h=/windows phone/i.test(t),m=(/SamsungBrowser/i.test(t),!h&&/windows/i.test(t)),v=!a&&!f&&/macintosh/i.test(t),b=!u&&!p&&!d&&!y&&/linux/i.test(t),g=n(/edg([ea]|ios)\/(\d+(\.\d+)?)/i),w=r(/version\/(\d+(\.\d+)?)/i),O=/tablet/i.test(t)&&!/tablet pc/i.test(t),S=!O&&/[^-]mobi/i.test(t),_=/xbox/i.test(t);/opera/i.test(t)?o={name:"Opera",opera:e,version:w||r(/(?:opera|opr|opios)[\s\/](\d+(\.\d+)?)/i)}:/opr\/|opios/i.test(t)?o={name:"Opera",opera:e,version:r(/(?:opr|opios)[\s\/](\d+(\.\d+)?)/i)||w}:/SamsungBrowser/i.test(t)?o={name:"Samsung Internet for Android",samsungBrowser:e,version:w||r(/(?:SamsungBrowser)[\s\/](\d+(\.\d+)?)/i)}:/Whale/i.test(t)?o={name:"NAVER Whale browser",whale:e,version:r(/(?:whale)[\s\/](\d+(?:\.\d+)+)/i)}:/MZBrowser/i.test(t)?o={name:"MZ Browser",mzbrowser:e,version:r(/(?:MZBrowser)[\s\/](\d+(?:\.\d+)+)/i)}:/coast/i.test(t)?o={name:"Opera Coast",coast:e,version:w||r(/(?:coast)[\s\/](\d+(\.\d+)?)/i)}:/focus/i.test(t)?o={name:"Focus",focus:e,version:r(/(?:focus)[\s\/](\d+(?:\.\d+)+)/i)}:/yabrowser/i.test(t)?o={name:"Yandex Browser",yandexbrowser:e,version:w||r(/(?:yabrowser)[\s\/](\d+(\.\d+)?)/i)}:/ucbrowser/i.test(t)?o={name:"UC Browser",ucbrowser:e,version:r(/(?:ucbrowser)[\s\/](\d+(?:\.\d+)+)/i)}:/mxios/i.test(t)?o={name:"Maxthon",maxthon:e,version:r(/(?:mxios)[\s\/](\d+(?:\.\d+)+)/i)}:/epiphany/i.test(t)?o={name:"Epiphany",epiphany:e,version:r(/(?:epiphany)[\s\/](\d+(?:\.\d+)+)/i)}:/puffin/i.test(t)?o={name:"Puffin",puffin:e,version:r(/(?:puffin)[\s\/](\d+(?:\.\d+)?)/i)}:/sleipnir/i.test(t)?o={name:"Sleipnir",sleipnir:e,version:r(/(?:sleipnir)[\s\/](\d+(?:\.\d+)+)/i)}:/k-meleon/i.test(t)?o={name:"K-Meleon",kMeleon:e,version:r(/(?:k-meleon)[\s\/](\d+(?:\.\d+)+)/i)}:h?(o={name:"Windows Phone",osname:"Windows Phone",windowsphone:e},g?(o.msedge=e,o.version=g):(o.msie=e,o.version=r(/iemobile\/(\d+(\.\d+)?)/i))):/msie|trident/i.test(t)?o={name:"Internet Explorer",msie:e,version:r(/(?:msie |rv:)(\d+(\.\d+)?)/i)}:l?o={name:"Chrome",osname:"Chrome OS",chromeos:e,chromeBook:e,chrome:e,version:r(/(?:chrome|crios|crmo)\/(\d+(\.\d+)?)/i)}:/edg([ea]|ios)/i.test(t)?o={name:"Microsoft Edge",msedge:e,version:g}:/vivaldi/i.test(t)?o={name:"Vivaldi",vivaldi:e,version:r(/vivaldi\/(\d+(\.\d+)?)/i)||w}:p?o={name:"Sailfish",osname:"Sailfish OS",sailfish:e,version:r(/sailfish\s?browser\/(\d+(\.\d+)?)/i)}:/seamonkey\//i.test(t)?o={name:"SeaMonkey",seamonkey:e,version:r(/seamonkey\/(\d+(\.\d+)?)/i)}:/firefox|iceweasel|fxios/i.test(t)?(o={name:"Firefox",firefox:e,version:r(/(?:firefox|iceweasel|fxios)[ \/](\d+(\.\d+)?)/i)},/\((mobile|tablet);[^\)]*rv:[\d\.]+\)/i.test(t)&&(o.firefoxos=e,o.osname="Firefox OS")):f?o={name:"Amazon Silk",silk:e,version:r(/silk\/(\d+(\.\d+)?)/i)}:/phantom/i.test(t)?o={name:"PhantomJS",phantom:e,version:r(/phantomjs\/(\d+(\.\d+)?)/i)}:/slimerjs/i.test(t)?o={name:"SlimerJS",slimer:e,version:r(/slimerjs\/(\d+(\.\d+)?)/i)}:/blackberry|\bbb\d+/i.test(t)||/rim\stablet/i.test(t)?o={name:"BlackBerry",osname:"BlackBerry OS",blackberry:e,version:w||r(/blackberry[\d]+\/(\d+(\.\d+)?)/i)}:y?(o={name:"WebOS",osname:"WebOS",webos:e,version:w||r(/w(?:eb)?osbrowser\/(\d+(\.\d+)?)/i)},/touchpad\//i.test(t)&&(o.touchpad=e)):/bada/i.test(t)?o={name:"Bada",osname:"Bada",bada:e,version:r(/dolfin\/(\d+(\.\d+)?)/i)}:d?o={name:"Tizen",osname:"Tizen",tizen:e,version:r(/(?:tizen\s?)?browser\/(\d+(\.\d+)?)/i)||w}:/qupzilla/i.test(t)?o={name:"QupZilla",qupzilla:e,version:r(/(?:qupzilla)[\s\/](\d+(?:\.\d+)+)/i)||w}:/chromium/i.test(t)?o={name:"Chromium",chromium:e,version:r(/(?:chromium)[\s\/](\d+(?:\.\d+)?)/i)||w}:/chrome|crios|crmo/i.test(t)?o={name:"Chrome",chrome:e,version:r(/(?:chrome|crios|crmo)\/(\d+(\.\d+)?)/i)}:u?o={name:"Android",version:w}:/safari|applewebkit/i.test(t)?(o={name:"Safari",safari:e},w&&(o.version=w)):a?(o={name:"iphone"==a?"iPhone":"ipad"==a?"iPad":"iPod"},w&&(o.version=w)):o=/googlebot/i.test(t)?{name:"Googlebot",googlebot:e,version:r(/googlebot\/(\d+(\.\d+))/i)||w}:{name:r(/^(.*)\/(.*) /),version:n(/^(.*)\/(.*) /)},!o.msedge&&/(apple)?webkit/i.test(t)?(/(apple)?webkit\/537\.36/i.test(t)?(o.name=o.name||"Blink",o.blink=e):(o.name=o.name||"Webkit",o.webkit=e),!o.version&&w&&(o.version=w)):!o.opera&&/gecko\//i.test(t)&&(o.name=o.name||"Gecko",o.gecko=e,o.version=o.version||r(/gecko\/(\d+(\.\d+)?)/i)),o.windowsphone||!u&&!o.silk?!o.windowsphone&&a?(o[a]=e,o.ios=e,o.osname="iOS"):v?(o.mac=e,o.osname="macOS"):_?(o.xbox=e,o.osname="Xbox"):m?(o.windows=e,o.osname="Windows"):b&&(o.linux=e,o.osname="Linux"):(o.android=e,o.osname="Android");var x="";o.windows?x=function(e){switch(e){case"NT":return"NT";case"XP":return"XP";case"NT 5.0":return"2000";case"NT 5.1":return"XP";case"NT 5.2":return"2003";case"NT 6.0":return"Vista";case"NT 6.1":return"7";case"NT 6.2":return"8";case"NT 6.3":return"8.1";case"NT 10.0":return"10";default:return}}(r(/Windows ((NT|XP)( \d\d?.\d)?)/i)):o.windowsphone?x=r(/windows phone (?:os)?\s?(\d+(\.\d+)*)/i):o.mac?x=(x=r(/Mac OS X (\d+([_\.\s]\d+)*)/i)).replace(/[_\s]/g,"."):a?x=(x=r(/os (\d+([_\s]\d+)*) like mac os x/i)).replace(/[_\s]/g,"."):u?x=r(/android[ \/-](\d+(\.\d+)*)/i):o.webos?x=r(/(?:web|hpw)os\/(\d+(\.\d+)*)/i):o.blackberry?x=r(/rim\stablet\sos\s(\d+(\.\d+)*)/i):o.bada?x=r(/bada\/(\d+(\.\d+)*)/i):o.tizen&&(x=r(/tizen[\/\s](\d+(\.\d+)*)/i)),x&&(o.osversion=x);var k=!o.windows&&x.split(".")[0];return O||c||"ipad"==a||u&&(3==k||k>=4&&!S)||o.silk?o.tablet=e:(S||"iphone"==a||"ipod"==a||u||s||o.blackberry||o.webos||o.bada)&&(o.mobile=e),o.msedge||o.msie&&o.version>=10||o.yandexbrowser&&o.version>=15||o.vivaldi&&o.version>=1||o.chrome&&o.version>=20||o.samsungBrowser&&o.version>=4||o.whale&&1===i([o.version,"1.0"])||o.mzbrowser&&1===i([o.version,"6.0"])||o.focus&&1===i([o.version,"1.0"])||o.firefox&&o.version>=20||o.safari&&o.version>=6||o.opera&&o.version>=10||o.ios&&o.osversion&&o.osversion.split(".")[0]>=6||o.blackberry&&o.version>=10.1||o.chromium&&o.version>=20?o.a=e:o.msie&&o.version<10||o.chrome&&o.version<20||o.firefox&&o.version<20||o.safari&&o.version<6||o.opera&&o.version<10||o.ios&&o.osversion&&o.osversion.split(".")[0]<6||o.chromium&&o.version<20?o.c=e:o.x=e,o}var r=t("undefined"!=typeof navigator&&navigator.userAgent||"");function n(e){return e.split(".").length}function o(e,t){var r,n=[];if(Array.prototype.map)return Array.prototype.map.call(e,t);for(r=0;r=0;){if(r[0][t]>r[1][t])return 1;if(r[0][t]!==r[1][t])return-1;if(0===t)return 0}}function a(e,n,o){var a=r;"string"==typeof n&&(o=n,n=void 0),void 0===n&&(n=!1),o&&(a=t(o));var u=""+a.version;for(var s in e)if(e.hasOwnProperty(s)&&a[s]){if("string"!=typeof e[s])throw new Error("Browser version in the minVersion map should be a string: "+s+": "+String(e));return i([u,e[s]])<0}return n}return r.test=function(e){for(var t=0;t=0||(o[r]=e[r]);return o}var v=r(4),b=r.n(v),g=r(13),w="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?n.useLayoutEffect:n.useEffect,O=[],S=[null,null];function _(e,t){var r=e[1];return[t.payload,r+1]}function x(e,t,r){w((function(){return e.apply(void 0,t)}),r)}function k(e,t,r,n,o,i,a){e.current=n,t.current=o,r.current=!1,i.current&&(i.current=null,a())}function j(e,t,r,n,o,i,a,u,s,c){if(e){var l=!1,f=null,p=function(){if(!l){var e,r,p=t.getState();try{e=n(p,o.current)}catch(e){r=e,f=e}r||(f=null),e===i.current?a.current||s():(i.current=e,u.current=e,a.current=!0,c({type:"STORE_UPDATED",payload:{error:r}}))}};r.onStateChange=p,r.trySubscribe(),p();return function(){if(l=!0,r.tryUnsubscribe(),r.onStateChange=null,f)throw f}}}var P=function(){return[null,0]};function E(e,t){void 0===t&&(t={});var r=t,i=r.getDisplayName,a=void 0===i?function(e){return"ConnectAdvanced("+e+")"}:i,u=r.methodName,s=void 0===u?"connectAdvanced":u,l=r.renderCountProp,f=void 0===l?void 0:l,p=r.shouldHandleStateChanges,y=void 0===p||p,v=r.storeKey,w=void 0===v?"store":v,E=(r.withRef,r.forwardRef),A=void 0!==E&&E,C=r.context,R=void 0===C?c:C,T=m(r,["getDisplayName","methodName","renderCountProp","shouldHandleStateChanges","storeKey","withRef","forwardRef","context"]),I=R;return function(t){var r=t.displayName||t.name||"Component",i=a(r),u=h({},T,{getDisplayName:a,methodName:s,renderCountProp:f,shouldHandleStateChanges:y,storeKey:w,displayName:i,wrappedComponentName:r,WrappedComponent:t}),c=T.pure;var l=c?n.useMemo:function(e){return e()};function p(r){var i=Object(n.useMemo)((function(){var e=r.forwardedRef,t=m(r,["forwardedRef"]);return[r.context,e,t]}),[r]),a=i[0],s=i[1],c=i[2],f=Object(n.useMemo)((function(){return a&&a.Consumer&&Object(g.isContextConsumer)(o.a.createElement(a.Consumer,null))?a:I}),[a,I]),p=Object(n.useContext)(f),v=Boolean(r.store)&&Boolean(r.store.getState)&&Boolean(r.store.dispatch);Boolean(p)&&Boolean(p.store);var b=v?r.store:p.store,w=Object(n.useMemo)((function(){return function(t){return e(t.dispatch,u)}(b)}),[b]),E=Object(n.useMemo)((function(){if(!y)return S;var e=new d(b,v?null:p.subscription),t=e.notifyNestedSubs.bind(e);return[e,t]}),[b,v,p]),A=E[0],C=E[1],R=Object(n.useMemo)((function(){return v?p:h({},p,{subscription:A})}),[v,p,A]),T=Object(n.useReducer)(_,O,P),M=T[0][0],D=T[1];if(M&&M.error)throw M.error;var N=Object(n.useRef)(),B=Object(n.useRef)(c),F=Object(n.useRef)(),U=Object(n.useRef)(!1),L=l((function(){return F.current&&c===B.current?F.current:w(b.getState(),c)}),[b,M,c]);x(k,[B,N,U,c,L,F,C]),x(j,[y,b,A,w,B,N,U,F,C,D],[b,A,w]);var W=Object(n.useMemo)((function(){return o.a.createElement(t,h({},L,{ref:s}))}),[s,t,L]);return Object(n.useMemo)((function(){return y?o.a.createElement(f.Provider,{value:R},W):W}),[f,W,R])}var v=c?o.a.memo(p):p;if(v.WrappedComponent=t,v.displayName=i,A){var E=o.a.forwardRef((function(e,t){return o.a.createElement(v,h({},e,{forwardedRef:t}))}));return E.displayName=i,E.WrappedComponent=t,b()(E,t)}return b()(v,t)}}function A(e,t){return e===t?0!==e||0!==t||1/e==1/t:e!=e&&t!=t}function C(e,t){if(A(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;var r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;for(var o=0;o=0;n--){var o=t[n](e);if(o)return o}return function(t,n){throw new Error("Invalid value of type "+typeof e+" for "+r+" argument when connecting component "+n.wrappedComponentName+".")}}function ee(e,t){return e===t}function te(e){var t=void 0===e?{}:e,r=t.connectHOC,n=void 0===r?E:r,o=t.mapStateToPropsFactories,i=void 0===o?V:o,a=t.mapDispatchToPropsFactories,u=void 0===a?H:a,s=t.mergePropsFactories,c=void 0===s?Q:s,l=t.selectorFactory,f=void 0===l?X:l;return function(e,t,r,o){void 0===o&&(o={});var a=o,s=a.pure,l=void 0===s||s,p=a.areStatesEqual,d=void 0===p?ee:p,y=a.areOwnPropsEqual,v=void 0===y?C:y,b=a.areStatePropsEqual,g=void 0===b?C:b,w=a.areMergedPropsEqual,O=void 0===w?C:w,S=m(a,["pure","areStatesEqual","areOwnPropsEqual","areStatePropsEqual","areMergedPropsEqual"]),_=Z(e,i,"mapStateToProps"),x=Z(t,u,"mapDispatchToProps"),k=Z(r,c,"mergeProps");return n(f,h({methodName:"connect",getDisplayName:function(e){return"Connect("+e+")"},shouldHandleStateChanges:Boolean(e),initMapStateToProps:_,initMapDispatchToProps:x,initMergeProps:k,pure:l,areStatesEqual:d,areOwnPropsEqual:v,areStatePropsEqual:g,areMergedPropsEqual:O},S))}}var re=te();var ne;function oe(e,t){switch(e){case 0:return function(){return t.apply(this,arguments)};case 1:return function(e){return t.apply(this,arguments)};case 2:return function(e,r){return t.apply(this,arguments)};case 3:return function(e,r,n){return t.apply(this,arguments)};case 4:return function(e,r,n,o){return t.apply(this,arguments)};case 5:return function(e,r,n,o,i){return t.apply(this,arguments)};case 6:return function(e,r,n,o,i,a){return t.apply(this,arguments)};case 7:return function(e,r,n,o,i,a,u){return t.apply(this,arguments)};case 8:return function(e,r,n,o,i,a,u,s){return t.apply(this,arguments)};case 9:return function(e,r,n,o,i,a,u,s,c){return t.apply(this,arguments)};case 10:return function(e,r,n,o,i,a,u,s,c,l){return t.apply(this,arguments)};default:throw new Error("First argument to _arity must be a non-negative integer no greater than ten")}}function ie(e){return null!=e&&"object"==typeof e&&!0===e["@@functional/placeholder"]}function ae(e){return function t(r){return 0===arguments.length||ie(r)?t:e.apply(this,arguments)}}ne=i.unstable_batchedUpdates,l=ne;var ue=ae((function(e){var t,r=!1;return oe(e.length,(function(){return r?t:(r=!0,t=e.apply(this,arguments))}))}));function se(e){return function(t){var r=t.dispatch,n=t.getState;return function(t){return function(o){return"function"==typeof o?o(r,n,e):t(o)}}}}var ce=se();ce.withExtraArgument=se;var le=ce,fe=Array.isArray||function(e){return null!=e&&e.length>=0&&"[object Array]"===Object.prototype.toString.call(e)};function pe(e,t){return function(){var r=arguments.length;if(0===r)return t();var n=arguments[r-1];return fe(n)||"function"!=typeof n[e]?t.apply(this,arguments):n[e].apply(n,Array.prototype.slice.call(arguments,0,r-1))}}function de(e){return function t(r,n){switch(arguments.length){case 0:return t;case 1:return ie(r)?t:ae((function(t){return e(r,t)}));default:return ie(r)&&ie(n)?t:ie(r)?ae((function(t){return e(t,n)})):ie(n)?ae((function(t){return e(r,t)})):e(r,n)}}}var ye=de(pe("forEach",(function(e,t){for(var r=t.length,n=0;n=0;)we(t=xe[r],e)&&!je(n,t)&&(n[n.length]=t),r-=1;return n})):ae((function(e){return Object(e)!==e?[]:Object.keys(e)}));function Ee(e){return"[object Object]"===Object.prototype.toString.call(e)}var Ae=ae((function(e){return null!=e&&"function"==typeof e["fantasy-land/empty"]?e["fantasy-land/empty"]():null!=e&&null!=e.constructor&&"function"==typeof e.constructor["fantasy-land/empty"]?e.constructor["fantasy-land/empty"]():null!=e&&"function"==typeof e.empty?e.empty():null!=e&&null!=e.constructor&&"function"==typeof e.constructor.empty?e.constructor.empty():fe(e)?[]:me(e)?"":Ee(e)?{}:Se(e)?function(){return arguments}():void 0}));function Ce(e){for(var t,r=[];!(t=e.next()).done;)r.push(t.value);return r}function Re(e,t,r){for(var n=0,o=r.length;n=0;){if(r[i]===e)return n[i]===t;i-=1}switch(o){case"Map":return e.size===t.size&&Me(e.entries(),t.entries(),r.concat([e]),n.concat([t]));case"Set":return e.size===t.size&&Me(e.values(),t.values(),r.concat([e]),n.concat([t]));case"Arguments":case"Array":case"Object":case"Boolean":case"Number":case"String":case"Date":case"Error":case"RegExp":case"Int8Array":case"Uint8Array":case"Uint8ClampedArray":case"Int16Array":case"Uint16Array":case"Int32Array":case"Uint32Array":case"Float32Array":case"Float64Array":case"ArrayBuffer":break;default:return!1}var a=Pe(e);if(a.length!==Pe(t).length)return!1;var u=r.concat([e]),s=n.concat([t]);for(i=a.length-1;i>=0;){var c=a[i];if(!we(c,t)||!De(t[c],e[c],u,s))return!1;i-=1}return!0}var Ne=de((function(e,t){return De(e,t,[],[])})),Be=ae((function(e){return null!=e&&Ne(e,Ae(e))}));function Fe(e){return function t(r,n,o){switch(arguments.length){case 0:return t;case 1:return ie(r)?t:de((function(t,n){return e(r,t,n)}));case 2:return ie(r)&&ie(n)?t:ie(r)?de((function(t,r){return e(t,n,r)})):ie(n)?de((function(t,n){return e(r,t,n)})):ae((function(t){return e(r,n,t)}));default:return ie(r)&&ie(n)&&ie(o)?t:ie(r)&&ie(n)?de((function(t,r){return e(t,r,o)})):ie(r)&&ie(o)?de((function(t,r){return e(t,n,r)})):ie(n)&&ie(o)?de((function(t,n){return e(r,t,n)})):ie(r)?ae((function(t){return e(t,n,o)})):ie(n)?ae((function(t){return e(r,t,o)})):ie(o)?ae((function(t){return e(r,n,t)})):e(r,n,o)}}}var Ue=Fe((function(e,t,r){var n,o={};for(n in t)we(n,t)&&(o[n]=we(n,r)?e(n,t[n],r[n]):t[n]);for(n in r)we(n,r)&&!we(n,o)&&(o[n]=r[n]);return o})),Le=Fe((function(e,t,r){return Ue((function(t,r,n){return e(r,n)}),t,r)})),We=de((function(e,t){return e.map((function(e){return ge([e],t)}))}));function qe(e){return null!=e&&"function"==typeof e["@@transducer/step"]}function ze(e,t,r){return function(){if(0===arguments.length)return r();var n=Array.prototype.slice.call(arguments,0),o=n.pop();if(!fe(o)){for(var i=0;i0&&(e.hasOwnProperty(0)&&e.hasOwnProperty(e.length-1)))))})),He=function(){function e(e){this.f=e}return e.prototype["@@transducer/init"]=function(){throw new Error("init not implemented on XWrap")},e.prototype["@@transducer/result"]=function(e){return e},e.prototype["@@transducer/step"]=function(e,t){return this.f(e,t)},e}();var Ve=de((function(e,t){return oe(e.length,(function(){return e.apply(t,arguments)}))}));function $e(e,t,r){for(var n=r.next();!n.done;){if((t=e["@@transducer/step"](t,n.value))&&t["@@transducer/reduced"]){t=t["@@transducer/value"];break}n=r.next()}return e["@@transducer/result"](t)}function Qe(e,t,r,n){return e["@@transducer/result"](r[n](Ve(e["@@transducer/step"],e),t))}var Ye="undefined"!=typeof Symbol?Symbol.iterator:"@@iterator";function Je(e,t,r){if("function"==typeof e&&(e=function(e){return new He(e)}(e)),Ke(r))return function(e,t,r){for(var n=0,o=r.length;n=arguments.length)?u=t[a]:(u=arguments[o],o+=1),n[a]=u,ie(u)||(i-=1),a+=1}return i<=0?r.apply(this,n):oe(i,ut(e,n,r))}}var st=de((function(e,t){return 1===e?ae(t):oe(e,ut(e,[],t))})),ct=de(ze(["fantasy-land/map","map"],at,(function(e,t){switch(Object.prototype.toString.call(t)){case"[object Function]":return st(t.length,(function(){return e.call(this,t.apply(this,arguments))}));case"[object Object]":return Je((function(r,n){return r[n]=e(t[n]),r}),{},Pe(t));default:return ot(e,t)}}))),lt=Fe(Je),ft=Fe((function(e,t,r){var n={};for(var o in r)n[o]=r[o];return n[e]=t,n}));function pt(e){var t=Object.prototype.toString.call(e);return"[object Function]"===t||"[object AsyncFunction]"===t||"[object GeneratorFunction]"===t||"[object AsyncGeneratorFunction]"===t}function dt(e,t){return function(e,t,r){var n,o;if("function"==typeof e.indexOf)switch(typeof t){case"number":if(0===t){for(n=1/t;r=0}function yt(e){return'"'+e.replace(/\\/g,"\\\\").replace(/[\b]/g,"\\b").replace(/\f/g,"\\f").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t").replace(/\v/g,"\\v").replace(/\0/g,"\\0").replace(/"/g,'\\"')+'"'}var ht=function(e){return(e<10?"0":"")+e},mt="function"==typeof Date.prototype.toISOString?function(e){return e.toISOString()}:function(e){return e.getUTCFullYear()+"-"+ht(e.getUTCMonth()+1)+"-"+ht(e.getUTCDate())+"T"+ht(e.getUTCHours())+":"+ht(e.getUTCMinutes())+":"+ht(e.getUTCSeconds())+"."+(e.getUTCMilliseconds()/1e3).toFixed(3).slice(2,5)+"Z"};var vt=de((function(e,t){return tt((r=e,function(){return!r.apply(this,arguments)}),t);var r}));var bt=ae((function(e){return function e(t,r){var n=function(n){var o=r.concat([t]);return dt(n,o)?"":e(n,o)},o=function(e,t){return ot((function(t){return yt(t)+": "+n(e[t])}),t.slice().sort())};switch(Object.prototype.toString.call(t)){case"[object Arguments]":return"(function() { return arguments; }("+ot(n,t).join(", ")+"))";case"[object Array]":return"["+ot(n,t).concat(o(t,vt((function(e){return/^\d+$/.test(e)}),Pe(t)))).join(", ")+"]";case"[object Boolean]":return"object"==typeof t?"new Boolean("+n(t.valueOf())+")":t.toString();case"[object Date]":return"new Date("+(isNaN(t.valueOf())?n(NaN):yt(mt(t)))+")";case"[object Null]":return"null";case"[object Number]":return"object"==typeof t?"new Number("+n(t.valueOf())+")":1/t==-1/0?"-0":t.toString(10);case"[object String]":return"object"==typeof t?"new String("+n(t.valueOf())+")":yt(t);case"[object Undefined]":return"undefined";default:if("function"==typeof t.toString){var i=t.toString();if("[object Object]"!==i)return i}return"{"+o(t,Pe(t)).join(", ")+"}"}}(e,[])})),gt=de((function(e,t){if(fe(e)){if(fe(t))return e.concat(t);throw new TypeError(bt(t)+" is not an array")}if(me(e)){if(me(t))return e+t;throw new TypeError(bt(t)+" is not a string")}if(null!=e&&pt(e["fantasy-land/concat"]))return e["fantasy-land/concat"](t);if(null!=e&&pt(e.concat))return e.concat(t);throw new TypeError(bt(e)+' does not have a method named "concat" or "fantasy-land/concat"')}));function wt(e){return e&&e["@@transducer/reduced"]?e:{"@@transducer/value":e,"@@transducer/reduced":!0}}var Ot=function(){function e(e,t){this.xf=t,this.f=e,this.all=!0}return e.prototype["@@transducer/init"]=Xe,e.prototype["@@transducer/result"]=function(e){return this.all&&(e=this.xf["@@transducer/step"](e,!0)),this.xf["@@transducer/result"](e)},e.prototype["@@transducer/step"]=function(e,t){return this.f(t)||(this.all=!1,e=wt(this.xf["@@transducer/step"](e,!1))),e},e}(),St=de(ze(["all"],de((function(e,t){return new Ot(e,t)})),(function(e,t){for(var r=0;re?t:e})),Pt=de((function(e,t){return ge([e],t)})),Et=de((function(e,t){return ct(Pt(e),t)})),At=de((function(e,t){return st(lt(jt,0,Et("length",t)),(function(){var r=arguments,n=this;return e.apply(n,ot((function(e){return e.apply(n,r)}),t))}))})),Ct=ae((function(e){return At((function(){return Array.prototype.slice.call(arguments,0)}),e)}))([tt,vt]),Rt=de((function(e,t){var r={};for(var n in t)e(t[n],n,t)&&(r[n]=t[n]);return r})),Tt=de((function(e,t){for(var r=0,n=Math.min(e.length,t.length),o={};rt.length?(r=e,n=t):(r=t,n=e),qt(Ge(Ut(dt)(r),n))})),Gt=ae((function(e){for(var t=Pe(e),r=t.length,n=[],o=0;o=0&&this.i>=this.n?wt(r):r},e}(),tr=de((function(e,t){return new er(e,t)})),rr=Fe(pe("slice",(function(e,t,r){return Array.prototype.slice.call(r,e,t)}))),nr=de(ze(["take"],tr,(function(e,t){return rr(0,e<0?1/0:e,t)}))),or=de((function(e,t){return Ne(nr(e.length,t),e)})),ir=function(){function e(e,t){this.xf=t,this.f=e,this.found=!1}return e.prototype["@@transducer/init"]=Xe,e.prototype["@@transducer/result"]=function(e){return this.found||(e=this.xf["@@transducer/step"](e,void 0)),this.xf["@@transducer/result"](e)},e.prototype["@@transducer/step"]=function(e,t){return this.f(t)&&(this.found=!0,e=wt(this.xf["@@transducer/step"](e,t))),e},e}(),ar=de(ze(["find"],de((function(e,t){return new ir(e,t)})),(function(e,t){for(var r=0,n=t.length;r2&&void 0!==arguments[2]?arguments[2]:[];if(Array.isArray(t))t.forEach((function(t,o){e(t,r,fr(o,n))}));else if("Object"===Ie(t)){r(t,n);var o=ge(yr,t);if(o){var i=gt(n,yr);e(o,r,i)}}},mr=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._ev={}}var t,r,n;return t=e,(r=[{key:"on",value:function(e,t){var r=this;return(this._ev[e]=this._ev[e]||[]).push(t),function(){return r.removeListener(e,t)}}},{key:"removeListener",value:function(e,t){var r=this._ev[e];if(r){var n=r.indexOf(t);n>-1&&r.splice(n,1)}}},{key:"emit",value:function(e){for(var t=this,r=arguments.length,n=new Array(r>1?r-1:0),o=1;oe.length)&&(t=e.length);for(var r=0,n=new Array(t);ro?1:nt?1:e=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){r=e[Symbol.iterator]()},n:function(){var e=r.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}(t);try{for(u.s();!(r=u.n()).done;){var s=r.value,c=s.id;if(s.property===o&&"string"!=typeof c&&Ne(Pe(c).sort(),i)&&St(Gr,Ft(a,We(i,c))))return s}}catch(e){u.e(e)}finally{u.f()}return!1}function Hr(e,t){var r=new It.DepGraph,n={},o=ct(Kt({id:Br})),i=ct((function(e){var t,r=e.output,n=Kt({inputs:o,state:o},e);return n.outputs=ct((function(e){return ft("out",!0,Nr(e))}),Er(r)?(t=r).substr(2,t.length-4).split("..."):[r]),n}),e),a=!1;zr(i,(function(e,r){a=!0,t(e,r)}));var u={},s={},c={},l={},f={MultiGraph:r,outputMap:u,inputMap:s,outputPatterns:c,inputPatterns:l,callbacks:i};if(a)return f;function p(e,t){var r=[{}];return Nt((function(e,o){var i=n[o].vals,a=i.indexOf(t[o]),u=[e];e&&e.wild&&(u=e===Rr?a>0?i.slice(0,a):[]:-1===a||e===Ar?i:[t[o]]),r=Vt(Vt([ft(o)],u),r)}),e),r}i.forEach((function(e){var t=e.outputs,r=e.inputs;t.concat(r).forEach((function(e){var t=e.id;"object"===Pr(t)&&Nt((function(e,t){n[t]||(n[t]={exact:[],expand:0});var r=n[t];e&&e.wild?e.expand&&(r.expand+=1):-1===r.exact.indexOf(e)&&r.exact.push(e)}),t)}))})),Nt((function(e){var t,r=e.exact,n=e.expand,o=r.slice().sort(Ur);if(n)for(var i=0;i2&&void 0!==arguments[2])||arguments[2];r.addNode(e),r.addDependency(e,t),n&&(y[y.length-1].push(e),h[h.length-1].push(t))}return i.forEach((function(e){var t=e.outputs,n=e.inputs;function o(e,t){r.addNode(t),n.forEach((function(r){var n=r.id,o=r.property;"object"===Pr(n)?p(n,e).forEach((function(e){m(fn({id:e,property:o}),t)})):m(fn(r),t)}))}y.push([]),h.push([]);var i=Vr(t[0].id).matchKeys,a=Qt((function(e){return!Yr(e.id)}),t),f=Jt({matchKeys:i,firstSingleOutput:a,outputs:t},e);t.forEach((function(e){var t=e.id,r=e.property,i=function(e,t){var r=e.id,n=e.property;return t.some((function(t){var o=t.id,i=t.property;if(n!==i||Pr(r)!==Pr(o))return!1;if("string"==typeof r){if(r===o)return!0}else if(Kr(t,[e]))return!0;return!1}))}(e,n);if("object"===Pr(t)){p(t,{}).forEach((function(e){var t={id:e,property:r},n=fn(t);i&&(d.push(t),n+="__output"),o(e,n)})),qr(c,t,r,f)}else{var a=fn(e);i&&(d.push(e),a+="__output"),o({},a),Wr(u,t,r,f)}})),n.forEach((function(e){var t=e.id,r=e.property;"object"===Pr(t)?qr(l,t,r,f):Wr(s,t,r,f)}))})),d.forEach((function(e){for(var t=fn(e),r=t.concat("__output"),n=0;ne.length)&&(t=e.length);for(var r=0,n=new Array(t);r5&&void 0!==arguments[5])||arguments[5],a=[],u=fn({id:r,property:n});if("string"==typeof r){var s=(e.inputMap[r]||{})[n];if(!s)return[];s.forEach(Zr(wn(),t,a))}else{var c=Object.keys(r).sort(),l=We(c,r),f=c.join(","),p=(e.inputPatterns[f]||{})[n];if(!p)return[];p.forEach((function(e){$r(c,l,e.values)&&e.callbacks.forEach(Zr(wn(c,l,e.values),t,a))}))}return a.forEach((function(r){r.changedPropIds[u]=o||2,i&&(r.priority=dn(e,t,r))})),a}function dn(e,t,r){for(var n=[r],o={},i=[];n.length;){var a=tt((function(e){return!o[fn(e)]}),nt(ct((function(e){return nt(e.getOutputs(t))}),n)));o=lt((function(e,t){return ft(fn(t),!0,e)}),o,a),(n=nt(ct((function(r){var n=r.id,o=r.property;return pn(e,t,n,o,cn,!1)}),a))).length&&i.push(n.length)}return i.unshift(i.length),ct((function(e){return Math.min(e,35).toString(36)}),i).join("")}var yn=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t;if(!t.length)return[];var n=ct(fn,lt((function(t,r){return gt(t,nt(r.getOutputs(e)))}),[],r)),o={};return ye((function(e){return o[e]=!0}),n),tt((function(t){return St((function(e){return!o[fn(e)]}),kt(nt(t.getInputs(e)),nt(t.getOutputs(e))))}),t)},hn=function(e,t,r,n){for(var o=[],i=en(e,t,r,n);;){var a=an(Ct((function(e){var r=e.callback.inputs,n=e.getInputs;return St(Yr,r)||!Be(kt(ct(fn,nt(n(t))),o))}),i),2),u=a[0],s=a[1];if(!s.length)break;i=u,o=gt(o,ct(fn,nt(ct((function(e){return(0,e.getOutputs)(t)}),s))))}var c=Math.random().toString(16);return ct((function(e){return nn(nn({},e),{},{executionGroup:c})}),i)},mn=function(e){var t=e.anyVals,r=e.callback,n=r.inputs,o=r.outputs,i=r.state;return gt(ct(fn,[].concat(tn(n),tn(o),tn(i))),Array.isArray(t)?t:""===t?[]:[t]).join(",")};function vn(e,t,r,n){return nt(ct((function(t){return pn(r,n,e,t)}),Pe(t)))}var bn=function(e,t,r){return{callback:e,anyVals:r,resolvedId:e.output+r,getOutputs:function(r){return e.outputs.map(t(r))},getInputs:function(r){return e.inputs.map(t(r))},getState:function(r){return e.state.map(t(r))},changedPropIds:{},initialCall:!1}};function gn(e,t){var r=an(Ct((function(e){var r=e.getOutputs,n=e.callback.outputs;return nt(r(t)).length===n.length}),e),2)[1],n=an(Ct((function(e){var r=e.getOutputs;return!nt(r(t)).length}),r),2)[1];return{added:ct((function(e){return ft("changedPropIds",Rt((function(e,r){return gr(t,Nr(r).id)}),e.changedPropIds),e)}),n),removed:r}}function wn(e,t,r){return function(n){return function(o){var i=o.id,a=o.property;if("string"==typeof i){var u=gr(n,i);return u?[{id:i,property:a,path:u}]:[]}var s=Object.keys(i).sort(),c=We(s,i),l=s.join(","),f=n.objs[l];if(!f)return[];var p=[];return f.forEach((function(n){var o=n.values,i=n.path;$r(s,o,c,e,t,r)&&p.push({id:Tt(s,o),property:a,path:i})})),p}}}var On=Fe((function e(t,r,n){if(0===t.length)return r;var o=t[0];if(t.length>1){var i=!sr(n)&&we(o,n)?n[o]:he(t[1])?[]:{};r=e(Array.prototype.slice.call(t,1),r,i)}if(he(o)&&fe(n)){var a=[].concat(n);return a[o]=r,a}return ft(o,r,n)}));var Sn={ON_PROP_CHANGE:1,SET_REQUEST_QUEUE:1,SET_GRAPHS:1,SET_PATHS:1,SET_LAYOUT:1,SET_APP_LIFECYCLE:1,SET_CONFIG:1,ON_ERROR:1,SET_HOOKS:1},_n=function(e){if(Sn[e])return e;throw new Error("".concat(e," is not defined."))};function xn(e){var t={STARTED:"STARTED",HYDRATED:"HYDRATED"};if(t[e])return t[e];throw new Error("".concat(e," is not a valid app state."))}var kn,jn,Pn,En,An=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:xn("STARTED"),t=arguments.length>1?arguments[1]:void 0;switch(t.type){case _n("SET_APP_LIFECYCLE"):return xn(t.payload);default:return e}};function Cn(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Rn(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:In,t=arguments.length>1?arguments[1]:void 0;return lt((function(e,t){return null===t?e:t.type===En.AddCompleted?Nn(e,t):Bn(e,t)}),e,t.type===En.Aggregate?t.payload:[t])};function Un(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1?arguments[1]:void 0;return t.type===_n("SET_CONFIG")?t.payload:e}var Ln={},Wn=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Ln,t=arguments.length>1?arguments[1]:void 0;return"SET_GRAPHS"===t.type?t.payload:e};function qn(e){return function(e){if(Array.isArray(e))return zn(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return zn(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return zn(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function zn(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r0&&void 0!==arguments[0]?arguments[0]:Gn,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"ON_ERROR":var r=e.frontEnd,n=e.backEnd,o=e.backEndConnected;return console.error(t.payload.error),"frontEnd"===t.payload.type?{frontEnd:[Jt(t.payload,{timestamp:new Date})].concat(qn(r)),backEnd:n,backEndConnected:o}:"backEnd"===t.payload.type?{frontEnd:r,backEnd:[Jt(t.payload,{timestamp:new Date})].concat(qn(n)),backEndConnected:o}:e;case"SET_CONNECTION_STATUS":return Jt(e,{backEndConnected:t.payload});default:return e}}function Hn(e){return function(e){if(Array.isArray(e))return Vn(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return Vn(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Vn(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Vn(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r0&&void 0!==arguments[0]?arguments[0]:$n,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"UNDO":var r=e.past,n=e.present,o=e.future,i=r[r.length-1],a=r.slice(0,r.length-1);return{past:a,present:i,future:[n].concat(Hn(o))};case"REDO":var u=e.past,s=e.present,c=e.future,l=c[0],f=c.slice(1);return{past:[].concat(Hn(u),[s]),present:l,future:f};case"REVERT":var p=e.past,d=e.future,y=p[p.length-1],h=p.slice(0,p.length-1);return{past:h,present:y,future:Hn(d)};default:return e}},Yn=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{request_pre:null,request_post:null,bear:!1},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SET_HOOKS":return t.payload;default:return e}};function Jn(e,t,r,n){var o,i=function(o){for(var i=t.length,a=0;a=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}var uo={count:0,total:0,compute:0,network:{time:0,upload:0,download:0},resources:{},status:{latest:null},result:{}},so={updated:[],resources:{},callbacks:{},graphLayout:null},co=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:so,t=arguments.length>1?arguments[1]:void 0;if("UPDATE_RESOURCE_USAGE"===t.type){var r=t.payload,n=r.id,o=r.usage,i=r.status,a=io[i]||i,u={updated:[n],resources:e.resources,callbacks:e.callbacks,graphLayout:e.graphLayout};u.callbacks[n]=u.callbacks[n]||Zn(uo);var s=u.callbacks[n],c=s.resources,l=u.resources;if(s.count+=1,s.status.latest=a,s.status[a]=(s.status[a]||0)+1,s.result=t.payload.result,s.inputs=t.payload.inputs,s.state=t.payload.state,o){var f=o.__dash_client,p=o.__dash_server,d=o.__dash_upload,y=o.__dash_download,h=ao(o,["__dash_client","__dash_server","__dash_upload","__dash_download"]);for(var m in s.total+=f,s.compute+=p,s.network.time+=f-p,s.network.upload+=d,s.network.download+=y,h)h.hasOwnProperty(m)&&(c[m]=(c[m]||0)+h[m],l[m]=(l[m]||0)+h[m])}return u}return e},lo={id:null,props:{}};var fo,po=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:lo;return e};!function(e){e.Set="IsLoading.Set"}(fo||(fo={}));var yo,ho=function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=arguments.length>1?arguments[1]:void 0;return t.type===fo.Set?t.payload:e},mo=function(e){return{value:e,"fantasy-land/map":function(){return this}}},vo=de((function(e,t){return e(mo)(t).value})),bo=de((function(e,t){return function(r){return function(n){return ct((function(e){return t(e,n)}),r(e(n)))}}})),go=ae((function(e){return bo(ge(e),On(e))})),wo=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;if(t.type===_n("SET_LAYOUT"))return t.payload;if(Bt(t.type,["UNDO_PROP_CHANGE","REDO_PROP_CHANGE",_n("ON_PROP_CHANGE")])){var r=fr("props",t.payload.itempath),n=vo(go(r),e),o=Jt(n,t.payload.props);return On(r,o,e)}return e};!function(e){e.Set="LoadingMap.Set"}(yo||(yo={}));var Oo={},So=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Oo,t=arguments.length>1?arguments[1]:void 0;return t.type===yo.Set?t.payload:e},_o={strs:{},objs:{}},xo=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:_o,t=arguments.length>1?arguments[1]:void 0;return t.type===_n("SET_PATHS")?t.payload:e};function ko(e){return function(e){if(Array.isArray(e))return jo(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return jo(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return jo(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function jo(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,n=e;if(t.type===r){var o=t.payload,i=o.id,a=o.status,u=o.content,s={status:a,content:u};n=Array.isArray(i)?On(i,s,e):i?ft(i,s,e):Jt(e,s)}return n})}),Po),B(e)}function Ao(e,t,r){var n,o=t.graphs,i=t.paths,a=t.layout,u=e.itempath,s=e.props,c=ge(u.concat(["props"]),a)||{},l=c.id;return l&&(r&&(t.changed={id:l,props:s}),n={id:l,props:{}},Pe(s).forEach((function(e){pn(o,i,l,e).length&&(n.props[e]=c[e])}))),n}function Co(){return function(e){return function(t,r){var n=t||{},o=n.history,i=n.config,a=n.hooks,u=t;return"RELOAD"===r.type?u={history:o,config:i,hooks:a}:"SET_CONFIG"===r.type&&(u={hooks:a}),e(u,r)}}((e=Eo(),function(t,r){var n=r.type,o=r.payload;if("ON_PROP_CHANGE"===n){var i=Ao(o,t,!0);i&&!Be(i.props)&&(t.history.present=i)}var a=e(t,r);if("ON_PROP_CHANGE"===n&&"response"!==o.source){var u=Ao(o,a);u&&!Be(u.props)&&(a.history={past:[].concat(ko(a.history.past),[t.history.present]),present:u,future:[]})}return a}));var e}var Ro=function e(t){var r=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._observers=[],this.observe=function(e,t){if("function"==typeof e){if(!Array.isArray(t))throw new Error("inputs must be an array");return r.add(e,t),function(){return r.remove(e)}}return r.add(e.observer,e.inputs),function(){return r.remove(e.observer)}},this.setStore=function(e){r.__finalize__(),r.__init__(e)},this.__finalize__=function(){var e;return null===(e=r._unsubscribe)||void 0===e?void 0:e.call(r)},this.__init__=function(e){r._store=e,e&&(r._unsubscribe=e.subscribe(r.notify)),ye((function(e){return e.lastState=null}),r._observers)},this.add=function(e,t){return r._observers.push({inputPaths:ct((function(e){return e.split(".")}),t),lastState:null,observer:e,triggered:!1})},this.notify=function(){var e=r._store;if(e){var t=e.getState(),n=tt((function(e){return!e.triggered&&Zt((function(r){return ge(r,t)!==ge(r,e.lastState)}),e.inputPaths)}),r._observers);ye((function(e){return e.triggered=!0}),n),ye((function(t){t.lastState=e.getState(),t.observer(e),t.triggered=!1}),n)}},this.remove=function(e){return r._observers.splice(r._observers.findIndex((function(t){return e===t.observer}),r._observers),1)},this.__init__(t)},To=function(e){var t=e(),r=t.config,n=t.isLoading,o=null==r?void 0:r.update_title;o&&(n?document.title!==o&&(Io.title=document.title,document.title=o):document.title===o?document.title=Io.title:Io.title=document.title)},Io={inputs:["isLoading"],mutationObserver:void 0,observer:function(e){var t=e.getState,r=t().config;if(Io.config!==r){var n;Io.config=r,null===(n=Io.mutationObserver)||void 0===n||n.disconnect(),Io.mutationObserver=new MutationObserver((function(){return To(t)}));var o=document.querySelector("title");o&&Io.mutationObserver.observe(o,{subtree:!0,childList:!0,attributes:!0,characterData:!0})}To(t)}},Mo=Io,Do=ae((function(e){var t=[];for(var r in e)we(r,e)&&(t[t.length]=[r,e[r]]);return t})),No=de((function(e,t){for(var r={},n=0;n1?r-1:0),o=1;oe.length)&&(t=e.length);for(var r=0,n=new Array(t);r5&&void 0!==arguments[5]&&arguments[5],a="Input"===o?r.getInputs:r.getState,u=[],s=0,c=a(e).map((function(i,a){var c=mi(Ni(e,i.map((function(e){var r=e.id,n=e.property,o=e.path;return{id:r,property:n,value:ge(o,t).props[n]}})),n[a],r.anyVals,o),2),l=c[0],f=c[1];return Yr(n[a])&&!l.length&&s++,f&&u.push(f),l}));if(u.length){if(i&&u.length+s===c.length)return null;Fi(u,e)}return c}function Fi(e,t){var r=e[0];throw-1!==r.indexOf("logged above")&&console.error(t.objs),new ReferenceError(r)}var Ui=function(e){return Array.isArray(e)?Et("value",e):e.value},Li=function(e,t){return Array.isArray(e)?Ft(e,t):[[e,t]]};function Wi(e,t,r,n){var o=window.dash_clientside=window.dash_clientside||{};o.no_update||(Object.defineProperty(o,"no_update",{value:{description:"Return to prevent updating an Output."},writable:!1}),Object.defineProperty(o,"PreventUpdate",{value:{description:"Throw to prevent updating all Outputs."},writable:!1}));var i=n.inputs,a=n.outputs,u=n.state,s=Date.now(),c=qi(i),l=qi(u),f={},p=to;try{var d,y=t.namespace,h=t.function_name,m=i.map(Ui);u&&(m=gt(m,u.map(Ui))),o.callback_context={},o.callback_context.triggered=n.changedPropIds.map((function(e){return{prop_id:e,value:c[e]}})),o.callback_context.inputs_list=i,o.callback_context.inputs=c,o.callback_context.states_list=u,o.callback_context.states=l;var v=(d=o[y])[h].apply(d,hi(m));if("function"==typeof(null==v?void 0:v.then))throw new Error("The clientside function returned a Promise. Promises are not supported in Dash clientside right now, but may be in the future.");Li(a,v).forEach((function(e){var t=mi(e,2),r=t[0],n=t[1];Li(r,n).forEach((function(e){var t=mi(e,2),r=t[0],n=t[1],i=r.id,a=r.property,u=Fr(i),s=f[u]=f[u]||{};n!==o.no_update&&(s[a]=n)}))}))}catch(e){if(e!==o.PreventUpdate)throw p=no,e;p=ro}finally{delete o.callback_context;var b=Date.now()-s,g={__dash_server:b,__dash_client:b,__dash_upload:0,__dash_download:0};r.ui&&e(Di({id:n.output,usage:g,status:p,result:f,inputs:i,state:u}))}return f}function qi(e){if(!e)return{};for(var t={},r=0;re.length)&&(t=e.length);for(var r=0,n=new Array(t);re.length)&&(t=e.length);for(var r=0,n=new Array(t);re.length)&&(t=e.length);for(var r=0,n=new Array(t);re.length)&&(t=e.length);for(var r=0,n=new Array(t);re.length)&&(t=e.length);for(var r=0,n=new Array(t);re.length)&&(t=e.length);for(var r=0,n=new Array(t);r(null!==(n=t.priority)&&void 0!==n?n:"")?-1:1},Ja=function(e,t){var r=(0,e.getOutputs)(t),n=nt(r),o=[],i={};return n.forEach((function(e){var t=e.id,r=e.property,n=Fr(t);(i[n]=i[n]||[]).push(r),o.push(fn({id:n,property:r}))})),{allOutputs:r,allPropIds:o}},Xa=function(e,t){return qt(Et("id",[].concat(Ha(nt(e.getInputs(t))),Ha(nt(e.getState(t))))))},Za={observer:(Qa=Ka(regeneratorRuntime.mark((function e(t){var r,n,o,i,a,u,s,c,l,f,p,d,y,h,m,v,b,g,w,O;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=t.dispatch,n=t.getState,o=n(),i=o.callbacks,a=i.executing,u=i.watched,s=o.config,c=o.hooks,l=o.layout,f=o.paths,p=n(),d=p.callbacks.prioritized,y=Math.max(0,12-a.length-u.length),d=Ba(Ya,d),h=Ct((function(e){return!0===Ua(l,f,Xa(e,f))}),d),m=za(h,2),v=m[0],b=m[1],g=v.slice(0,y),w=b.slice(0,y-g.length),g.length&&r(Mi([Ci(g),Si(ct((function(e){return zi(e,s,c,f,l,Ja(e,f),r)}),g))])),w.length&&(O=ct((function(e){return Wa(Wa(Wa({},e),Ja(e,f)),{},{isReady:Ua(l,f,Xa(e,f))})}),w),r(Mi([Ci(w),gi(O)])),ye(function(){var e=Ka(regeneratorRuntime.mark((function e(t){var o,i,a;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.isReady;case 2:if(o=n(),i=o.callbacks.blocked,ar((function(e){return e===t||e.isReady===t.isReady}),i)){e.next=6;break}return e.abrupt("return");case 6:a=zi(t,s,c,f,l,t,r),r(Mi([Ei([t]),Si([a])]));case 8:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),O));case 10:case"end":return e.stop()}}),e)}))),function(e){return Qa.apply(this,arguments)}),inputs:["callbacks.prioritized","callbacks.completed"]},eu=de((function(e,t){return Yt({},t,e)})),tu=function(){function e(e,t,r,n){this.valueFn=e,this.valueAcc=t,this.keyFn=r,this.xf=n,this.inputs={}}return e.prototype["@@transducer/init"]=Xe,e.prototype["@@transducer/result"]=function(e){var t;for(t in this.inputs)if(we(t,this.inputs)&&(e=this.xf["@@transducer/step"](e,this.inputs[t]))["@@transducer/reduced"]){e=e["@@transducer/value"];break}return this.inputs=null,this.xf["@@transducer/result"](e)},e.prototype["@@transducer/step"]=function(e,t){var r=this.keyFn(t);return this.inputs[r]=this.inputs[r]||[r,this.valueAcc],this.inputs[r][1]=this.valueFn(this.inputs[r][1],t),e},e}(),ru=de(pe("groupBy",ut(4,[],ze([],ut(4,[],(function(e,t,r,n){return new tu(e,t,r,n)})),(function(e,t,r,n){return Je((function(n,o){var i=r(o);return n[i]=e(we(i,n)?n[i]:Jn(t,[],[],!1),o),n}),{},n)})))((function(e,t){return null==e&&(e=[]),e.push(t),e}),null)));function nu(e,t,r,n,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void r(e)}u.done?t(s):Promise.resolve(s).then(n,o)}var ou=function(){var e,t=(e=regeneratorRuntime.mark((function e(t){var r,n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=new Promise((function(e){return r=e})),setTimeout(r,t),e.abrupt("return",n);case 3:case"end":return e.stop()}}),e)})),function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function a(e){nu(i,n,o,a,u,"next",e)}function u(e){nu(i,n,o,a,u,"throw",e)}a(void 0)}))});return function(e){return t.apply(this,arguments)}}();function iu(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function au(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);re.length)&&(t=e.length);for(var r=0,n=new Array(t);r4&&void 0!==arguments[4]?arguments[4]:null,i=[];for(var a in e)if(e.hasOwnProperty(a)){var u=void 0;try{"function"!=typeof e[a]?(u=Error((n||"React class")+": "+r+" type `"+a+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+Tu(e[a])+"`.")).name="Invariant Violation":u=e[a](t,a,n,r,null,Ru.a)}catch(e){u=e}if(!u||u instanceof Error||i.push((n||"React class")+": type specification of "+r+" `"+a+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+Tu(u)+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),u instanceof Error){var s=o&&o()||"";i.push("Failed "+r+" type: "+u.message+s)}}return i.join("\n\n")}(t.propTypes,n,"component prop",t);return a&&function(e,t,r){var n,o=e.split("`");if(Bt("is marked as required",e)){var i=o[1];n="".concat(i," in ").concat(r),t.id&&(n+=' with ID "'.concat(t.id,'"')),n+=" is required but it was not provided."}else if(Bt("Bad object",e))n=e.split("supplied to ")[0]+"supplied to ".concat(r)+".\nBad"+e.split(".\nBad")[1];else{if(!Bt("Invalid ",e)||!Bt(" supplied to ",e))throw new Error(e);var a=o[1];if(n="Invalid argument `".concat(a,"` passed into ").concat(r),t.id&&(n+=' with ID "'.concat(t.id,'"')),n+=".",Bt(", expected ",e)){var u=e.split(", expected ")[1];n+="\nExpected ".concat(u)}if(Bt(" of type `",e)){var s=e.split(" of type `")[1].split("`")[0];n+="\nWas supplied type `".concat(s,"`.")}if(lr(a,t)){var c=JSON.stringify(t[a],null,2);c&&(Bt("\n",c)?n+="\nValue provided: \n".concat(c):n+="\nValue provided: ".concat(c))}}throw new Error(n)}(a,n,i),Ju(t,n,r,o)}function Ju(e,t,r,n){var i=Jt(t,r);return Array.isArray(n)?o.a.createElement.apply(o.a,[e,i].concat(Vu(n))):o.a.createElement(e,i,n)}Yu.propTypes={children:s.a.any,element:s.a.any,layout:s.a.any,props:s.a.any,extraProps:s.a.any,id:s.a.string};var Xu=Object(n.memo)((function(e){return o.a.createElement(hs.Consumer,null,(function(t){return o.a.createElement(Zu,Hu({},t.fn(),e,{_dashprivate_path:JSON.parse(e._dashprivate_path)}))}))})),Zu=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Wu(e,t)}(a,e);var t,r,n,i=qu(a);function a(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(t=i.call(this,e)).setProps=t.setProps.bind(Gu(t)),t}return t=a,(r=[{key:"createContainer",value:function(e,t,r){return Ou(t)?t:o.a.createElement(Xu,{key:t&&t.props&&Fr(t.props.id),_dashprivate_error:e._dashprivate_error,_dashprivate_layout:t,_dashprivate_loadingState:Iu(t,r,e._dashprivate_loadingMap),_dashprivate_loadingStateHash:Mu(r,e._dashprivate_loadingMap),_dashprivate_path:JSON.stringify(r)})}},{key:"setProps",value:function(e){var t=this.props,r=t._dashprivate_graphs,n=t._dashprivate_dispatch,o=t._dashprivate_path,i=t._dashprivate_layout,a=this.getLayoutProps(),u=a.id,s=Rt((function(e,t){return!Ne(e,a[t])}),e);if(!Be(s)){var c=function(e,t,r){if(!(e&&r&&t.length))return[];if("string"==typeof e){var n=r.inputMap[e];return n?t.filter((function(e){return n[e]})):[]}var o=Object.keys(e).sort(),i=We(o,e),a=o.join(","),u=r.inputPatterns[a];return u?t.filter((function(e){var t=u[e];return t&&t.some((function(e){return $r(o,i,e.values)}))})):[]}(u,Pe(s),r);!function(e,t,r){var n=fa(e),o=n.canPersist,i=n.id,a=n.props,u=n.element,s=n.persistence,c=n.persisted_props,l=n.persistence_type;o&&s&&ye((function(e){var n=$i(e.split("."),2),o=n[0],c=n[1];if(void 0!==t[o]){var f=ua(l,r),p=ca(u,o,c).extract,d=la(i,e,s),y=p(a[o]),h=p(t[o]);if(y!==h){f.hasItem(d)&&(y=f.getItem(d)[1]);var m=void 0===y?[h]:[h,y];f.setItem(d,m,r)}}}),c)}(i,e,n),c.length&&n(li({id:u,props:No(c,s)})),n(ti({props:s,itempath:o}))}}},{key:"getChildren",value:function(e,t){var r=this;return sr(e)?null:Array.isArray(e)?hu(ct)((function(e,n){return r.createContainer(r.props,e,gt(t,["props","children",n]))}),e):this.createContainer(this.props,e,gt(t,["props","children"]))}},{key:"getComponent",value:function(e,t,r,n){var i=this.props,a=i._dashprivate_config,u=i._dashprivate_dispatch,s=i._dashprivate_error;if(Be(e))return null;if(Ou(e))return e;Du(e);var c=wr(e),l=mu("children",e.props);"Object"===Ie(l.id)&&(l.id=Fr(l.id));var f={loading_state:r||Qu,setProps:n};return(o.a.createElement(Au,{componentType:e.type,componentId:l.id,key:l.id,dispatch:u,error:s},a.props_check?o.a.createElement(Yu,{children:t,element:c,props:l,extraProps:f,type:e.type}):Ju(c,l,f,t)))}},{key:"getLayoutProps",value:function(){return gu({},"props",this.props._dashprivate_layout)}},{key:"render",value:function(){var e=this.props,t=e._dashprivate_layout,r=e._dashprivate_loadingState,n=e._dashprivate_path,o=this.getLayoutProps(),i=this.getChildren(o.children,n);return this.getComponent(t,i,r,this.setProps)}}])&&Lu(t.prototype,r),n&&Lu(t,n),a}(n.Component);Xu.propTypes={_dashprivate_error:s.a.any,_dashprivate_layout:s.a.object,_dashprivate_loadingState:s.a.oneOfType([s.a.object,s.a.bool]),_dashprivate_loadingStateHash:s.a.string,_dashprivate_path:s.a.string},Zu.propTypes=Bu(Bu({},Xu.propTypes),{},{_dashprivate_config:s.a.object,_dashprivate_dispatch:s.a.func,_dashprivate_graphs:s.a.any,_dashprivate_loadingMap:s.a.any,_dashprivate_path:s.a.array});var es=Xu;function ts(e){return(ts="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)}function rs(e,t){for(var r=0;r2&&void 0!==arguments[2]?arguments[2]:{};return fetch(e,Fo(t,{method:"POST",headers:ii(),body:r?JSON.stringify(r):null}))}};function fs(e,t,r,n,o){return function(i,a){var u=a().config,s="".concat(dr(u)).concat(e);function c(e){a().error.backEndConnected!==e&&i({type:"SET_CONNECTION_STATUS",payload:e})}return i({type:r,payload:{id:n,status:"loading"}}),ls[t](s,u.fetch,o).then((function(e){c(!0);var t=e.headers.get("content-type");return t&&-1!==t.indexOf("application/json")?e.json().then((function(t){return i({type:r,payload:{status:e.status,content:t,id:n}}),t})):(cs("Response is missing header: content-type: application/json"),i({type:r,payload:{id:n,status:e.status}}))}),(function(){c(!1)})).catch((function(t){fi(t,"Error from API call: "+e,i)}))}}function ps(e,t,r,n,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void r(e)}u.done?t(s):Promise.resolve(s).then(n,o)}function ds(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var r=[],n=!0,o=!1,i=void 0;try{for(var a,u=e[Symbol.iterator]();!(n=(a=u.next()).done)&&(r.push(a.value),!t||r.length!==t);n=!0);}catch(e){o=!0,i=e}finally{try{n||null==u.return||u.return()}finally{if(o)throw i}}return r}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return ys(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return ys(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ys(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r>>0).toString(16)}function Is(e){return(Is="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)}function Ms(e){return e&&e.constructor===Object&&e.toString===Object.prototype.toString}function Ds(e){var t={};return e.forEach((function(e){e&&"object"===Is(e)&&(Array.isArray(e)&&(e=Ds(e)),Object.keys(e).forEach((function(r){if(Ms(e[r])&&Ms(t[r])){if(0===r.indexOf("@media"))for(var n=r;;)if(!t[n+=" "])return void(t[n]=e[r]);t[r]=Ds([t[r],e[r]])}else t[r]=e[r]})))})),t}var Ns=[],Bs=!1;function Fs(){Ns.forEach((function(e){e()}))}var Us,Ls=function(e){return-1===Ns.indexOf(e)&&Ns.push(e),Bs||(window.addEventListener("mouseup",Fs),Bs=!0),{remove:function(){var t=Ns.indexOf(e);Ns.splice(t,1),0===Ns.length&&Bs&&(window.removeEventListener("mouseup",Fs),Bs=!1)}}},Ws=function(e){return":hover"===e||":active"===e||":focus"===e};function qs(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function zs(e,t){return Object.keys(e).filter((function(r){return t(e[r],r)})).reduce((function(t,r){return t[r]=e[r],t}),{})}var Gs={checkProps:function(){},keyframes:function(e){var t=e.addCSS,r=e.config,n=e.style,o=function(e){var n=e.__process(r.userAgent),o=n.animationName,i=n.css;return t(i),o};return{style:Object.keys(n).reduce((function(e,t){var r=n[t],i=Array.isArray(r);return"animationName"===t&&r&&(r.__radiumKeyframes||i)&&(r=i?r.map(o).join(", "):o(r)),e[t]=r,e}),{})}},mergeStyleArray:function(e){var t=e.style,r=e.mergeStyles;return{style:Array.isArray(t)?r(t):t}},prefix:function(e){var t=e.config,r=e.style;return{style:Object(js.b)(r,t.userAgent)}},removeNestedStyles:function(e){var t=e.isNestedStyle,r=e.style;return{style:Object.keys(r).reduce((function(e,n){var o=r[n];return t(o)||(e[n]=o),e}),{})}},resolveInteractionStyles:function(e){var t=e.ExecutionEnvironment,r=e.getComponentField,n=e.getState,o=e.mergeStyles,i=e.props,a=e.setState,u=e.style,s={},c={};if(u[":hover"]){var l=i.onMouseEnter;c.onMouseEnter=function(e){l&&l(e),a(":hover",!0)};var f=i.onMouseLeave;c.onMouseLeave=function(e){f&&f(e),a(":hover",!1)}}if(u[":active"]){var p=i.onMouseDown;c.onMouseDown=function(e){p&&p(e),s._lastMouseDown=Date.now(),a(":active","viamousedown")};var d=i.onKeyDown;c.onKeyDown=function(e){d&&d(e)," "!==e.key&&"Enter"!==e.key||a(":active","viakeydown")};var y=i.onKeyUp;c.onKeyUp=function(e){y&&y(e)," "!==e.key&&"Enter"!==e.key||a(":active",!1)}}if(u[":focus"]){var h=i.onFocus;c.onFocus=function(e){h&&h(e),a(":focus",!0)};var m=i.onBlur;c.onBlur=function(e){m&&m(e),a(":focus",!1)}}u[":active"]&&!r("_radiumMouseUpListener")&&t.canUseEventListeners&&(s._radiumMouseUpListener=Ls((function(){Object.keys(r("state")._radiumStyleState).forEach((function(e){"viamousedown"===n(":active",e)&&a(":active",!1,e)}))})));var v=i.disabled?[u[":disabled"]]:Object.keys(u).filter((function(e){return Ws(e)&&n(e)})).map((function(e){return u[e]})),b=o([u].concat(v));return b=Object.keys(b).reduce((function(e,t){return Ws(t)||":disabled"===t||(e[t]=b[t]),e}),{}),{componentFields:s,props:c,style:b}},resolveMediaQueries:function(e){var t=e.ExecutionEnvironment,r=e.addCSS,n=e.appendImportantToEachValue,o=e.config,i=e.cssRuleSetToString,a=e.getComponentField,u=e.getGlobalState,s=e.hash,c=e.isNestedStyle,l=e.mergeStyles,f=e.props,p=e.setState,d=e.style,y=function(e){return Object.keys(e).reduce((function(t,r){return 0!==r.indexOf("@media")&&(t[r]=e[r]),t}),{})}(d),h=function(e){var t=e.addCSS,r=e.appendImportantToEachValue,n=e.cssRuleSetToString,o=e.hash,i=e.isNestedStyle,a=e.style,u=e.userAgent,s="";return Object.keys(a).filter((function(e){return 0===e.indexOf("@media")})).map((function(e){var c=r(zs(a[e],(function(e){return!i(e)})));if(Object.keys(c).length){var l=n("",c,u),f="rmq-"+o(e+l);t(e+"{ ."+f+l+"}"),s+=(s?" ":"")+f}})),s}({addCSS:r,appendImportantToEachValue:n,cssRuleSetToString:i,hash:s,isNestedStyle:c,style:d,userAgent:o.userAgent}),m=h?{className:h+(f.className?" "+f.className:"")}:null,v=o.matchMedia||function(e){return void 0===Us&&(Us=!!e.canUseDOM&&!!window&&!!window.matchMedia&&function(e){return window.matchMedia(e)}||null),Us}(t);if(!v)return{props:m,style:y};var b=function(e){for(var t=1;t2&&void 0!==arguments[2]?arguments[2]:Ys,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=arguments.length>4&&void 0!==arguments[4]&&arguments[4],i=arguments.length>5?arguments[5]:void 0;if(!i){var a=Rs(e);i=Object.keys(a).reduce((function(e,t){return"main"!==t&&(e[t]=!0),e}),{})}if(Array.isArray(t)&&!t.props){var u=t.map((function(t){if(i){var a=Cs(t);delete i[a]}return Xs(e,t,r,n,o,i).element}));return{extraStateKeyMap:i,element:u}}if(!t||t.props&&t.props["data-radium"]||o&&!Zs(t))return{extraStateKeyMap:i,element:t};var s=t.props.children,c=ec({children:s,component:e,config:r,existingKeyMap:n,extraStateKeyMap:i}),l=tc({component:e,config:r,existingKeyMap:n,extraStateKeyMap:i,props:t.props});if(l=rc({component:e,config:r,existingKeyMap:n,props:l,renderedElement:t}),c===s&&l===t.props)return{extraStateKeyMap:i,element:t};var f=nc(t,l!==t.props?l:{},c);return{extraStateKeyMap:i,element:f}};function ic(){return(ic=Object.assign||function(e){for(var t=1;t=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}function Sc(e){var t=function(e,t){if("object"!==cc(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!==cc(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===cc(t)?t:String(t)}var _c,xc,kc=["arguments","callee","caller","length","name","prototype","type"];function jc(e){var t=e.prototype||{};return!(e.isReactComponent||t.isReactComponent||e.render||t.render)}function Pc(e){return"function"==typeof e&&/^\s*class\s+/.test(e.toString())}function Ec(e,t){xc.forEach((function(r){var n=Object.getOwnPropertyDescriptor(e,r),o=(n||{}).value;if(o){var i=(Object.getOwnPropertyDescriptor(_c,r)||{}).value;t.prototype[r]||o===i||(n&&Object.defineProperty(t.prototype,r,n),delete e[r])}}))}function Ac(e){if(e._extraRadiumStateKeys&&e._extraRadiumStateKeys.length>0){var t=e._extraRadiumStateKeys.reduce((function(e,t){e[t];return Oc(e,[t].map(Sc))}),Rs(e));e._lastRadiumState=t,e.setState({_radiumStyleState:t})}}function Cc(e){var t=e._radiumMouseUpListener,r=e._radiumMediaQueryListenersByQuery;e._radiumIsMounted=!1,t&&t.remove(),r&&Object.keys(r).forEach((function(e){r[e].remove()}),e)}function Rc(e,t,r){var n=e||t||r;return r&&n!==r&&(n=gc({},r,n)),n}function Tc(e,t,r,n){var i=oc(e,t,r),a=i.extraStateKeyMap,u=i.element;return e._extraRadiumStateKeys=Object.keys(a),n?o.a.createElement(uc.Provider,{value:n},u):u}function Ic(e,t){var r=o.a.forwardRef((function(r,o){var i=r.radiumConfig,a=Oc(r,["radiumConfig"]),u=Object(n.useContext)(uc),s=Object(n.useContext)(ac),c=bc(Object(n.useState)({}),2),l=c[0],f=c[1],p=Object(n.useRef)({state:l,setState:f,_radiumMediaQueryListenersByQuery:void 0,_radiumMouseUpListener:void 0,_radiumIsMounted:!0,_lastRadiumState:void 0,_extraRadiumStateKeys:void 0,_radiumStyleKeeper:s}).current;p.state=l,Object(n.useEffect)((function(){return function(){Cc(p)}}),[p]);var d=p._extraRadiumStateKeys&&p._extraRadiumStateKeys.length>0;Object(n.useEffect)((function(){Ac(p)}),[d,p]);var y=e(a,o),h=Rc(i,u,t);return Tc(p,y,h,i)}));return r._isRadiumEnhanced=!0,r.defaultProps=e.defaultProps,b()(r,e)}function Mc(e,t,r){var n,o,i=function(e){function n(){var e;lc(this,n),(e=pc(this,hc(n).apply(this,arguments))).state=e.state||{},e._radiumStyleKeeper=e.props.styleKeeperContext,e._radiumMediaQueryListenersByQuery=e._radiumMediaQueryListenersByQuery,e._radiumMouseUpListener=e._radiumMouseUpListener,e._radiumIsMounted=!0,e._lastRadiumState=void 0,e._extraRadiumStateKeys=void 0,e.state._radiumStyleState={};var r=dc(e);return Ec(r,t),e}var o,i,a;return mc(n,e),o=n,(i=[{key:"componentDidUpdate",value:function(e,t,r){yc(hc(n.prototype),"componentDidUpdate",this)&&yc(hc(n.prototype),"componentDidUpdate",this).call(this,e,t,r),Ac(this)}},{key:"componentWillUnmount",value:function(){yc(hc(n.prototype),"componentWillUnmount",this)&&yc(hc(n.prototype),"componentWillUnmount",this).call(this),Cc(this)}},{key:"render",value:function(){return Tc(this,yc(hc(n.prototype),"render",this).call(this),Rc(this.props.radiumConfig,this.props.radiumConfigContext,r),this.props.radiumConfig)}}])&&fc(o.prototype,i),a&&fc(o,a),n}(t);return i._isRadiumEnhanced=!0,_c=i.prototype,xc=Object.getOwnPropertyNames(_c).filter((function(e){return"constructor"!==e&&"function"==typeof _c[e]})),n=e,o=i,Object.getOwnPropertyNames(n).forEach((function(e){if(kc.indexOf(e)<0&&!o.hasOwnProperty(e)){var t=Object.getOwnPropertyDescriptor(n,e);t&&Object.defineProperty(o,e,t)}})),i.propTypes&&i.propTypes.style&&(i.propTypes=gc({},i.propTypes,{style:s.a.oneOfType([s.a.array,s.a.object])})),i.displayName=e.displayName||e.name||"Component",sc(i)}function Dc(e){return e=function(e){function t(){var t=Reflect.construct(e,arguments,this.constructor);return t}return Reflect.setPrototypeOf(t.prototype,e.prototype),Reflect.setPrototypeOf(t,e),t}(e)}var Nc=Object(n.forwardRef)((function(){return null})).$$typeof;function Bc(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(Nc&&e.$$typeof===Nc)return Ic(e.render,t);if("function"!=typeof e)return Fc(t,e);var r=e;if(jc(r))return Ic(r,t);var n=r;return Pc(n)&&(n=Dc(n)),n===r&&(n=function(e){function t(){return lc(this,t),pc(this,hc(t).apply(this,arguments))}return mc(t,e),t}(n)),Mc(r,n,t)}function Fc(e,t){var r=gc({},e,t);return function(e){return Bc(e,r)}}function Uc(e){return(Uc="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)}function Lc(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Wc(e,t){for(var r=0;r-1&&t._listeners.splice(r,1)}}}},{key:"addCSS",value:function(e){var t=this;return this._cssSet[e]||(this._cssSet[e]=!0,this._emitChange()),{remove:function(){delete t._cssSet[e],t._emitChange()}}}},{key:"getCSS",value:function(){return Object.keys(this._cssSet).join("\n")}},{key:"_emitChange",value:function(){this._listeners.forEach((function(e){return e()}))}}])&&Vc(t.prototype,r),n&&Vc(t,n),e}();function Qc(e){return(Qc="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)}function Yc(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Jc(e,t){for(var r=0;r=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}var nl=Bc((function(e){var t=e.children,r=rl(e,["children"]);return o.a.createElement("div",r,t,o.a.createElement(tl,null))})),ol=function(e){var t=e.radiumConfig,r=Object(n.useContext)(uc),i=Object(n.useRef)(function(e,t){var r=e&&e.userAgent||t&&t.userAgent;return new $c(r)}(t,r));return o.a.createElement(ac.Provider,{value:i.current},o.a.createElement(nl,e))};function il(e){return Bc(e)}il.Plugins=Gs,il.Style=Hc,il.StyleRoot=ol,il.getState=As,il.keyframes=function(e,t){return{__radiumKeyframes:!0,__process:function(r){var n=Object(js.a)(r),o=Object.keys(e).map((function(t){return Ps(t,e[t],r)})).join("\n"),i=(t?t+"-":"")+"radium-animation-"+Ts(o);return{css:"@"+n+" "+i+" {\n"+o+"\n}\n",animationName:i}}}};var al=il;function ul(e){var t=e.dispatch,r=e.history,n={parentSpanStyle:{display:"inline-block",opacity:"0.2",":hover":{opacity:1}},iconStyle:{fontSize:20},labelStyle:{fontSize:15}},i=o.a.createElement("span",{key:"undoLink",style:Jt({color:r.past.length?"#0074D9":"grey",cursor:r.past.length?"pointer":"default"},n.parentSpanStyle),onClick:function(){return t(ui)}},o.a.createElement("div",{style:Jt({transform:"rotate(270deg)"},n.iconStyle)},"↺"),o.a.createElement("div",{style:n.labelStyle},"undo")),a=o.a.createElement("span",{key:"redoLink",style:Jt({color:r.future.length?"#0074D9":"grey",cursor:r.future.length?"pointer":"default",marginLeft:10},n.parentSpanStyle),onClick:function(){return t(ai)}},o.a.createElement("div",{style:Jt({transform:"rotate(90deg)"},n.iconStyle)},"↻"),o.a.createElement("div",{style:n.labelStyle},"redo"));return o.a.createElement("div",{className:"_dash-undo-redo",style:{position:"fixed",bottom:"30px",left:"30px",fontSize:"20px",textAlign:"center",zIndex:"9999",backgroundColor:"rgba(255, 255, 255, 0.9)"}},o.a.createElement("div",{style:{position:"relative"}},r.past.length>0?i:null,r.future.length>0?a:null))}ul.propTypes={history:s.a.object,dispatch:s.a.func};var sl=re((function(e){return{history:e.history}}),(function(e){return{dispatch:e}}))(al(ul)),cl=ae((function(e){return function(t,r){return e(t,r)?-1:e(r,t)?1:0}})),ll=de((function(e,t){return e=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){r=e[Symbol.iterator]()},n:function(){var e=r.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}function dl(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r0){var f=document.createElement("link");f.href="".concat(u.url,"?m=").concat(u.modified),f.type="text/css",f.rel="stylesheet",this._head.appendChild(f)}}}catch(e){a.e(e)}finally{a.f()}i||window.location.reload()}else 500===r.status&&(this._retry>this.state.max_retry&&(this.clearInterval(),window.alert("\n Reloader failed after ".concat(this._retry," times.\n Please check your application for errors.\n "))),this._retry++)}},{key:"componentDidMount",value:function(){var e=this.props,t=e.dispatch,r=e.reloadRequest,n=this.state,o=n.disabled,i=n.interval;if(!o&&!this.state.intervalId){var a=window.setInterval((function(){"loading"!==r.status&&t(fs("_reload-hash","GET","reloadRequest"))}),i);this.setState({intervalId:a})}}},{key:"componentWillUnmount",value:function(){!this.state.disabled&&this.state.intervalId&&this.clearInterval()}},{key:"render",value:function(){return null}}])&&yl(t.prototype,r),n&&yl(t,n),i}(o.a.Component);wl.defaultProps={},wl.propTypes={id:s.a.string,config:s.a.object,reloadRequest:s.a.object,dispatch:s.a.func,interval:s.a.number};var Ol=re((function(e){return{config:e.config,reloadRequest:e.reloadRequest}}),(function(e){return{dispatch:e}}))(wl);function Sl(e){return(Sl="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)}function _l(e,t){for(var r=0;re.length)&&(t=e.length);for(var r=0,n=new Array(t);r 2 && arguments[2] !== undefined ? arguments[2] : true; + multiGraph.addNode(inIdProp); + multiGraph.addDependency(inIdProp, outIdProp); // only store callback inputs and outputs during the first pass + + if (firstPass) { + cbIn[cbIn.length - 1].push(inIdProp); + cbOut[cbOut.length - 1].push(outIdProp); + } + } parsedDependencies.forEach(function registerDependency(dependency) { var outputs = dependency.outputs, - inputs = dependency.inputs; // multiGraph - just for testing circularity + inputs = dependency.inputs; // new callback, add an empty array for its inputs and outputs - function addInputToMulti(inIdProp, outIdProp) { - multiGraph.addNode(inIdProp); - multiGraph.addDependency(inIdProp, outIdProp); - } + cbIn.push([]); + cbOut.push([]); function addOutputToMulti(outIdFinal, outIdProp) { multiGraph.addNode(outIdProp); @@ -823,19 +861,36 @@ function computeGraphs(dependencies, dispatchError) { }, dependency); outputs.forEach(function (outIdProp) { var outId = outIdProp.id, - property = outIdProp.property; + property = outIdProp.property; // check if this output is also an input to the same callback + + var alsoInput = checkInOutOverlap(outIdProp, inputs); if (_typeof(outId) === 'object') { var outIdList = makeAllIds(outId, {}); outIdList.forEach(function (id) { - addOutputToMulti(id, (0, _dependencies_ts.combineIdAndProp)({ + var tempOutIdProp = { id: id, property: property - })); + }; + var outIdName = (0, _dependencies_ts.combineIdAndProp)(tempOutIdProp); // if this output is also an input, add `outputTag` to the name + + if (alsoInput) { + duplicateOutputs.push(tempOutIdProp); + outIdName += outputTag; + } + + addOutputToMulti(id, outIdName); }); addPattern(outputPatterns, outId, property, finalDependency); } else { - addOutputToMulti({}, (0, _dependencies_ts.combineIdAndProp)(outIdProp)); + var outIdName = (0, _dependencies_ts.combineIdAndProp)(outIdProp); // if this output is also an input, add `outputTag` to the name + + if (alsoInput) { + duplicateOutputs.push(outIdProp); + outIdName += outputTag; + } + + addOutputToMulti({}, outIdName); addMap(outputMap, outId, property, finalDependency); } }); @@ -849,6 +904,29 @@ function computeGraphs(dependencies, dispatchError) { addMap(inputMap, inId, inProp, finalDependency); } }); + }); // second pass for adding new output nodes as dependencies where needed + + duplicateOutputs.forEach(function (dupeOutIdProp) { + var originalName = (0, _dependencies_ts.combineIdAndProp)(dupeOutIdProp); + var newName = originalName.concat(outputTag); + + for (var cnt = 0; cnt < cbIn.length; cnt++) { + // check if input to the callback + if (cbIn[cnt].some(function (inName) { + return inName === originalName; + })) { + /* make sure it's not also an output of the callback + * (this will be the original callback) + */ + if (!cbOut[cnt].some(function (outName) { + return outName === newName; + })) { + cbOut[cnt].forEach(function (outName) { + addInputToMulti(newName, outName, false); + }); + } + } + } }); return finalGraphs; } diff --git a/dash-renderer/lib/actions/dependencies_ts.js b/dash-renderer/lib/actions/dependencies_ts.js index 706278eb64..2238207579 100644 --- a/dash-renderer/lib/actions/dependencies_ts.js +++ b/dash-renderer/lib/actions/dependencies_ts.js @@ -159,11 +159,12 @@ var getReadyCallbacks = function getReadyCallbacks(paths, candidates) { (0, _ramda.forEach)(function (output) { return outputsMap[output] = true; }, outputs); // Find `requested` callbacks that do not depend on a outstanding output (as either input or state) + // Outputs which overlap an input do not count as an outstanding output return (0, _ramda.filter)(function (cb) { return (0, _ramda.all)(function (cbp) { return !outputsMap[combineIdAndProp(cbp)]; - }, (0, _ramda.flatten)(cb.getInputs(paths))); + }, (0, _ramda.difference)((0, _ramda.flatten)(cb.getInputs(paths)), (0, _ramda.flatten)(cb.getOutputs(paths)))); }, candidates); }; diff --git a/dash-renderer/lib/components/error/CallbackGraph/CallbackGraphContainer.react.js b/dash-renderer/lib/components/error/CallbackGraph/CallbackGraphContainer.react.js index 96c84f194d..9268ff92a2 100644 --- a/dash-renderer/lib/components/error/CallbackGraph/CallbackGraphContainer.react.js +++ b/dash-renderer/lib/components/error/CallbackGraph/CallbackGraphContainer.react.js @@ -85,7 +85,7 @@ _cytoscape["default"].use(_cytoscapeDagre["default"]); _cytoscape["default"].use(_cytoscapeFcose["default"]); /* - * Generates all the elements (nodes, edeges) for the dependency graph. + * Generates all the elements (nodes, edges) for the dependency graph. */ @@ -323,7 +323,7 @@ function CallbackGraph() { pan: cy.pan(), _chosenType: (_layoutSelector$curre = layoutSelector.current) === null || _layoutSelector$curre === void 0 ? void 0 : _layoutSelector$curre.value }; - } // Adds callbacks once cyctoscape is intialized. + } // Adds callbacks once cyctoscape is initialized. useCytoscapeEffect(function (cy) { diff --git a/dash-renderer/lib/components/error/CallbackGraph/CallbackGraphEffects.js b/dash-renderer/lib/components/error/CallbackGraph/CallbackGraphEffects.js index 10a0b46838..86e69c2291 100644 --- a/dash-renderer/lib/components/error/CallbackGraph/CallbackGraphEffects.js +++ b/dash-renderer/lib/components/error/CallbackGraph/CallbackGraphEffects.js @@ -15,7 +15,7 @@ var _constants = require("../../../constants/constants"); * Finds all edges connected to a node and splits them by type. * * @param {Object} node - Cytoscape node. - * @returns {Object} - Object contaiing the edges, sorted by type. + * @returns {Object} - Object containing the edges, sorted by type. */ function getEdgeTypes(node) { var elements = node.connectedEdges(); @@ -75,7 +75,7 @@ function updateSelectedNode(cy, id) { }); }; - var node = cy.getElementById(id); // Highlght the selected node. + var node = cy.getElementById(id); // Highlight the selected node. node.addClass('selected-node'); var subtree = cy.collection(); @@ -123,7 +123,7 @@ function updateChangedProps(cy, id, props) { * * @param {Object} cy - Reference to the cytoscape instance. * @param {String} id - The id of the callback (i.e., it's output identifier) - * @param {Object} profile - The callback profiling infomration. + * @param {Object} profile - The callback profiling information. * @param {Number} flashTime - The time to flash classes for in ms. * @returns {undefined} */ diff --git a/dash-renderer/lib/components/error/FrontEnd/FrontEndError.css b/dash-renderer/lib/components/error/FrontEnd/FrontEndError.css index e5f50d5490..ec1293a4c6 100644 --- a/dash-renderer/lib/components/error/FrontEnd/FrontEndError.css +++ b/dash-renderer/lib/components/error/FrontEnd/FrontEndError.css @@ -2,6 +2,22 @@ margin-top: 10px; } +.dash-fe-error__icon-x { + position: absolute; + right: 0; + top: 0; + color: #B9C2CE; + font-size: 20px; + cursor: pointer; + margin-right: 10px +} + +.dash-fe-error__icon-x:hover +{ + color:#a1a9b5; +} + + .dash-fe-errors { min-width: 386px; max-width: 650px; diff --git a/dash-renderer/lib/components/error/FrontEnd/FrontEndErrorContainer.react.js b/dash-renderer/lib/components/error/FrontEnd/FrontEndErrorContainer.react.js index 09123ae9c5..1b23b99593 100644 --- a/dash-renderer/lib/components/error/FrontEnd/FrontEndErrorContainer.react.js +++ b/dash-renderer/lib/components/error/FrontEnd/FrontEndErrorContainer.react.js @@ -57,10 +57,12 @@ var FrontEndErrorContainer = /*#__PURE__*/function (_Component) { value: function render() { var _this$props = this.props, errors = _this$props.errors, - connected = _this$props.connected; + connected = _this$props.connected, + errorsOpened = _this$props.errorsOpened, + clickHandler = _this$props.clickHandler; var errorsLength = errors.length; - if (errorsLength === 0) { + if (errorsLength === 0 || !errorsOpened) { return null; } @@ -86,7 +88,12 @@ var FrontEndErrorContainer = /*#__PURE__*/function (_Component) { className: "dash-error-card__message" }, "\uD83D\uDED1 Errors (", /*#__PURE__*/_react["default"].createElement("strong", { className: "test-devtools-error-count" - }, errorsLength), ")", connected ? null : "\xA0 \uD83D\uDEAB Server Unavailable")), /*#__PURE__*/_react["default"].createElement("div", { + }, errorsLength), ")", connected ? null : "\xA0 \uD83D\uDEAB Server Unavailable"), /*#__PURE__*/_react["default"].createElement("div", { + className: "dash-fe-error__icon-x", + onClick: function onClick() { + return clickHandler(); + } + }, "\xD7")), /*#__PURE__*/_react["default"].createElement("div", { className: "dash-error-card__list" }, errorElements)); } @@ -97,9 +104,12 @@ var FrontEndErrorContainer = /*#__PURE__*/function (_Component) { exports.FrontEndErrorContainer = FrontEndErrorContainer; FrontEndErrorContainer.propTypes = { + id: _propTypes["default"].string, errors: _propTypes["default"].array, connected: _propTypes["default"].bool, - inAlertsTray: _propTypes["default"].any + inAlertsTray: _propTypes["default"].any, + errorsOpened: _propTypes["default"].any, + clickHandler: _propTypes["default"].func }; FrontEndErrorContainer.propTypes = { inAlertsTray: _propTypes["default"].any diff --git a/dash-renderer/lib/components/error/GlobalErrorOverlay.css b/dash-renderer/lib/components/error/GlobalErrorOverlay.css index 318efa88ba..955c97c160 100644 --- a/dash-renderer/lib/components/error/GlobalErrorOverlay.css +++ b/dash-renderer/lib/components/error/GlobalErrorOverlay.css @@ -53,6 +53,7 @@ display: flex; justify-content: center; align-items: center; + position: relative; } .dash-error-card__message { font-size: 14px; diff --git a/dash-renderer/lib/components/error/GlobalErrorOverlay.react.js b/dash-renderer/lib/components/error/GlobalErrorOverlay.react.js index 8b51b6cf82..8eb9c9e371 100644 --- a/dash-renderer/lib/components/error/GlobalErrorOverlay.react.js +++ b/dash-renderer/lib/components/error/GlobalErrorOverlay.react.js @@ -60,14 +60,17 @@ var GlobalErrorOverlay = /*#__PURE__*/function (_Component) { var _this$props = this.props, visible = _this$props.visible, error = _this$props.error, - errorsOpened = _this$props.errorsOpened; + errorsOpened = _this$props.errorsOpened, + clickHandler = _this$props.clickHandler; var frontEndErrors; if (errorsOpened) { var errors = (0, _ramda.concat)(error.frontEnd, error.backEnd); frontEndErrors = /*#__PURE__*/_react["default"].createElement(_FrontEndErrorContainer.FrontEndErrorContainer, { errors: errors, - connected: error.backEndConnected + connected: error.backEndConnected, + errorsOpened: errorsOpened, + clickHandler: clickHandler }); } @@ -87,5 +90,6 @@ GlobalErrorOverlay.propTypes = { children: _propTypes["default"].object, visible: _propTypes["default"].bool, error: _propTypes["default"].object, - errorsOpened: _propTypes["default"].any + errorsOpened: _propTypes["default"].any, + clickHandler: _propTypes["default"].func }; \ No newline at end of file diff --git a/dash-renderer/lib/components/error/menu/DebugMenu.react.js b/dash-renderer/lib/components/error/menu/DebugMenu.react.js index 0a903fe0f3..55ae0b1be5 100644 --- a/dash-renderer/lib/components/error/menu/DebugMenu.react.js +++ b/dash-renderer/lib/components/error/menu/DebugMenu.react.js @@ -150,7 +150,8 @@ var DebugMenu = /*#__PURE__*/function (_Component) { })), /*#__PURE__*/_react["default"].createElement(_GlobalErrorOverlay["default"], { error: error, visible: errCount > 0, - errorsOpened: errorsOpened + errorsOpened: errorsOpened, + clickHandler: toggleErrors }, this.props.children)); } }]); diff --git a/dash-renderer/lib/observers/prioritizedCallbacks.js b/dash-renderer/lib/observers/prioritizedCallbacks.js index ecace669b1..04e5fa43d9 100644 --- a/dash-renderer/lib/observers/prioritizedCallbacks.js +++ b/dash-renderer/lib/observers/prioritizedCallbacks.js @@ -83,7 +83,7 @@ var getIds = function getIds(cb, paths) { var observer = { observer: function () { var _observer = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2(_ref2) { - var dispatch, getState, _getState, _getState$callbacks, executing, watched, config, hooks, layout, paths, _getState2, prioritized, available, _partition, _partition2, syncCallbacks, asyncCallbacks, pickedSyncCallbacks, pickedAsyncCallbacks, deffered; + var dispatch, getState, _getState, _getState$callbacks, executing, watched, config, hooks, layout, paths, _getState2, prioritized, available, _partition, _partition2, syncCallbacks, asyncCallbacks, pickedSyncCallbacks, pickedAsyncCallbacks, deferred; return regeneratorRuntime.wrap(function _callee2$(_context2) { while (1) { @@ -109,12 +109,12 @@ var observer = { } if (pickedAsyncCallbacks.length) { - deffered = (0, _ramda.map)(function (cb) { + deferred = (0, _ramda.map)(function (cb) { return _objectSpread(_objectSpread(_objectSpread({}, cb), getStash(cb, paths)), {}, { isReady: (0, _isAppReady["default"])(layout, paths, getIds(cb, paths)) }); }, pickedAsyncCallbacks); - dispatch((0, _callbacks.aggregateCallbacks)([(0, _callbacks.removePrioritizedCallbacks)(pickedAsyncCallbacks), (0, _callbacks.addBlockedCallbacks)(deffered)])); + dispatch((0, _callbacks.aggregateCallbacks)([(0, _callbacks.removePrioritizedCallbacks)(pickedAsyncCallbacks), (0, _callbacks.addBlockedCallbacks)(deferred)])); (0, _ramda.forEach)( /*#__PURE__*/function () { var _ref3 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(cb) { var _getState3, blocked, currentCb, executingCallback; @@ -158,7 +158,7 @@ var observer = { return function (_x2) { return _ref3.apply(this, arguments); }; - }(), deffered); + }(), deferred); } case 10: diff --git a/dash-renderer/lib/reducers/profile.js b/dash-renderer/lib/reducers/profile.js index fee8a37575..fb44641db6 100644 --- a/dash-renderer/lib/reducers/profile.js +++ b/dash-renderer/lib/reducers/profile.js @@ -41,7 +41,7 @@ var profile = function profile() { if (action.type === 'UPDATE_RESOURCE_USAGE') { // Keep a record of the most recent change. This - // is subtly different from history.present becasue + // is subtly different from history.present because // it watches all props, not just inputs. var _action$payload = action.payload, id = _action$payload.id, diff --git a/dash-renderer/package-lock.json b/dash-renderer/package-lock.json index 1f007f19d9..6d74b4b15c 100644 --- a/dash-renderer/package-lock.json +++ b/dash-renderer/package-lock.json @@ -1,6 +1,6 @@ { "name": "dash-renderer", - "version": "1.8.3", + "version": "1.9.0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/dash-renderer/package.json b/dash-renderer/package.json index 6b3a4e1e9f..fb3b3a8d96 100644 --- a/dash-renderer/package.json +++ b/dash-renderer/package.json @@ -1,6 +1,6 @@ { "name": "dash-renderer", - "version": "1.8.3", + "version": "1.9.0", "description": "render dash components in react", "main": "dash_renderer/dash_renderer.min.js", "scripts": { diff --git a/dash-renderer/src/actions/dependencies.js b/dash-renderer/src/actions/dependencies.js index b83015dbf8..f88f36b003 100644 --- a/dash-renderer/src/actions/dependencies.js +++ b/dash-renderer/src/actions/dependencies.js @@ -239,7 +239,6 @@ function validateDependencies(parsedDependencies, dispatchError) { }); findDuplicateOutputs(outputs, head, dispatchError, outStrs, outObjs); - findInOutOverlap(outputs, inputs, head, dispatchError); findMismatchedWildcards(outputs, inputs, state, head, dispatchError); }); } @@ -364,31 +363,21 @@ function findDuplicateOutputs(outputs, head, dispatchError, outStrs, outObjs) { }); } -function findInOutOverlap(outputs, inputs, head, dispatchError) { - outputs.forEach((out, outi) => { - const {id: outId, property: outProp} = out; - inputs.forEach((in_, ini) => { - const {id: inId, property: inProp} = in_; - if (outProp !== inProp || typeof outId !== typeof inId) { - return; - } - if (typeof outId === 'string') { - if (outId === inId) { - dispatchError('Same `Input` and `Output`', [ - head, - `Input ${ini} (${combineIdAndProp(in_)})`, - `matches Output ${outi} (${combineIdAndProp(out)})` - ]); - } - } else if (wildcardOverlap(in_, [out])) { - dispatchError('Same `Input` and `Output`', [ - head, - `Input ${ini} (${combineIdAndProp(in_)})`, - 'can match the same component(s) as', - `Output ${outi} (${combineIdAndProp(out)})` - ]); +function checkInOutOverlap(out, inputs) { + const {id: outId, property: outProp} = out; + return inputs.some(in_ => { + const {id: inId, property: inProp} = in_; + if (outProp !== inProp || typeof outId !== typeof inId) { + return false; + } + if (typeof outId === 'string') { + if (outId === inId) { + return true; } - }); + } else if (wildcardOverlap(in_, [out])) { + return true; + } + return false; }); } @@ -749,15 +738,52 @@ export function computeGraphs(dependencies, dispatchError) { return idList; } + /* multiGraph is used only for testing circularity + * + * Each component+property that is used as an input or output is added as a node + * to a directed graph with a dependency from each input to each output. The + * function triggerDefaultState in index.js then checks this graph for circularity. + * + * In order to allow the same component+property to be both an input and output + * of the same callback, a two pass approach is used. + * + * In the first pass, the graph is built up normally with the exception that + * in cases where an output is also an input to the same callback a special + * "output" node is added and the dependencies target this output node instead. + * For example, if `slider.value` is both an input and an output, then the a new + * node `slider.value__output` will be added with a dependency from `slider.value` + * to `slider.value__output`. Splitting the input and output into separate nodes + * removes the circularity. + * + * In order to still detect other forms of circularity, it is necessary to do a + * second pass and add the new output nodes as a dependency in any *other* callbacks + * where the original node was an input. Continuing the example, any other callback + * that had `slider.value` as an input dependency also needs to have + * `slider.value__output` as a dependency. To make this efficient, all the inputs + * and outputs for each callback are stored during the first pass. + */ + + const outputTag = '__output'; + const duplicateOutputs = []; + const cbIn = []; + const cbOut = []; + + function addInputToMulti(inIdProp, outIdProp, firstPass = true) { + multiGraph.addNode(inIdProp); + multiGraph.addDependency(inIdProp, outIdProp); + // only store callback inputs and outputs during the first pass + if (firstPass) { + cbIn[cbIn.length - 1].push(inIdProp); + cbOut[cbOut.length - 1].push(outIdProp); + } + } + parsedDependencies.forEach(function registerDependency(dependency) { const {outputs, inputs} = dependency; - // multiGraph - just for testing circularity - - function addInputToMulti(inIdProp, outIdProp) { - multiGraph.addNode(inIdProp); - multiGraph.addDependency(inIdProp, outIdProp); - } + // new callback, add an empty array for its inputs and outputs + cbIn.push([]); + cbOut.push([]); function addOutputToMulti(outIdFinal, outIdProp) { multiGraph.addNode(outIdProp); @@ -791,15 +817,29 @@ export function computeGraphs(dependencies, dispatchError) { outputs.forEach(outIdProp => { const {id: outId, property} = outIdProp; + // check if this output is also an input to the same callback + const alsoInput = checkInOutOverlap(outIdProp, inputs); if (typeof outId === 'object') { const outIdList = makeAllIds(outId, {}); outIdList.forEach(id => { - addOutputToMulti(id, combineIdAndProp({id, property})); + const tempOutIdProp = {id, property}; + let outIdName = combineIdAndProp(tempOutIdProp); + // if this output is also an input, add `outputTag` to the name + if (alsoInput) { + duplicateOutputs.push(tempOutIdProp); + outIdName += outputTag; + } + addOutputToMulti(id, outIdName); }); - addPattern(outputPatterns, outId, property, finalDependency); } else { - addOutputToMulti({}, combineIdAndProp(outIdProp)); + let outIdName = combineIdAndProp(outIdProp); + // if this output is also an input, add `outputTag` to the name + if (alsoInput) { + duplicateOutputs.push(outIdProp); + outIdName += outputTag; + } + addOutputToMulti({}, outIdName); addMap(outputMap, outId, property, finalDependency); } }); @@ -814,6 +854,25 @@ export function computeGraphs(dependencies, dispatchError) { }); }); + // second pass for adding new output nodes as dependencies where needed + duplicateOutputs.forEach(dupeOutIdProp => { + const originalName = combineIdAndProp(dupeOutIdProp); + const newName = originalName.concat(outputTag); + for (var cnt = 0; cnt < cbIn.length; cnt++) { + // check if input to the callback + if (cbIn[cnt].some(inName => inName === originalName)) { + /* make sure it's not also an output of the callback + * (this will be the original callback) + */ + if (!cbOut[cnt].some(outName => outName === newName)) { + cbOut[cnt].forEach(outName => { + addInputToMulti(newName, outName, false); + }); + } + } + } + }); + return finalGraphs; } diff --git a/dash-renderer/src/actions/dependencies_ts.ts b/dash-renderer/src/actions/dependencies_ts.ts index a053d4ffd8..0314f4f1ad 100644 --- a/dash-renderer/src/actions/dependencies_ts.ts +++ b/dash-renderer/src/actions/dependencies_ts.ts @@ -167,11 +167,15 @@ export const getReadyCallbacks = ( forEach(output => (outputsMap[output] = true), outputs); // Find `requested` callbacks that do not depend on a outstanding output (as either input or state) + // Outputs which overlap an input do not count as an outstanding output return filter( cb => - all( + all( cbp => !outputsMap[combineIdAndProp(cbp)], - flatten(cb.getInputs(paths)) + difference( + flatten(cb.getInputs(paths)), + flatten(cb.getOutputs(paths)) + ) ), candidates ); diff --git a/dash-renderer/src/components/error/CallbackGraph/CallbackGraphContainer.react.js b/dash-renderer/src/components/error/CallbackGraph/CallbackGraphContainer.react.js index 6acb49512c..5765ab4e6d 100644 --- a/dash-renderer/src/components/error/CallbackGraph/CallbackGraphContainer.react.js +++ b/dash-renderer/src/components/error/CallbackGraph/CallbackGraphContainer.react.js @@ -24,7 +24,7 @@ Cytoscape.use(dagre); Cytoscape.use(fcose); /* - * Generates all the elements (nodes, edeges) for the dependency graph. + * Generates all the elements (nodes, edges) for the dependency graph. */ function generateElements(graphs, profile, extraLinks) { const consumed = []; @@ -229,7 +229,7 @@ function CallbackGraph() { }; } - // Adds callbacks once cyctoscape is intialized. + // Adds callbacks once cyctoscape is initialized. useCytoscapeEffect( cy => { cytoscape.on('tap', 'node', e => setSelected(e.target)); diff --git a/dash-renderer/src/components/error/CallbackGraph/CallbackGraphEffects.js b/dash-renderer/src/components/error/CallbackGraph/CallbackGraphEffects.js index 05c777f8cc..3f42f51405 100644 --- a/dash-renderer/src/components/error/CallbackGraph/CallbackGraphEffects.js +++ b/dash-renderer/src/components/error/CallbackGraph/CallbackGraphEffects.js @@ -6,7 +6,7 @@ import {STATUS, STATUSMAP} from '../../../constants/constants'; * Finds all edges connected to a node and splits them by type. * * @param {Object} node - Cytoscape node. - * @returns {Object} - Object contaiing the edges, sorted by type. + * @returns {Object} - Object containing the edges, sorted by type. */ function getEdgeTypes(node) { const elements = node.connectedEdges(); @@ -30,7 +30,7 @@ export function updateSelectedNode(cy, id) { if (id) { const node = cy.getElementById(id); - // Highlght the selected node. + // Highlight the selected node. node.addClass('selected-node'); @@ -112,7 +112,7 @@ export function updateChangedProps(cy, id, props, flashTime = 500) { * * @param {Object} cy - Reference to the cytoscape instance. * @param {String} id - The id of the callback (i.e., it's output identifier) - * @param {Object} profile - The callback profiling infomration. + * @param {Object} profile - The callback profiling information. * @param {Number} flashTime - The time to flash classes for in ms. * @returns {undefined} */ diff --git a/dash-renderer/src/components/error/FrontEnd/FrontEndError.css b/dash-renderer/src/components/error/FrontEnd/FrontEndError.css index e5f50d5490..ec1293a4c6 100644 --- a/dash-renderer/src/components/error/FrontEnd/FrontEndError.css +++ b/dash-renderer/src/components/error/FrontEnd/FrontEndError.css @@ -2,6 +2,22 @@ margin-top: 10px; } +.dash-fe-error__icon-x { + position: absolute; + right: 0; + top: 0; + color: #B9C2CE; + font-size: 20px; + cursor: pointer; + margin-right: 10px +} + +.dash-fe-error__icon-x:hover +{ + color:#a1a9b5; +} + + .dash-fe-errors { min-width: 386px; max-width: 650px; diff --git a/dash-renderer/src/components/error/FrontEnd/FrontEndErrorContainer.react.js b/dash-renderer/src/components/error/FrontEnd/FrontEndErrorContainer.react.js index 3bdbf51cb3..1ff561febb 100644 --- a/dash-renderer/src/components/error/FrontEnd/FrontEndErrorContainer.react.js +++ b/dash-renderer/src/components/error/FrontEnd/FrontEndErrorContainer.react.js @@ -9,9 +9,9 @@ class FrontEndErrorContainer extends Component { } render() { - const {errors, connected} = this.props; + const {errors, connected, errorsOpened, clickHandler} = this.props; const errorsLength = errors.length; - if (errorsLength === 0) { + if (errorsLength === 0 || !errorsOpened) { return null; } @@ -34,6 +34,12 @@ class FrontEndErrorContainer extends Component { ){connected ? null : '\u00a0 🚫 Server Unavailable'} +
clickHandler()} + > + × +
{errorElements}
@@ -42,9 +48,12 @@ class FrontEndErrorContainer extends Component { } FrontEndErrorContainer.propTypes = { + id: PropTypes.string, errors: PropTypes.array, connected: PropTypes.bool, - inAlertsTray: PropTypes.any + inAlertsTray: PropTypes.any, + errorsOpened: PropTypes.any, + clickHandler: PropTypes.func }; FrontEndErrorContainer.propTypes = { diff --git a/dash-renderer/src/components/error/GlobalErrorOverlay.css b/dash-renderer/src/components/error/GlobalErrorOverlay.css index 318efa88ba..955c97c160 100644 --- a/dash-renderer/src/components/error/GlobalErrorOverlay.css +++ b/dash-renderer/src/components/error/GlobalErrorOverlay.css @@ -53,6 +53,7 @@ display: flex; justify-content: center; align-items: center; + position: relative; } .dash-error-card__message { font-size: 14px; diff --git a/dash-renderer/src/components/error/GlobalErrorOverlay.react.js b/dash-renderer/src/components/error/GlobalErrorOverlay.react.js index 4ad50a978c..ccb581bf84 100644 --- a/dash-renderer/src/components/error/GlobalErrorOverlay.react.js +++ b/dash-renderer/src/components/error/GlobalErrorOverlay.react.js @@ -11,7 +11,7 @@ export default class GlobalErrorOverlay extends Component { } render() { - const {visible, error, errorsOpened} = this.props; + const {visible, error, errorsOpened, clickHandler} = this.props; let frontEndErrors; if (errorsOpened) { @@ -21,6 +21,8 @@ export default class GlobalErrorOverlay extends Component { ); } @@ -41,5 +43,6 @@ GlobalErrorOverlay.propTypes = { children: PropTypes.object, visible: PropTypes.bool, error: PropTypes.object, - errorsOpened: PropTypes.any + errorsOpened: PropTypes.any, + clickHandler: PropTypes.func }; diff --git a/dash-renderer/src/components/error/menu/DebugMenu.react.js b/dash-renderer/src/components/error/menu/DebugMenu.react.js index 47f0d5cf23..a11ab6085d 100644 --- a/dash-renderer/src/components/error/menu/DebugMenu.react.js +++ b/dash-renderer/src/components/error/menu/DebugMenu.react.js @@ -147,6 +147,7 @@ class DebugMenu extends Component { error={error} visible={errCount > 0} errorsOpened={errorsOpened} + clickHandler={toggleErrors} > {this.props.children} diff --git a/dash-renderer/src/observers/prioritizedCallbacks.ts b/dash-renderer/src/observers/prioritizedCallbacks.ts index dfda545878..4651d41411 100644 --- a/dash-renderer/src/observers/prioritizedCallbacks.ts +++ b/dash-renderer/src/observers/prioritizedCallbacks.ts @@ -114,7 +114,7 @@ const observer: IStoreObserverDefinition = { } if (pickedAsyncCallbacks.length) { - const deffered = map( + const deferred = map( cb => ({ ...cb, ...getStash(cb, paths), @@ -126,7 +126,7 @@ const observer: IStoreObserverDefinition = { dispatch( aggregateCallbacks([ removePrioritizedCallbacks(pickedAsyncCallbacks), - addBlockedCallbacks(deffered) + addBlockedCallbacks(deferred) ]) ); @@ -165,7 +165,7 @@ const observer: IStoreObserverDefinition = { addExecutingCallbacks([executingCallback]) ]) ); - }, deffered); + }, deferred); } }, inputs: ['callbacks.prioritized', 'callbacks.completed'] diff --git a/dash-renderer/src/reducers/profile.js b/dash-renderer/src/reducers/profile.js index 28ba2d0ec1..2e70dd9b83 100644 --- a/dash-renderer/src/reducers/profile.js +++ b/dash-renderer/src/reducers/profile.js @@ -28,7 +28,7 @@ const defaultState = { const profile = (state = defaultState, action) => { if (action.type === 'UPDATE_RESOURCE_USAGE') { // Keep a record of the most recent change. This - // is subtly different from history.present becasue + // is subtly different from history.present because // it watches all props, not just inputs. const {id, usage, status} = action.payload; const statusMapped = STATUSMAP[status] || status; diff --git a/dash/__init__.py b/dash/__init__.py index 647c457edd..0449329627 100644 --- a/dash/__init__.py +++ b/dash/__init__.py @@ -1,7 +1,11 @@ -from .dash import Dash, no_update # noqa: F401 -from . import dependencies # noqa: F401 -from . import development # noqa: F401 -from . import exceptions # noqa: F401 -from . import resources # noqa: F401 -from .version import __version__ # noqa: F401 -from ._callback_context import callback_context # noqa: F401 +# pylint: disable=C0413 +# __plotly_dash is for the "make sure you don't have a dash.py" check +# must come before any other imports. +__plotly_dash = True +from .dash import Dash, no_update # noqa: F401,E402 +from . import dependencies # noqa: F401,E402 +from . import development # noqa: F401,E402 +from . import exceptions # noqa: F401,E402 +from . import resources # noqa: F401,E402 +from .version import __version__ # noqa: F401,E402 +from ._callback_context import callback_context # noqa: F401,E402 diff --git a/dash/_utils.py b/dash/_utils.py index 51c476c9c3..d073bf6e6d 100644 --- a/dash/_utils.py +++ b/dash/_utils.py @@ -65,8 +65,12 @@ def get_relative_path(requests_pathname, path): return requests_pathname elif not path.startswith("/"): raise exceptions.UnsupportedRelativePath( - "Paths that aren't prefixed with a leading / are not supported.\n" - + "You supplied: {}".format(path) + """ + Paths that aren't prefixed with a leading / are not supported. + You supplied: {} + """.format( + path + ) ) return "/".join([requests_pathname.rstrip("/"), path.lstrip("/")]) @@ -78,9 +82,10 @@ def strip_relative_path(requests_pathname, path): requests_pathname != "/" and not path.startswith(requests_pathname.rstrip("/")) ) or (requests_pathname == "/" and not path.startswith("/")): raise exceptions.UnsupportedRelativePath( - "Paths that aren't prefixed with a leading " - + "requests_pathname_prefix are not supported.\n" - + "You supplied: {} and requests_pathname_prefix was {}".format( + """ + Paths that aren't prefixed with requests_pathname_prefix are not supported. + You supplied: {} and requests_pathname_prefix was {} + """.format( path, requests_pathname ) ) diff --git a/dash/_validate.py b/dash/_validate.py index 76047242a6..d06856bc8c 100644 --- a/dash/_validate.py +++ b/dash/_validate.py @@ -1,5 +1,6 @@ import collections import re +from textwrap import dedent from .development.base_component import Component from . import exceptions @@ -15,26 +16,26 @@ def validate_callback(output, inputs, state, extra_args, types): if extra_args: if not isinstance(extra_args[0], (Output, Input, State)): raise exceptions.IncorrectTypeException( - """ - Callback arguments must be `Output`, `Input`, or `State` objects, - optionally wrapped in a list or tuple. We found (possibly after - unwrapping a list or tuple): - {} - """.format( - repr(extra_args[0]) - ) + dedent( + """ + Callback arguments must be `Output`, `Input`, or `State` objects, + optionally wrapped in a list or tuple. We found (possibly after + unwrapping a list or tuple): + {} + """ + ).format(repr(extra_args[0])) ) raise exceptions.IncorrectTypeException( - """ - In a callback definition, you must provide all Outputs first, - then all Inputs, then all States. After this item: - {} - we found this item next: - {} - """.format( - repr((outputs + inputs + state)[-1]), repr(extra_args[0]) - ) + dedent( + """ + In a callback definition, you must provide all Outputs first, + then all Inputs, then all States. After this item: + {} + we found this item next: + {} + """ + ).format(repr((outputs + inputs + state)[-1]), repr(extra_args[0])) ) for args in [outputs, inputs, state]: @@ -45,11 +46,11 @@ def validate_callback(output, inputs, state, extra_args, types): def validate_callback_arg(arg): if not isinstance(getattr(arg, "component_property", None), _strings): raise exceptions.IncorrectTypeException( - """ - component_property must be a string, found {!r} - """.format( - arg.component_property - ) + dedent( + """ + component_property must be a string, found {!r} + """ + ).format(arg.component_property) ) if hasattr(arg, "component_event"): @@ -68,11 +69,11 @@ def validate_callback_arg(arg): else: raise exceptions.IncorrectTypeException( - """ - component_id must be a string or dict, found {!r} - """.format( - arg.component_id - ) + dedent( + """ + component_id must be a string or dict, found {!r} + """ + ).format(arg.component_id) ) @@ -85,12 +86,12 @@ def validate_id_dict(arg): # cause unwanted collisions if not isinstance(k, _strings): raise exceptions.IncorrectTypeException( - """ - Wildcard ID keys must be non-empty strings, - found {!r} in id {!r} - """.format( - k, arg_id - ) + dedent( + """ + Wildcard ID keys must be non-empty strings, + found {!r} in id {!r} + """ + ).format(k, arg_id) ) @@ -113,13 +114,13 @@ def validate_id_string(arg): def validate_multi_return(outputs_list, output_value, callback_id): if not isinstance(output_value, (list, tuple)): raise exceptions.InvalidCallbackReturnValue( - """ - The callback {} is a multi-output. - Expected the output type to be a list or tuple but got: - {}. - """.format( - callback_id, repr(output_value) - ) + dedent( + """ + The callback {} is a multi-output. + Expected the output type to be a list or tuple but got: + {}. + """ + ).format(callback_id, repr(output_value)) ) if len(output_value) != len(outputs_list): @@ -137,26 +138,26 @@ def validate_multi_return(outputs_list, output_value, callback_id): vi = output_value[i] if not isinstance(vi, (list, tuple)): raise exceptions.InvalidCallbackReturnValue( - """ - The callback {} output {} is a wildcard multi-output. - Expected the output type to be a list or tuple but got: - {}. - output spec: {} - """.format( - callback_id, i, repr(vi), repr(outi) - ) + dedent( + """ + The callback {} output {} is a wildcard multi-output. + Expected the output type to be a list or tuple but got: + {}. + output spec: {} + """ + ).format(callback_id, i, repr(vi), repr(outi)) ) if len(vi) != len(outi): raise exceptions.InvalidCallbackReturnValue( - """ - Invalid number of output values for {} item {}. - Expected {}, got {} - output spec: {} - output value: {} - """.format( - callback_id, i, len(vi), len(outi), repr(outi), repr(vi) - ) + dedent( + """ + Invalid number of output values for {} item {}. + Expected {}, got {} + output spec: {} + output value: {} + """ + ).format(callback_id, i, len(vi), len(outi), repr(outi), repr(vi)) ) @@ -170,34 +171,38 @@ def _raise_invalid(bad_val, outer_val, path, index=None, toplevel=False): ) outer_type = type(outer_val).__name__ if toplevel: - location = """ - The value in question is either the only value returned, - or is in the top level of the returned list, - """ + location = dedent( + """ + The value in question is either the only value returned, + or is in the top level of the returned list, + """ + ) else: index_string = "[*]" if index is None else "[{:d}]".format(index) - location = """ - The value in question is located at - {} {} {} - {}, - """.format( - index_string, outer_type, outer_id, path - ) + location = dedent( + """ + The value in question is located at + {} {} {} + {}, + """ + ).format(index_string, outer_type, outer_id, path) raise exceptions.InvalidCallbackReturnValue( - """ - The callback for `{output}` - returned a {object:s} having type `{type}` - which is not JSON serializable. + dedent( + """ + The callback for `{output}` + returned a {object:s} having type `{type}` + which is not JSON serializable. - {location} - and has string representation - `{bad_val}` + {location} + and has string representation + `{bad_val}` - In general, Dash properties can only be - dash components, strings, dictionaries, numbers, None, - or lists of those. - """.format( + In general, Dash properties can only be + dash components, strings, dictionaries, numbers, None, + or lists of those. + """ + ).format( output=repr(output), object="tree with one value" if not toplevel else "value", type=bad_type, diff --git a/dash/dash.py b/dash/dash.py index 54fc4c9be5..34f6652bb7 100644 --- a/dash/dash.py +++ b/dash/dash.py @@ -150,10 +150,12 @@ class Dash(object): :type assets_ignore: string :param assets_external_path: an absolute URL from which to load assets. - Use with ``serve_locally=False``. Dash can still find js and css to - automatically load if you also keep local copies in your assets - folder that Dash can index, but external serving can improve - performance and reduce load on the Dash server. + Use with ``serve_locally=False``. assets_external_path is joined + with assets_url_path to determine the absolute url to the + asset folder. Dash can still find js and css to automatically load + if you also keep local copies in your assets folder that Dash can index, + but external serving can improve performance and reduce load on + the Dash server. env: ``DASH_ASSETS_EXTERNAL_PATH`` :type assets_external_path: string @@ -1098,9 +1100,7 @@ def _setup_server(self): def _add_assets_resource(self, url_path, file_path): res = {"asset_path": url_path, "filepath": file_path} if self.config.assets_external_path: - res["external_url"] = "{}{}".format( - self.config.assets_external_path, url_path - ) + res["external_url"] = self.get_asset_url(url_path.lstrip("/")) self._assets_files.append(file_path) return res @@ -1185,11 +1185,12 @@ def csp_hashes(self, hash_algorithm="sha256"): ] def get_asset_url(self, path): - asset = get_asset_path( - self.config.requests_pathname_prefix, - path, - self.config.assets_url_path.lstrip("/"), - ) + if self.config.assets_external_path: + prefix = self.config.assets_external_path + else: + prefix = self.config.requests_pathname_prefix + + asset = get_asset_path(prefix, path, self.config.assets_url_path.lstrip("/")) return asset diff --git a/dash/development/_jl_components_generation.py b/dash/development/_jl_components_generation.py index 981b249d31..642221d678 100644 --- a/dash/development/_jl_components_generation.py +++ b/dash/development/_jl_components_generation.py @@ -4,7 +4,6 @@ import copy import os import shutil -import glob import warnings import sys import importlib @@ -526,14 +525,21 @@ def generate_module( os.makedirs("deps") - for javascript in glob.glob("{}/*.js".format(project_shortname)): - shutil.copy(javascript, "deps/") + for rel_dirname, _, filenames in os.walk(project_shortname): + for filename in filenames: + extension = os.path.splitext(filename)[1] - for css in glob.glob("{}/*.css".format(project_shortname)): - shutil.copy(css, "deps/") + if extension in [".py", ".pyc", ".json"]: + continue - for sourcemap in glob.glob("{}/*.map".format(project_shortname)): - shutil.copy(sourcemap, "deps/") + target_dirname = os.path.join( + "deps/", os.path.relpath(rel_dirname, project_shortname) + ) + + if not os.path.exists(target_dirname): + os.makedirs(target_dirname) + + shutil.copy(os.path.join(rel_dirname, filename), target_dirname) generate_package_file(project_shortname, components, pkg_data, prefix) generate_toml_file(project_shortname, pkg_data) diff --git a/dash/resources.py b/dash/resources.py index 5d0d8a1ac6..65f8e088a4 100644 --- a/dash/resources.py +++ b/dash/resources.py @@ -24,8 +24,12 @@ def _filter_resources(self, all_resources, dev_bundles=False): if "async" in s: if "dynamic" in s: raise exceptions.ResourceException( - "Can't have both 'dynamic' and 'async'. " - "{}".format(json.dumps(filtered_resource)) + """ + Can't have both 'dynamic' and 'async'. + {} + """.format( + json.dumps(filtered_resource) + ) ) # Async assigns a value dynamically to 'dynamic' @@ -70,9 +74,12 @@ def _filter_resources(self, all_resources, dev_bundles=False): continue else: raise exceptions.ResourceException( - "{} does not have a " - "relative_package_path, absolute_path, or an " - "external_url.".format(json.dumps(filtered_resource)) + """ + {} does not have a relative_package_path, absolute_path, + or an external_url. + """.format( + json.dumps(filtered_resource) + ) ) filtered_resources.append(filtered_resource) diff --git a/dash/testing/application_runners.py b/dash/testing/application_runners.py index 3a08b41087..d2c2b898a8 100644 --- a/dash/testing/application_runners.py +++ b/dash/testing/application_runners.py @@ -125,7 +125,7 @@ def _stop_server(): stopper() return "Flask server is shutting down" - # pylint: disable=arguments-differ,C0330 + # pylint: disable=arguments-differ def start(self, app, **kwargs): """Start the app server in threading flavor.""" app.server.add_url_rule(self.stop_route, self.stop_route, self._stop_server) diff --git a/dash/testing/browser.py b/dash/testing/browser.py index cbaac4e8fa..4a09d2a19b 100644 --- a/dash/testing/browser.py +++ b/dash/testing/browser.py @@ -358,9 +358,9 @@ def wait_for_page(self, url=None, timeout=10): if self._pause: try: - import pdb as pdb_ + import pdb as pdb_ # pylint: disable=import-outside-toplevel except ImportError: - import ipdb as pdb_ + import ipdb as pdb_ # pylint: disable=import-outside-toplevel pdb_.set_trace() @@ -431,6 +431,7 @@ def _get_chrome(self): capabilities = DesiredCapabilities.CHROME capabilities["loggingPrefs"] = {"browser": "SEVERE"} + capabilities["goog:loggingPrefs"] = {"browser": "SEVERE"} if "DASH_TEST_CHROMEPATH" in os.environ: options.binary_location = os.environ["DASH_TEST_CHROMEPATH"] diff --git a/dash/testing/plugin.py b/dash/testing/plugin.py index 0f2a8d313b..69699747c6 100644 --- a/dash/testing/plugin.py +++ b/dash/testing/plugin.py @@ -65,7 +65,7 @@ def pytest_addoption(parser): def pytest_addhooks(pluginmanager): # https://github.com/pytest-dev/pytest-xdist/blob/974bd566c599dc6a9ea291838c6f226197208b46/xdist/plugin.py#L67 # avoid warnings with pytest-2.8 - from dash.testing import newhooks + from dash.testing import newhooks # pylint: disable=import-outside-toplevel method = getattr(pluginmanager, "add_hookspecs", None) if method is None: diff --git a/dash/version.py b/dash/version.py index 4a7bff5447..d84d79d43f 100644 --- a/dash/version.py +++ b/dash/version.py @@ -1 +1 @@ -__version__ = "1.18.1" +__version__ = "1.19.0" diff --git a/package.json b/package.json index a39ad82e26..973f38f797 100644 --- a/package.json +++ b/package.json @@ -22,6 +22,7 @@ "private::test.unit-dash": "pytest tests/unit", "private::test.unit-renderer": "cd dash-renderer && npm run test", "private::test.integration-dash": "TESTFILES=$(circleci tests glob \"tests/integration/**/test_*.py\" | circleci tests split --split-by=timings) && pytest --headless --nopercyfinalize --junitxml=test-reports/junit_intg.xml ${TESTFILES}", + "private::test.integration-dash-import": "cd tests/integration/dash && python dash_import_test.py", "format": "run-s private::format.*", "initialize": "run-s private::initialize.*", "lint": "run-s private::lint.*", diff --git a/requires-dev.txt b/requires-dev.txt index 86dbb809c1..febe2bee40 100644 --- a/requires-dev.txt +++ b/requires-dev.txt @@ -1,14 +1,15 @@ dash_flow_example==0.0.5 dash-dangerously-set-inner-html -isort==4.3.21 -mock==4.0.1;python_version>="3.0" +isort==4.3.21;python_version<"3.7" +mock==4.0.3;python_version>="3.0" mock==3.0.5;python_version=="2.7" -flake8==3.7.9 -PyYAML==5.3 -pylint==1.9.4;python_version<"3.7" -pylint==2.3.1;python_version=="3.7" -astroid==2.2.5;python_version=="3.7" +flake8==3.8.4 +PyYAML==5.3.1 +pylint==1.9.5;python_version<"3.7" +pylint==2.6.0;python_version>="3.7" +astroid==2.4.2;python_version>="3.7" black==19.10b0;python_version>="3.0" -virtualenv==20.0.10;python_version=="2.7" -fire==0.2.1 -coloredlogs==14.0 +virtualenv==20.2.2;python_version=="2.7" +fire==0.3.1 +coloredlogs==15.0 +flask-talisman==0.7.0 diff --git a/requires-install.txt b/requires-install.txt index 0ee466a2bb..141271a8d8 100644 --- a/requires-install.txt +++ b/requires-install.txt @@ -1,8 +1,8 @@ Flask>=1.0.4 flask-compress plotly -dash_renderer==1.8.3 -dash-core-components==1.14.1 -dash-html-components==1.1.1 -dash-table==4.11.1 +dash_renderer==1.9.0 +dash-core-components==1.15.0 +dash-html-components==1.1.2 +dash-table==4.11.2 future diff --git a/requires-testing.txt b/requires-testing.txt index f22a1bf729..8634ae4e8e 100644 --- a/requires-testing.txt +++ b/requires-testing.txt @@ -1,13 +1,12 @@ -pytest==6.0.1;python_version>="3.0" -pytest==4.6.9;python_version=="2.7" -pytest-sugar==0.9.4 -pytest-mock==3.2.0;python_version>="3.0" -pytest-mock==2.0.0;python_version=="2.7" -lxml==4.6.1 -selenium==3.141.0 -percy==2.0.2 -cryptography==3.0 -requests[security]==2.21.0 -beautifulsoup4==4.8.2 -waitress==1.4.3 -flask-talisman==0.7.0 +pytest>=6.0.2;python_version>="3.0" +pytest>=4.6,<5;python_version=="2.7" +pytest-sugar>=0.9.4 +pytest-mock>=3.2.0;python_version>="3.0" +pytest-mock>=2.0.0,<3;python_version=="2.7" +lxml>=4.6.2 +selenium>=3.141.0 +percy>=2.0.2 +requests[security]>=2.21.0 +beautifulsoup4>=4.8.2,<=4.9.3;python_version=="2.7" +beautifulsoup4>=4.8.2;python_version>="3.0" +waitress>=1.4.4 diff --git a/tests/integration/IntegrationTests.py b/tests/integration/IntegrationTests.py deleted file mode 100644 index 597acba912..0000000000 --- a/tests/integration/IntegrationTests.py +++ /dev/null @@ -1,138 +0,0 @@ -import os -import sys -import time -import unittest -import multiprocessing - -import percy -from selenium import webdriver -from selenium.webdriver.chrome.options import Options -from selenium.webdriver.common.by import By -from selenium.webdriver.common.desired_capabilities import DesiredCapabilities -from selenium.webdriver.support.ui import WebDriverWait -from selenium.webdriver.support import expected_conditions as EC - -TIMEOUT = 5 - - -class SeleniumDriverTimeout(Exception): - pass - - -class IntegrationTests(unittest.TestCase): - - last_timestamp = 0 - - @classmethod - def setUpClass(cls): - super(IntegrationTests, cls).setUpClass() - - options = Options() - options.add_argument("--no-sandbox") - - capabilities = DesiredCapabilities.CHROME - capabilities["loggingPrefs"] = {"browser": "SEVERE"} - - if "DASH_TEST_CHROMEPATH" in os.environ: - options.binary_location = os.environ["DASH_TEST_CHROMEPATH"] - - cls.driver = webdriver.Chrome( - options=options, - desired_capabilities=capabilities, - service_args=["--verbose", "--log-path=chrome.log"], - ) - - cls.percy_runner = percy.Runner( - loader=percy.ResourceLoader( - webdriver=cls.driver, base_url="/assets", root_dir="tests/assets" - ) - ) - - cls.percy_runner.initialize_build() - - @classmethod - def tearDownClass(cls): - super(IntegrationTests, cls).tearDownClass() - cls.driver.quit() - cls.percy_runner.finalize_build() - - def setUp(self): - self.server_process = None - - def tearDown(self): - try: - time.sleep(1.5) - self.server_process.terminate() - time.sleep(1) - except AttributeError: - pass - finally: - self.clear_log() - time.sleep(1) - - def startServer(self, dash, **kwargs): - def run(): - dash.scripts.config.serve_locally = True - dash.css.config.serve_locally = True - kws = dict(port=8050, debug=False, processes=4, threaded=False) - kws.update(kwargs) - dash.run_server(**kws) - - # Run on a separate process so that it doesn't block - self.server_process = multiprocessing.Process(target=run) - self.server_process.start() - time.sleep(0.5) - - # Visit the dash page - self.driver.implicitly_wait(2) - self.driver.get("http://localhost:8050") - - def percy_snapshot(self, name=""): - snapshot_name = "{} - py{}.{}".format( - name, sys.version_info.major, sys.version_info.minor - ) - print(snapshot_name) - self.percy_runner.snapshot(name=snapshot_name) - - def wait_for_element_by_css_selector(self, selector, timeout=TIMEOUT): - return WebDriverWait(self.driver, timeout).until( - EC.presence_of_element_located((By.CSS_SELECTOR, selector)), - 'Could not find element with selector "{}"'.format(selector), - ) - - def wait_for_text_to_equal(self, selector, assertion_text, timeout=TIMEOUT): - el = self.wait_for_element_by_css_selector(selector) - WebDriverWait(self.driver, timeout).until( - lambda *args: ( - (str(el.text) == assertion_text) - or (str(el.get_attribute("value")) == assertion_text) - ), - "Element '{}' text was supposed to equal '{}' but it didn't".format( - selector, assertion_text - ), - ) - - def clear_log(self): - entries = self.driver.get_log("browser") - if entries: - self.last_timestamp = entries[-1]["timestamp"] - - def get_log(self): - entries = self.driver.get_log("browser") - return [entry for entry in entries if entry["timestamp"] > self.last_timestamp] - - def wait_until_get_log(self, timeout=10): - - logs = None - cnt, poll = 0, 0.1 - while not logs: - logs = self.get_log() - time.sleep(poll) - cnt += 1 - if cnt * poll >= timeout * 1000: - raise SeleniumDriverTimeout("cannot get log in {}".format(timeout)) - - return logs - - def is_console_clean(self): - return not self.get_log() diff --git a/tests/integration/callbacks/test_basic_callback.py b/tests/integration/callbacks/test_basic_callback.py index 693b1ea147..8deb0ea6b7 100644 --- a/tests/integration/callbacks/test_basic_callback.py +++ b/tests/integration/callbacks/test_basic_callback.py @@ -1,6 +1,7 @@ import json from multiprocessing import Lock, Value import pytest +import time import dash_core_components as dcc import dash_html_components as html @@ -449,3 +450,249 @@ def content(n, d, v): wait.until( lambda: dash_duo.find_element("#output").text == '[1, 2, "A"]', 3, ) + + +def test_cbsc010_event_properties(dash_duo): + app = dash.Dash(__name__) + app.layout = html.Div([html.Button("Click Me", id="button"), html.Div(id="output")]) + + call_count = Value("i", 0) + + @app.callback(Output("output", "children"), [Input("button", "n_clicks")]) + def update_output(n_clicks): + if not n_clicks: + raise PreventUpdate + call_count.value += 1 + return "Click" + + dash_duo.start_server(app) + dash_duo.wait_for_text_to_equal("#output", "") + assert call_count.value == 0 + + dash_duo.find_element("#button").click() + dash_duo.wait_for_text_to_equal("#output", "Click") + assert call_count.value == 1 + + +def test_cbsc011_one_call_for_multiple_outputs_initial(dash_duo): + app = dash.Dash(__name__) + call_count = Value("i", 0) + + app.layout = html.Div( + [ + html.Div( + [ + dcc.Input(value="Input {}".format(i), id="input-{}".format(i)) + for i in range(10) + ] + ), + html.Div(id="container"), + dcc.RadioItems(), + ] + ) + + @app.callback( + Output("container", "children"), + [Input("input-{}".format(i), "value") for i in range(10)], + ) + def dynamic_output(*args): + call_count.value += 1 + return json.dumps(args, indent=2) + + dash_duo.start_server(app) + dash_duo.wait_for_text_to_equal("#input-9", "Input 9") + + assert call_count.value == 1 + dash_duo.percy_snapshot("test_rendering_layout_calls_callback_once_per_output") + + +def test_cbsc012_one_call_for_multiple_outputs_update(dash_duo): + app = dash.Dash(__name__, suppress_callback_exceptions=True) + call_count = Value("i", 0) + + app.layout = html.Div( + [ + html.Button(id="display-content", children="Display Content"), + html.Div(id="container"), + dcc.RadioItems(), + ] + ) + + @app.callback(Output("container", "children"), Input("display-content", "n_clicks")) + def display_output(n_clicks): + if not n_clicks: + return "" + return html.Div( + [ + html.Div( + [ + dcc.Input(value="Input {}".format(i), id="input-{}".format(i)) + for i in range(10) + ] + ), + html.Div(id="dynamic-output"), + ] + ) + + @app.callback( + Output("dynamic-output", "children"), + [Input("input-{}".format(i), "value") for i in range(10)], + ) + def dynamic_output(*args): + call_count.value += 1 + return json.dumps(args, indent=2) + + dash_duo.start_server(app) + + dash_duo.find_element("#display-content").click() + + dash_duo.wait_for_text_to_equal("#input-9", "Input 9") + assert call_count.value == 1 + + dash_duo.percy_snapshot("test_rendering_new_content_calls_callback_once_per_output") + + +def test_cbsc013_multi_output_out_of_order(dash_duo): + app = dash.Dash(__name__) + app.layout = html.Div( + [ + html.Button(id="input", n_clicks=0), + html.Div(id="output1"), + html.Div(id="output2"), + ] + ) + + call_count = Value("i", 0) + lock = Lock() + + @app.callback( + Output("output1", "children"), + Output("output2", "children"), + Input("input", "n_clicks"), + ) + def update_output(n_clicks): + call_count.value += 1 + if n_clicks == 1: + with lock: + pass + return n_clicks, n_clicks + 1 + + dash_duo.start_server(app) + + button = dash_duo.find_element("#input") + with lock: + button.click() + button.click() + + dash_duo.wait_for_text_to_equal("#output1", "2") + dash_duo.wait_for_text_to_equal("#output2", "3") + assert call_count.value == 3 + dash_duo.percy_snapshot( + "test_callbacks_called_multiple_times_and_out_of_order_multi_output" + ) + assert dash_duo.driver.execute_script("return !window.store.getState().isLoading;") + + +def test_cbsc014_multiple_properties_update_at_same_time_on_same_component(dash_duo): + call_count = Value("i", 0) + timestamp_1 = Value("d", -5) + timestamp_2 = Value("d", -5) + + app = dash.Dash(__name__) + app.layout = html.Div( + [ + html.Div(id="container"), + html.Button("Click", id="button-1", n_clicks=0, n_clicks_timestamp=-1), + html.Button("Click", id="button-2", n_clicks=0, n_clicks_timestamp=-1), + ] + ) + + @app.callback( + Output("container", "children"), + Input("button-1", "n_clicks"), + Input("button-1", "n_clicks_timestamp"), + Input("button-2", "n_clicks"), + Input("button-2", "n_clicks_timestamp"), + ) + def update_output(n1, t1, n2, t2): + call_count.value += 1 + timestamp_1.value = t1 + timestamp_2.value = t2 + return "{}, {}".format(n1, n2) + + dash_duo.start_server(app) + + dash_duo.wait_for_text_to_equal("#container", "0, 0") + assert timestamp_1.value == -1 + assert timestamp_2.value == -1 + assert call_count.value == 1 + dash_duo.percy_snapshot("button initialization 1") + + dash_duo.find_element("#button-1").click() + dash_duo.wait_for_text_to_equal("#container", "1, 0") + assert timestamp_1.value > ((time.time() - (24 * 60 * 60)) * 1000) + assert timestamp_2.value == -1 + assert call_count.value == 2 + dash_duo.percy_snapshot("button-1 click") + prev_timestamp_1 = timestamp_1.value + + dash_duo.find_element("#button-2").click() + dash_duo.wait_for_text_to_equal("#container", "1, 1") + assert timestamp_1.value == prev_timestamp_1 + assert timestamp_2.value > ((time.time() - 24 * 60 * 60) * 1000) + assert call_count.value == 3 + dash_duo.percy_snapshot("button-2 click") + prev_timestamp_2 = timestamp_2.value + + dash_duo.find_element("#button-2").click() + dash_duo.wait_for_text_to_equal("#container", "1, 2") + assert timestamp_1.value == prev_timestamp_1 + assert timestamp_2.value > prev_timestamp_2 + assert timestamp_2.value > timestamp_1.value + assert call_count.value == 4 + dash_duo.percy_snapshot("button-2 click again") + + +def test_cbsc015_input_output_callback(dash_duo): + lock = Lock() + + app = dash.Dash(__name__) + app.layout = html.Div( + [html.Div("0", id="input-text"), dcc.Input(id="input", type="number", value=0)] + ) + + @app.callback( + Output("input", "value"), Input("input", "value"), + ) + def circular_output(v): + ctx = dash.callback_context + if not ctx.triggered: + value = v + else: + value = v + 1 + return value + + call_count = Value("i", 0) + + @app.callback( + Output("input-text", "children"), Input("input", "value"), + ) + def follower_output(v): + with lock: + call_count.value = call_count.value + 1 + return str(v) + + dash_duo.start_server(app) + + input_ = dash_duo.find_element("#input") + for key in "2": + with lock: + input_.send_keys(key) + + wait.until(lambda: dash_duo.find_element("#input-text").text == "3", 2) + + assert call_count.value == 2, "initial + changed once" + + assert not dash_duo.redux_state_is_loading + + assert dash_duo.get_logs() == [] diff --git a/tests/integration/callbacks/test_callback_context.py b/tests/integration/callbacks/test_callback_context.py index 3eabe92e64..bb146d0013 100644 --- a/tests/integration/callbacks/test_callback_context.py +++ b/tests/integration/callbacks/test_callback_context.py @@ -154,6 +154,7 @@ def click(target): ActionChains(dash_duo.driver).move_to_element_with_offset( target, 5, 5 ).click().perform() + dash_duo._wait_for_callbacks() dash_duo.start_server(app) click(dash_duo.find_element("#btn0")) diff --git a/tests/integration/callbacks/test_missing_outputs.py b/tests/integration/callbacks/test_missing_outputs.py index 17d9f28bfb..694fcbc129 100644 --- a/tests/integration/callbacks/test_missing_outputs.py +++ b/tests/integration/callbacks/test_missing_outputs.py @@ -1,11 +1,14 @@ import pytest +from multiprocessing import Lock, Value -import dash_html_components as html -# import dash_core_components as dcc +import dash_html_components as html +import dash_core_components as dcc import dash from dash.dependencies import Input, Output, ALL, MATCH +from dash.testing.wait import until + debugging = dict( debug=True, use_reloader=False, use_debugger=True, dev_tools_hot_reload=False ) @@ -25,7 +28,7 @@ def test_cbmo001_all_output(with_simple, dash_duo): ) @app.callback(Output("content", "children"), [Input("items", "n_clicks")]) - def content(n1): + def set_content(n1): return [html.Div(id={"i": i}) for i in range((n1 or 0) % 4)] # these two variants have identical results, but the internal behavior @@ -99,7 +102,7 @@ def test_cbmo002_all_and_match_output(with_simple, dash_duo): ) @app.callback(Output("content", "children"), [Input("items", "n_clicks")]) - def content(n1): + def set_content(n1): return [ html.Div( [ @@ -259,3 +262,80 @@ def out2(ci, cj): dash_duo.wait_for_text_to_equal("#output", output) assert not dash_duo.get_logs() + + +def test_cbmo004_removing_element_while_waiting_to_update(dash_duo): + app = dash.Dash(__name__, suppress_callback_exceptions=True) + app.layout = html.Div( + [ + dcc.RadioItems( + id="toc", + options=[{"label": i, "value": i} for i in ["1", "2"]], + value="1", + ), + html.Div(id="body"), + ] + ) + + call_counts = {"body": Value("i", 0), "button-output": Value("i", 0)} + lock = Lock() + + @app.callback(Output("body", "children"), Input("toc", "value")) + def update_body(chapter): + call_counts["body"].value += 1 + if chapter == "1": + return [ + html.Div("Chapter 1", id="ch1-title"), + html.Button("clicking this button takes forever", id="button"), + html.Div(id="button-output"), + ] + elif chapter == "2": + return "Chapter 2" + else: + raise Exception("chapter is {}".format(chapter)) + + @app.callback(Output("button-output", "children"), Input("button", "n_clicks")) + def this_callback_takes_forever(n_clicks): + if not n_clicks: + # initial value is quick, only new value is slow + # also don't let the initial value increment call_counts + return "Initial Value" + + with lock: + call_counts["button-output"].value += 1 + return "New value!" + + dash_duo.start_server(app) + + dash_duo.wait_for_text_to_equal("#ch1-title", "Chapter 1") + assert call_counts["body"].value == 1 + + # while that callback is resolving, switch the chapter, + # hiding the `button-output` tag + def chapter2_assertions(): + dash_duo.wait_for_text_to_equal("#body", "Chapter 2") + + layout = dash_duo.driver.execute_script( + "return JSON.parse(JSON.stringify(" "window.store.getState().layout" "))" + ) + + dcc_radio = layout["props"]["children"][0] + html_body = layout["props"]["children"][1] + + assert dcc_radio["props"]["id"] == "toc" + assert dcc_radio["props"]["value"] == "2" + + assert html_body["props"]["id"] == "body" + assert html_body["props"]["children"] == "Chapter 2" + + with lock: + dash_duo.find_element("#button").click() + + (dash_duo.find_elements('input[type="radio"]')[1]).click() + chapter2_assertions() + assert call_counts["button-output"].value == 0 + + until(lambda: call_counts["button-output"].value == 1, 3) + dash_duo._wait_for_callbacks() + chapter2_assertions() + assert not dash_duo.get_logs() diff --git a/tests/integration/callbacks/test_multiple_callbacks.py b/tests/integration/callbacks/test_multiple_callbacks.py index 8c081d2cad..65022d24f5 100644 --- a/tests/integration/callbacks/test_multiple_callbacks.py +++ b/tests/integration/callbacks/test_multiple_callbacks.py @@ -305,3 +305,281 @@ def out(v): # as of https://github.com/plotly/dash/issues/1223, above-out would be 0 dash_duo.wait_for_text_to_equal("#above-out", "42") dash_duo.wait_for_text_to_equal("#below-out", "44") + + +def test_cbmt008_direct_chain(dash_duo): + app = dash.Dash(__name__) + app.layout = html.Div( + [ + dcc.Input(id="input-1", value="input 1"), + dcc.Input(id="input-2"), + html.Div("test", id="output"), + ] + ) + + call_counts = {"output": Value("i", 0), "input-2": Value("i", 0)} + + @app.callback(Output("input-2", "value"), Input("input-1", "value")) + def update_input(input1): + call_counts["input-2"].value += 1 + return "<<{}>>".format(input1) + + @app.callback( + Output("output", "children"), + Input("input-1", "value"), + Input("input-2", "value"), + ) + def update_output(input1, input2): + call_counts["output"].value += 1 + return "{} + {}".format(input1, input2) + + dash_duo.start_server(app) + + dash_duo.wait_for_text_to_equal("#input-1", "input 1") + dash_duo.wait_for_text_to_equal("#input-2", "<>") + dash_duo.wait_for_text_to_equal("#output", "input 1 + <>") + assert call_counts["output"].value == 1 + assert call_counts["input-2"].value == 1 + + dash_duo.find_element("#input-1").send_keys("x") + dash_duo.wait_for_text_to_equal("#input-1", "input 1x") + dash_duo.wait_for_text_to_equal("#input-2", "<>") + dash_duo.wait_for_text_to_equal("#output", "input 1x + <>") + assert call_counts["output"].value == 2 + assert call_counts["input-2"].value == 2 + + dash_duo.find_element("#input-2").send_keys("y") + dash_duo.wait_for_text_to_equal("#input-2", "<>y") + dash_duo.wait_for_text_to_equal("#output", "input 1x + <>y") + dash_duo.wait_for_text_to_equal("#input-1", "input 1x") + assert call_counts["output"].value == 3 + assert call_counts["input-2"].value == 2 + + +def test_cbmt009_branched_chain(dash_duo): + app = dash.Dash(__name__) + app.layout = html.Div( + [ + dcc.Input(id="grandparent", value="input 1"), + dcc.Input(id="parent-a"), + dcc.Input(id="parent-b"), + html.Div(id="child-a"), + html.Div(id="child-b"), + ] + ) + call_counts = { + "parent-a": Value("i", 0), + "parent-b": Value("i", 0), + "child-a": Value("i", 0), + "child-b": Value("i", 0), + } + + @app.callback(Output("parent-a", "value"), Input("grandparent", "value")) + def update_parenta(value): + call_counts["parent-a"].value += 1 + return "a: {}".format(value) + + @app.callback(Output("parent-b", "value"), Input("grandparent", "value")) + def update_parentb(value): + time.sleep(0.2) + call_counts["parent-b"].value += 1 + return "b: {}".format(value) + + @app.callback( + Output("child-a", "children"), + Input("parent-a", "value"), + Input("parent-b", "value"), + ) + def update_childa(parenta_value, parentb_value): + time.sleep(0.5) + call_counts["child-a"].value += 1 + return "{} + {}".format(parenta_value, parentb_value) + + @app.callback( + Output("child-b", "children"), + Input("parent-a", "value"), + Input("parent-b", "value"), + Input("grandparent", "value"), + ) + def update_childb(parenta_value, parentb_value, grandparent_value): + call_counts["child-b"].value += 1 + return "{} + {} + {}".format(parenta_value, parentb_value, grandparent_value) + + dash_duo.start_server(app) + + dash_duo.wait_for_text_to_equal("#child-a", "a: input 1 + b: input 1") + dash_duo.wait_for_text_to_equal("#child-b", "a: input 1 + b: input 1 + input 1") + dash_duo.wait_for_text_to_equal("#parent-a", "a: input 1") + dash_duo.wait_for_text_to_equal("#parent-b", "b: input 1") + assert call_counts["parent-a"].value == 1 + assert call_counts["parent-b"].value == 1 + assert call_counts["child-a"].value == 1 + assert call_counts["child-b"].value == 1 + + +def test_cbmt010_shared_grandparent(dash_duo): + app = dash.Dash(__name__) + + app.layout = html.Div( + [ + html.Div("id", id="session-id"), + dcc.Dropdown(id="dropdown-1"), + dcc.Dropdown(id="dropdown-2"), + html.Div(id="output"), + ] + ) + + options = [{"value": "a", "label": "a"}] + + call_counts = {"dropdown_1": Value("i", 0), "dropdown_2": Value("i", 0)} + + @app.callback( + Output("dropdown-1", "options"), + [Input("dropdown-1", "value"), Input("session-id", "children")], + ) + def dropdown_1(value, session_id): + call_counts["dropdown_1"].value += 1 + return options + + @app.callback( + Output("dropdown-2", "options"), + Input("dropdown-2", "value"), + Input("session-id", "children"), + ) + def dropdown_2(value, session_id): + call_counts["dropdown_2"].value += 1 + return options + + @app.callback( + Output("output", "children"), + Input("dropdown-1", "value"), + Input("dropdown-2", "value"), + ) + def set_output(v1, v2): + return (v1 or "b") + (v2 or "b") + + dash_duo.start_server(app) + + dash_duo.wait_for_text_to_equal("#output", "bb") + assert call_counts["dropdown_1"].value == 1 + assert call_counts["dropdown_2"].value == 1 + + assert not dash_duo.get_logs() + + +def test_cbmt011_callbacks_triggered_on_generated_output(dash_duo): + app = dash.Dash(__name__, suppress_callback_exceptions=True) + + call_counts = {"tab1": Value("i", 0), "tab2": Value("i", 0)} + + app.layout = html.Div( + [ + dcc.Dropdown( + id="outer-controls", + options=[{"label": i, "value": i} for i in ["a", "b"]], + value="a", + ), + dcc.RadioItems( + options=[ + {"label": "Tab 1", "value": 1}, + {"label": "Tab 2", "value": 2}, + ], + value=1, + id="tabs", + ), + html.Div(id="tab-output"), + ] + ) + + @app.callback(Output("tab-output", "children"), Input("tabs", "value")) + def display_content(value): + return html.Div([html.Div(id="tab-{}-output".format(value))]) + + @app.callback(Output("tab-1-output", "children"), Input("outer-controls", "value")) + def display_tab1_output(value): + call_counts["tab1"].value += 1 + return 'Selected "{}" in tab 1'.format(value) + + @app.callback(Output("tab-2-output", "children"), Input("outer-controls", "value")) + def display_tab2_output(value): + call_counts["tab2"].value += 1 + return 'Selected "{}" in tab 2'.format(value) + + dash_duo.start_server(app) + + dash_duo.wait_for_text_to_equal("#tab-output", 'Selected "a" in tab 1') + dash_duo.wait_for_text_to_equal("#tab-1-output", 'Selected "a" in tab 1') + assert call_counts["tab1"].value == 1 + assert call_counts["tab2"].value == 0 + + dash_duo.find_elements('input[type="radio"]')[1].click() + + dash_duo.wait_for_text_to_equal("#tab-output", 'Selected "a" in tab 2') + dash_duo.wait_for_text_to_equal("#tab-2-output", 'Selected "a" in tab 2') + assert call_counts["tab1"].value == 1 + assert call_counts["tab2"].value == 1 + + assert not dash_duo.get_logs() + + +@pytest.mark.parametrize("generate", [False, True]) +def test_cbmt012_initialization_with_overlapping_outputs(generate, dash_duo): + app = dash.Dash(__name__, suppress_callback_exceptions=generate) + block = html.Div( + [ + html.Div(id="input-1", children="input-1"), + html.Div(id="input-2", children="input-2"), + html.Div(id="input-3", children="input-3"), + html.Div(id="input-4", children="input-4"), + html.Div(id="input-5", children="input-5"), + html.Div(id="output-1"), + html.Div(id="output-2"), + html.Div(id="output-3"), + html.Div(id="output-4"), + ] + ) + + call_counts = { + "container": Value("i", 0), + "output-1": Value("i", 0), + "output-2": Value("i", 0), + "output-3": Value("i", 0), + "output-4": Value("i", 0), + } + + if generate: + app.layout = html.Div([html.Div(id="input"), html.Div(id="container")]) + + @app.callback(Output("container", "children"), Input("input", "children")) + def set_content(_): + call_counts["container"].value += 1 + return block + + else: + app.layout = block + + def generate_callback(outputid): + def callback(*args): + call_counts[outputid].value += 1 + return "{}, {}".format(*args) + + return callback + + for i in range(1, 5): + outputid = "output-{}".format(i) + app.callback( + Output(outputid, "children"), + Input("input-{}".format(i), "children"), + Input("input-{}".format(i + 1), "children"), + )(generate_callback(outputid)) + + dash_duo.start_server(app) + + for i in range(1, 5): + outputid = "output-{}".format(i) + dash_duo.wait_for_text_to_equal( + "#{}".format(outputid), "input-{}, input-{}".format(i, i + 1) + ) + assert call_counts[outputid].value == 1 + + assert call_counts["container"].value == (1 if generate else 0) diff --git a/tests/integration/callbacks/test_prevent_update.py b/tests/integration/callbacks/test_prevent_update.py index 248a3e05b3..e5f122f602 100644 --- a/tests/integration/callbacks/test_prevent_update.py +++ b/tests/integration/callbacks/test_prevent_update.py @@ -47,14 +47,15 @@ def callback2(value): dash_duo.start_server(app) input_ = dash_duo.find_element("#input") - input_.send_keys("xyz") - dash_duo.wait_for_text_to_equal("#input", "initial inputxyz") + for i, key in enumerate("xyz"): + input_.send_keys(key) + until( + lambda: callback1_count.value == i + 2, + timeout=3, + msg="callback1 runs 4x (initial page load and 3x through send_keys)", + ) - until( - lambda: callback1_count.value == 4, - timeout=3, - msg="callback1 runs 4x (initial page load and 3x through send_keys)", - ) + dash_duo.wait_for_text_to_equal("#input", "initial inputxyz") assert ( callback2_count.value == 0 diff --git a/tests/integration/clientside/assets/clientside.js b/tests/integration/clientside/assets/clientside.js index eaee0e6a09..71e8dc0abe 100644 --- a/tests/integration/clientside/assets/clientside.js +++ b/tests/integration/clientside/assets/clientside.js @@ -81,5 +81,22 @@ window.dash_clientside.clientside = { states_list_to_str: function(val0, val1, st0, st1) { return JSON.stringify(dash_clientside.callback_context.states_list); + }, + + input_output_callback: function(inputValue) { + const triggered = dash_clientside.callback_context.triggered; + if (triggered.length==0){ + return inputValue; + } else { + return inputValue + 1; + } + }, + + input_output_follower: function(inputValue) { + if (!window.callCount) { + window.callCount = 0 + } + window.callCount += 1; + return inputValue.toString(); } }; diff --git a/tests/integration/clientside/test_clientside.py b/tests/integration/clientside/test_clientside.py index f3239ba6bc..c8b2629cad 100644 --- a/tests/integration/clientside/test_clientside.py +++ b/tests/integration/clientside/test_clientside.py @@ -683,3 +683,37 @@ def test_clsd013_clientside_callback_context_states_list(dash_duo): '{"id":{"in1":2},"property":"value","value":"test 2"}]]' ), ) + + +def test_clsd014_input_output_callback(dash_duo): + app = Dash(__name__, assets_folder="assets") + + app.layout = html.Div( + [html.Div(id="input-text"), dcc.Input(id="input", type="number", value=0)] + ) + + app.clientside_callback( + ClientsideFunction( + namespace="clientside", function_name="input_output_callback" + ), + Output("input", "value"), + Input("input", "value"), + ) + + app.clientside_callback( + ClientsideFunction( + namespace="clientside", function_name="input_output_follower" + ), + Output("input-text", "children"), + Input("input", "value"), + ) + + dash_duo.start_server(app) + + dash_duo.find_element("#input").send_keys("2") + dash_duo.wait_for_text_to_equal("#input-text", "3") + call_count = dash_duo.driver.execute_script("return window.callCount;") + + assert call_count == 2, "initial + changed once" + + assert dash_duo.get_logs() == [] diff --git a/tests/integration/dash/dash_import_test.py b/tests/integration/dash/dash_import_test.py new file mode 100644 index 0000000000..f9b1ddf89e --- /dev/null +++ b/tests/integration/dash/dash_import_test.py @@ -0,0 +1,15 @@ +# NOTE: this is NOT a pytest test. Just run it as a regular Python script. +# pytest does some magic that makes the issue we're trying to test disappear. + +import types +import os + +import dash + +assert isinstance(dash, types.ModuleType), "dash can be imported" + +this_dir = os.path.dirname(__file__) +with open(os.path.join(this_dir, "../../../dash/version.py")) as fp: + assert dash.__version__ in fp.read(), "version is consistent" + +assert getattr(dash, "Dash").__name__ == "Dash", "access to main Dash class is valid" diff --git a/tests/integration/dash/org.py b/tests/integration/dash/org.py new file mode 100644 index 0000000000..9cf7a3aeca --- /dev/null +++ b/tests/integration/dash/org.py @@ -0,0 +1,3 @@ +# used implicitly by dash_import_test +# to test https://github.com/plotly/dash/issues/1143 +import dash_core_components as dcc # noqa: F401 diff --git a/tests/integration/devtools/test_callback_validation.py b/tests/integration/devtools/test_callback_validation.py index 4f57e01254..3be7604b84 100644 --- a/tests/integration/devtools/test_callback_validation.py +++ b/tests/integration/devtools/test_callback_validation.py @@ -5,6 +5,7 @@ import dash_html_components as html from dash import Dash from dash.dependencies import Input, Output, State, MATCH, ALL, ALLSMALLER +from dash.testing import wait debugging = dict( debug=True, use_reloader=False, use_debugger=True, dev_tools_hot_reload=False @@ -91,9 +92,7 @@ def x(a): dash_duo.start_server(app, **debugging) - # the first one is just an artifact... the other 4 we care about specs = [ - ["Same `Input` and `Output`", []], [ "Callback item missing ID", ['Input[0].id = ""', "Every item linked to a callback needs an ID"], @@ -252,33 +251,9 @@ def y2(c): dash_duo.start_server(app, **debugging) - specs = [ - [ - "Same `Input` and `Output`", - [ - 'Input 0 ({"b":MATCH,"c":1}.children)', - "can match the same component(s) as", - 'Output 1 ({"b":MATCH,"c":1}.children)', - ], - ], - [ - "Same `Input` and `Output`", - [ - 'Input 0 ({"a":1}.children)', - "can match the same component(s) as", - 'Output 0 ({"a":ALL}.children)', - ], - ], - [ - "Same `Input` and `Output`", - ["Input 0 (c.children)", "matches Output 1 (c.children)"], - ], - [ - "Same `Input` and `Output`", - ["Input 0 (a.children)", "matches Output 0 (a.children)"], - ], - ] - check_errors(dash_duo, specs) + # input/output overlap is now legal, shouldn't throw any errors + wait.until(lambda: ~dash_duo.redux_state_is_loading, 2) + assert dash_duo.get_logs() == [] def test_dvcv006_inconsistent_wildcards(dash_duo): @@ -814,3 +789,36 @@ def test_dvcv015_multipage_validation_layout(validation, dash_duo): dash_duo.wait_for_text_to_equal("#page-2-display-value", 'You have selected "LA"') assert not dash_duo.get_logs() + + +def test_dvcv016_circular_with_input_output(dash_duo): + app = Dash(__name__) + + app.layout = html.Div( + [html.Div([], id="a"), html.Div(["Bye"], id="b"), html.Div(["Hello"], id="c")] + ) + + @app.callback( + [Output("a", "children"), Output("b", "children")], + [Input("a", "children"), Input("b", "children"), Input("c", "children")], + ) + def c1(a, b, c): + return a, b + + @app.callback(Output("c", "children"), [Input("a", "children")]) + def c2(children): + return children + + dash_duo.start_server(app, **debugging) + + specs = [ + [ + "Circular Dependencies", + [ + "Dependency Cycle Found:", + "a.children__output -> c.children", + "c.children -> a.children__output", + ], + ] + ] + check_errors(dash_duo, specs) diff --git a/tests/integration/devtools/test_devtools_ui.py b/tests/integration/devtools/test_devtools_ui.py index bcc7dd18a0..06d9200ba1 100644 --- a/tests/integration/devtools/test_devtools_ui.py +++ b/tests/integration/devtools/test_devtools_ui.py @@ -154,3 +154,73 @@ def get_width(n_clicks): sleep(3) # wait for callback graph to draw assert dash_duo.get_logs() == [] + + +def test_dvui005_undo_redo(dash_duo): + def click_undo(): + undo_selector = "._dash-undo-redo span:first-child div:last-child" + dash_duo.wait_for_text_to_equal(undo_selector, "undo") + dash_duo.find_element(undo_selector).click() + + def click_redo(): + redo_selector = "._dash-undo-redo span:last-child div:last-child" + dash_duo.wait_for_text_to_equal(redo_selector, "redo") + dash_duo.find_element(redo_selector).click() + + def check_undo_redo_exist(has_undo, has_redo): + selector = "._dash-undo-redo span div:last-child" + els = dash_duo.find_elements(selector) + texts = (["undo"] if has_undo else []) + (["redo"] if has_redo else []) + + assert len(els) == len(texts) + for el, text in zip(els, texts): + assert el.text == text + + app = dash.Dash(__name__, show_undo_redo=True) + app.layout = html.Div([dcc.Input(id="a"), html.Div(id="b")]) + + @app.callback(Output("b", "children"), Input("a", "value")) + def set_b(a): + return a + + dash_duo.start_server(app) + + dash_duo.find_element("#a").send_keys("xyz") + + dash_duo.wait_for_text_to_equal("#b", "xyz") + check_undo_redo_exist(True, False) + + click_undo() + dash_duo.wait_for_text_to_equal("#b", "xy") + check_undo_redo_exist(True, True) + + click_undo() + dash_duo.wait_for_text_to_equal("#b", "x") + check_undo_redo_exist(True, True) + + click_redo() + dash_duo.wait_for_text_to_equal("#b", "xy") + check_undo_redo_exist(True, True) + + dash_duo.percy_snapshot(name="undo-redo") + + click_undo() + click_undo() + dash_duo.wait_for_text_to_equal("#b", "") + check_undo_redo_exist(False, True) + + +def test_dvui006_no_undo_redo(dash_duo): + app = dash.Dash(__name__) + app.layout = html.Div([dcc.Input(id="a"), html.Div(id="b")]) + + @app.callback(Output("b", "children"), Input("a", "value")) + def set_b(a): + return a + + dash_duo.start_server(app) + + dash_duo.find_element("#a").send_keys("xyz") + + dash_duo.wait_for_text_to_equal("#b", "xyz") + dash_duo.wait_for_no_elements("._dash-undo-redo") diff --git a/tests/integration/renderer/test_due_diligence.py b/tests/integration/renderer/test_due_diligence.py index e46314bc51..9fd963fec3 100644 --- a/tests/integration/renderer/test_due_diligence.py +++ b/tests/integration/renderer/test_due_diligence.py @@ -1,6 +1,7 @@ import json import os import string +import pytest from bs4 import BeautifulSoup import requests @@ -99,3 +100,15 @@ def test_rddd001_initial_state(dash_duo): dash_duo.percy_snapshot(name="layout") assert dash_duo.get_logs() == [], "console has no errors" + + +@pytest.mark.parametrize("child", [0, [0]]) +def test_rddd002_falsy_child(dash_duo, child): + app = dash.Dash(__name__) + app.layout = html.Div(id="falsy-wrapper", children=child) + + dash_duo.start_server(app) + + dash_duo.wait_for_text_to_equal("#falsy-wrapper", "0") + + assert not dash_duo.get_logs() diff --git a/tests/integration/renderer/test_iframe.py b/tests/integration/renderer/test_iframe.py index 9cabc9a13b..189209f4a1 100644 --- a/tests/integration/renderer/test_iframe.py +++ b/tests/integration/renderer/test_iframe.py @@ -57,4 +57,4 @@ def apply_cors(response): dash_duo.wait_for_element_by_id("btn").click() dash_duo.wait_for_element("#output-0").text == "0=1" - assert len(dash_duo.get_logs()) != 0 + assert dash_duo.get_logs() == [] diff --git a/tests/integration/renderer/test_race_conditions.py b/tests/integration/renderer/test_race_conditions.py new file mode 100644 index 0000000000..6759b1672a --- /dev/null +++ b/tests/integration/renderer/test_race_conditions.py @@ -0,0 +1,55 @@ +import itertools +import time +import flask +import pytest + +import dash_html_components as html +import dash_core_components as dcc +from dash import Dash +from dash.dependencies import Input, Output + + +DELAY_TIME = 0.2 + +routes = [ + "layout", + "dependencies", + "update-component", + "_config" + # routes and component-suites + # are other endpoints but are excluded to speed up tests +] + +permuted_strs = [ + ",".join(endpoints) for endpoints in itertools.permutations(routes, len(routes)) +] + + +@pytest.mark.parametrize("permuted_str", permuted_strs) +def test_rdrc001_race_conditions(dash_duo, permuted_str): + endpoints = permuted_str.split(",") + app = Dash(__name__) + app.layout = html.Div( + [ + html.Div("Hello world", id="output"), + dcc.Input(id="input", value="initial value"), + ] + ) + + @app.callback(Output("output", "children"), Input("input", "value")) + def update(value): + return value + + def delay(): + for i, route in enumerate(endpoints): + if route in flask.request.path: + time.sleep((DELAY_TIME * i) + DELAY_TIME) + + app.server.before_request(delay) + dash_duo.start_server(app) + + dash_duo.wait_for_text_to_equal( + "#output", "initial value", timeout=DELAY_TIME * (len(endpoints) + 3) + 3 + ) + + assert not dash_duo.get_logs() diff --git a/tests/integration/test_integration.py b/tests/integration/test_integration.py index fbd3ad4591..2af3abff7f 100644 --- a/tests/integration/test_integration.py +++ b/tests/integration/test_integration.py @@ -1,7 +1,6 @@ import datetime - import flask - +import json import pytest from bs4 import BeautifulSoup @@ -152,7 +151,7 @@ def test_inin008_index_customization(dash_duo):